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
 LabTalk Forum
 dotool, pointproc, getpts..
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Luba

USA
Posts

Posted - 02/22/2005 :  1:59:57 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Mike Buess

USA
3037 Posts

Posted - 02/22/2005 :  3:37:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This article might help...

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

Mike Buess
Origin WebRing Member
Go to Top of Page

Luba

USA
Posts

Posted - 02/28/2005 :  1:19:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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!
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