DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DDE Links

 
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions
View previous topic :: View next topic  
Author Message
raydela



Joined: 10 Sep 2003
Posts: 46
Location: Oxford, MI, USA

PostPosted: Wed Sep 17, 2003 3:16 pm    Post subject: DDE Links Reply with quote

Mr. Hyde,

1.) Would it be too difficult to implement an "Insert Link..." edit list so that one could review/edit existing links? ( This question also relates back to part of a replay you gave in the "Bug Reports/Swap X,Y anomalies(?)" thread, which also mentions only 1 DDE link is currently possible.)

Example of one way I envision links being parsed/viewed in an Edit dialog:

Excel, Data, R6C2:R14C3 [CRLF]
Excel, Data, R6C5:R14C6 [CRLF]
Excel, Data, R6C8:R14C9

2.) When one currently does an "Insert Link...", where is the link? That is, is there any way to view/edit existing the (single) link in DPlot? I took a peek at the .set file in Notepad and it didn't seem to save this data.

3.) I was able to confirm that a graph from DPlot is able to be pasted/linked into Excel (XP) and to have data changes in Excel get dynamically reflected back from DPlot. Here is the method I used:
a.) In DPlot: "Copy Picture" from DPlot.
b.) In Excel: Select "Edit | Paste Special..." and on the "Paste Special" pop-up dialog, select "Paste Link" with Picture (Enhanced Meta File) highlighted (highlighting bitmap still seems to link a meta file -- compare appearance of result to a non-link pasted bitmap).
c.) Here are the results of playing around with the DDE link

i.) DPlot: I started with the most basic Polar plot (a point, really a zero length vector from 0,0 to 0,0 just to keep the grids visible). Also on this I added a Legend. I confirmed that moving the Legend in DPlot caused the corresponding change in Excel plot. Thus, I confirmed that the (Picture) Link was active.

ii.) DPlot: I did an "Insert (data) Link..." and got the error, "Could not get any data from Excel|Data|R6C2:R14C3" (a known good range in my data).

iii.) Excel: I selected the polar chart and went to "Edit | Links..." and highlighted the link to DPlot file, then pressed "Open Source". Ignore the error "Cannot start the source application for this object". The link between DPlot and Excel will be active again, as confirmed by the "Drag-The-Legend-Around" test. (Btw, I've tried "Update Values" and "Check Status", but they don't get the link active again.)

iv.) DPlot: Repeat ii.) -- now the "Insert Link..." is accepted and the polar chart is "flashing" (periodic polling of Excel data?). After the first change to a data cell, DPlot and Excel plots change OK and flashing stops in DPlot. Subsequent data changes are OK in curve 1.

v.) DPlot: I tried to enter a 2nd link -- It seems that entering something into the "Insert Link..." dialog kills the DDE (Excel data changes and DPlot Legend re-positioning both unresponsive in Excel plot) Need to perform step iii.) above to get things active again. (Does DPlot have provision for user to re-start DDE link as in Excel? I looked around and didn't notice anything.)

vi.) Entered 2nd curve data and got it to plot. However, going to Excel and changing data for curve 2 causes curve 2 data to disappear from DPlot altogether! (Link seems to revert back to curve 1 because now changes to Excel curve 1 data are reflected back OK.)

By the way, regarding the Swap X,Y -- row/column data for dynamic polar plots embedded in Excel currently need to be in same order that DPlot expects ("x=angle,y=mag" backward pairs), because, like you said elsewhere, Swap X,Y is not persistent at this time.

Ray
Back to top
View user's profile Send private message Send e-mail MSN Messenger
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Wed Sep 17, 2003 5:15 pm    Post subject: Reply with quote

Quote:
1.) Would it be too difficult to implement an "Insert Link..." edit list so that one could review/edit existing links?


"Review", sure. "Edit" wouldn't really be an edit in the way you're thinking of it. You could get rid of one link and set up another.

