Merge branch 'development' into feature/Joinmap-Markdown

This commit is contained in:
Trevor Payne
2022-10-21 16:27:44 -05:00
committed by GitHub
6 changed files with 64 additions and 37 deletions

View File

@@ -97,10 +97,10 @@ namespace PepperDash.Essentials
{ {
TriList.SetSigFalseAction(ButtonPressJoinBase + 1, ShadeDevice.Open); TriList.SetSigFalseAction(ButtonPressJoinBase + 1, ShadeDevice.Open);
TriList.SetSigFalseAction(ButtonPressJoinBase + 2, (ShadeDevice as IShadesOpenCloseStop).StopOrPreset); TriList.SetSigFalseAction(ButtonPressJoinBase + 2, (ShadeDevice as IShadesOpenCloseStop).Stop);
if(ShadeDevice is RelayControlledShade) if (ShadeDevice is IShadesOpenCloseStop)
TriList.SetString(StringJoinBase + 2, (ShadeDevice as RelayControlledShade).StopOrPresetButtonLabel); TriList.SetString(StringJoinBase + 2, "Stop");
TriList.SetSigFalseAction(ButtonPressJoinBase + 3, ShadeDevice.Close); TriList.SetSigFalseAction(ButtonPressJoinBase + 3, ShadeDevice.Close);
} }

View File

@@ -19,6 +19,7 @@ namespace PepperDash.Essentials.Core.Shades
/// <summary> /// <summary>
/// Requirements for a device that implements basic Open/Close shade control /// Requirements for a device that implements basic Open/Close shade control
/// </summary> /// </summary>
[Obsolete("Please use IShadesOpenCloseStop instead")]
public interface IShadesOpenClose public interface IShadesOpenClose
{ {
void Open(); void Open();
@@ -28,15 +29,26 @@ namespace PepperDash.Essentials.Core.Shades
/// <summary> /// <summary>
/// Requirements for a device that implements basic Open/Close/Stop shade control (Uses 3 relays) /// Requirements for a device that implements basic Open/Close/Stop shade control (Uses 3 relays)
/// </summary> /// </summary>
public interface IShadesOpenCloseStop : IShadesOpenClose public interface IShadesOpenCloseStop
{ {
void StopOrPreset(); void Open();
void Close();
void Stop();
}
public interface IShadesOpenClosePreset : IShadesOpenCloseStop
{
void RecallPreset(uint presetNumber);
void SavePreset(uint presetNumber);
string StopOrPresetButtonLabel { get; } string StopOrPresetButtonLabel { get; }
event EventHandler PresetSaved;
} }
/// <summary> /// <summary>
/// Requirements for a shade that implements press/hold raise/lower functions /// Requirements for a shade that implements press/hold raise/lower functions
/// </summary> /// </summary>
[Obsolete("Please use IShadesOpenCloseStop instead")]
public interface IShadesRaiseLower public interface IShadesRaiseLower
{ {
void Raise(bool state); void Raise(bool state);
@@ -55,7 +67,7 @@ namespace PepperDash.Essentials.Core.Shades
/// <summary> /// <summary>
/// Requirements for a shade/scene that is open or closed /// Requirements for a shade/scene that is open or closed
/// </summary> /// </summary>
public interface IShadesOpenClosedFeedback: IShadesOpenClose public interface IShadesOpenClosedFeedback: IShadesOpenCloseStop
{ {
BoolFeedback ShadeIsOpenFeedback { get; } BoolFeedback ShadeIsOpenFeedback { get; }
BoolFeedback ShadeIsClosedFeedback { get; } BoolFeedback ShadeIsClosedFeedback { get; }
@@ -64,13 +76,14 @@ namespace PepperDash.Essentials.Core.Shades
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public interface IShadesStop [Obsolete("Please use IShadesOpenCloseStop instead")]
public interface IShadesStop
{ {
void Stop(); void Stop();
} }
/// <summary> /// <summary>
/// /// Used to implement raise/stop/lower/stop from single button
/// </summary> /// </summary>
public interface IShadesStopOrMove public interface IShadesStopOrMove
{ {
@@ -82,7 +95,7 @@ namespace PepperDash.Essentials.Core.Shades
/// <summary> /// <summary>
/// Basic feedback for shades/scene stopped /// Basic feedback for shades/scene stopped
/// </summary> /// </summary>
public interface IShadesStopFeedback public interface IShadesStopFeedback : IShadesOpenCloseStop
{ {
BoolFeedback IsStoppedFeedback { get; } BoolFeedback IsStoppedFeedback { get; }
} }

View File

@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.Shades
/// <summary> /// <summary>
/// Base class for a shade device /// Base class for a shade device
/// </summary> /// </summary>
public abstract class ShadeBase : EssentialsDevice, IShadesOpenClose public abstract class ShadeBase : EssentialsDevice, IShadesOpenCloseStop
{ {
public ShadeBase(string key, string name) public ShadeBase(string key, string name)
: base(key, name) : base(key, name)
@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.Core.Shades
#region iShadesOpenClose Members #region iShadesOpenClose Members
public abstract void Open(); public abstract void Open();
public abstract void StopOrPreset(); public abstract void Stop();
public abstract void Close(); public abstract void Close();
#endregion #endregion

View File

@@ -56,9 +56,9 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Somfy
PulseOutput(OpenRelay, RelayPulseTime); PulseOutput(OpenRelay, RelayPulseTime);
} }
public override void StopOrPreset() public override void Stop()
{ {
Debug.Console(1, this, "Stopping or recalling preset on Shade: '{0}'", this.Name); Debug.Console(1, this, "Stopping Shade: '{0}'", this.Name);
PulseOutput(StopOrPresetRelay, RelayPulseTime); PulseOutput(StopOrPresetRelay, RelayPulseTime);
} }

View File

@@ -1393,11 +1393,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, call.IsOnHold); tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, call.IsOnHold);
//serials //serials
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty); tokenArray[arrayIndex] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty);
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty); tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty);
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString()); tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString());
tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, call.Type.ToString()); tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 4, call.Type.ToString());
tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, call.Status.ToString()); tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 5, call.Status.ToString());
if(call.Duration != null) if(call.Duration != null)
{ {
// May need to verify correct string format here // May need to verify correct string format here
@@ -1407,9 +1407,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
arrayIndex += offset; arrayIndex += offset;
stringIndex += maxStrings; stringIndex += maxStrings;
digitalIndex++; digitalIndex += maxDigitals;
} }
while (digitalIndex < maxCalls) while (arrayIndex < maxCalls * offset)
{ {
//digitals //digitals
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, false); tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, false);
@@ -1417,16 +1417,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
//serials //serials
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, String.Empty); tokenArray[arrayIndex] = new XSigSerialToken(stringIndex + 1, String.Empty);
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, String.Empty); tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 2, String.Empty);
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, String.Empty); tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 3, String.Empty);
tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, String.Empty); tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 4, String.Empty);
tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, String.Empty); tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 5, String.Empty);
tokenArray[arrayIndex + 6] = new XSigSerialToken(stringIndex + 6, String.Empty); tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 6, String.Empty);
arrayIndex += offset; arrayIndex += offset;
stringIndex += maxStrings; stringIndex += maxStrings;
digitalIndex++; digitalIndex += maxDigitals;
} }
return GetXSigString(tokenArray); return GetXSigString(tokenArray);

