@@ -75,13 +75,15 @@ export class CoreMosDeviceHandler {
7575 private _pendingStoryItemChanges : Array < IStoryItemChange > = [ ]
7676 private _pendingChangeTimeout : number = 60 * 1000
7777 private mosTypes : MosTypes
78+ private _hotStandby : boolean
7879
7980 private _messageQueue : Queue
8081
81- constructor ( parent : CoreHandler , mosDevice : IMOSDevice , mosHandler : MosHandler ) {
82+ constructor ( parent : CoreHandler , mosDevice : IMOSDevice , mosHandler : MosHandler , hotStandby : boolean ) {
8283 this . _coreParentHandler = parent
8384 this . _mosDevice = mosDevice
8485 this . _mosHandler = mosHandler
86+ this . _hotStandby = hotStandby
8587
8688 this . _messageQueue = new Queue ( )
8789
@@ -138,25 +140,39 @@ export class CoreMosDeviceHandler {
138140 let statusCode : StatusCode
139141 const messages : Array < string > = [ ]
140142
141- if ( connectionStatus . PrimaryConnected ) {
142- if ( connectionStatus . SecondaryConnected || ! this . _mosDevice . idSecondary ) {
143+ if ( this . _hotStandby ) {
144+ if ( connectionStatus . PrimaryConnected ) {
143145 statusCode = StatusCode . GOOD
144146 } else {
145- statusCode = StatusCode . WARNING_MINOR
147+ if ( connectionStatus . SecondaryConnected ) {
148+ statusCode = StatusCode . GOOD
149+ messages . push ( connectionStatus . SecondaryStatus || 'Running NRCS on hot standby' )
150+ } else {
151+ statusCode = StatusCode . BAD
152+ messages . push ( connectionStatus . SecondaryStatus || 'Primary and hot standby are not connected' )
153+ }
146154 }
147155 } else {
148- if ( connectionStatus . SecondaryConnected ) {
149- statusCode = StatusCode . WARNING_MAJOR
156+ if ( connectionStatus . PrimaryConnected ) {
157+ if ( connectionStatus . SecondaryConnected || ! this . _mosDevice . idSecondary ) {
158+ statusCode = StatusCode . GOOD
159+ } else {
160+ statusCode = StatusCode . WARNING_MINOR
161+ }
150162 } else {
151- statusCode = StatusCode . BAD
163+ if ( connectionStatus . SecondaryConnected ) {
164+ statusCode = StatusCode . WARNING_MAJOR
165+ } else {
166+ statusCode = StatusCode . BAD
167+ }
152168 }
153- }
154169
155- if ( ! connectionStatus . PrimaryConnected ) {
156- messages . push ( connectionStatus . PrimaryStatus || 'Primary not connected' )
157- }
158- if ( this . _mosDevice . idSecondary && ! connectionStatus . SecondaryConnected ) {
159- messages . push ( connectionStatus . SecondaryStatus || 'Fallback not connected' )
170+ if ( ! connectionStatus . PrimaryConnected ) {
171+ messages . push ( connectionStatus . PrimaryStatus || 'Primary not connected' )
172+ }
173+ if ( this . _mosDevice . idSecondary && ! connectionStatus . SecondaryConnected ) {
174+ messages . push ( connectionStatus . SecondaryStatus || 'Fallback not connected' )
175+ }
160176 }
161177
162178 this . core
0 commit comments