diff --git a/Packages/MIES/MIES_BrowserSettingsPanel.ipf b/Packages/MIES/MIES_BrowserSettingsPanel.ipf index d2f4ae4d1d..5224d61584 100644 --- a/Packages/MIES/MIES_BrowserSettingsPanel.ipf +++ b/Packages/MIES/MIES_BrowserSettingsPanel.ipf @@ -1979,7 +1979,7 @@ Function/S BSP_RenameAndSetTitle(string win, string newName) suffix = " with \"" + BSP_GetDevice(win) + "\"" endif - if(WindowExists(newName)) + if(WindowExists(newName) && cmpstr(win, newName)) newName = UniqueName(newName, 9, 1) endif diff --git a/Packages/MIES/MIES_Constants.ipf b/Packages/MIES/MIES_Constants.ipf index a22e71cc1c..323fb053f6 100644 --- a/Packages/MIES/MIES_Constants.ipf +++ b/Packages/MIES/MIES_Constants.ipf @@ -19,7 +19,7 @@ Constant DAQ_CONFIG_WAVE_VERSION = 2 /// Used to upgrade the GuiStateWave as well as the DA Ephys panel Constant DA_EPHYS_PANEL_VERSION = 64 -Constant DATA_SWEEP_BROWSER_PANEL_VERSION = 47 +Constant DATA_SWEEP_BROWSER_PANEL_VERSION = 48 Constant WAVEBUILDER_PANEL_VERSION = 14 Constant ANALYSISBROWSER_PANEL_VERSION = 3 diff --git a/Packages/MIES/MIES_DataBrowser.ipf b/Packages/MIES/MIES_DataBrowser.ipf index 1d55fd89dd..33268e2688 100644 --- a/Packages/MIES/MIES_DataBrowser.ipf +++ b/Packages/MIES/MIES_DataBrowser.ipf @@ -225,7 +225,7 @@ Function DB_ResetAndStoreCurrentDBPanel() // settings history CheckBox check_limit_x_selected_sweeps, WIN = $shPanel, value=0 - SF_SetFormula(device, "data(\rcursors(A,B),\rselect(channels(AD),sweeps())\r)") + SF_SetFormula(device, SF_GetDefaultFormula()) helpNBWin = BSP_GetSFHELP(device) SetWindow $helpNBWin, userdata($EXPCONFIG_UDATA_EXCLUDE_RESTORE)="1" diff --git a/Packages/MIES/MIES_DataBrowser_Macro.ipf b/Packages/MIES/MIES_DataBrowser_Macro.ipf index 4245176470..c39b901712 100644 --- a/Packages/MIES/MIES_DataBrowser_Macro.ipf +++ b/Packages/MIES/MIES_DataBrowser_Macro.ipf @@ -11,14 +11,13 @@ Window DataBrowser() : Graph PauseUpdate; Silent 1 // building window... - Display /W=(739.5,170,1279.5,715.25)/K=1 as "DataBrowser" + Display /W=(739.5,170,1279.5,715.25)/K=1 as "Browser" Button button_BSP_open,pos={3.00,3.00},size={24.00,24.00},disable=1,proc=BSP_ButtonProc_Panel Button button_BSP_open,title="<<",help={"Restore side panels"} Button button_BSP_open,userdata(ResizeControlsInfo)=A"!!,>M!!#8L!!#=#!!#=#z!!#](Aon\"Qzzzzzzzzzzzzzz!!#](Aon\"Qzz" Button button_BSP_open,userdata(ResizeControlsInfo)+=A"zzzzzzzzzzzz!!#u:Du]kn!!#?!!!#<(z!!#`-A7TLfzzzzzzzzzzzzzz!!#r+D.OhkBk2=!z" @@ -961,10 +961,10 @@ Window DataBrowser() : Graph SetVariable setvar_sweepFormula_parseResult,userdata(ResizeControlsInfo)=A"!!,CD!!#C.J,hsZJ,hlsz!!#](Aon#azzzzzzzzzzzzzz!!#o2B4uAeBk2=!z" SetVariable setvar_sweepFormula_parseResult,userdata(ResizeControlsInfo)+=A"zzzzzzzzzzzz!!#?(FEDG8lc2\"sb*'?t0`LOsu56M&O#8%0(kYUuD?'Lb'WM2S$2n35;Co_bnHG;[8413O#OCe=>%L&rkt2`4Wb4*2%$_9qC;7eC9(Z%8BPJ\\er8p1`7uY(`<2AMfKJPE4[$a\")KaohdHS(QjNH:A67LFqg7Sd\"hufK:5,7\"-A)I1\"q[QTj:$>G59,B/5EIFXp7j2@c9ue;Z)GpiP!GP_2)u6l%!CfqsS!`W871g&;q6\\)Ym=LZr8u4cp#1tHWM8uU\\C@K0$L(0Cn8\\6_kkZ@L-ZLElJCF2qHBVAV" Notebook kwTopWin, zdataEnd= 1 SetWindow kwTopWin,hook(ResizeControls)=ResizeControls#ResizeControlsHook SetWindow kwTopWin,userdata(tabnum)="0" diff --git a/Packages/MIES/MIES_SweepFormula.ipf b/Packages/MIES/MIES_SweepFormula.ipf index 11f68f7511..073aba7e7f 100644 --- a/Packages/MIES/MIES_SweepFormula.ipf +++ b/Packages/MIES/MIES_SweepFormula.ipf @@ -5327,3 +5327,12 @@ static Function/WAVE SF_ResolveDataset(WAVE input) return out End + +Function/S SF_GetDefaultFormula() + + return "trange = cursors(A,B)\r" + \ + "sel = select(channels(AD),sweeps())\r" + \ + "dat = data($trange, $sel)\r" + \ + "\r" + \ + "$dat" +End diff --git a/Packages/tests/Basic/UTF_SweepFormula.ipf b/Packages/tests/Basic/UTF_SweepFormula.ipf index 74650501da..fa6b2f538b 100644 --- a/Packages/tests/Basic/UTF_SweepFormula.ipf +++ b/Packages/tests/Basic/UTF_SweepFormula.ipf @@ -3642,3 +3642,14 @@ static Function TestVariables2() code = MIES_SF#SF_ExecuteVariableAssignments(win, str) CHECK_EQUAL_STR("", code) End + +Function TestDefaultFormula() + + string win, bsPanel + + win = GetDataBrowserWithData() + bsPanel = BSP_GetPanel(win) + + PGC_SetAndActivateControl(bsPanel, "check_BrowserSettings_SF", val = CHECKBOX_SELECTED) + PGC_SetAndActivateControl(bsPanel, "button_sweepFormula_display") +End