Skip to content

Commit ac8ff84

Browse files
committed
Add set cycle counts to labnotebook for TTL channels
This needs to be per-rack again for ITC hardware as we get the set cycle count from DC_CalculateChannelColumnNo.
1 parent 0609f41 commit ac8ff84

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

Packages/MIES/MIES_Constants.ipf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ Constant ANALYSISBROWSER_PANEL_VERSION = 1
633633
/// - Changed names of entries
634634
/// - Changed units or meaning of entries
635635
/// - New/Changed layers of entries
636-
Constant LABNOTEBOOK_VERSION = 48
636+
Constant LABNOTEBOOK_VERSION = 49
637637

638638
/// Version of the stimset wave note
639639
Constant STIMSET_NOTE_VERSION = 7

Packages/MIES/MIES_DataConfigurator.ipf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,6 +1758,7 @@ static Function DC_ITC_MakeTTLWave(panelTitle, rackNo)
17581758
string stimSetWaveNote = ""
17591759
string stimSetchecksum = ""
17601760
string stimSetLength = ""
1761+
string setCycleCounts = ""
17611762

17621763
WAVE statusTTLFiltered = DC_GetFilteredChannelState(panelTitle, DATA_ACQUISITION_MODE, CHANNEL_TYPE_TTL)
17631764

@@ -1793,6 +1794,7 @@ static Function DC_ITC_MakeTTLWave(panelTitle, rackNo)
17931794
if(!statusTTLFiltered[i])
17941795
if(i >= first && i <= last)
17951796
setSweepCounts = AddListItem("", setSweepCounts, ";", inf)
1797+
setCycleCounts = AddListItem("", setCycleCounts, ";", inf)
17961798
endif
17971799

17981800
indexingEndStimset = AddListItem("", indexingEndStimset, ";", inf)
@@ -1821,17 +1823,20 @@ static Function DC_ITC_MakeTTLWave(panelTitle, rackNo)
18211823
bit = 2^(i - first)
18221824
MultiThread TTLWave[0, lastIdx] += bit * TTLStimSet[p][col]
18231825
setSweepCounts = AddListItem(num2str(col), setSweepCounts, ";", inf)
1826+
setCycleCounts = AddListItem(num2str(setCycleCount), setCycleCounts, ";", inf)
18241827
endif
18251828
endfor
18261829

18271830
if(rackNo == RACK_ZERO)
18281831
sweepDataLNB[0][%$"TTL rack zero bits"][INDEP_HEADSTAGE] = bits
18291832
sweepDataTxTLNB[0][%$"TTL rack zero stim sets"][INDEP_HEADSTAGE] = listOfSets
18301833
sweepDataTxTLNB[0][%$"TTL rack zero set sweep counts"][INDEP_HEADSTAGE] = setSweepCounts
1834+
sweepDataTxTLNB[0][%$"TTL rack zero set cycle counts"][INDEP_HEADSTAGE] = setCycleCounts
18311835
else
18321836
sweepDataLNB[0][%$"TTL rack one bits"][INDEP_HEADSTAGE] = bits
18331837
sweepDataTxTLNB[0][%$"TTL rack one stim sets"][INDEP_HEADSTAGE] = listOfSets
18341838
sweepDataTxTLNB[0][%$"TTL rack one set sweep counts"][INDEP_HEADSTAGE] = setSweepCounts
1839+
sweepDataTxTLNB[0][%$"TTL rack one set cycle counts"][INDEP_HEADSTAGE] = setCycleCounts
18351840
endif
18361841

18371842
sweepDataTxTLNB[0][%$"TTL Indexing End stimset"][INDEP_HEADSTAGE] = indexingEndStimset
@@ -1852,6 +1857,7 @@ static Function DC_NI_MakeTTLWave(panelTitle)
18521857
string stimSetWaveNote = ""
18531858
string stimSetChecksum = ""
18541859
string stimSetLength = ""
1860+
string setCycleCounts = ""
18551861

