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
 Reset range with 2 GetN_XYRange in box
 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/20/2015 :  3:12:55 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2015 sr2
Operating System:Windows

Hi, I currently have a GetN box with 2 GETN_XYRANGE commands, as the user needs to select two separate, specific peaks on the graph. Currently, when selecting the range for the second GETN_XYRANGE instance, the range from the first GETN_XYRANGE is included. I would like the equivalent of the "Reset" or "Reselect all data from graph" options from the side arrows in the dialog to be automatically used.

I have included a screenshot of part of my GETN box to show what I mean. Notice that the top range is repeated in the lower range, followed by the real second peak [1321:1354].



My code currently works, as long as the user doesn't hit reselect all or reset, as my code specifically grabs range 2 of the 2nd GETN_XYRANGE instance. Another possible solution is a way to simply grab the last range selected from GETN_XYRANGE, although this is slightly less desirable than resetting the ranges. This method would essentially grab the highest number, where if three selections are made, Range3 would be selected, or if the user resets the box, and then makes only a single selection, Range1 would be selected.


Here is the relevant portion of code:
#include <Origin.h>
#include <..\OriginLab\theme_utils.h>
#include <GetNBox.h>
#include <..\originlab\nlsf_utils.h>
#include <..\originlab\NLFitSession.h>

void test()
{
GETN_TREE(gettr)
GETN_XYRANGE(Substrate,"Select Substrate Peak",1,"0")
GETN_XYRANGE(Film, "Select Film Peak", 1, "0")
GetNBox(gettr);
vector yData, xData, subyData,subxData;
XYRange subdr;
xy_range_from_GetN_data_node(gettr.Substrate.Range1, subdr);
subdr.GetData(subyData,subxData);
XYRange dr;
xy_range_from_GetN_data_node(gettr.Film.Range2, dr);
dr.GetData(yData, xData);
}

SeanMao

China
288 Posts

Posted - 07/21/2015 :  02:03:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

We have confirmed that this is a bug that you mentioned that second hunt button will hunt extra data subrange.

I have created a JIRA ORG-13351 in our problem tracking base for it.

Regards!

Sean

OriginLab Tech. Service
Go to Top of Page

Castiel

343 Posts

Posted - 07/21/2015 :  09:39:37 AM  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): 2015 sr2
Operating System:Windows

Hi, I currently have a GetN box with 2 GETN_XYRANGE commands, as the user needs to select two separate, specific peaks on the graph. Currently, when selecting the range for the second GETN_XYRANGE instance, the range from the first GETN_XYRANGE is included. I would like the equivalent of the "Reset" or "Reselect all data from graph" options from the side arrows in the dialog to be automatically used.

I have included a screenshot of part of my GETN box to show what I mean. Notice that the top range is repeated in the lower range, followed by the real second peak [1321:1354].



My code currently works, as long as the user doesn't hit reselect all or reset, as my code specifically grabs range 2 of the 2nd GETN_XYRANGE instance. Another possible solution is a way to simply grab the last range selected from GETN_XYRANGE, although this is slightly less desirable than resetting the ranges. This method would essentially grab the highest number, where if three selections are made, Range3 would be selected, or if the user resets the box, and then makes only a single selection, Range1 would be selected.


Here is the relevant portion of code:
#include <Origin.h>
#include <..\OriginLab\theme_utils.h>
#include <GetNBox.h>
#include <..\originlab\nlsf_utils.h>
#include <..\originlab\NLFitSession.h>

void test()
{
GETN_TREE(gettr)
GETN_XYRANGE(Substrate,"Select Substrate Peak",1,"0")
GETN_XYRANGE(Film, "Select Film Peak", 1, "0")
GetNBox(gettr);
vector yData, xData, subyData,subxData;
XYRange subdr;
xy_range_from_GetN_data_node(gettr.Substrate.Range1, subdr);
subdr.GetData(subyData,subxData);
XYRange dr;
xy_range_from_GetN_data_node(gettr.Film.Range2, dr);
dr.GetData(yData, xData);
}





You can disable multiple XYRanges by ICOPT_RESTRICT_TO_ONE_DATA. For example:
GETN_XYRANGE(...)
GETN_OPTION_INTERACTIVE_CONTROL(ICOPT_RESTRICT_TO_ONE_DATA)


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

michaelbraun

USA
21 Posts

Posted - 07/21/2015 :  10:36:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Castiel
You can disable multiple XYRanges by ICOPT_RESTRICT_TO_ONE_DATA. For example:
GETN_XYRANGE(...)
GETN_OPTION_INTERACTIVE_CONTROL(ICOPT_RESTRICT_TO_ONE_DATA)




This technically works, but is not immediately obvious for the user as you have to click and drag the original bounds from the first GETN_XYRANGE to the second peak. Ideally when selecting from the second GETN_XYRANGE the graph selection would be identical to the first one (ie no red lines already on graph, and having the dragable box selector).
Go to Top of Page

Castiel

343 Posts

Posted - 07/21/2015 :  11:00:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by michaelbraun

quote:
Originally posted by Castiel
You can disable multiple XYRanges by ICOPT_RESTRICT_TO_ONE_DATA. For example:
GETN_XYRANGE(...)
GETN_OPTION_INTERACTIVE_CONTROL(ICOPT_RESTRICT_TO_ONE_DATA)




This technically works, but is not immediately obvious for the user as you have to click and drag the original bounds from the first GETN_XYRANGE to the second peak. Ideally when selecting from the second GETN_XYRANGE the graph selection would be identical to the first one (ie no red lines already on graph, and having the dragable box selector).


Well, it's been a bug confirmed....

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

michaelbraun

USA
21 Posts

Posted - 07/21/2015 :  11:15:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Indeed, thank you both for your help!
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