07-17-2009 04:28 PM
07-17-2009 09:18 PM
Mike,
Good point and that is the approach I took. However, there is a subVI in the panel resize event. The subVI is panelResize.vi. As one of its inputs, it takes a cluster of references to the original controls. Those control references are specific control references in the subVI. As previously mentioned, that subVI is locked because it used an unreleased node.
The bottom line is that panel resizing is not easy to accomplish. One workaround I tried was to customize a TDMS viewer with the example code using a vertical splitter bar. When I put the original controls of the TDMS Viewer on the right of a splitter pane, it does not resize correctly as the demonstration is to highlight viewing TDMS files, not exposing NI's secrets of resizing (and other engimatic codes 😉
This is an interesting thread as I did not see an easy way to have a user view graphs of data with upto three signals, one signal per graph. One solution is three separate subVI's inserted into a subpanel.
On a side note, the cluster of references input to the panelResize.VI is restrictive in that specific control classes are used in a locked subVI. NI has builtin ability to use less-specific control classes, such as WaveChart reference instead of a WaveformGraph or a WaveformChart or an XYChart.
07-19-2009 08:09 PM
Most of the resize code is based on documented nodes, so I unlocked the resize VI and created a subVI that contains the locked portion. That should give you all you need for customizing the resize behavior (see attachment).
As for embedding the viewer in a subpanel, one thing that comes to mind is using the panel resize event of the host VI in order to trigger the resize event in the viewer. For example, you could put hidden controls for height and width on the viewer's panel. You could set the values on these from the resize event of the host and duplicate the viewer panel resize event in order to react to these value changes. I haven't tried that, though, so there might be more pitfalls.
Hope that helps,
Herbert
01-18-2010 07:58 AM
Hi, Kenneth
I used tdmsfile viewer function but i didnt do print dialog for user.My code is likely to your code, by the way my data format is .tdms format can you help to print dialog? how can i do? i saw your tdms file viewer front panel you did i think.
I will your answer thank you for interesting.
01-19-2010 05:17 AM
Hi,Kenneth
can i see your code if it is possibble?