Skip to content

Commit

Permalink
Updates to ReceiverMonitor
Browse files Browse the repository at this point in the history
- update NcSynchronizationStatus as per latest feature sets register
- add overallStatusReportingDelay as per latest feature sets register
  • Loading branch information
cristian-recoseanu committed Jul 2, 2024
1 parent b0fe162 commit 6a2788c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 35 deletions.
51 changes: 21 additions & 30 deletions code/src/NCModel/Features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ export class NcStatusMonitor extends NcWorker
@myIdDecorator('3p2')
public overallStatusMessage: string | null;

@myIdDecorator('3p3')
public overallStatusReportingDelay: number;

public constructor(
oid: number,
constantOid: boolean,
Expand All @@ -333,24 +336,7 @@ export class NcStatusMonitor extends NcWorker

this.overallStatus = NcOverallStatus.Inactive;
this.overallStatusMessage = "Receiver is inactive";
}

public Connected()
{
this.overallStatus = NcOverallStatus.Healthy;
this.overallStatusMessage = "Receiver is connected and healthy";

this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(3, 1), NcPropertyChangeType.ValueChanged, this.overallStatus, null);
this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(3, 3), NcPropertyChangeType.ValueChanged, this.overallStatusMessage, null);
}

public Disconnected()
{
this.overallStatus = NcOverallStatus.Inactive;
this.overallStatusMessage = "Receiver is inactive";

this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(3, 1), NcPropertyChangeType.ValueChanged, this.overallStatus, null);
this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(3, 3), NcPropertyChangeType.ValueChanged, this.overallStatusMessage, null);
this.overallStatusReportingDelay = 5;
}

//'1m1'
Expand All @@ -366,6 +352,8 @@ export class NcStatusMonitor extends NcWorker
return new CommandResponseWithValue(handle, NcMethodStatus.OK, this.overallStatus);
case '3p2':
return new CommandResponseWithValue(handle, NcMethodStatus.OK, this.overallStatusMessage);
case '3p3':
return new CommandResponseWithValue(handle, NcMethodStatus.OK, this.overallStatusReportingDelay);
default:
return super.Get(oid, id, handle);
}
Expand All @@ -386,6 +374,10 @@ export class NcStatusMonitor extends NcWorker
case '3p1':
case '3p2':
return new CommandResponseError(handle, NcMethodStatus.Readonly, 'Property is readonly');
case '3p3':
this.overallStatusReportingDelay = value;
this.notificationContext.NotifyPropertyChanged(this.oid, id, NcPropertyChangeType.ValueChanged, this.overallStatusReportingDelay, null);
return new CommandResponseNoValue(handle, NcMethodStatus.OK);
default:
return super.Set(oid, id, value, handle);
}
Expand All @@ -401,6 +393,7 @@ export class NcStatusMonitor extends NcWorker
[
new NcPropertyDescriptor(new NcElementId(3, 1), "overallStatus", "NcOverallStatus", true, false, false, null, "Overall status property"),
new NcPropertyDescriptor(new NcElementId(3, 2), "overallStatusMessage", "NcString", true, true, false, null, "Overall status message property"),
new NcPropertyDescriptor(new NcElementId(3, 3), "overallStatusReportingDelay", "NcUint32", false, false, false, null, "Overall status reporting delay property (in seconds, default is 5s and 0 means no delay)"),
],
[],
[]
Expand Down Expand Up @@ -437,11 +430,9 @@ enum NcConnectionStatus
enum NcSynchronizationStatus
{
NotUsed = 0,
BasebandLocked = 1,
BasebandPartiallyLocked = 2,
NetworkLocked = 3,
NetworkPartiallyLocked = 4,
NotLocked = 5
Healthy = 1,
PartiallyHealthy = 2,
Unhealthy = 3
}

enum NcStreamStatus
Expand Down Expand Up @@ -478,7 +469,7 @@ export class NcReceiverMonitor extends NcStatusMonitor
public synchronizationStatusMessage: string | null;

@myIdDecorator('4p7')
public grandMasterClockId: string | null;
public synchronizationSourceId: string | null;

@myIdDecorator('4p8')
public streamStatus: NcStreamStatus;
Expand Down Expand Up @@ -506,9 +497,9 @@ export class NcReceiverMonitor extends NcStatusMonitor
this.connectionStatus = NcConnectionStatus.Inactive;
this.connectionStatusMessage = "Receiver is inactive";

this.synchronizationStatus = NcSynchronizationStatus.NetworkLocked;
this.synchronizationStatus = NcSynchronizationStatus.Healthy;
this.synchronizationStatusMessage = "Locked to grandmaster";
this.grandMasterClockId = "0xD4:AD:71:FF:FE:6F:E2:80";
this.synchronizationSourceId = "0xD4:AD:71:FF:FE:6F:E2:80";

