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
 Binary checkbox inside a status object

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
MonT Posted - 08/15/2013 : 03:48:05 AM
Origin Ver. 7.0 and Service Release 0 (Select Help-->About Origin):
Operating System: Virtual XP under Win 7

I open two graphical objects with "LT_execute" and "draw -n objname -f read template".
I want the user to be able to input some parameters and then continue after the user clicks
the "start fit" checkbox.
Here is my code for these gobjects:



enum {MUA_INIT=1, MUSP_INIT, REFRACTIVE_INDEX, ISVARREFRACTIVEINDEX, DIFFUSIONMETHOD, STARTFIT};

int functionname(void){
  string LT_cmdStr;
  double isstartfit;

  LT_execute("draw -n DiffusionFit_Parameters -f read %y\OriginC\DiffusionFit\Difffitopt");
  LT_execute("draw -n DiffusionFit_Note -f read %y\OriginC\DiffusionFit\Difffitnote");
  LT_cmdStr.Format("DiffusionFit_Parameters.special.value%1d",STARTFIT);
    
  isstartfit = 0;
  while (0 == isstartfit){
    LT_get_var(LT_cmdStr, &isstartfit);
  }
    
  LT_execute("label -r DiffusionFit_Parameters");
  LT_execute("label -r DiffusionFit_Note");
}


The problem is the CPU usage while waiting for the user pressing the "start fit" checkbox.
I even cannot move the mouse cursor anymore. After pressing escape and stopping the program with the debugger
Origin is still working. Is there another way to get programatical response from a checkbox inside a status object
which does not block cpu?

Yours MonT
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 08/28/2013 : 04:47:22 AM
Hi MonT,

I'm not sure how your dialog created. And there is no the template file you used in the code. I just created a dialog by using LabTalk, which is called in Origin C code. Then, if the "Start Fit" checkbox is checked, and "OK" button is clicked, do something.

void functionname() {
	string LT_cmdDialog;
	LT_cmdDialog = "getn ";
	LT_cmdDialog += "(Start Value ua) MUA_INIT ";
	LT_cmdDialog += "(Start Value us') MUSP_INIT ";
	LT_cmdDialog += "(Refractive Index, if not automatically) REFRACTIVE_INDEX ";
	LT_cmdDialog += "(Variable Refractive Index) ISVARREFRACTIVEINDEX:2 ";
	LT_cmdDialog += "(Diffusion Method) DIFFUSIONMETHOD:2 ";
	LT_cmdDialog += "(Start Fit) STARTFIT:2 ";
	LT_cmdDialog += "(DiffusionFit_Parameters);";	
	LT_execute(LT_cmdDialog);
	
	string LT_cmdStr = "STARTFIT";
	double isstartfit = 0;

	LT_get_var(LT_cmdStr, &isstartfit);
	if(isstartfit == 1)
		printf("isstartfit");
}


Penn

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