View File

@@ -62,6 +62,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
private readonly ZoomRoomPropertiesConfig _props; private readonly ZoomRoomPropertiesConfig _props;
private bool _meetingPasswordRequired;
public void Poll(string pollString)
{
if(_meetingPasswordRequired) return;
SendText(string.Format("{0}{1}", pollString, SendDelimiter));
}
public ZoomRoom(DeviceConfig config, IBasicCommunication comm) public ZoomRoom(DeviceConfig config, IBasicCommunication comm)
: base(config) : base(config)
{ {
@@ -75,13 +84,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
if (_props.CommunicationMonitorProperties != null) if (_props.CommunicationMonitorProperties != null)
{ {
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, _props.CommunicationMonitorProperties.PollInterval, _props.CommunicationMonitorProperties.TimeToWarning, _props.CommunicationMonitorProperties.TimeToError,
_props.CommunicationMonitorProperties); () => Poll(_props.CommunicationMonitorProperties.PollString));
} }
else else
{ {
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, () => Poll("zStatus SystemUnit"));
"zStatus SystemUnit" + SendDelimiter);
} }
DeviceManager.AddDevice(CommunicationMonitor); DeviceManager.AddDevice(CommunicationMonitor);
@@ -1992,6 +2000,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
/// </summary> /// </summary>
private void GetBookings() private void GetBookings()
{ {
if (_meetingPasswordRequired) return;
SendText("zCommand Bookings List"); SendText("zCommand Bookings List");
} }
@@ -2179,6 +2189,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
); );
} }
_meetingPasswordRequired = false;
base.OnCallStatusChange(item); base.OnCallStatusChange(item);
Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}", Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}",
@@ -3450,6 +3461,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
var handler = PasswordRequired; var handler = PasswordRequired;
if (handler != null) if (handler != null)
{ {
if(!loginFailed || !loginCancelled)
_meetingPasswordRequired = true;
handler(this, new PasswordPromptEventArgs(lastAttemptIncorrect, loginFailed, loginCancelled, message)); handler(this, new PasswordPromptEventArgs(lastAttemptIncorrect, loginFailed, loginCancelled, message));
} }
} }