Skip to content

Commit

Permalink
Merge pull request #29 from isaaacporter/feat-add-camera-autoframe
Browse files Browse the repository at this point in the history
feat: add AutoFrame On/Off/Toggle/IsOn to QsysCamera
  • Loading branch information
MatKlucznyk authored Sep 26, 2023
2 parents 905c27e + 620f5ac commit 2e60614
Show file tree
Hide file tree
Showing 24 changed files with 514 additions and 430 deletions.
Binary file modified QscQsys/Q-Sys Designer File/Test.qsys
Binary file not shown.
28 changes: 28 additions & 0 deletions QscQsys/QscQsys/NamedComponents/QsysCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public sealed class QsysCamera : AbstractQsysComponent

public delegate void AutoFocusChange(SimplSharpString componentName, ushort value);

public delegate void AutoFrameChange(SimplSharpString componentName, ushort autoFrameEnableValue);

[PublicAPI("S+")]
public PrivacyChange onPrivacyChange { get; set; }
[PublicAPI("S+")]
Expand Down Expand Up @@ -69,6 +71,8 @@ public sealed class QsysCamera : AbstractQsysComponent
public WhiteBalanceBlueGainChange onWhiteBalanceBlueGainChange { get; set; }
[PublicAPI("S+")]
public AutoFocusChange onAutoFocusChange { get; set; }
[PublicAPI("S+")]
public AutoFrameChange onAutoFrameChange { get; set; }


private const string CONTROL_TOGGLE_PRIVACY = "toggle_privacy";
Expand All @@ -86,6 +90,7 @@ public sealed class QsysCamera : AbstractQsysComponent
private const string CONTROL_WHITEBALANCE_GAIN_RED = "wb_red_gain";
private const string CONTROL_WHITEBALANCE_GAIN_BLUE = "wb_blue_gain";
private const string CONTROL_FOCUS_AUTO = "focus_auto";
private const string CONTROL_AUTOFRAME_TOGGLE = "autoframe_enable";

private bool _currentPrivacy;
private ushort _currentBri;
Expand All @@ -102,6 +107,7 @@ public sealed class QsysCamera : AbstractQsysComponent
private ushort _currentRed;
private ushort _currentBlue;
private ushort _currentAutoFocus;
private bool _currentAutoFrame;

public bool PrivacyValue { get { return _currentPrivacy; } }
public ushort BrightnessValue { get { return _currentBri; } }
Expand All @@ -118,6 +124,7 @@ public sealed class QsysCamera : AbstractQsysComponent
public ushort RedGainValue { get { return _currentRed; } }
public ushort BlueGainValue { get { return _currentBlue; } }
public ushort AutoFocusValue { get { return _currentAutoFocus; } }
public bool AutoFrameValue { get { return _currentAutoFrame; } }

public void Initialize(string coreId, string componentName)
{
Expand Down Expand Up @@ -146,6 +153,7 @@ protected override void HandleComponentUpdated(NamedComponent component)
component.LazyLoadComponentControl(CONTROL_WHITEBALANCE_GAIN_RED);
component.LazyLoadComponentControl(CONTROL_WHITEBALANCE_GAIN_BLUE);
component.LazyLoadComponentControl(CONTROL_FOCUS_AUTO);
component.LazyLoadComponentControl(CONTROL_AUTOFRAME_TOGGLE);
}

protected override void ComponentOnFeedbackReceived(object sender, QsysInternalEventsArgs args)
Expand Down Expand Up @@ -244,6 +252,13 @@ protected override void ComponentOnFeedbackReceived(object sender, QsysInternalE
onAutoFocusChange(ComponentName, (ushort)args.Value);
}
break;
case CONTROL_AUTOFRAME_TOGGLE:
_currentAutoFrame = Convert.ToBoolean(args.Value);
if (onAutoFrameChange != null)
{
onAutoFrameChange(ComponentName, (ushort)args.Value);
}
break;
}
}

Expand Down Expand Up @@ -438,6 +453,19 @@ public void BlueGain(ushort value)
Component.SendChangePosition("wb_blue_gain", SimplUtils.ScaleToDouble(value));
}

public void AutoFrameToggle(ushort value)
{
if (Component == null)
return;

Component.SendChangeDoubleValue("autoframe_enable", value);
}

public void AutoFrameToggle(bool value)
{
PrivacyToggle(Convert.ToUInt16(value));
}

