From 7368cd03c204dce0719ce7b87bf7ea94303efb64 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 8 Aug 2023 20:10:55 +0200 Subject: [PATCH 1/9] tools/check-code.sh: Add check to ensure that all macros are in their own files --- tools/check-code.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/check-code.sh b/tools/check-code.sh index ba10e2c566..82bb0c4be4 100755 --- a/tools/check-code.sh +++ b/tools/check-code.sh @@ -67,6 +67,15 @@ then ret=1 fi +matches=$(git grep $opts "^(Window|Macro)\b" '*/MIES_*.ipf' ':^*/MIES_*_Macro.ipf' ':^*/MIES_Include.ipf') + +if [[ -n "$matches" ]] +then + echo "Macros are only allowed in separate files:" + echo "$matches" + ret=1 +fi + matches=$(git grep $opts "\bbutton_SettingsPlus_LockDevice\b" '*/UTF_*.ipf' ':^*/UTF_HardwareHelperFunctions.ipf') if [[ -n "$matches" ]] From 8bfeb5de1b91c4fd142e74fee237fa38333d3be4 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 8 Aug 2023 20:06:35 +0200 Subject: [PATCH 2/9] MIES_AnalysisBrowserMacro.ipf: Rename to match standard naming scheme --- ..._AnalysisBrowserMacro.ipf => MIES_AnalysisBrowser_Macro.ipf} | 0 Packages/MIES_Include.ipf | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename Packages/MIES/{MIES_AnalysisBrowserMacro.ipf => MIES_AnalysisBrowser_Macro.ipf} (100%) diff --git a/Packages/MIES/MIES_AnalysisBrowserMacro.ipf b/Packages/MIES/MIES_AnalysisBrowser_Macro.ipf similarity index 100% rename from Packages/MIES/MIES_AnalysisBrowserMacro.ipf rename to Packages/MIES/MIES_AnalysisBrowser_Macro.ipf diff --git a/Packages/MIES_Include.ipf b/Packages/MIES_Include.ipf index ecd7063a89..8b341a8162 100644 --- a/Packages/MIES_Include.ipf +++ b/Packages/MIES_Include.ipf @@ -146,7 +146,7 @@ End #include "MIES_AcquisitionStateHandling" #include "MIES_AmplifierInteraction" #include "MIES_AnalysisBrowser" -#include "MIES_AnalysisBrowserMacro" +#include "MIES_AnalysisBrowser_Macro" #include "MIES_AnalysisBrowser_SweepBrowser" #include "MIES_AnalysisBrowser_SweepBrowser_Export" #include "MIES_AnalysisFunctionHelpers" From f6d8040a219a815440eb2c5df0b26ecc20ccf2af Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 8 Aug 2023 20:07:15 +0200 Subject: [PATCH 3/9] SBE_ExportSettingsPanel: Factor it out --- ...ES_AnalysisBrowser_SweepBrowser_Export.ipf | 49 +---------------- ...lysisBrowser_SweepBrowser_Export_Macro.ipf | 54 +++++++++++++++++++ Packages/MIES_Include.ipf | 1 + Packages/tests/UTF_DataGenerators.ipf | 2 +- 4 files changed, 57 insertions(+), 49 deletions(-) create mode 100644 Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export_Macro.ipf diff --git a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf index ad987823e7..a53d3e4407 100644 --- a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf +++ b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export.ipf @@ -6,7 +6,7 @@ #pragma ModuleName=MIES_SBE #endif -static StrConstant SBE_EXPORT_PANEL = "SBE_ExportSettingsPanel" +static StrConstant SBE_EXPORT_PANEL = "ExportSettingsPanel" /// @file MIES_AnalysisBrowser_SweepBrowser_Export.ipf /// @brief __SBE__ Panel for exporting sweepbrowser traces to new graphs or existing graphs @@ -564,53 +564,6 @@ static Function SBE_ExportSweepBrowser(sett) Execute/P/Q "SetDataFolder " + saveDFR End -Window SBE_ExportSettingsPanel() : Panel - PauseUpdate; Silent 1 // building window... - NewPanel /K=1 /W=(367,800,605,1282) as "Export settings" - SetVariable setvar_sweep_export_datafolder,pos={18.00,303.00},size={199.00,18.00},bodyWidth=140,title="Datafolder" - SetVariable setvar_sweep_export_datafolder,value= _STR:"myFolder" - SetVariable setvar_sweep_export_x_range_beg,pos={18.00,109.00},size={170.00,18.00},bodyWidth=50,title="Manual X range begin" - SetVariable setvar_sweep_export_x_range_beg,value= _NUM:NaN - SetVariable setvar_sweep_export_x_range_end,pos={18.00,132.00},size={160.00,18.00},bodyWidth=50,title="Manual X range end" - SetVariable setvar_sweep_export_x_range_end,value= _NUM:NaN - CheckBox checkbox_sweep_export_cursor,pos={18.00,85.00},size={160.00,15.00},title="Duplicate only cursor range" - CheckBox checkbox_sweep_export_cursor,value= 0,side= 1 - CheckBox checkbox_sweep_export_resetOff,pos={18.00,62.00},size={197.00,15.00},title="Reset the wave's dim offset to zero" - CheckBox checkbox_sweep_export_resetOff,value= 0,side= 1 - PopupMenu popup_sweep_export_graph,pos={18.00,276.00},size={192.00,19.00},bodyWidth=120,proc=SBE_PopMenu_ExportTargetGraph,title="Target Graph" - PopupMenu popup_sweep_export_graph,mode=1,popvalue="New",value= #"SBE_ListOfGraphsAndNew()" - PopupMenu popup_sweep_export_x_axis,pos={43.00,329.00},size={154.00,19.00},bodyWidth=120,proc=SBE_PopMenu_ExportTargetAxis,title="X Axis" - PopupMenu popup_sweep_export_x_axis,mode=1,popvalue="New",value= #"SBE_GetSelectedAxis(\"popup_sweep_export_graph\", 1)" - PopupMenu popup_sweep_export_y_axis,pos={43.00,380.00},size={154.00,19.00},bodyWidth=120,proc=SBE_PopMenu_ExportTargetAxis,title="Y Axis" - PopupMenu popup_sweep_export_y_axis,mode=1,popvalue="New",value= #"SBE_GetSelectedAxis(\"popup_sweep_export_graph\", 2)" - Button button_sweep_export_doIt,pos={79.00,454.00},size={81.00,23.00},proc=SBE_ButtonProc_PerformExport,title="Do It" - GroupBox group_sweep_export_input,pos={10.00,8.00},size={217.00,40.00} - PopupMenu popup_sweep_export_source_graph,pos={14.00,16.00},size={194.00,19.00},bodyWidth=120,title="Source Graph" - PopupMenu popup_sweep_export_source_graph,mode=1,popvalue="SweepBrowser1",value= #"SBE_ListOfSweepGraphs()" - GroupBox group_sweep_export_input1,pos={12.00,54.00},size={214.00,397.00} - SetVariable setvar_sweep_export_new_x_name,pos={16.00,352.00},size={200.00,18.00},bodyWidth=140,title="New X axis" - SetVariable setvar_sweep_export_new_x_name,value= _STR:"bottom" - SetVariable setvar_sweep_export_new_y_name,pos={17.00,403.00},size={200.00,18.00},bodyWidth=140,title="New Y axis" - SetVariable setvar_sweep_export_new_y_name,value= _STR:"left" - CheckBox checkbox_sweep_export_equalY,pos={21.00,427.00},size={54.00,15.00},title="Equal Y" - CheckBox checkbox_sweep_export_equalY,help={"Set the y ranges of all vertical axes to the maximum per clamp mode"} - CheckBox checkbox_sweep_export_equalY,value= 1,side= 1 - CheckBox checkbox_sweep_export_redistAx,pos={85.00,427.00},size={105.00,15.00},title="Redistribute Axes" - CheckBox checkbox_sweep_export_redistAx,help={"Redistribute the axes in the target graph so that no axes overlap. Needs to be off for dDAQ view mode."} - CheckBox checkbox_sweep_export_redistAx,value= 1,side= 1 - GroupBox group_pulse_settings,pos={20.00,155.00},size={197.00,118.00} - CheckBox checkbox_sweep_export_pulse_set,pos={26.00,162.00},size={181.00,15.00},proc=SBE_CheckProc_UsePulseForXRange,title="Use pulses for X range selection" - CheckBox checkbox_sweep_export_pulse_set,value= 0,side= 1 - PopupMenu popup_sweep_export_pulse_AD,pos={28.00,181.00},size={69.00,19.00},bodyWidth=50,disable=2,proc=SBE_PopMenuProc_PulsesADTrace,title="AD" - PopupMenu popup_sweep_export_pulse_AD,mode=1,popvalue="0",value= "0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15" - SetVariable setvar_sweep_export_num_pulses,pos={28.00,205.00},size={148.00,18.00},bodyWidth=50,disable=2,title="Number of pulses" - SetVariable setvar_sweep_export_num_pulses,limits={0,12,1},value= _NUM:1 - SetVariable setvar_sweep_export_pulse_pre,pos={28.00,227.00},size={172.00,18.00},bodyWidth=50,disable=2,title="Time before first pulse" - SetVariable setvar_sweep_export_pulse_pre,value= _NUM:0, help={"Positive values increase the x range, negative values decrease it."} - SetVariable setvar_sweep_export_pulse_post,pos={28.00,250.00},size={160.00,18.00},bodyWidth=50,disable=2,title="Time after last pulse" - SetVariable setvar_sweep_export_pulse_post,value= _NUM:0, help={"Positive values increase the x range, negative values decrease it."} -EndMacro - Function SBE_PopMenu_ExportTargetAxis(pa) : PopupMenuControl STRUCT WMPopupAction &pa diff --git a/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export_Macro.ipf b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export_Macro.ipf new file mode 100644 index 0000000000..96ff54a0dc --- /dev/null +++ b/Packages/MIES/MIES_AnalysisBrowser_SweepBrowser_Export_Macro.ipf @@ -0,0 +1,54 @@ +#pragma TextEncoding = "UTF-8" +#pragma rtGlobals=3 // Use modern global access method and strict wave access. +#pragma rtFunctionErrors=1 + +#ifdef AUTOMATED_TESTING +#pragma ModuleName=MIES_SBEM +#endif + +Window ExportSettingsPanel() : Panel + PauseUpdate; Silent 1 // building window... + NewPanel /K=1 /W=(367,800,605,1282) as "Export settings" + SetVariable setvar_sweep_export_datafolder,pos={18.00,303.00},size={199.00,18.00},bodyWidth=140,title="Datafolder" + SetVariable setvar_sweep_export_datafolder,value= _STR:"myFolder" + SetVariable setvar_sweep_export_x_range_beg,pos={18.00,109.00},size={170.00,18.00},bodyWidth=50,title="Manual X range begin" + SetVariable setvar_sweep_export_x_range_beg,value= _NUM:NaN + SetVariable setvar_sweep_export_x_range_end,pos={18.00,132.00},size={160.00,18.00},bodyWidth=50,title="Manual X range end" + SetVariable setvar_sweep_export_x_range_end,value= _NUM:NaN + CheckBox checkbox_sweep_export_cursor,pos={18.00,85.00},size={160.00,15.00},title="Duplicate only cursor range" + CheckBox checkbox_sweep_export_cursor,value= 0,side= 1 + CheckBox checkbox_sweep_export_resetOff,pos={18.00,62.00},size={197.00,15.00},title="Reset the wave's dim offset to zero" + CheckBox checkbox_sweep_export_resetOff,value= 0,side= 1 + PopupMenu popup_sweep_export_graph,pos={18.00,276.00},size={192.00,19.00},bodyWidth=120,proc=SBE_PopMenu_ExportTargetGraph,title="Target Graph" + PopupMenu popup_sweep_export_graph,mode=1,popvalue="New",value= #"SBE_ListOfGraphsAndNew()" + PopupMenu popup_sweep_export_x_axis,pos={43.00,329.00},size={154.00,19.00},bodyWidth=120,proc=SBE_PopMenu_ExportTargetAxis,title="X Axis" + PopupMenu popup_sweep_export_x_axis,mode=1,popvalue="New",value= #"SBE_GetSelectedAxis(\"popup_sweep_export_graph\", 1)" + PopupMenu popup_sweep_export_y_axis,pos={43.00,380.00},size={154.00,19.00},bodyWidth=120,proc=SBE_PopMenu_ExportTargetAxis,title="Y Axis" + PopupMenu popup_sweep_export_y_axis,mode=1,popvalue="New",value= #"SBE_GetSelectedAxis(\"popup_sweep_export_graph\", 2)" + Button button_sweep_export_doIt,pos={79.00,454.00},size={81.00,23.00},proc=SBE_ButtonProc_PerformExport,title="Do It" + GroupBox group_sweep_export_input,pos={10.00,8.00},size={217.00,40.00} + PopupMenu popup_sweep_export_source_graph,pos={14.00,16.00},size={194.00,19.00},bodyWidth=120,title="Source Graph" + PopupMenu popup_sweep_export_source_graph,mode=1,popvalue="SweepBrowser1",value= #"SBE_ListOfSweepGraphs()" + GroupBox group_sweep_export_input1,pos={12.00,54.00},size={214.00,397.00} + SetVariable setvar_sweep_export_new_x_name,pos={16.00,352.00},size={200.00,18.00},bodyWidth=140,title="New X axis" + SetVariable setvar_sweep_export_new_x_name,value= _STR:"bottom" + SetVariable setvar_sweep_export_new_y_name,pos={17.00,403.00},size={200.00,18.00},bodyWidth=140,title="New Y axis" + SetVariable setvar_sweep_export_new_y_name,value= _STR:"left" + CheckBox checkbox_sweep_export_equalY,pos={21.00,427.00},size={54.00,15.00},title="Equal Y" + CheckBox checkbox_sweep_export_equalY,help={"Set the y ranges of all vertical axes to the maximum per clamp mode"} + CheckBox checkbox_sweep_export_equalY,value= 1,side= 1 + CheckBox checkbox_sweep_export_redistAx,pos={85.00,427.00},size={105.00,15.00},title="Redistribute Axes" + CheckBox checkbox_sweep_export_redistAx,help={"Redistribute the axes in the target graph so that no axes overlap. Needs to be off for dDAQ view mode."} + CheckBox checkbox_sweep_export_redistAx,value= 1,side= 1 + GroupBox group_pulse_settings,pos={20.00,155.00},size={197.00,118.00} + CheckBox checkbox_sweep_export_pulse_set,pos={26.00,162.00},size={181.00,15.00},proc=SBE_CheckProc_UsePulseForXRange,title="Use pulses for X range selection" + CheckBox checkbox_sweep_export_pulse_set,value= 0,side= 1 + PopupMenu popup_sweep_export_pulse_AD,pos={28.00,181.00},size={69.00,19.00},bodyWidth=50,disable=2,proc=SBE_PopMenuProc_PulsesADTrace,title="AD" + PopupMenu popup_sweep_export_pulse_AD,mode=1,popvalue="0",value= "0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15" + SetVariable setvar_sweep_export_num_pulses,pos={28.00,205.00},size={148.00,18.00},bodyWidth=50,disable=2,title="Number of pulses" + SetVariable setvar_sweep_export_num_pulses,limits={0,12,1},value= _NUM:1 + SetVariable setvar_sweep_export_pulse_pre,pos={28.00,227.00},size={172.00,18.00},bodyWidth=50,disable=2,title="Time before first pulse" + SetVariable setvar_sweep_export_pulse_pre,value= _NUM:0, help={"Positive values increase the x range, negative values decrease it."} + SetVariable setvar_sweep_export_pulse_post,pos={28.00,250.00},size={160.00,18.00},bodyWidth=50,disable=2,title="Time after last pulse" + SetVariable setvar_sweep_export_pulse_post,value= _NUM:0, help={"Positive values increase the x range, negative values decrease it."} +EndMacro diff --git a/Packages/MIES_Include.ipf b/Packages/MIES_Include.ipf index 8b341a8162..6752d99ba5 100644 --- a/Packages/MIES_Include.ipf +++ b/Packages/MIES_Include.ipf @@ -149,6 +149,7 @@ End #include "MIES_AnalysisBrowser_Macro" #include "MIES_AnalysisBrowser_SweepBrowser" #include "MIES_AnalysisBrowser_SweepBrowser_Export" +#include "MIES_AnalysisBrowser_SweepBrowser_Export_Macro" #include "MIES_AnalysisFunctionHelpers" #include "MIES_AnalysisFunctionManagement" #include "MIES_AnalysisFunctions_PatchSeq" diff --git a/Packages/tests/UTF_DataGenerators.ipf b/Packages/tests/UTF_DataGenerators.ipf index 166e069681..93f7b6773b 100644 --- a/Packages/tests/UTF_DataGenerators.ipf +++ b/Packages/tests/UTF_DataGenerators.ipf @@ -254,7 +254,7 @@ End Function/WAVE GetMiesMacrosWithPanelType() WAVE/T allMiesMacros = GetMIESMacros() - Make/FREE/T panelsWithoutType = {"ID_Headstage_Panel", "ID_Popup_Panel", "DP_DebugPanel", "SBE_ExportSettingsPanel", "PSXPanel"} + Make/FREE/T panelsWithoutType = {"ID_Headstage_Panel", "ID_Popup_Panel", "DP_DebugPanel", "ExportSettingsPanel", "PSXPanel"} WAVE/T matches = GetSetDifference(allMiesMacros, panelsWithoutType) From 47323c0b412abd74100ba0f15143cbf4d7d2087a Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 8 Aug 2023 20:20:12 +0200 Subject: [PATCH 4/9] IVSCCControlPanel: Factor it out --- Packages/MIES/MIES_IVSCC.ipf | 10 ---------- Packages/MIES/MIES_IVSCC_Macro.ipf | 17 +++++++++++++++++ Packages/MIES_Include.ipf | 1 + 3 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 Packages/MIES/MIES_IVSCC_Macro.ipf diff --git a/Packages/MIES/MIES_IVSCC.ipf b/Packages/MIES/MIES_IVSCC.ipf index 5661add0a1..6d34d3a0e8 100644 --- a/Packages/MIES/MIES_IVSCC.ipf +++ b/Packages/MIES/MIES_IVSCC.ipf @@ -336,16 +336,6 @@ Function IVS_CreatePanel() Execute "IVSCCControlPanel()" End -Window IVSCCControlPanel() : Panel - PauseUpdate; Silent 1 // building window... - NewPanel /K=1 /W=(392,734,683,925) as "IVSCC control panel" - Button button_ivs_setup,pos={86.00,19.00},size={130.00,30.00},proc=IVS_ButtonProc_Setup,title="Setup DAEphys panel" - Button button_runGigOhmSealQC,pos={48.00,103.00},size={190.00,30.00},proc=IVS_ButtonProc_GOhmSeal,title="Run GΩ seal check" - Button button_runBaselineQC,pos={48.00,61.00},size={190.00,30.00},proc=IVS_ButtonProc_BaselineQC,title="Run baseline QC" - Button button_runAccessResisQC,pos={48.00,145.00},size={190.00,30.00},proc=IVS_ButtonProc_AccessResist,title="Run access resistance QC check" - SetWindow kwTopWin,userdata(Config_PanelType)="IVSCControlPanel" -EndMacro - /// @brief Return the Set QC passed/failed state for the given sweep /// /// @return 1 if passed, 0 if not (or not yet) and diff --git a/Packages/MIES/MIES_IVSCC_Macro.ipf b/Packages/MIES/MIES_IVSCC_Macro.ipf new file mode 100644 index 0000000000..f1a83e80b0 --- /dev/null +++ b/Packages/MIES/MIES_IVSCC_Macro.ipf @@ -0,0 +1,17 @@ +#pragma TextEncoding = "UTF-8" +#pragma rtGlobals=3 // Use modern global access method and strict wave access. +#pragma rtFunctionErrors=1 + +#ifdef AUTOMATED_TESTING +#pragma ModuleName=MIES_IVSCCM +#endif + +Window IVSCCControlPanel() : Panel + PauseUpdate; Silent 1 // building window... + NewPanel /K=1 /W=(392,734,683,925) as "IVSCC control panel" + Button button_ivs_setup,pos={86.00,19.00},size={130.00,30.00},proc=IVS_ButtonProc_Setup,title="Setup DAEphys panel" + Button button_runGigOhmSealQC,pos={48.00,103.00},size={190.00,30.00},proc=IVS_ButtonProc_GOhmSeal,title="Run GΩ seal check" + Button button_runBaselineQC,pos={48.00,61.00},size={190.00,30.00},proc=IVS_ButtonProc_BaselineQC,title="Run baseline QC" + Button button_runAccessResisQC,pos={48.00,145.00},size={190.00,30.00},proc=IVS_ButtonProc_AccessResist,title="Run access resistance QC check" + SetWindow kwTopWin,userdata(Config_PanelType)="IVSCControlPanel" +EndMacro diff --git a/Packages/MIES_Include.ipf b/Packages/MIES_Include.ipf index 6752d99ba5..4b6d3bd72a 100644 --- a/Packages/MIES_Include.ipf +++ b/Packages/MIES_Include.ipf @@ -198,6 +198,7 @@ End #include "MIES_Indexing" #include "MIES_InputDialog" #include "MIES_IVSCC" +#include "MIES_IVSCC_Macro" #include "MIES_JSONWaveNotes" #include "MIES_Labnotebook" #include "MIES_LogbookViewer" From 5059a8357beb2b78a594827c62f66f05f87a7400 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Tue, 8 Aug 2023 20:29:15 +0200 Subject: [PATCH 5/9] ID_Headstage_Panel/ID_Popup_Panel: Factor out --- Packages/MIES/MIES_InputDialog.ipf | 102 +--------------------- Packages/MIES/MIES_InputDialog_Macro.ipf | 105 +++++++++++++++++++++++ Packages/MIES_Include.ipf | 1 + Packages/tests/UTF_DataGenerators.ipf | 2 +- 4 files changed, 109 insertions(+), 101 deletions(-) create mode 100644 Packages/MIES/MIES_InputDialog_Macro.ipf diff --git a/Packages/MIES/MIES_InputDialog.ipf b/Packages/MIES/MIES_InputDialog.ipf index 03894907e2..fcf9ee5199 100644 --- a/Packages/MIES/MIES_InputDialog.ipf +++ b/Packages/MIES/MIES_InputDialog.ipf @@ -33,9 +33,9 @@ Function ID_AskUserForSettings(variable mode, string title, WAVE data, WAVE mock ASSERT(DimSize(data, ROWS) > 0, "Empty wave") if(mode == ID_HEADSTAGE_SETTINGS) - Execute "ID_Headstage_Panel()" + Execute "IDM_Headstage_Panel()" elseif(mode == ID_POPUPMENU_SETTINGS) - Execute "ID_Popup_Panel()" + Execute "IDM_Popup_Panel()" endif win = GetCurrentWindow() @@ -174,101 +174,3 @@ Function/S ID_GetPopupEntries() return TextWaveToList(items, ";") End - -Window ID_Headstage_Panel() : Panel - PauseUpdate; Silent 1 // building window... - NewPanel/K=1/W=(490,960,726,1225) as "InputPanelForHeadstages" - Button button_continue,pos={22.00,227.00},size={92.00,20.00},proc=ID_ButtonProc - Button button_continue,title="Continue" - Button button_continue,userdata(ResizeControlsInfo)= A"!!,Bi!!#Ar!!#?q!!#V!!#?c!!#!!#AV!!#@&!!#J,fQLzzzzzzzzzzzzzzzzzzzz" - SetWindow kwTopWin,userdata(ResizeControlsInfo) += A"zzzzzzzzzzzzzzzzzzzzzzzzz" - SetWindow kwTopWin,userdata(ResizeControlsInfo) += A"zzzzzzzzzzzzzzzzzzz!!!" - Execute/Q/Z "SetWindow kwTopWin sizeLimit={177,198.75,inf,inf}" // sizeLimit requires Igor 7 or later -EndMacro - -Window ID_Popup_Panel() : Panel - PauseUpdate; Silent 1 // building window... - NewPanel /K=1 /W=(490,960,735,1066) as "InputPanelForPopupEntries" - SetDrawLayer UserBack - Button button_continue,pos={32.00,75.00},size={92.00,20.00},proc=ID_ButtonProc - Button button_continue,title="Continue" - Button button_continue,userdata(ResizeControlsInfo)=A"!!,Cd!!#?O!!#?q!!#\"!!#@T!!#V!!#?c!!#!!#AV!!#@&!!#J,fQLzzzzzzzzzzzzzzzzzzzz" + SetWindow kwTopWin,userdata(ResizeControlsInfo) += A"zzzzzzzzzzzzzzzzzzzzzzzzz" + SetWindow kwTopWin,userdata(ResizeControlsInfo) += A"zzzzzzzzzzzzzzzzzzz!!!" + Execute/Q/Z "SetWindow kwTopWin sizeLimit={177,198.75,inf,inf}" // sizeLimit requires Igor 7 or later +EndMacro + +Window IDM_Popup_Panel() : Panel + PauseUpdate; Silent 1 // building window... + NewPanel /K=1 /W=(490,960,735,1066) as "InputPanelForPopupEntries" + SetDrawLayer UserBack + Button button_continue,pos={32.00,75.00},size={92.00,20.00},proc=ID_ButtonProc + Button button_continue,title="Continue" + Button button_continue,userdata(ResizeControlsInfo)=A"!!,Cd!!#?O!!#?q!!#\"!!#@T!!# Date: Tue, 8 Aug 2023 20:18:38 +0200 Subject: [PATCH 6/9] DebugPanel: Factor it out --- Packages/MIES/MIES_DebugPanel.ipf | 33 +-------------------- Packages/MIES/MIES_DebugPanel_Macro.ipf | 38 +++++++++++++++++++++++++ Packages/MIES_Include.ipf | 1 + Packages/tests/Basic/UTF_Macros.ipf | 4 +-- Packages/tests/Basic/UTF_Utils.ipf | 4 +-- Packages/tests/UTF_DataGenerators.ipf | 2 +- Packages/tests/UTF_HelperFunctions.ipf | 2 +- 7 files changed, 46 insertions(+), 38 deletions(-) create mode 100644 Packages/MIES/MIES_DebugPanel_Macro.ipf diff --git a/Packages/MIES/MIES_DebugPanel.ipf b/Packages/MIES/MIES_DebugPanel.ipf index 21efeab1ef..5417922fec 100644 --- a/Packages/MIES/MIES_DebugPanel.ipf +++ b/Packages/MIES/MIES_DebugPanel.ipf @@ -10,7 +10,7 @@ /// /// @brief __DP__ Holds the debug panel -static StrConstant PANEL = "DP_DebugPanel" +static StrConstant PANEL = "DebugPanel" Function DP_DebuggingEnabledForFile(file) string file @@ -74,37 +74,6 @@ Function/S DP_OpenDebugPanel() return panel End -Window DP_DebugPanel() : Panel - PauseUpdate; Silent 1 // building window... - NewPanel /K=1 /W=(230,184,625,648) - SetDrawLayer UserBack - CheckBox check_itc_xop_debug_mode,pos={254.00,11.00},size={121.00,15.00},proc=DP_CheckProc_Debug,title="ITC XOP Debugging" - CheckBox check_itc_xop_debug_mode,userdata(ResizeControlsInfo)= A"!!,H9!!#;=!!#@V!!#<(z!!#o2B4uAezzzzzzzzzzzzzz!!#o2B4uAezz" - CheckBox check_itc_xop_debug_mode,userdata(ResizeControlsInfo) += A"zzzzzzzzzzzz!!#u:Du]k Date: Tue, 8 Aug 2023 20:33:05 +0200 Subject: [PATCH 7/9] PsxPanel: Factor it out --- Packages/MIES/MIES_SweepFormula_PSX.ipf | 136 ----------------- Packages/MIES/MIES_SweepFormula_PSX_Macro.ipf | 143 ++++++++++++++++++ Packages/MIES_Include.ipf | 1 + 3 files changed, 144 insertions(+), 136 deletions(-) create mode 100644 Packages/MIES/MIES_SweepFormula_PSX_Macro.ipf diff --git a/Packages/MIES/MIES_SweepFormula_PSX.ipf b/Packages/MIES/MIES_SweepFormula_PSX.ipf index 03409a5605..e758c6e2f9 100644 --- a/Packages/MIES/MIES_SweepFormula_PSX.ipf +++ b/Packages/MIES/MIES_SweepFormula_PSX.ipf @@ -5047,139 +5047,3 @@ Function ApplyMacroToExistingPanel(string win, string mac) SetActiveSubwindow $currWindow End - -Window PSXPanel() : Panel - PauseUpdate; Silent 1 // building window... - NewPanel /K=1 /W=(1251,700,2391,1532) as "SweepFormula plot from " - SetDrawLayer UserBack - SetDrawEnv pop - DrawText 47,475,"UI" - SetDrawEnv fname= "Lucida Console" - SetDrawEnv push - Button button_load,pos={17.00,46.00},size={50.00,20.00},proc=PSX_ButtonProc_LoadEvents - Button button_load,title="Load" - Button button_load,help={"Load the event data from the results wave and redo SweepFormula evaluation\rto update possible psxStats plots."} - Button button_load,userdata(ResizeControlsInfo)=A"!!,BA!!#>F!!#>V!!#V!!#V!!#- none -"} - Button button_psx_info,userdata="- none -" - Button button_psx_info,userdata(ResizeControlsInfo)=A"!!,BI!!#CJ!!#
The following keyboard shortcuts work for either the psx or the psxstats graphs.\rAll of them require that the cursor A is located on an event, which is by default\rthe case for the psx graph. The current direction for automatic advancement defaults to left-to-right.\r    ↑ (up): Accept the current event, changing both event and fit state to accept,\r            and advance the cursor to the next event in the current direction\r    ↓ (down): Reject the current event, changing both event and fit state to reject,\r              and advance the cursor to the next event in the current direction\r    → (right): Move the cursor to the next event on the right\r    ← (left): Move the cursor to the previous event on the left\r    (space): Toggle the event and fit state of the current event without any movement\r    r: Reverse the current direction\r    c: Center the x-axis around the current event\r    e: Toggle the event state\r    f: Toggle the fit state\r    z: Accept the event state but reject the fit state\r
"} - GroupBox group_UI,userdata(ResizeControlsInfo)=A"!!,DC!!#CJ!!#- none -"} - Button button_fit_results,userdata="- none -" - GroupBox group_event,pos={14.00,13.00},size={69.00,122.00},title="Event" - GroupBox group_event,help={"Toggle the display of the event traces"} - SetVariable setvar_event_block_size,pos={0.00,193.00},size={120.00,18.00},bodyWidth=44,proc=PSX_SetVarBlockSize - SetVariable setvar_event_block_size,title="Block size [%]" - SetVariable setvar_event_block_size,help={"Allows to restrict the all event graph to only a percentage of the events."} - SetVariable setvar_event_block_size,limits={0,100,1},value=_NUM:100 - PopupMenu popup_block,pos={17.00,218.00},size={82.00,19.00},bodyWidth=50,proc=PSX_PopupMenuBlockNumber - PopupMenu popup_block,title="Block" - PopupMenu popup_block,help={"Select which of the event blocks to display"} - PopupMenu popup_block,userdata(NumberOfBlocks)="1" - PopupMenu popup_block,mode=1,popvalue="",value=#"\"\"" - PopupMenu popupmenu_event_offset,pos={136.00,168.00},size={53.00,19.00},proc=PSX_PopupMenuState - PopupMenu popupmenu_event_offset,help={"Select the time point in x direction for aligning the single event traces in the all event graph"} - PopupMenu popupmenu_event_offset,mode=1,popvalue="Onset",value=#"\"Onset;Peak\"" - DefineGuide leftMenu={FL,0.2,FR},horizCenter={leftMenu,0.5,FR} - SetWindow kwTopWin,hook(resetScaling)=IH_ResetScaling - SetWindow kwTopWin,hook(ctrl)=PSX_AllEventGraphHook - SetWindow kwTopWin,hook(windowCoordinateSaving)=StoreWindowCoordinatesHook - Execute/Q/Z "SetWindow kwTopWin sizeLimit={750,200.25,inf,inf}" // sizeLimit requires Igor 7 or later - Display/W=(225,62,675,188)/FG=(horizCenter,FT,FR,FB)/HOST=# - RenameWindow #,Single - SetActiveSubwindow ## - Display/W=(225,62,675,188)/FG=(leftMenu,FT,horizCenter,FB)/HOST=# - RenameWindow #,All - SetActiveSubwindow ## - RenameWindow #,SpecialEventPanel - SetActiveSubwindow ## -EndMacro diff --git a/Packages/MIES/MIES_SweepFormula_PSX_Macro.ipf b/Packages/MIES/MIES_SweepFormula_PSX_Macro.ipf new file mode 100644 index 0000000000..e95eae9e76 --- /dev/null +++ b/Packages/MIES/MIES_SweepFormula_PSX_Macro.ipf @@ -0,0 +1,143 @@ +#pragma TextEncoding = "UTF-8" +#pragma rtGlobals=3 // Use modern global access method and strict wave access. +#pragma rtFunctionErrors=1 + +#ifdef AUTOMATED_TESTING +#pragma ModuleName=MIES_PSXM +#endif + +Window PSXPanel() : Panel + PauseUpdate; Silent 1 // building window... + NewPanel /K=1 /W=(1251,700,2391,1532) as "SweepFormula plot from " + SetDrawLayer UserBack + SetDrawEnv pop + DrawText 47,475,"UI" + SetDrawEnv fname= "Lucida Console" + SetDrawEnv push + Button button_load,pos={17.00,46.00},size={50.00,20.00},proc=PSX_ButtonProc_LoadEvents + Button button_load,title="Load" + Button button_load,help={"Load the event data from the results wave and redo SweepFormula evaluation\rto update possible psxStats plots."} + Button button_load,userdata(ResizeControlsInfo)=A"!!,BA!!#>F!!#>V!!#V!!#V!!#- none -"} + Button button_psx_info,userdata="- none -" + Button button_psx_info,userdata(ResizeControlsInfo)=A"!!,BI!!#CJ!!#
The following keyboard shortcuts work for either the psx or the psxstats graphs.\rAll of them require that the cursor A is located on an event, which is by default\rthe case for the psx graph. The current direction for automatic advancement defaults to left-to-right.\r    ↑ (up): Accept the current event, changing both event and fit state to accept,\r            and advance the cursor to the next event in the current direction\r    ↓ (down): Reject the current event, changing both event and fit state to reject,\r              and advance the cursor to the next event in the current direction\r    → (right): Move the cursor to the next event on the right\r    ← (left): Move the cursor to the previous event on the left\r    (space): Toggle the event and fit state of the current event without any movement\r    r: Reverse the current direction\r    c: Center the x-axis around the current event\r    e: Toggle the event state\r    f: Toggle the fit state\r    z: Accept the event state but reject the fit state\r
"} + GroupBox group_UI,userdata(ResizeControlsInfo)=A"!!,DC!!#CJ!!#- none -"} + Button button_fit_results,userdata="- none -" + GroupBox group_event,pos={14.00,13.00},size={69.00,122.00},title="Event" + GroupBox group_event,help={"Toggle the display of the event traces"} + SetVariable setvar_event_block_size,pos={0.00,193.00},size={120.00,18.00},bodyWidth=44,proc=PSX_SetVarBlockSize + SetVariable setvar_event_block_size,title="Block size [%]" + SetVariable setvar_event_block_size,help={"Allows to restrict the all event graph to only a percentage of the events."} + SetVariable setvar_event_block_size,limits={0,100,1},value=_NUM:100 + PopupMenu popup_block,pos={17.00,218.00},size={82.00,19.00},bodyWidth=50,proc=PSX_PopupMenuBlockNumber + PopupMenu popup_block,title="Block" + PopupMenu popup_block,help={"Select which of the event blocks to display"} + PopupMenu popup_block,userdata(NumberOfBlocks)="1" + PopupMenu popup_block,mode=1,popvalue="",value=#"\"\"" + PopupMenu popupmenu_event_offset,pos={136.00,168.00},size={53.00,19.00},proc=PSX_PopupMenuState + PopupMenu popupmenu_event_offset,help={"Select the time point in x direction for aligning the single event traces in the all event graph"} + PopupMenu popupmenu_event_offset,mode=1,popvalue="Onset",value=#"\"Onset;Peak\"" + DefineGuide leftMenu={FL,0.2,FR},horizCenter={leftMenu,0.5,FR} + SetWindow kwTopWin,hook(resetScaling)=IH_ResetScaling + SetWindow kwTopWin,hook(ctrl)=PSX_AllEventGraphHook + SetWindow kwTopWin,hook(windowCoordinateSaving)=StoreWindowCoordinatesHook + Execute/Q/Z "SetWindow kwTopWin sizeLimit={750,200.25,inf,inf}" // sizeLimit requires Igor 7 or later + Display/W=(225,62,675,188)/FG=(horizCenter,FT,FR,FB)/HOST=# + RenameWindow #,Single + SetActiveSubwindow ## + Display/W=(225,62,675,188)/FG=(leftMenu,FT,horizCenter,FB)/HOST=# + RenameWindow #,All + SetActiveSubwindow ## + RenameWindow #,SpecialEventPanel + SetActiveSubwindow ## +EndMacro diff --git a/Packages/MIES_Include.ipf b/Packages/MIES_Include.ipf index 65bda5a47f..c053768bae 100644 --- a/Packages/MIES_Include.ipf +++ b/Packages/MIES_Include.ipf @@ -224,6 +224,7 @@ End #include "MIES_SweepFormula" #include "MIES_SweepFormula_Helpers" #include "MIES_SweepFormula_PSX" +#include "MIES_SweepFormula_PSX_Macro" #include "MIES_SweepSaving" #include "MIES_ThreadedFIFOHandling" #include "MIES_ThreadsafeDataSharing" From 9e2e24e42cd2b03952016df8a5b4c003196f11af Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Fri, 11 Aug 2023 14:35:31 +0200 Subject: [PATCH 8/9] Packages/igortest: Update --- Packages/igortest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/igortest b/Packages/igortest index 78ceff4305..1b0c98b6e4 160000 --- a/Packages/igortest +++ b/Packages/igortest @@ -1 +1 @@ -Subproject commit 78ceff430598ab5bf376474b9a7f3ada6722ab8f +Subproject commit 1b0c98b6e40dcd82fe57921e091036f1caa94992 From 51e3bd4564352e5b9aa3f56f00d9916769fa9a2e Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Mon, 21 Aug 2023 19:35:10 +0200 Subject: [PATCH 9/9] CONF_RestoreWindow: Add missing CR at end of output message --- Packages/MIES/MIES_Configuration.ipf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/MIES/MIES_Configuration.ipf b/Packages/MIES/MIES_Configuration.ipf index 0a40207c88..72f50f93e9 100644 --- a/Packages/MIES/MIES_Configuration.ipf +++ b/Packages/MIES/MIES_Configuration.ipf @@ -510,7 +510,7 @@ Function CONF_RestoreWindow(string fName, [string rigFile]) if(ClearRTError()) ASSERT(0, errMsg) else - printf "Configuration restore aborted at file %s.", fullFilePath + printf "Configuration restore aborted at file %s.\r", fullFilePath Abort endif endtry