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
 NLFit Dialog Preview Line

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
zvicars Posted - 11/10/2015 : 5:35:48 PM
Hello,

I am attempting to write a script that will batch through all of the layers in a plot window and fit a user selected data range with a user-defined fitting function. I've gotten that to work, for the most part. However, for some reason, the preview line that allows the user to see their fit progress in real time only displays on the first layer of the plot window, regardless of the layer being fitted on. The data markers seem to be selecting the right data set, and the fit line preview appears to be fitting the right data set as well, but it isn't being shown on the same layer as the active one.

Since this particular operation typically involves 50+ data sets, the plot window is set to display only the active page layer.

This is not something that occurs when using the NLFit dialog from the menu, so I'm leaning towards it being the fault of my script.

Here is the relevant portion of the script:

//clear all data markers in plot
doc -e LW{mks1=-1;}
plot -c;
//define integer to be iterated in doc -e loop
int nn = 1;
//define datasets to store fit parameters
dataset alpha, gamma, tauHN, deps, temps;
doc -e LW
{
		plot -c;
		//prompt the user to see if the layer in question can be fitted
		type -y "Do you want to fit this plot?";
		if(t == 1)
		{
			range -w aa=%C;
			// wks range for the sheet the column belongs to
			range ss = uid2range(aa.GetLayer())$;
			// show sheet name
			dname$ = ss.name$;
			dname2$ = dname.Between("_","K")$;
			//extract temperature from the sheet name
			temp = %(dname2$);
			
			// Start range selector
			dotool 4;
			// Define macro that runs when user is done
			def pointproc 
			{
				done = 1;
				dotool 0;
			}
			// Wait in a loop for user to finish by pressing ...
			// (1) Enter key or (2) double-clicking
			for( done = 0 ; done == 0 ; )
			{
				sec -p .1;
			}
				//start fitting session with parameter initialization
				nlbegin func:=HN_EpsImaginary nltree:=ParamTree;
				ParamTree.tauHN = .0005;
				ParamTree.alpha = 1;
				ParamTree.gamma = 1; 
				ParamTree.sigma_0 = 0;
				ParamTree.f_sigma_0=1;
				//allow the user to run the fit to completion
				nlpara 1;
				nlend;
				//store fit parameters as the next element in each dataset
				temps[$(nn)] = temp;
				alpha[$(nn)] = ParamTree.alpha;
				gamma[$(nn)] = ParamTree.gamma;
				deps[$(nn)] = ParamTree.deps;
				tauHN[$(nn)] = ParamTree.tauHN;
				//delete marker for this fit
				mks1=-1;
				//iterate the indexing variable
				nn = nn+1;
		}
}


Thanks,
zvicars


Origin Pro 2015 Sr. 2
Windows 7
5   L A T E S T    R E P L I E S    (Newest First)
jasonzhao Posted - 12/08/2015 : 9:27:34 PM
Hello,

This problem will be fixed in the upcoming Origin 2016 SR1, which will be available this month.

Best regards!
Jason
OriginLab Technical Service
jasonzhao Posted - 12/07/2015 : 04:37:57 AM
Hello,

The preview curve fail to show for other layers in this case,
I have added it to our bug tracking database ID: ORG-14011 for further improvement.



Best regards!
Jason
OriginLab Technical Service
kfauth Posted - 12/02/2015 : 03:25:05 AM
Hi there, any progress made?
zvicars Posted - 11/11/2015 : 4:28:25 PM
The email has been sent. Thank you for your assistance.

zvicars
jasonzhao Posted - 11/11/2015 : 04:35:56 AM
Hello,

Would you please send the OPJ file and the fdf file to us (tech@originlab.com) to make a further check?


Best regards!
Jason
OriginLab Technical Service

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