Skip to content

Commit 6863b5b

Browse files
authored
Merge pull request #2171 from AllenInstitute/feature/2171-add-table-support-in-sweepformula
Add table operation in SweepFormula
2 parents b6cbb15 + 1c6f1c4 commit 6863b5b

15 files changed

+828
-81
lines changed

Packages/MIES/MIES_Constants.ipf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,21 @@ Constant WINTYPE_CAMERA = 15
16191619
Constant WINTYPE_GIZMO = 17
16201620
///@}
16211621

1622+
/// @name WindowTypes for the WinList function (bitwise)
1623+
/// @anchor WinListWindowTypes
1624+
///@{
1625+
Constant WINDOWTYPE_GRAPH = 1
1626+
Constant WINDOWTYPE_TABLE = 2
1627+
Constant WINDOWTYPE_LAYOUT = 4
1628+
Constant WINDOWTYPE_NOTEBOOK = 16
1629+
Constant WINDOWTYPE_PANEL = 64
1630+
Constant WINDOWTYPE_PROCEDURE = 128
1631+
Constant WINDOWTYPE_HELP = 512
1632+
Constant WINDOWTYPE_XOP = 4096
1633+
Constant WINDOWTYPE_CAMERA = 16384
1634+
Constant WINDOWTYPE_GIZMO = 65536
1635+
///@}
1636+
16221637
/// @name Panel tag codes to identify panel types, set in creation macro as main window userdata($EXPCONFIG_UDATA_PANELTYPE)
16231638
/// @anchor panelTags
16241639
///@{
@@ -2125,6 +2140,7 @@ StrConstant SF_META_TRACE_MODE = "/TraceMode" // number, one of @
21252140
StrConstant SF_META_TRACETOFRONT = "/TraceToFront" // number, boolean, defaults to false (0)
21262141
StrConstant SF_META_DONOTPLOT = "/DoNotPlot" // number, boolean, defaults to false (0)
21272142
StrConstant SF_META_WINDOW_HOOK = "/WindowHook" // string
2143+
StrConstant SF_META_FORMULA = "/Formula" // string
21282144

21292145
/// A color group allows to have matching colors for sweep data with the same channel type/number and sweep.
21302146
/// It is applied before the matching headstage/average colors in #SF_GetTraceColor().
@@ -2519,12 +2535,15 @@ StrConstant SF_OP_SELECTIVSCCSWEEPQC = "selivsccsweepqc"
25192535
StrConstant SF_OP_SELECTIVSCCSETQC = "selivsccsetqc"
25202536
StrConstant SF_OP_SELECTRANGE = "selrange"
25212537
StrConstant SF_OP_POWERSPECTRUM = "powerspectrum"
2538+
StrConstant SF_OP_TABLE = "table"
25222539
StrConstant SF_OP_TPSS = "tpss"
25232540
StrConstant SF_OP_TPINST = "tpinst"
25242541
StrConstant SF_OP_TPBASE = "tpbase"
25252542
StrConstant SF_OP_TPFIT = "tpfit"
25262543
///@}
25272544

2545+
StrConstant SF_PROPERTY_TABLE = "Table"
2546+
25282547
/// @name SF operations shorts
25292548
///
25302549
/// @anchor SFOperationsShorts

Packages/MIES/MIES_GlobalStringAndVariableAccess.ipf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,3 +818,9 @@ Function/S GetDeviceADCConfig(string device)
818818

819819
return GetNVARAsString(GetDevicePath(device), "ADCConfig", initialValue = NaN)
820820
End
821+
822+
/// @brief Returns the last right clicked sweep formula display (plot/table) window
823+
Function/S GetSweepFormulaLastRightClickedDisplayWindow()
824+
825+
return GetSVARAsString(GetSweepFormulaPath(), "LastRightClickedDisplayWindow", initialValue = "")
826+
End

Packages/MIES/MIES_GuiUtilities.ipf

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,33 +1864,45 @@ End
18641864
/// @brief Recursively build a list of windows, including all child
18651865
/// windows, starting with wName.
18661866
///
1867-
/// @param wName parent window name to start with
1867+
/// @param wName parent window name to start with, if wName is empty then all graphs, tables, layouts, notebooks and panels
1868+
/// with subwindows (possible for graphs and panels) are returned
18681869
/// @return A string containing names of windows. This list is a semicolon separated list. It will include the window
1869-
/// wName and all of its children and children of children, etc.
1870+
/// wName, if wName was not empty, and all of its children and children of children, etc.
18701871
Function/S GetAllWindows(string wName)
18711872

18721873
string windowList = ""
1873-
GetAllWindowsImpl(wName, windowList)
1874+
[windowList] = GetAllWindowsImpl(wName)
18741875

18751876
return windowList
18761877
End
18771878

1878-
static Function GetAllWindowsImpl(string wName, string &windowList)
1879+
static Function [string windowList] GetAllWindowsImpl(string wName)
18791880

1880-
string children
1881-
variable i, numChildren, err
1881+
string children, topLevelWindows, win
1882+
variable windowsWithUserdata
18821883

1883-
windowList = AddListItem(wName, windowList, ";", Inf)
1884+
if(IsEmpty(wName))
1885+
windowsWithUserdata = WINDOWTYPE_GRAPH | WINDOWTYPE_TABLE | WINDOWTYPE_LAYOUT | WINDOWTYPE_NOTEBOOK | WINDOWTYPE_PANEL | WINDOWTYPE_GIZMO
1886+
topLevelWindows = WinList("*", ";", "WIN:" + num2istr(windowsWithUserdata))
1887+
WAVE/T wList = ListToTextWave(topLevelWindows, ";")
1888+
for(win : wList)
1889+
[windowList] = GetAllWindowsImpl(win)
1890+
endfor
1891+
else
1892+
windowList = AddListItem(wName, windowList, ";", Inf)
18841893

1885-
if(!WindowTypeCanHaveChildren(wName))
1886-
return NaN
1894+
if(!WindowTypeCanHaveChildren(wName))
1895+
return [windowList]
1896+
endif
1897+
1898+
children = ChildWindowList(wName)
1899+
WAVE/T wList = ListToTextWave(children, ";")
1900+
for(win : wList)
1901+
[windowList] = GetAllWindowsImpl(wName + "#" + win)
1902+
endfor
18871903
endif
18881904

1889-
children = ChildWindowList(wName)
1890-
numChildren = ItemsInList(children, ";")
1891-
for(i = 0; i < numChildren; i += 1)
1892-
GetAllWindowsImpl(wName + "#" + StringFromList(i, children, ";"), windowList)
1893-
endfor
1905+
return [windowList]
18941906
End
18951907

18961908
Function IsSubwindow(string win)

0 commit comments

Comments
 (0)