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
 NLFit Dialog Preview Line
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

zvicars

USA
4 Posts

Posted - 11/10/2015 :  5:35:48 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

jasonzhao

China
262 Posts

Posted - 11/11/2015 :  04:35:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - jasonzhao on 11/11/2015 04:38:29 AM
Go to Top of Page

zvicars

USA
4 Posts

Posted - 11/11/2015 :  4:28:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The email has been sent. Thank you for your assistance.

zvicars

Edited by - zvicars on 11/11/2015 4:28:45 PM
Go to Top of Page

kfauth

Germany
33 Posts

Posted - 12/02/2015 :  03:25:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi there, any progress made?
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 12/07/2015 :  04:37:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 12/08/2015 :  9:27:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

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

Best regards!
Jason
OriginLab Technical Service
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