I gave multiple links in the same document some more thought, and this is going to require a bit of work (meaning it won't happen this week). Right now, when DPlot receives notification that the linked data has changed, it wipes out all data and retrieves it all over again. To make this work correctly with multiple links I need to be able to tie specific curves to links. The bookkeeping gets to be a bit of a mess when you start considering what the user can do in DPlot (erase a curve, for example).

Quote:
2.) When one currently does an "Insert Link...", where is the link? That is, is there any way to view/edit existing the (single) link in DPlot? I took a peek at the .set file in Notepad and it didn't seem to save this data.


That information isn't available to the user (now). It will be, given that your #1 gets plugged in.

Quote:
3.) I was able to confirm that a graph from DPlot is able to be pasted/linked into Excel (XP) and to have data changes in Excel get dynamically reflected back from DPlot. Here is the method I used:

<snipped>


I played around with this till the wee hours last night on XP after discovering the same thing. But there are quite a few problems. The flashing you ran across happens when the data is linked to DPlot and DPlot's picture is linked to Excel. For some reason that I haven't quite figured out yet, DPlot gets an update message (data has changed), which causes the plot to be redrawn, which causes Excel to get an update message about the picture, which causes DPlot to get another update message about the data (which shouldn't happen but definitely does)... repeat this loop forever, until you break the chain by manually editing the data in Excel. Bleah. I got a workaround for this problem working, but at present it is unstable. Sometimes Paste Link works, other times you get the nice blank box.

If you're going to be doing a lot of this sort of thing, I'd suggest taking a look at XLProPlot from spreadsheetworld. They have done some very nifty things with the interface between Excel and DPlot. While I'll continue to work on Excel<>DPlot issues, I don't want to get too far bogged down in this when my DPlot to-do list is still growing.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raydela



Joined: 10 Sep 2003
Posts: 46
Location: Oxford, MI, USA

PostPosted: Fri Sep 19, 2003 8:42 am    Post subject: Reply with quote

Sorry, didn't mean to overload you.

The ability to paste the picture meta file into Excel was really all I needed for the recent report I had to do.

Having the capability for an imbedded plot which will dynamically update is more of a wish-list thing rather than a pressing need. Then one could develop an Excel spreadsheet as a template for a certain type of report which others could easily use by simply plugging in the cell data.

Btw, in Excel when I did the "Edit | Links..." and highlighted the link to DPlot file, then pressed "Open Source", why did Excel have a problem opening (or detecting an already open) the DPlot application? (A dead DDE link did become live, however, by doing this.)
What do I need to do to allow a DPlot link in Excel to open DPlot automatically if necessary? (i.e. do I need to add a path to the DPlot application somewhere or is this a bug in the DPlot registration process during install?)

I just downloaded your latest beta version with the "Insert Link.." changes and will play with it today. (And thanks for the Polar plot changes!)


Ray
Back to top
View user's profile Send private message Send e-mail MSN Messenger
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Fri Sep 19, 2003 11:42 am    Post subject: Reply with quote

Quote:
Sorry, didn't mean to overload you.


Don't ever worry about that. I've appreciated all of your comments.

Quote:
Having the capability for an imbedded plot which will dynamically update is more of a wish-list thing rather than a pressing need. Then one could develop an Excel spreadsheet as a template for a certain type of report which others could easily use by simply plugging in the cell data.


At present there are still problems associated with having a two-way link. If you don't use InsertLink, OR if you remove previous links, then you should be able to link a picture into Excel with no problem. Where I run into problems is with two-way links on the same sheet - confusion results and right now I'm not sure which end the confusion is at. I'm fairly certain there's a way to automatically run a macro when a range of cells is changed, though I can't find it at the moment. If you can do this, then there's no good reason to use InsertLink and everything will operate quite a bit more smoothly.

This is one of the nice things about spreadsheetworld's XLProPlot package. I've seen a couple of demos in which a DPlot-produced picture is placed in your spreadsheet and is updated as needed, in the same way that an Excel graph is. And it doesn't use InsertLink.

Quote:
Btw, in Excel when I did the "Edit | Links..." and highlighted the link to DPlot file, then pressed "Open Source", why did Excel have a problem opening (or detecting an already open) the DPlot application?


I wish I knew. That has always bothered me a bit, and I'm not real sure exactly what Excel is attempting to do when you click "Open Source". Thanks for the reminder; I'll try to look into this a bit more.

Quote:
I just downloaded your latest beta version with the "Insert Link.." changes and will play with it today. (And thanks for the Polar plot changes!)


And thanks again for the suggestions Very Happy. Keep 'em coming.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raydela



Joined: 10 Sep 2003
Posts: 46
Location: Oxford, MI, USA

PostPosted: Fri Sep 19, 2003 2:41 pm    Post subject: Reply with quote

Quote:
...Where I run into problems is with two-way links on the same sheet...


Now that you mention it, this is when I noticed when DPlot started having flashing behavior. Initially, I had my polar plots on separate sheets (for my work report). Then, when I had a chance to experiement with the DDE, I moved a polar chart to the same sheet as the data for convenience. Does this mean a current restriction is to separate plots from the data sheet then all will work ok?

Or, is it possible to provide (2) commands, given example names,
LinkRefreshEvent(AUTO/MANUAL), UpdateDPlotLinks( ).
Where LinkRefreshEvent(AUTO) would cause DPlot to do what it does currently regarding DDE refresh, and LinkRefreshEvent(MANUAL) would cause DPlot to wait for an explicit call to UpdateDPlotLinks()
I guess I have in mind creating a macro in Excel (run by a button in a cell, maybe labeled, "Update Charts"), which basically just does [UpdateDPlotLinks()].

Quote:
This is one of the nice things about spreadsheetworld's XLProPlot package. I've seen a couple of demos in which a DPlot-produced picture is placed in your spreadsheet and is updated as needed, in the same way that an Excel graph is. And it doesn't use InsertLink.


I take it that their program takes care of the DDE overhead and uses your DPlot commands in some way.


Quote:
...I'm not real sure exactly what Excel is attempting to do when you click "Open Source".


Have you tried using a utility which monitors/logs accesses to the Windows Registry? For instance, here's one:
http://www.sysinternals.com/ntw2k/source/regmon.shtml


Ray
Back to top
View user's profile Send private message Send e-mail MSN Messenger
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Fri Sep 19, 2003 8:51 pm    Post subject: Reply with quote

Quote:
Now that you mention it, this is when I noticed when DPlot started having flashing behavior. Initially, I had my polar plots on separate sheets (for my work report). Then, when I had a chance to experiement with the DDE, I moved a polar chart to the same sheet as the data for convenience. Does this mean a current restriction is to separate plots from the data sheet then all will work ok?


No, you should be OK doing this. What I've noticed in the example.xls file with the PlotColumns example is that the very act of selecting columns of numbers causes Excel to send an update message if I've previously linked those same columns... or perhaps it's the act of clicking the plot button, I'm not sure. This doesn't cause any serious problems unless I select a different scale type for the 2nd plot - say log-log when the first was linear-linear. At that point I'm fairly sure DPlot is getting confused about which plot it's working with, and a log(0) causes it to crash.

What I've done today is add a [RemoveLink("app","topic","item")] command and I now call it in the PlotColumns example to unlink the data (if such a link exists). And now all works well. But in the event you want to establish automatic links to pictures of the same data with different scale types... you're out of luck.

Quote:
Or, is it possible to provide (2) commands, given example names,
LinkRefreshEvent(AUTO/MANUAL), UpdateDPlotLinks( ).
Where LinkRefreshEvent(AUTO) would cause DPlot to do what it does currently regarding DDE refresh, and LinkRefreshEvent(MANUAL) would cause DPlot to wait for an explicit call to UpdateDPlotLinks()
I guess I have in mind creating a macro in Excel (run by a button in a cell, maybe labeled, "Update Charts"), which basically just does [UpdateDPlotLinks()].


I could easily modify the [InsertLink()] command to accept an additional parameter indicating whether DPlot should accept automatic change notifications (yes=your LinkRefreshEvent(AUTO), no=your LinkRefreshEvent(MANUAL). This would likely go a long way towards solving current problems.

Spreadsheetworld:
Quote:
I take it that their program takes care of the DDE overhead and uses your DPlot commands in some way.


Indirectly. They're calling functions in DPLOTLIB.DLL, which in turn uses DDE to communicate with DPlot. They've also added a lot of magic to give DPlot the appearance of being an "object", as in DPlot.Title1="My Plot".

Quote:
Have you tried using a utility which monitors/logs accesses to the Windows Registry? For instance, here's one:
http://www.sysinternals.com/ntw2k/source/regmon.shtml


Wow! Nice tool, thanks for the link. This ended in bad news, though. Excel is looking for HKCR\DPlot (OK so far) then HKCR\DPlot\CLSID and HKCR\DPlot\StdFileEditing. Those are both OLE entries; DPlot doesn't do OLE. If it instead looked for HKCR\DPlot\shell\open\command or HKCU\Software\DPlot\shell\open\command, well... then it would have the correct answer Very Happy .
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raydela



Joined: 10 Sep 2003
Posts: 46
Location: Oxford, MI, USA

PostPosted: Mon Sep 22, 2003 2:50 pm    Post subject: Reply with quote

Only now have I got a chance to try out the "Insert Link..." dialog on 1.8.3.1 beta. Much better than previous one.

However, I noticed that when there is an active link, the options below "Edit | Insert Link..." are now greyed out. When you have the chance, implenting the ones that make sense for linked (and refreshed) data would be convenient. Especially Swap X,Y in my case for exchaning Magnitude,Angle column order from my Excel data for a Polar plot.

Also, I noticed that when no curve data links are present, moving the DPlot Legend around will still move the Legend in the linked metafile in Excel.
(Excel Cell Entry=DPLOT|PlotFileName.grf!Picture)

Finally, it might be useful to mention in your online help that if "Insert Link..." is giving an error on a known good entry, then this indicates (at least in Excel) that you have to go to "Edit | Links..." and press "Open Source" in order to get the DDE communication going again -- but then again, is this sometimes a problem because I inserted a linked plot into my spreadsheet and caused some sore of DDE Paradox?

Ray
Back to top
View user's profile Send private message Send e-mail MSN Messenger
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Mon Sep 22, 2003 3:38 pm    Post subject: Reply with quote

Quote:
However, I noticed that when there is an active link, the options below "Edit | Insert Link..." are now greyed out. When you have the chance, implenting the ones that make sense for linked (and refreshed) data would be convenient. Especially Swap X,Y in my case for exchaning Magnitude,Angle column order from my Excel data for a Polar plot.


I botched this up, but not in the way you mean. All of the Edit menu commands are intentionally disabled and SHOULD be (but aren't always) re-enabled when all data links to a document are removed. To get around this goof you can press Ctrl+N to open a new document, then close that new window. This will cause the menu to be updated properly.

But while the links are active, those commands must be disabled else things get too confusing. Say you do a Swap X,Y in DPlot but then inadvertently cause Excel to send an update message, which causes the original data to be restored. That's really the only correct behavior, but will lead to a lot of confusion about who's running the show.

Once I get the additional options plugged into the Insert Link dialog (pick which column is X, specify whether the columns are X,Y,X,Y or X,Y,Y,Y, etc.) then... I think you'll like this much better.

Quote:
Also, I noticed that when no curve data links are present, moving the DPlot Legend around will still move the Legend in the linked metafile in Excel.
(Excel Cell Entry=DPLOT|PlotFileName.grf!Picture)


If I understand you correctly (link from Excel is removed, but the picture link from DPlot in Excel still exists) that's the correct behavior.

Quote:
Finally, it might be useful to mention in your online help that if "Insert Link..." is giving an error on a known good entry, then this indicates (at least in Excel) that you have to go to "Edit | Links..." and press "Open Source" in order to get the DDE communication going again -- but then again, is this sometimes a problem because I inserted a linked plot into my spreadsheet and caused some sore of DDE Paradox?


I haven't tried moving linked pictures between sheets (or multiple copies of the same linked picture); will have to take a look at that.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group