The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Select data points from DataPlot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

TreeNode

64 Posts

Posted - 03/07/2011 :  08:07:38 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: Origin 8 SR6
Operating System: Win XP

Hi,

I want to select data points from a DataPlot. The selected points should be stored in a special data structure.
Before selecting the points it comes up a Dialog. Depending on intention of the user it should be possible to
select a range with the DataSelector (Tool 4) or a single point with DataReader (Tool 3).

Unfortunately there is no direct way to access DataSelector tool from OriginC. So I tried to use Labtalk script, and
called it by function: LT_execute(strScript). To test if it could work this way, I used script example for DoToolbox
command: http://wiki.originlab.com/~originla/ltwiki/index.php?title=LabTalk:DoToolbox_%28command%29

The code from which script is called:
void MyDialog::ClickedOk(TreeNode& tr)
{
	string strScript;
	bool bRet;
	strScript = "  	dotool 4;  	def pointproc {  		py = %C[mks1];  		%A = xof(%C);  		px = %A[mks1];  		type -a Left marker is at index $(mks1), X is $(px),Y is $(py);  		py = %C[mks2];  		%A = xof(%C);  		px = %A[mks2];  		type -a Right marker is at index $(mks2), X is $(px),Y is $(py);  		dotool 0;  	};";
	bRet = LT_execute(strScript);

	if(bRet)
		out_str("Script executed...");
}

One problem I could figure out, is that execution of the OriginC code is not holded during script execution.
But I need the execution of the OriginC code to be stopped, until user accepted data point by pressing return, so that
pointproc-script is executed. Because after that I want to store these points in my data structure. So after pointproc macro
I need to get the selected points into OriginC variables.

Anyone got an idea? I would be very thankful for help...


|-- TreeNode
...|-- a??
...|-- ha!!

TreeNode

64 Posts

Posted - 03/07/2011 :  08:16:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
...sry, didnt recognize the behaviour of the '\' in my code example, so now defining
the strScript variable looks a bit strange :)

why cant I edit my topic? There comes up the message: "Only the poster and moderator can edit topic!"
But I am the poster...

|-- TreeNode
...|-- a??
...|-- ha!!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000