Skip to content

Draft: Small tool that allows to browse through wave reference waves from the DataBrowser #2406

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Packages/MIES/MIES_Menu.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ Menu "Mies Panels"
"Reset and store DA_EPHYS", /Q, DAP_EphysPanelStartUpSettings()
"Reset and store DataBrowser", /Q, DB_ResetAndStoreCurrentDBPanel()
"Reset and store Wavebuilder", /Q, WBP_StartupSettings()
"Reset and store WaverefBrowser", /Q, WRB_RecreateWrefBrowser()
"Check GUI control procedures of top panel", /Q, SearchForInvalidControlProcs(GetCurrentWindow())
"Open debug panel", /Q, DP_OpenDebugPanel()
"Enable Enhanced Databrowser", /Q, WRB_AddDataBrowserButton()
"Start Background Task watcher panel", /Q, MEN_OpenBackgroundWatcherPanel()
End
End
Expand Down
18 changes: 18 additions & 0 deletions Packages/MIES/MIES_Utilities_GUI.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -749,3 +749,21 @@ Function RemoveAllDrawLayers(string win)
SetDrawLayer/W=$win/K UserAxes
endif
End

Function/S GetUnusedWindowName(string baseName)

variable i
string wName

if(!WindowExists(baseName))
return baseName
endif

for(;;)
wName = baseName + num2istr(i)
if(!WindowExists(wName))
return wName
endif
i += 1
endfor
End
134 changes: 134 additions & 0 deletions Packages/MIES/MIES_WaveDataFolderGetters.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -8934,3 +8934,137 @@ threadsafe Function/WAVE GetTPAnalysisDataWave()

return tpData
End

/// @name Waveref Browser
///@{

/// @brief Returns string path to Waveref Browser home data folder
///
/// UTF_NOINSTRUMENTATION
Function/S GetWaverefBrowserHomeStr()

return "root:Packages:WaverefBrowser"
End

/// @brief Returns reference to Waveref Browser home data folder
///
/// UTF_NOINSTRUMENTATION
Function/DF GetWaverefBRowserHomeDF()

return createDFWithAllParents(GetWaverefBrowserHomeStr())
End

Function/WAVE GetWaverefBRowserListWave()

variable version = 1
string name = "listWave"

DFREF dfr = GetWaverefBRowserHomeDF()

WAVE/Z/T/SDFR=dfr wv = $name

if(ExistsWithCorrectLayoutVersion(wv, version))
return wv
endif

if(WaveExists(wv))
// upgrade here
else
Make/T/N=(0) dfr:$name/WAVE=wv
endif

return wv
End

Function/WAVE GetWaverefBRowserSelectionWave()

variable version = 1
string name = "selectionWave"

DFREF dfr = GetWaverefBRowserHomeDF()

WAVE/Z/SDFR=dfr wv = $name

if(ExistsWithCorrectLayoutVersion(wv, version))
return wv
endif

if(WaveExists(wv))
// upgrade here
else
Make/N=(0, 1, 3) dfr:$name/WAVE=wv
endif

SetDimLabel LAYERS, 1, $LISTBOX_LAYER_FOREGROUND, wv
SetDimLabel LAYERS, 2, $LISTBOX_LAYER_BACKGROUND, wv

return wv
End

Function/WAVE GetWaverefBRowserColorWave()

variable version = 1
string name = "colorWave"

DFREF dfr = GetWaverefBRowserHomeDF()

WAVE/Z/U/W/SDFR=dfr wv = $name

if(ExistsWithCorrectLayoutVersion(wv, version))
return wv
endif

if(WaveExists(wv))
// upgrade here
else
Make/W/U/N=(5, 3) dfr:$name/WAVE=wv
endif

SetDimLabel COLS, 0, R, wv
SetDimLabel COLS, 1, G, wv
SetDimLabel COLS, 2, B, wv

wv[1][%R] = 255
wv[1][%G] = 255
wv[1][%B] = 229

wv[2][%R] = 229
wv[2][%G] = 255
wv[2][%B] = 229

wv[3][%R] = 255
wv[3][%G] = 229
wv[3][%B] = 229

wv[4][%R] = 229
wv[4][%G] = 255
wv[4][%B] = 255

wv = wv << 8

return wv
End

Function/WAVE GetWaverefBRowserReferenceWave()

variable version = 1
string name = "referenceWave"

DFREF dfr = GetWaverefBRowserHomeDF()

WAVE/Z/WAVE/SDFR=dfr wv = $name

if(ExistsWithCorrectLayoutVersion(wv, version))
return wv
endif

if(WaveExists(wv))
// upgrade here
else
Make/WAVE/N=(0) dfr:$name/WAVE=wv
endif

return wv
End

///@}
Loading