Skip to content

Commit e516eff

Browse files
authored
Merge pull request #1211 from AllenInstitute/feature/1211-fix-message-filter-listing
Feature/1211 fix message filter listing
2 parents 2d15dcd + bc74ddd commit e516eff

File tree

3 files changed

+32
-12
lines changed

3 files changed

+32
-12
lines changed

Packages/MIES/MIES_Constants.ipf

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,8 +1516,6 @@ StrConstant PACKAGE_SETTINGS_JSON = "Settings.json"
15161516

15171517
StrConstant LOGFILE_NAME = "Log.jsonl"
15181518

1519-
StrConstant IVS_PUB_FILTER = "ivscc"
1520-
15211519
Constant PSQ_CR_SPIKE_CHECK_DEFAULT = 1
15221520

15231521
StrConstant NOT_AVAILABLE = "n/a"
@@ -1577,11 +1575,17 @@ Constant LBN_TEXTUAL_KEYS = 0x4
15771575
Constant LBN_TEXTUAL_VALUES = 0x8
15781576
/// @}
15791577

1580-
StrConstant PRESSURE_STATE_FILTER = "pressure:state"
1581-
StrConstant PRESSURE_SEALED_FILTER = "pressure:sealed"
1582-
StrConstant PRESSURE_BREAKIN_FILTER = "pressure:break in"
1583-
1584-
StrConstant AUTO_TP_FILTER = "testpulse:autotune result"
1578+
/// @name All available ZeroMQ message filters
1579+
/// @anchor ZeroMQMessageFilters
1580+
/// @{
1581+
StrConstant IVS_PUB_FILTER = "ivscc"
1582+
StrConstant PRESSURE_STATE_FILTER = "pressure:state"
1583+
StrConstant PRESSURE_SEALED_FILTER = "pressure:sealed"
1584+
StrConstant PRESSURE_BREAKIN_FILTER = "pressure:break in"
1585+
StrConstant AUTO_TP_FILTER = "testpulse:autotune result"
1586+
StrConstant AMPLIFIER_CLAMP_MODE_FILTER = "amplifier:clamp mode"
1587+
StrConstant AMPLIFIER_AUTO_BRIDGE_BALANCE = "amplifier:auto bridge balance"
1588+
/// @}
15851589

15861590
/// which is sufficient to represent each sample point time with a distinctive number up to rates of 10 MHz.
15871591
Constant EPOCHTIME_PRECISION = 7
@@ -1659,6 +1663,3 @@ Constant TP_BASELINE_FIT_RESULT_TOO_NOISY = 32
16591663
Constant TP_GETVALUES_DEFAULT = 0x0
16601664
Constant TP_GETVALUES_LATEST_AUTOTPCYCLE = 0x1
16611665
/// @}
1662-
1663-
StrConstant AMPLIFIER_CLAMP_MODE_FILTER = "amplifier:clamp mode"
1664-
StrConstant AMPLIFIER_AUTO_BRIDGE_BALANCE = "amplifier:auto bridge balance"

Packages/MIES/MIES_ForeignFunctionInterface.ipf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,17 @@ Function FFI_GetJSONTemplate(string device, variable headstage)
7171
return jsonID
7272
End
7373

74-
/// @brief Return a text wave with all available message filters for Publisher/Subscriber ZeroMQ sockets
74+
/// @brief Return a text wave with all available message filters for
75+
/// Publisher/Subscriber ZeroMQ sockets
76+
///
77+
/// See also @ref ZeroMQMessageFilters.
7578
///
7679
/// @sa FFI_GetJSONTemplate
7780
Function/WAVE FFI_GetAvailableMessageFilters()
7881

79-
Make/FREE/T wv = {ZeroMQ_HEARTBEAT, IVS_PUB_FILTER, PRESSURE_STATE_FILTER, PRESSURE_SEALED_FILTER, AUTO_TP_FILTER}
82+
Make/FREE/T wv = {ZeroMQ_HEARTBEAT, IVS_PUB_FILTER, PRESSURE_STATE_FILTER, PRESSURE_SEALED_FILTER, \
83+
PRESSURE_BREAKIN_FILTER, AUTO_TP_FILTER, AMPLIFIER_CLAMP_MODE_FILTER, \
84+
AMPLIFIER_AUTO_BRIDGE_BALANCE}
8085

8186
Note/K wv "Heartbeat is sent every 5 seconds."
8287

Packages/Testing-MIES/UTF_ZeroMQPublishing.ipf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ static Function TEST_CASE_END_OVERRIDE(string testname)
1919
zeromq_sub_add_filter("")
2020
End
2121

22+
Function CheckMessageFilters_IGNORE(string filter)
23+
WAVE/T/Z allFilters = FFI_GetAvailableMessageFilters()
24+
CHECK_WAVE(allFilters, TEXT_WAVE)
25+
26+
FindValue/TXOP=4/TEXT=(filter) allFilters
27+
CHECK_GE_VAR(V_Value, 0)
28+
End
29+
2230
static Function CheckPressureStatePublishing()
2331
string device, msg, filter, expected, actual
2432
variable headstage, i, jsonID
@@ -43,6 +51,7 @@ static Function CheckPressureStatePublishing()
4351
expected = PRESSURE_STATE_FILTER
4452
actual = filter
4553
CHECK_EQUAL_STR(actual, expected)
54+
CheckMessageFilters_IGNORE(expected)
4655

4756
jsonID = JSON_Parse(msg)
4857

@@ -81,6 +90,7 @@ static Function CheckPressureSealPublishing()
8190
expected = PRESSURE_SEALED_FILTER
8291
actual = filter
8392
CHECK_EQUAL_STR(actual, expected)
93+
CheckMessageFilters_IGNORE(expected)
8494

8595
jsonID = JSON_Parse(msg)
8696

@@ -114,6 +124,7 @@ static Function CheckClampModePublishing()
114124
expected = AMPLIFIER_CLAMP_MODE_FILTER
115125
actual = filter
116126
CHECK_EQUAL_STR(actual, expected)
127+
CheckMessageFilters_IGNORE(expected)
117128

118129
jsonID = JSON_Parse(msg)
119130

@@ -152,6 +163,7 @@ static Function CheckAutoBridgeBalancePublishing()
152163
expected = AMPLIFIER_AUTO_BRIDGE_BALANCE
153164
actual = filter
154165
CHECK_EQUAL_STR(actual, expected)
166+
CheckMessageFilters_IGNORE(expected)
155167

156168
jsonID = JSON_Parse(msg)
157169

@@ -189,6 +201,7 @@ static Function CheckPressureBreakinPublishing()
189201
expected = PRESSURE_BREAKIN_FILTER
190202
actual = filter
191203
CHECK_EQUAL_STR(actual, expected)
204+
CheckMessageFilters_IGNORE(expected)
192205

193206
jsonID = JSON_Parse(msg)
194207

@@ -240,6 +253,7 @@ static Function CheckAutoTPPublishing()
240253
expected = AUTO_TP_FILTER
241254
actual = filter
242255
CHECK_EQUAL_STR(actual, expected)
256+
CheckMessageFilters_IGNORE(expected)
243257

244258
jsonID = JSON_Parse(msg)
245259

0 commit comments

Comments
 (0)