public void TiltUp()
{
StartPTZ(PtzTypes.Up);
Expand Down
Binary file modified QscQsys/QscQsys/bin/Debug/QscQsys.clz
Binary file not shown.
6 changes: 3 additions & 3 deletions QscQsys/QscQsys/bin/Debug/QscQsys.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
<ArchiveName />
</RequiredInfo>
<OptionalInfo>
<CompiledOn>8/11/2023 4:07:11 PM</CompiledOn>
<CompilerRev>1.0.0.27215</CompilerRev>
<CompiledOn>9/21/2023 11:56:12 AM</CompiledOn>
<CompilerRev>1.0.0.19685</CompilerRev>
</OptionalInfo>
<Plugin>
<Version>Crestron.SIMPLSharp, Version=2.0.58.0, Culture=neutral, PublicKeyToken=812d080f93e2de10</Version>
<Include4.dat>2.18.112</Include4.dat>
<Include4.dat>2.19.069</Include4.dat>
</Plugin>
</ProgramInfo>
Binary file modified QscQsys/QscQsys/bin/Debug/QscQsys.dll
Binary file not shown.
Binary file modified QscQsys/QscQsys/bin/Debug/QscQsys.pdb
Binary file not shown.
78 changes: 39 additions & 39 deletions QscQsys/QscQsys/bin/Debug/QscQsys.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file modified QscQsys/QscQsys/bin/Debug/SimplSharpHelperInterface.dll
Binary file not shown.
Binary file modified QscQsys/QscQsys/bin/Debug/SimplSharpNewtonsoft.dll
Binary file not shown.
Binary file modified QscQsys/QscQsys/bin/Debug/SimplSharpReflectionInterface.dll
Binary file not shown.
Binary file modified QscQsys/QscQsys/bin/Debug/SimplSharpSQLHelperInterface.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions QscQsys/QscQsys/bin/Debug/manifest.info
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MainAssembly=QscQsys.dll:a578a7bf21a1da12c8b11ff61444303c
MainAssembly=QscQsys.dll:580bae242ca2e7f2b70d0d193104155e
MainAssemblyMinFirmwareVersion=1.007.0017
MainAssemblyResource=QscQsys.xml:6af0cb9822f360566116449ad3ff5811
MainAssemblyResource=QscQsys.xml:e340eae22c57ac2970821cf9c52366a2
MainAssemblyResource=SimplSharpData.dat:820b61c48c8a2cace82957eed4cc377c
MainAssemblyResource=SimplSharpData.dat.der:bf862965c00f3e6ec535e4e00e82d30c
MainAssemblyResource=SimplSharpData.dat:820b61c48c8a2cace82957eed4cc377c
Expand Down
Binary file modified QscQsys/QscQsys/bin/Debug/manifest.ser
Binary file not shown.
14 changes: 14 additions & 0 deletions QscQsys/QscQsys/obj/Debug/QscQsys.csproj.FileListAbsolute.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,17 @@ C:\Users\astin\ICDPF\Infrastructure\External\Qsys\QscQsys\QscQsys\obj\Debug\QscQ
C:\Users\astin\ICDPF\Infrastructure\External\Qsys\QscQsys\QscQsys\bin\Debug\ExtensionMethods.dll
C:\Users\astin\ICDPF\Infrastructure\External\Qsys\QscQsys\QscQsys\bin\Debug\TCPClient.dll
C:\Users\astin\ICDPF\Infrastructure\External\Qsys\QscQsys\QscQsys\bin\Debug\QscQsys.xml
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\QscQsys.xml
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\QscQsys.dll
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\QscQsys.pdb
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\ExtensionMethods.dll
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\SimplSharpCustomAttributesInterface.dll
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\SimplSharpHelperInterface.dll
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\SimplSharpNewtonsoft.dll
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\SimplSharpReflectionInterface.dll
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\TCPClient.dll
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\SimplSharpSQLHelperInterface.dll
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\bin\Debug\Newtonsoft.Json.Compact.dll
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\obj\Debug\ResolveAssemblyReference.cache
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\obj\Debug\QscQsys.dll
Z:\iporter\Repos\isaaacporter\Qsys\QscQsys\QscQsys\obj\Debug\QscQsys.pdb
Binary file modified QscQsys/QscQsys/obj/Debug/QscQsys.dll
Binary file not shown.
Binary file modified QscQsys/QscQsys/obj/Debug/QscQsys.pdb
Binary file not shown.
Loading

0 comments on commit 2e60614

Please sign in to comment.