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
 programming with origin 8?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ovelha.negra

1 Posts

Posted - 07/31/2009 :  04:51:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:

Hi,

I have a small program to index automatically some lines in several graphs and I have associated that same program to a button. It was written using origin 7 and i want to make it work in origin 8. Could someone please tell me if there is any changes refering to the code that I must take into consideration? I have checked everything several times and I have no idea of what's wrong.


#include <Origin.h>

#include <Graph.h>

void Plot_Data(string strTemplate, string strData)

{
GraphPage grph;
BOOL bOK = grph.Create(strTemplate, CREATE_VISIBLE);// this create a graph window from a Template
if (!bOK)
return;

GraphLayer grlay = grph.Layers(0); // attaching the first layer (0) to a new GraphLayer object
Curve cv(strData);
//adding the Curve object to the GraphLayer1 object
int nPlot = grlay.AddPlot(cv);
if(nPlot>=0)

{
// setting plot color to blue (3)
grlay.DataPlots(nPlot).SetColor(3, TRUE);
grlay.Rescale(); // rescaling the plot
}

//--------------

string LTcmd;
// assign string variable LabTalk statements
LTcmd = "label -xb (Energy (eV));"
"label -yb (Luminescence intensity (arb.units));"
"draw -c 1 -l {3.33329,1000,3.33329,20000};"
"draw -d 2 -n myText -l {3.363443,1000,3.363443,20000};"
"draw -d 2 -l {3.3605,1000,3.3605,20000};"
"draw -d 2 -l {3.357269,1000,3.357269,20000};"
"draw -d 2 -l {3.3484,1000,3.3484,20000};"
"draw -d 2 -l {3.36141112,1000,3.36141112,20000};"
"draw -d 2 -l {3.3772,1000,3.3772,20000};"
"draw -d 2 -l {3.3759,1000,3.3759,20000};"
"draw -d 2 -l {3.3156,1000,3.3156,20000};"
"draw -d 2 -l {3.3069,1000,3.3069,20000};"
"label -a 3.33329 21000 DBX;"
"label -a 3.363443 21000 I4;"
"label -a 3.3605 21000 I8;"
"label -a 3.357269 21000 I9;"
"label -a 3.3484 21000 I11;"
"label -a 3.36141112 21000 I6;"
"label -a 3.3772 21000 AL*;"
"label -a 3.3756 21000 AT*;"
"label -a 3.3140 21000 TES1;"
"label -a 3.3050 21000 TES2;";
LT_execute(LTcmd);
//--------------

}

void plott(string strTemplate)
{
string data = "DefaultDd";
string wsname;

for( int i = 1; i < 26; i++ )
{
wsname = data + i + "_b";
Worksheet wks(wsname);
string LTcmd;
LTcmd = "DefaultDd" + i + "_signal1"
"= (6.62606896E-34*0.62415E28*299792458)/DefaultDd" + i + "_signal1";
LT_execute(LTcmd);
Plot_Data( strTemplate, wsname)
}

}

Iris_Bai

China
Posts

Posted - 07/31/2009 :  05:18:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Could you give more details about not work in Origin8?

Iris
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