File MIES_TraceUserData.ipf¶
This file holds helper functions to work with our own trace user data handling.
It works by storing the trace user data in one wave per graph. It is cleaned up when the graph is killed. For subwindows the window hook responsible for cleaning up is attached to the top-most parent as only that is receiving window hook events.
Functions
-
variable TUD_RemoveUserDataWave(WMWinHookStruct *s)¶
Window hook for clearing the user data of the attached graph.
-
variable TUD_Clear(string graph, variable recursive = defaultValue)¶
Clear the user data wave and release the indexing JSON document.
Works recursively on all child windows and calls TUD_ClearImpl on each graph.
-
static variable TUD_ClearImpl(string graph)¶
-
string TUD_GetUserData(string graph, string trace, string key)¶
Return the user data given by the
graphandtracenamedkey
-
wave TUD_GetAllUserData(string graph, string trace)¶
Return all the user data from
traceofgraph
-
wave TUD_GetUserDataAsWave(string graph, string key, WaveText keys = defaultValue, WaveText values = defaultValue, variable returnIndizes = defaultValue)¶
Return the user data for
keyof all traces in graph in a 1D text wave.- Parameters:
graph – existing graph
key – key value to gather data for
keys – [optional] Either both
keysandvaluesare present or none of them. These allow to further restrict the returned result to traces having all of the additional key/value pairsvalues – [optional] See
keyreturnIndizes – [optional, default to false] Return the indizes of the matches instead of the values
-
variable TUD_SetUserData(string graph, string trace, string key, string value)¶
Set the given user data for the trace of the graph.
-
variable TUD_SetUserDataFromWaves(string graph, string trace, WaveText keys, WaveText values)¶
Set the given user data for the trace of the graph.
The
keys/valuesmust span a consecutive range.
-
static variable TUD_GraphIsManaged(string graph)¶
-
variable TUD_GetTraceCount(string graph)¶
Return the number of traces in the user data.
-
variable TUD_RemoveUserData(string graph, string trace)¶
Remove all user data from the given trace.
-
variable TUD_TraceIsOnGraph(string graph, string trace)¶
Check if the given trace is displayed on the graph.
-
variable TUD_Init(string graph)¶
Initialize the graph for our user trace data handling.
This is done implicitly after the user data wave is created. Once that is cleared with TUD_Clear() and the window is gone, this function can be used to reattach the cleanup hook to the newly created graph.