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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Select data points from DataPlot

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
TreeNode Posted - 03/07/2011 : 08:07:38 AM
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!!
1   L A T E S T    R E P L I E S    (Newest First)
TreeNode Posted - 03/07/2011 : 08:16:07 AM
...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!!

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000