18561862
WAVE statusTTLFiltered = DC_GetFilteredChannelState(panelTitle, DATA_ACQUISITION_MODE, CHANNEL_TYPE_TTL)
18571863
WAVE/T allSetNames = DAG_GetChannelTextual(panelTitle, CHANNEL_TYPE_TTL, CHANNEL_CONTROL_WAVE)
@@ -1865,6 +1871,7 @@ static Function DC_NI_MakeTTLWave(panelTitle)
18651871
if(!statusTTLFiltered[i])
18661872
listOfSets = AddListItem("", listOfSets, ";", inf)
18671873
setSweepCounts = AddListItem("", setSweepCounts, ";", inf)
1874+
setCycleCounts = AddListItem("", setCycleCounts, ";", inf)
18681875
channels = AddListItem("", channels, ";", inf)
18691876
indexingEndStimset = AddListItem("", indexingEndStimset, ";", inf)
18701877
stimSetWaveNote = AddListItem("", stimSetWaveNote, ";", inf)
@@ -1882,6 +1889,7 @@ static Function DC_NI_MakeTTLWave(panelTitle)
18821889

18831890
listOfSets = AddListItem(set, listOfSets, ";", inf)
18841891
setSweepCounts = AddListItem(num2str(col), setSweepCounts, ";", inf)
1892+
setCycleCounts = AddListItem(num2str(setCycleCount), setCycleCounts, ";", inf)
18851893
channels = AddListItem(num2str(i), channels, ";", inf)
18861894
indexingEndStimset = AddListItem(allSetNamesIndexingEnd[i], indexingEndStimset, ";", inf)
18871895
stimSetWaveNote = AddListItem(URLEncode(note(TTLStimSet)), stimSetWaveNote, ";", inf)
@@ -1896,6 +1904,7 @@ static Function DC_NI_MakeTTLWave(panelTitle)
18961904
sweepDataTxTLNB[0][%$"TTL channels"][INDEP_HEADSTAGE] = channels
18971905
sweepDataTxTLNB[0][%$"TTL stim sets"][INDEP_HEADSTAGE] = listOfSets
18981906
sweepDataTxTLNB[0][%$"TTL set sweep counts"][INDEP_HEADSTAGE] = setSweepCounts
1907+
sweepDataTxTLNB[0][%$"TTL set cycle counts"][INDEP_HEADSTAGE] = setCycleCounts
18991908
sweepDataTxTLNB[0][%$"TTL Indexing End stimset"][INDEP_HEADSTAGE] = indexingEndStimset
19001909
sweepDataTxTLNB[0][%$"TTL Stimset wave note"][INDEP_HEADSTAGE] = stimSetWaveNote
19011910
sweepDataTxTLNB[0][%$"TTL Stim Wave Checksum"][INDEP_HEADSTAGE] = stimSetChecksum

Packages/MIES/MIES_WaveDataFolderGetters.ipf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ threadsafe Function/WAVE GetLBNidCache(numericalValues)
16871687
return wv
16881688
End
16891689

1690-
static Constant SWEEP_SETTINGS_WAVE_VERSION = 31
1690+
static Constant SWEEP_SETTINGS_WAVE_VERSION = 32
16911691

16921692
/// @brief Uses the parameter names from the `sourceKey` columns and
16931693
/// write them as dimension into the columns of dest.
@@ -2184,6 +2184,9 @@ End
21842184
/// - 36: TTL Stim Wave Checksum (hardware agnostic) URL-encoded payload, see [URL-encoding](https://en.wikipedia.org/wiki/Percent-encoding)
21852185
/// for background information, same string list formatting
21862186
/// - 37: TTL Stim set length (hardware agnostic), same string list formatting
2187+
/// - 38: TTL rack zero set cycle counts (ITC hardware)
2188+
/// - 39: TTL rack one set cycle counts (ITC hardware)
2189+
/// - 40: TTL set cycle counts (NI hardware), string list in `INDEP_HEADSTAGE` layer with empty entries indexed by [0, NUM_DA_TTL_CHANNELS[
21872190
Function/Wave GetSweepSettingsTextKeyWave(panelTitle)
21882191
string panelTitle
21892192