this.streamStatus = NcStreamStatus.Inactive;
this.streamStatusMessage = "Receiver is inactive";
Expand All @@ -526,7 +517,7 @@ export class NcReceiverMonitor extends NcStatusMonitor
this.streamStatusMessage = "Receiver is connected and stream is healthy";

this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(3, 1), NcPropertyChangeType.ValueChanged, this.overallStatus, null);
this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(3, 3), NcPropertyChangeType.ValueChanged, this.overallStatusMessage, null);
this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(3, 2), NcPropertyChangeType.ValueChanged, this.overallStatusMessage, null);

this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(4, 3), NcPropertyChangeType.ValueChanged, this.connectionStatus, null);
this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(4, 4), NcPropertyChangeType.ValueChanged, this.connectionStatusMessage, null);
Expand All @@ -547,7 +538,7 @@ export class NcReceiverMonitor extends NcStatusMonitor
this.streamStatusMessage = "Receiver is inactive";

this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(3, 1), NcPropertyChangeType.ValueChanged, this.overallStatus, null);
this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(3, 3), NcPropertyChangeType.ValueChanged, this.overallStatusMessage, null);
this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(3, 2), NcPropertyChangeType.ValueChanged, this.overallStatusMessage, null);

this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(4, 3), NcPropertyChangeType.ValueChanged, this.connectionStatus, null);
this.notificationContext.NotifyPropertyChanged(this.oid, new NcElementId(4, 4), NcPropertyChangeType.ValueChanged, this.connectionStatusMessage, null);
Expand Down Expand Up @@ -578,7 +569,7 @@ export class NcReceiverMonitor extends NcStatusMonitor
case '4p6':
return new CommandResponseWithValue(handle, NcMethodStatus.OK, this.synchronizationStatusMessage);
case '4p7':
return new CommandResponseWithValue(handle, NcMethodStatus.OK, this.grandMasterClockId);
return new CommandResponseWithValue(handle, NcMethodStatus.OK, this.synchronizationSourceId);
case '4p8':
return new CommandResponseWithValue(handle, NcMethodStatus.OK, this.streamStatus);
case '4p9':
Expand Down Expand Up @@ -629,7 +620,7 @@ export class NcReceiverMonitor extends NcStatusMonitor
new NcPropertyDescriptor(new NcElementId(4, 4), "connectionStatusMessage", "NcString", true, true, false, null, "Connection status message property"),
new NcPropertyDescriptor(new NcElementId(4, 5), "synchronizationStatus", "NcSynchronizationStatus", true, false, false, null, "Synchronization status property"),
new NcPropertyDescriptor(new NcElementId(4, 6), "synchronizationStatusMessage", "NcString", true, true, false, null, "Synchronization status message property"),
new NcPropertyDescriptor(new NcElementId(4, 7), "grandMasterClockId", "NcString", true, true, false, null, "Grand master clock id property"),
new NcPropertyDescriptor(new NcElementId(4, 7), "synchronizationSourceId", "NcString", true, true, false, null, "Synchronization source id property"),
new NcPropertyDescriptor(new NcElementId(4, 8), "streamStatus", "NcStreamStatus", true, false, false, null, "Stream status property"),
new NcPropertyDescriptor(new NcElementId(4, 9), "streamStatusMessage", "NcString", true, true, false, null, "Stream status message property")
],
Expand Down
8 changes: 3 additions & 5 deletions code/src/NCModel/Managers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,11 +851,9 @@ export class NcClassManager extends NcManager
], null, "Connection status enum data type"),
'NcSynchronizationStatus': new NcDatatypeDescriptorEnum("NcSynchronizationStatus", [
new NcEnumItemDescriptor("NotUsed", 0, "Feature not in use"),
new NcEnumItemDescriptor("BasebandLocked", 1, "Locked from baseband"),
new NcEnumItemDescriptor("BasebandPartiallyLocked", 2, "Partially locked from baseband"),
new NcEnumItemDescriptor("NetworkLocked", 3, "Locked from network"),
new NcEnumItemDescriptor("NetworkPartiallyLocked", 4, "Partially locked from network"),
new NcEnumItemDescriptor("NotLocked", 5, "Not locked"),
new NcEnumItemDescriptor("Healthy", 1, "Locked to a synchronization source"),
new NcEnumItemDescriptor("PartiallyHealthy", 2, "Partially locked to a synchronization source"),
new NcEnumItemDescriptor("Unhealthy", 3, "Not locked to a synchronization source")
], null, "Synchronization status enum data type"),
'NcStreamStatus': new NcDatatypeDescriptorEnum("NcStreamStatus", [
new NcEnumItemDescriptor("Inactive", 0, "Inactive"),
Expand Down

0 comments on commit 6a2788c

Please sign in to comment.