Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SweepFormula: Support TTL channels #1817

Closed
t-b opened this issue Jul 12, 2023 · 7 comments · Fixed by #1822
Closed

SweepFormula: Support TTL channels #1817

t-b opened this issue Jul 12, 2023 · 7 comments · Fixed by #1822
Assignees
Labels
enhancement New feature or request SweepFormula

Comments

@t-b
Copy link
Collaborator

t-b commented Jul 12, 2023

select/data/epochs should also support data from TTL channels.

@timjarsky
Copy link
Collaborator

@t-b twist: the primary use case for TTL epochs is to use them to extract AD channel data.

@t-b
Copy link
Collaborator Author

t-b commented Jul 13, 2023

@t-b twist: the primary use case for TTL epochs is to use them to extract AD channel data.

If that twist always applies it is easy to implement.

@timjarsky
Copy link
Collaborator

@t-b it does always apply. So, do TTL epochs need a channel prefix so something like data(TTL0_E0, select(channels(AD0), sweeps()) will work?

@timjarsky
Copy link
Collaborator

@t-b ....or maybe we need a range operation. e.g., range(channel, epoch).....data(range(TTL0, E0), select(channels(AD0), sweeps())

@t-b
Copy link
Collaborator Author

t-b commented Jul 14, 2023

Using the patch proposed by Michael

diff --git a/Packages/MIES/MIES_SweepFormula.ipf b/Packages/MIES/MIES_SweepFormula.ipf
index 23d0503f17..b088b0c7ed 100644
--- a/Packages/MIES/MIES_SweepFormula.ipf
+++ b/Packages/MIES/MIES_SweepFormula.ipf
@@ -2104,7 +2104,7 @@ static Function/WAVE SF_GetActiveChannelNumbersForSweeps(string graph, WAVE/Z ch
             channelNumber = channels[j][%channelNumber]

             if(IsNaN(channelType))
-                settingList = "ADC;DAC;"
+                settingList = "ADC;DAC;TTL;"
             else
                 switch(channelType)
                     case XOP_CHANNEL_TYPE_DAC:
@@ -2113,6 +2113,9 @@ static Function/WAVE SF_GetActiveChannelNumbersForSweeps(string graph, WAVE/Z ch
                     case XOP_CHANNEL_TYPE_ADC:
                         settingList = "ADC;"
                         break
+                    case XOP_CHANNEL_TYPE_TTL:
+                        settingList = "TTL;"
+                        break
                     default:
                         sprintf msg, "Unhandled channel type %g in channels() at position %d", channelType, j
                         SFH_ASSERT(0, msg)
@@ -2131,6 +2134,10 @@ static Function/WAVE SF_GetActiveChannelNumbersForSweeps(string graph, WAVE/Z ch
                         channelType = XOP_CHANNEL_TYPE_ADC
                         maxChannels = NUM_AD_CHANNELS
                         break
+                    case "TTL":
+                        channelType = XOP_CHANNEL_TYPE_TTL
+                        maxChannels = NUM_DA_TTL_CHANNELS
+                        break
                     default:
                         SFH_ASSERT(0, "Unexpected setting entry for channel type resolution.")
                         break

with TTL_2023_07_12_154006.zip from the issue1817 folder on the FTP.

When using the SF formula

TTL=select(channels(TTL0),sweeps())
r=epochs(E0, $TTL)

$r

I get two ranges. The reason is that the select expression results in two matches as for TTL0 we have the same hardware channel on ITC. Maybe the returned channel numbers for select should be GUI channel numbers?

@t-b

This comment was marked as outdated.

@t-b
Copy link
Collaborator Author

t-b commented Jul 14, 2023

Chat with Michael:

  • Add gui channel number in TUD for DB/SB, see CreateTiledChanneLgraph
  • Adapt axis naming for TTL in databrowser/sweepbrowser, show GUI channel (TTL2) instead of combination of hardware channel and TTL bit TTL0_2 for ITC
  • BSP_AddTracesForEpoch, use new TUD gui channel numbers
  • SF_GetActiveChannelNumbersForSweeps
    • Define that select returns GUI channel numbers, adapt documentation
    • Use GUI channel numbers for all channel types
    • All case:
      • Support TTL with ITC hardware
      • Fix support for unassoc DA/AD
      • Ignore clamp mode selection by user for TTL/unassoc
  • Adapt data extraction in SFH_GetSweepsForFormula, GetDAQDataSingleColumnWave
    • TTL/ITC: Calculate HW channel/TTLBits from GUI channel, see TestEpochsGeneric()
  • Add wrapper for GetDAQDataSingleColumnWave which accepts numerical/textual LBNs
Function/WAVE GetDAQDataSingleColumnWaveNG(WAVE numericalValues, WAVE/T textualValues, DFREF sweepDFR, variable channelType, variable GUIchannelNumber)
End

. This calls GetDAQDataSingleColumnWave always with splitTTLBits = 1.

  • SF_OperationEpochsImpl should prefer EP_FetchEpochs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SweepFormula
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants