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
 Forum for Origin C
 Reset range with 2 GetN_XYRange in box

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
michaelbraun Posted - 07/20/2015 : 3:12:55 PM
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);
}

5   L A T E S T    R E P L I E S    (Newest First)
michaelbraun Posted - 07/21/2015 : 11:15:12 AM
Indeed, thank you both for your help!
Castiel Posted - 07/21/2015 : 11:00:19 AM
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....

©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦
michaelbraun Posted - 07/21/2015 : 10:36:12 AM
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).
Castiel Posted - 07/21/2015 : 09:39:37 AM
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)


©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦
SeanMao Posted - 07/21/2015 : 02:03:42 AM
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

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