Skip to content

Commit

Permalink
Added camera command
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn-malmo committed Oct 11, 2024
1 parent 27748c6 commit 31d3be4
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 6 deletions.
47 changes: 47 additions & 0 deletions VidiView.Api.DataModel/DataModel/CameraCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
namespace VidiView.Api.DataModel;

/// <summary>
/// Execute a camera command
/// </summary>
public record CameraCommand
{
/// <summary>
/// Select a specific preset
/// </summary>
public Guid? PresetId { get; init; }

/// <summary>
/// Pan camera relative current position and visible area
/// </summary>
/// <remarks>Current position is 0.5, the left edge of the visible area is 0.0 and the right edge is 1.0</remarks>
public double? PanRelative { get; init; }

/// <summary>
/// Pan camera to absolute position
/// </summary>
/// <remarks>Leftmost position of camera is 0.0 and rightmost 1.0</remarks>
public double? PanAbsolute { get; init; }

/// <summary>
/// Tilt camera relative current position and visible area
/// </summary>
/// <remarks>Current position is 0.5, the top edge of the visible area is 1.0 and the bottom edge is 0.0</remarks>
public double? TiltRelative { get; init; }

/// <summary>
/// Tilt camera to absolute position
/// </summary>
/// <remarks>Top position of camera is 1.0 and bottom is 0.0</remarks>
public double? TiltAbsolute { get; init; }

/// <summary>
/// Set camera zoom to absolute value.
/// </summary>
/// <remarks>Minimum zoom is 0.0 (wide), and maximum supported zoom is 1.0 (tele)</remarks>
public double? ZoomAbsolute { get; init; }

/// <summary>
/// Start/stop a pan/tilt/zoom operation
/// </summary>
public CameraDriveEnum? Drive { get; init; }
}
14 changes: 14 additions & 0 deletions VidiView.Api.DataModel/DataModel/CameraDriveEnum.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace VidiView.Api.DataModel;

[JsonConverter(typeof(StringEnumConverterEx<CameraDriveEnum>))]
[Flags]
public enum CameraDriveEnum
{
None = 0x0,
PanLeft = 0x1,
PanRight = 0x2,
TiltUp = 0x4,
TiltDown = 0x8,
ZoomWide = 0x16, // Zoom out
ZoomTele = 0x32, // Zoom in
}
10 changes: 4 additions & 6 deletions VidiView.Api.DataModel/DataModel/Rel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static class Rel
public const string AuthenticateX509Windows = "authenticate-x509-windows";
public const string AuthenticateToken = "authenticate-login-token";
public const string BiometricLoginToken = "biometric-login-token";
public const string CameraControl = "camera-control";
public const string CameraCommand = "camera-command";
public const string ClientDeviceRegistration = "device-registration";
public const string Clear = "clear";
public const string Close = "close";
Expand Down Expand Up @@ -54,13 +54,14 @@ public static class Rel
public const string FindStudy = "find-study";
public const string GrantDevice = "grant-device";
public const string IdentifyStudy = "identify";

[Obsolete("Use File instead", true)]
public const string Image = "image";
[Obsolete("Use Files instead", true)]
public const string Images = "images";
[Obsolete("Use POST RequestToken instead", false)]

public const string IssueSamlToken = "issue-saml-token";

public const string JoinAudioLegacy = "join-av-legacy";
public const string LeaveAudioLegacy = "leave-av-legacy";
public const string Load = "load";
Expand All @@ -78,13 +79,12 @@ public static class Rel
public const string ReleaseStudy = "release-study";
public const string RemoveStudy = "remove-study";
public const string RequestToken = "request-token";

[Obsolete("Use POST RequestToken instead", false)]
public const string RenewSamlToken = "renew-saml-token";

public const string ReportImage = "report-image";
public const string Roles = "roles";
[Obsolete("Use Recover instead", true)]
public const string UndoDelete = "undo-delete";
public const string Self = "self";
public const string ServiceHosts = "service-hosts";
public const string Settings = "settings";
Expand All @@ -106,10 +106,8 @@ public static class Rel
public const string UserProfile = "user-profile";
public const string User = "user";
public const string Users = "users";

public const string WebSocket = "websocket";
public const string WorklistMetadata = "worklist-metadata";

public const string GetLoginPin = "login-pin";
public const string ClearLoginPin = "clear-login-pin";
public const string SetLoginPin = "set-login-pin";
Expand Down

0 comments on commit 31d3be4

Please sign in to comment.