Graph name and subwindow of trace w/ TraceInfo
jcor
String graphName= WinName(0,1)
string traceName= stringFromList(i, traceList)
String hAxis= StringByKey("XAXIS", TraceInfo("", traceName, 0))
String vAxis= StringByKey("YAXIS", TraceInfo("", traceName, 0))
GetMarquee /W=$graphName $hAxis, $vAxis // <-- error, graphName is wrong
string traceName= stringFromList(i, traceList)
String hAxis= StringByKey("XAXIS", TraceInfo("", traceName, 0))
String vAxis= StringByKey("YAXIS", TraceInfo("", traceName, 0))
GetMarquee /W=$graphName $hAxis, $vAxis // <-- error, graphName is wrong
To my knowledge there is no way to use TraceInfo to actually get the subwindow name.
ChildWindowList
gives me a list of subwindows, but if I am looking for axis Bottom, all subwindows will have it (in my situation).Anyone have a solution?
TraceInfo gives you no information about the trace's window, so I'm not sure why you bring that up.
September 16, 2016 at 06:20 am - Permalink
string traceName= stringFromList(i, traceList)
, the list of traces must have come from some graph, so the information about the window must have been available at some time. Can you propagate the window path to your code from the place where tracelist was filled out?John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
September 16, 2016 at 09:15 am - Permalink
From your replies I realized I didn't do the best job of posting an example. The function I posted is being called from the GraphMarquee menu, and prints information (average, wave indices, etc) according to the user's request. So I call the function by clicking on a graph.
While writing up a long and detailed reply, I discovered the error which had confused me:
String graphName= WinName(0,1)
gets the top graph's name, butTraceInfo("", traceName, 0)
isn't using the top graph name --- it was using TopGraph#subgraph without my realizing.With this I figured out the bug and have now spent enough time on the function that I hope someone else finds it useful: http://www.igorexchange.com/node/7315
j
September 22, 2016 at 04:50 am - Permalink