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
 Origin Forum
 How to make a button/link to a fitting routin
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

a.abc.b35

175 Posts

Posted - 01/13/2011 :  4:41:25 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi, I want to know how I could make a button for a fitting routin and attach it to a toolbar so that it is visible on the toolbar whenever i have a graph. In this way I dont have to repeatedly hit ctrl+y to see the fitting window. Also fitting window will always default to the gauss function for my data type whereas I have a custom made fitting routin for those data. So I have to everytime browse through the functions to get that particular fitting routin. So I want a button on the toolbar, on which, if I click, it'll direct me to the fitting window with that particular fitting function selected by default.So that i can straight way start fitting. I have a lot of files and this will save me some time.
:)

AB

a.abc.b35

175 Posts

Posted - 01/13/2011 :  5:53:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I have seen the custom routin button and the instructions to modify it in : http://www.originlab.com/www/support/resultstech.aspx?language=english&ID=655....
as posted in the forum :http://www.originlab.com/forum/topic.asp?TOPIC_ID=5742....
by Mike Buess,Origin WebRing Member.
................
But I am a novice who is not able to understand that solution at all.
Rather , I dont even know how I can modify it to customise my case:
I have a fitting function which I wrote in origin c and added to the fitting organizer in the user group of mine. I want to direct the cutom button to this so that whenever I click it, i am directed to the fitting page of this function only. Will save a lot of time for me.
Thanks in advance,



AB
Go to Top of Page

AmandaLu

439 Posts

Posted - 01/14/2011 :  12:57:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear AB,

You can do this by using a dialog theme rather than creating a button. That is:

1. Open the NLFit dialog. Choose your user-defined fitting function from the Function Selection page.

2. Click the triangle button next to the Dialog Theme (on the top of the dialog), and then select Save As from the context menu. Select the theme settings you want to save under the Theme Settings branch and type a name in the Theme Name combo box.

3. Click OK button to save the theme.

4. Click Cancel button to close the NLFit dialog.

Now select Analysis: Fitting: Nonlinear Curve Fit from the Origin main menu. You can see the theme you just save is listed under Nonlinear Curve Fit sub-menu.

5. Hold down the Shift key on the keyboard and select that theme name from the menu.

This will bring up the NLFit dialog with your user-defined function as the default chose of fitting Function.

If you just want to fit this user-defined function with the default parameter settings, you can select the theme name from the main menu WITHOUT holding down the Shift key. This will perform fitting without opening the NLFit dialog.
Go to Top of Page

a.abc.b35

175 Posts

Posted - 01/14/2011 :  1:01:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for the reply. But I know these and this is more time consuming particualry if you have 100s of files as you have to go through the menu s. I want a quicker solution where I can click a button to access the fitting function. Is there a way to do it in origin ?
....

AB
Go to Top of Page

AmandaLu

439 Posts

Posted - 01/18/2011 :  03:03:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear AB,

To create a button to open the NLFit dialog with your user-defined fitting function selected, you need to use LabTalk scripts to open the NLFit dialog with a user-defined theme (to select your function). However, NLFit dialog is not LabTalk accessible. It needs to call a user-defined OriginC function instead. That is,

1. Open the NLFit dialog. Choose your user-defined fitting function from the Function Selection page. Save this as a dialog theme.

2. Open the Code Builder. Create a new C File. Give it a name and save it to your User Files folder.



3. In this C file, use "do_AU_command" command to create an OC function, named open_nlfit_dialog for example. This function can open NLFit dialog with the theme you sepecified.



Compile it.

Now you can call this "open_nlfit_dialog" function in LabTalk script.

4. Create an .ogs file for the button. Create a LabTalk Script File. Give it a name and save it to your User Files folder.



5. In this LT file, write scripts to load the open_nlfit_dialog.c file and then call "open_nlfit_dialog" function.

[OpenNLFitDialog]
run.addoc(open_nlfit_dialog.c);
open_nlfit_dialog;

6. Select View: Toolbar to open Customize Toolbar dialog. Go to the Button Groups tab. Select User Defined from Groups box. Then choose a button bitmap from the Buttons box.

7. Click Settings button. In the Button Settings dialog that opens, specify the path of the open_nlfit_dialog.ogs file. Type the section name you want to run when clicking this button. In this case, we have only one section in this .ogs file. Specify the Tool Tip and Status Bar text if you like.



8. Click OK to close the dialog.

Now you can drag and drop this button to the Origin workspace.

Highlight same data, click the button. You can see that the NLFit dialog opened with your fitting function selected by default.
Go to Top of Page

a.abc.b35

175 Posts

Posted - 01/26/2011 :  2:48:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
One question, when i use the "do_AU_command", for my fitting function whose theme is named as 'mytheme', may I use "mytheme" instead of "FitNL" or "FitNL:mytheme" or something else ?

AB
Go to Top of Page

AmandaLu

439 Posts

Posted - 01/26/2011 :  9:31:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi a.abc.b35,

In your case, you should use do_AU_command("FitNL", true, "mytheme").
It means that running this function will open the FitNL dialog with the dialog theme named "mytheme".
Go to Top of Page

a.abc.b35

175 Posts

Posted - 05/03/2011 :  1:30:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you, I know I am late. but still. Thanks a lot.It works !

AB
Go to Top of Page

farecat

1 Posts

Posted - 05/03/2011 :  3:01:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks so much. That worked great.
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