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
 Binary checkbox inside a status object
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

MonT

Germany
4 Posts

Posted - 08/15/2013 :  03:48:05 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Penn

China
644 Posts

Posted - 08/28/2013 :  04:47:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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