@@ -196,6 +196,22 @@ static Function P_FindLastSetEntry(WAVE wv, variable row, variable col, string n
196196 return NaN
197197End
198198
199+ static Function P_AddSealedEntryToTPStorage ( string panelTitle, variable headstage)
200+ variable count
201+
202+ if ( ! P_ValidatePressureSetHeadstage ( panelTitle, headstage) || ! P_IsHSActiveAndInVClamp ( panelTitle, headstage))
203+ return NaN
204+ endif
205+
206+ WAVE TPStorage = GetTPStorage ( panelTitle)
207+
208+ count = GetNumberFromWaveNote ( TPStorage, NOTE_INDEX)
209+
210+ TPStorage[ count][ headstage][ % CellState] = TPSTORAGE_SEALED
211+
212+ SetNumberInWaveNote ( TPStorage, NOTE_INDEX, ++ count)
213+ End
214+
199215static Function P_PublishPressureMethodChange ( string panelTitle, variable headstage, variable oldMethod, variable newMethod)
200216
201217 variable jsonID, err
@@ -216,7 +232,7 @@ static Function P_PublishPressureMethodChange(string panelTitle, variable headst
216232 try
217233 ClearRTError ()
218234#if exists ( "zeromq_pub_send" )
219- zeromq_pub_send ( PRESSURE_FILTER , payload) ; AbortOnRTE
235+ zeromq_pub_send ( PRESSURE_STATE_FILTER , payload) ; AbortOnRTE
220236#else
221237 ASSERT ( 0, "ZeroMQ XOP not present" )
222238#endif
@@ -226,6 +242,29 @@ static Function P_PublishPressureMethodChange(string panelTitle, variable headst
226242 endtry
227243End
228244
245+ static Function P_PublishSealedState ( string panelTitle, variable headstage)
246+ variable jsonID, err
247+ string payload
248+
249+ jsonID = FFI_GetJSONTemplate ( panelTitle, headstage)
250+ JSON_AddBoolean ( jsonID, "/sealed" , 1 )
251+
252+ payload = JSON_Dump ( jsonID)
253+ JSON_Release ( jsonID)
254+
255+ try
256+ ClearRTError ()
257+ #if exists ( "zeromq_pub_send" )
258+ zeromq_pub_send ( PRESSURE_SEALED_FILTER, payload) ; AbortOnRTE
259+ #else
260+ ASSERT ( 0, "ZeroMQ XOP not present" )
261+ #endif
262+ catch
263+ err = ClearRTError ()
264+ BUG ( "Could not publish pressure seal state " + num2str ( err))
265+ endtry
266+ End
267+
229268/// @brief Sets the pressure to atmospheric
230269static Function P_MethodAtmospheric ( panelTitle, headstage)
231270 string panelTitle
@@ -306,6 +345,8 @@ static Function P_MethodSeal(panelTitle, headStage)
306345 // apply holding potential of SEAL_POTENTIAL
307346 P_UpdateVcom ( panelTitle, SEAL_POTENTIAL, headStage)
308347 print "Seal on head stage:" , headstage
348+ P_PublishSealedState ( panelTitle, headstage)
349+ P_AddSealedEntryToTPStorage ( panelTitle, headstage)
309350 else // no seal, start, hold, or increment negative pressure
310351 // if there is no neg pressure, apply starting pressure.
311352 access = P_GetUserAccess ( panelTitle, headStage, PRESSURE_METHOD_SEAL)
0 commit comments