@@ -2202,9 +2205,9 @@ Function/Wave GetSweepSettingsTextKeyWave(panelTitle)
22022205
if(ExistsWithCorrectLayoutVersion(wv, versionOfNewWave))
22032206
return wv
22042207
elseif(WaveExists(wv))
2205-
Redimension/N=(-1, 38, 0) wv
2208+
Redimension/N=(-1, 41, 0) wv
22062209
else
2207-
Make/T/N=(1, 38) newDFR:$newName/Wave=wv
2210+
Make/T/N=(1, 41) newDFR:$newName/Wave=wv
22082211
endif
22092212

22102213
SetDimLabel ROWS, 0, Parameter, wv
@@ -2249,6 +2252,9 @@ Function/Wave GetSweepSettingsTextKeyWave(panelTitle)
22492252
wv[0][35] = "TTL Stimset wave note"
22502253
wv[0][36] = "TTL Stim Wave Checksum"
22512254
wv[0][37] = "TTL Stim set length"
2255+
wv[0][38] = "TTL rack zero set cycle counts"
2256+
wv[0][39] = "TTL rack one set cycle counts"
2257+
wv[0][40] = "TTL set cycle counts"
22522258

22532259
SetSweepSettingsDimLabels(wv, wv)
22542260
SetWaveVersion(wv, versionOfNewWave)

Packages/Testing-MIES/UTF_BasicHardwareTests.ipf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,6 +2596,17 @@ Function UnassociatedChannelsAndTTLs_REENTRY([str])
25962596
else
25972597
CHECK_WAVE(sweepCounts, NULL_WAVE)
25982598
endif
2599+
2600+
// set cycle count
2601+
WAVE/T/Z cycleCounts = GetLastSetting(textualValues, j, "TTL rack zero set cycle counts", DATA_ACQUISITION_MODE)
2602+
CHECK_EQUAL_TEXTWAVES(cycleCounts, {"", "", "", "", "", "", "", "", ";0;;0;"})
2603+
WAVE/T/Z cycleCounts = GetLastSetting(textualValues, j, "TTL rack one set cycle counts", DATA_ACQUISITION_MODE)
2604+
if(HW_ITC_GetNumberOfRacks(device) > 1)
2605+
CHECK_EQUAL_TEXTWAVES(cycleCounts, {"", "", "", "", "", "", "", "", ";0;;0;"})
2606+
else
2607+
CHECK_WAVE(cycleCounts, NULL_WAVE)
2608+
endif
2609+
25992610
break
26002611
case HARDWARE_NI_DAC:
26012612
CHECK_EQUAL_WAVES(TTLs, {1, 3}, mode = WAVE_DATA)
@@ -2609,6 +2620,9 @@ Function UnassociatedChannelsAndTTLs_REENTRY([str])
26092620
WAVE/T/Z sweepCounts = GetLastSetting(textualValues, j, "TTL set sweep counts", DATA_ACQUISITION_MODE)
26102621
CHECK_EQUAL_TEXTWAVES(sweepCounts, {"", "", "", "", "", "", "", "", ";0;;0;;;;;"})
26112622

2623+
WAVE/T/Z cycleCounts = GetLastSetting(textualValues, j, "TTL set cycle counts", DATA_ACQUISITION_MODE)
2624+
CHECK_EQUAL_TEXTWAVES(cycleCounts, {"", "", "", "", "", "", "", "", ";0;;0;;;;;"})
2625+
26122626
break
26132627
endswitch
26142628

0 commit comments

Comments
 (0)