Page 1 of 1

Using DPlot_Request

Posted: Thu Jan 19, 2006 10:32 pm
by Pabjr
I would like to know if it is possible to use DPlot_Request to get information regarding plot settings such as:

axis bounds
text formats
etc.

Also is there a list of request topics other than those listed in the help file?

Thanks,

Paul

Posted: Fri Jan 20, 2006 12:01 am
by DPlotAdmin
I just updated the documentation for DPlot_Request with a few previously undocumented items. It is now complete.

axis bounds: Yes, see PlotMetrics
text formats: No, but this would be an easy addition. If there are any others you'd like please let me know and I'll try to have those ready in the next release.

Posted: Mon Jan 23, 2006 10:28 pm
by Pabjr
David,

Thanks for the extra info.

Paul

Posted: Tue Jan 24, 2006 4:03 pm
by Pabjr
I spent some time trying to integrate the request command into my program and had a few difficulties.

1.) The PlotMetrics command is returing "0,0,0,0,0,0,0,0"

I tired to access Dplot from both my code and excel dde and both returned the same value. Could I be using the wrong version of the Dplot? Does PlotMetrics work on/in Dplotjr?

2.) Is there a way to list all open document numbers? I noticed that if I open two document and then close the first one there is no way of telling if document one exists. This prevens me for verifying the state of open documents and interating through all open documents.

Thanks,

Paul

Posted: Tue Jan 24, 2006 4:36 pm
by DPlotAdmin
1.) The PlotMetrics command is returing "0,0,0,0,0,0,0,0"
Bah, my mistake. I apologize for misleading you. PlotMetrics and PlotMetricsEx were only intended to be used internally for retrieving that information for bitmaps generated with DPlot_GetBitmapEx. See, for example, the ctest2 and btest2 example programs, which use that information to translate mouse position to data space. If you don't generate a bitmap, those fields are never initialized (hence the 0,0,0...). Off the top of my head I can't think of a good reason for this limitation, and I'll fix this (or at least remove the limitation and see what can of worms this opens up) before the next release.

On the other hand, if you're NOT working with bitmaps then you need to be careful about the information that's returned by PlotMetrics if you're trying to get that information for the display. If the user resizes the document window then those values may be no good. It would probably be helpful to me if you'd describe exactly what you're up to.
2.) Is there a way to list all open document numbers? I noticed that if I open two document and then close the first one there is no way of telling if document one exists.
I'm not sure I follow this. If you're using DPlot_Plot to open new documents, then the document index is the return value for that call. If you're using some command that produces a new document like FFT or Histogram, then you can request LastNewDocNum immediately after that command to get its index. If you're trying to do something I haven't considered, please give more details.

Posted: Tue Jan 24, 2006 10:04 pm
by Pabjr
A little more about what I am trying to do. I am working on a real time application that could have to plot up to 1000 pts / s. To save processor time I have decided not to create a bitmap and use the dplot interface as the primary display. I also want the user to have much of the functionality provided in Dplot so I do not wish to completely disable all the menus.

So between capture events it is possible for the user to change the plot exents as well as open old graphs that they wish to append. I want to be able to check the exents of the current plot before capture and compare it to the current incoming data and adjust accordingly. I also want to be able to fill a drop down box with all selectable plots.

I hope this helps. Let me know if I should explain a little more.

Paul

Posted: Tue Jan 24, 2006 10:32 pm
by DPlotAdmin
Paul,
No, that's plenty of info, thanks. I'll get PlotMetrics working correctly before the next release.