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
 LabTalk Forum
 dotool, pointproc, getpts..

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
Luba Posted - 02/22/2005 : 1:59:57 PM
Origin Version (Select Help-->About Origin): 7.5
Operating System:XP

I am really new at writing scripts and I have hard time understanding the correct use of dotool (or getpts, for that matter). I have read the previous topics on these subjects, as well as the article in the knowledge base and it still doesn't click.

I would like to plot a number of curves (spectra) one at a time, have user manually select a maximum, then record the x position of maximum in a worksheet along with the curve number (let's say, curve number in column a, maximum position in column b), and go on to the next curve.

I can't get the part of the code that gets and records a maximum to work properly:

dotool 2;
def PointProc{userpick=x; dotool 0; break; };

peak_a[1]=n;
peak_b[1]=userpick;

I am testing this part and every time it fills not the current but the previous value into "peak" worksheet.
The getpts instead of dotool does the same thing..

If anybody has any suggestion or explanation, that would be great!
Thanks.
2   L A T E S T    R E P L I E S    (Newest First)
Luba Posted - 02/28/2005 : 1:19:39 PM
Thank you very much for your help.

I tried incorporating Endtoolbox macro into my script but it still doesn't work properly. Maybe, I just didn't do it right, so here is my script:

create spectrum -w 70;
wks.col1.name$="wavel";

for(ii=1; ii<71; ii++) {spectrum_wavel[ii]=a2dtranspose!cell(1,ii+1)};


create peak -w 2674;
wks.col1.name$="t";
wks.col2.name$="wv";

window -t plot line;

np=1;
for(MR=2605; MR>2505; MR-=10) {

for(ii=1; ii<71; ii++) {spectrum_b[ii]=a2dtranspose!cell(MR,ii+1)};
window -a graph1;
layer -i spectrum_b;
layer -a;

dotool 2;
def PointProc{userpick=x; dotool 0; };
def Quittoolbox {
peak_t[np]=a2dtranspose!cell(MR,1);
peak_wv[np]=userpick;
};
np=np+1;
};


The first part of the script works fine:

it creates worksheet "Spectrum" for holding current spectum;

fills the "wavel" column with wavelength values taken from the matrix "a2dtranspose" that holds the data;

creates worksheet "peak" that should contain the peak parameters (t - time, from first column of the matrix, and wv - wavelnght of the peak determined by user);

creates graph for current spectum.

After this, I would like to fill the second column of "spectrum" with data from MR's row of matrix "a2dtranspose" , plot the current spectum, have user click on the graph to pick the maximum, write parameters to "peak", and then go on to the nest spectrum (next MR).

NOw, if I manually enter values of MR and np (one by one) - it works. But when I try to go thru them in a loop - it doesn't, and I am not sure where did I go wrong.

I am sorry for such a long post but hopefully somebody can take a look at my script and tell me where I am making a mistake.

Thank you!
Mike Buess Posted - 02/22/2005 : 3:37:39 PM
This article might help...

http://www.originlab.com/index.aspx?s=9&pid=541

Mike Buess
Origin WebRing Member

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