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
 Forum for Origin C
 GetN selection into a new sheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

michaelbraun

USA
21 Posts

Posted - 07/09/2015 :  5:17:21 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Origin 2015 sr2
Operating System:Windows

Hi, I am currently trying to fit a gaussian peak in a dataset. I have not found a way to directly limit the NLSF fitting to only a user selected range (ie through GetN), so instead I am trying to use GetN to select the appropriate data range, dump that into a new worksheet, replot the selected data and apply to NLSF routine.

I am able to use GetN to pop up a dialog and have me select the appropriate region, and I can make a new data sheet. However I cannot get the data to insert into the sheet. Help on directly limiting the NLSF fit, or how to get the output from GetN into a worksheet would be great!

Here is my header and GetN code

#include <Origin.h>
#include <..\OriginLab\theme_utils.h>
#include <GetNBox.h>
                        GETN_TREE(gettr)	
			GETN_INTERACTIVE(Range1, "Select Range", "Graph")	
			if( GetNBox(gettr) ) // returns true if click OK button
			{
			 
				DataRange dr;
				dr.Add("Range1", gettr.Range1.strVal);
			 
				vector vData;
				int index = 0; // range index
				dr.GetData(&vData, index); // The data in vData is the selected data points
			}
                        
                        //make a new worksheet for the data
                        Worksheet   newwks;
			newwks.Create();

Castiel

343 Posts

Posted - 07/09/2015 :  7:55:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by michaelbraun

Origin Ver. and Service Release (Select Help-->About Origin): Origin 2015 sr2
Operating System:Windows

Hi, I am currently trying to fit a gaussian peak in a dataset. I have not found a way to directly limit the NLSF fitting to only a user selected range (ie through GetN), so instead I am trying to use GetN to select the appropriate data range, dump that into a new worksheet, replot the selected data and apply to NLSF routine.

I am able to use GetN to pop up a dialog and have me select the appropriate region, and I can make a new data sheet. However I cannot get the data to insert into the sheet. Help on directly limiting the NLSF fit, or how to get the output from GetN into a worksheet would be great!

Here is my header and GetN code

#include <Origin.h>
#include <..\OriginLab\theme_utils.h>
#include <GetNBox.h>
                        GETN_TREE(gettr)	
			GETN_INTERACTIVE(Range1, "Select Range", "Graph")	
			if( GetNBox(gettr) ) // returns true if click OK button
			{
			 
				DataRange dr;
				dr.Add("Range1", gettr.Range1.strVal);
			 
				vector vData;
				int index = 0; // range index
				dr.GetData(&vData, index); // The data in vData is the selected data points
			}
                        
                        //make a new worksheet for the data
                        Worksheet   newwks;
			newwks.Create();




vector<double> vData = {1,2,3,4};
vectorbase& vb = newwks.Columns(0).GetDataObject();
vb = vData;

Now the first column in newwks is {1,2,3,4}.


妾+   午旦  妹罕妾  妾伊    用仇  妾/     岫ㄞ
 妾京用 仍巨  件 侈   件戶' 甘岫平   /欠  白岫妹
   併             艮          岫  奈 白   岫
                              岫
Go to Top of Page

michaelbraun

USA
21 Posts

Posted - 07/10/2015 :  5:23:30 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Your solution partially worked. I was able to add part of the selected data (the y data points), but I cannot figure out how to also get the x data points out of the GetN selection. As this is a slightly different issue, I opened a new topic here: http://www.originlab.com/forum/topic.asp?TOPIC_ID=21311
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