V 10
1
LANG:1 0 
PANEL,333 135 692 639 N {102,153,204} 0
EEE E E 1 -1 -1 0  60 50
"" 0 1
EE 2
"CBRef""0"
"EClose"E
""
DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
LAYER, 0 
1
LANG:1 6 Layer1
27 823
"Curve01"
""
1 1306 -2099 E E E 1 E 1 E N {0,255,255} E N {0,0,0} E E
 E E
704 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,49,Courier New
0 ""
18 18 672 432
2 0 50 10 0 "%H:%M" 1 1
LANG:1 118 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,0,0,0,0,Courier New
0 ""
0 2 1 1 0 1 N {153,153,153}
0 0 50 10 0 "%H:%M" 1 1
LANG:1 118 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,0,0,0,0,Courier New
0 ""
0 2 1 1 0 1 N {153,153,153}
1 1 1 0 1
LANG:1 118 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,0,0,0,0,Courier New
0 ""
2 1 1 0 1 N {153,153,153}
0 1 1 0 1 N {153,153,153}
5 0 0 100 0 N {0,0,0} N {0,0,0} N {255,0,0} 1
1 0 1 1 0 1 N {255,255,0} 1 E
13 574
"Button2"
""
1 -20 0 E E E 1 E 1 E N "_Window" E N {51,102,153} E E
 E E
461 0 0 0 0 0
EE E
1
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,49,Courier New
0 ""
-22 -2 2 652
T 
1
LANG:1 0 
E E E E
13 931
"Go01"
""
1 210 430 E E E 1 E 1 E N "_3DText" E N {204,204,102} E E
 E E
809 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 105 -microsoft windows-Arial-bold-r-normal-*-*-140-100-100-*-*-iso8859-1|-16,0,0,0,700,0,0,0,0,3,2,1,34,Arial
0 ""
208 428 461 482
T 
1
LANG:1 22 Get last IV curve plot
"main()
{

dyn_float X_data_array,Y_data_array;
shape curve01;
int i;
float x_max,x_min,y_max,y_min;

int err, probl, alert, channel;
string time1, date, filename;
time tm1;
float T, V, I;
file g;


/* open temp file */
	g = fopen(\"D:/IVcurve/temp.txt\", \"r\"); // open for read

/*	get Time */
	sprintf(date, \"SCTmops1:Crate00.Channel%02d.IVCurve.StartTime:_online.._value\", channel);
	dpGet(date, tm1);

/* IV Values */ 
	i=1;
	fgets(filename, 50, g);
	while( fscanf(g, \"%f\\t%f\\t%d\\t%d\\n\", V, I, probl, alert) ) {
		X_data_array[i] = V;
		Y_data_array[i] = I;
		i++;
		}

/* temperature */
	fscanf(g, \"T0 = %f\", T);
	
/* close file */
	if (err!=0) DebugN(\"Error no. \",err,\" occurred\");
	fclose(g);



    //X_data_array = makeDynFloat(50,150,350);	

   //Y_data_array = makeDynFloat(500,900,2000);	
 

    DebugN(X_data_array,Y_data_array);
	
	//make_dy
 	//DebugN(\"=======================================2\");
 	curve01 = getShape(\"Curve01\");
	// Y-axis coordinates stuff
	
	y_max = dynMax(Y_data_array) + 100;
	y_min = dynMin(Y_data_array) + 50;
	
	DebugN(\"ymin,ymax\",y_min,y_max);
	setValue(curve01, \"yOrigin\", BAR_BOTTOM);
	setValue(curve01, \"yCenter\", 0);
	setValue(curve01, \"yRange\",  y_max);
	//setValue(curve01, \"yStep\",   y_step);
	setValue(curve01, \"yPrec\",   0);
	setValue(curve01, \"yGrid\",   FALSE);

	// X-axis coordiantes stuff
	x_max = dynMax(X_data_array)+50;
	if(x_max == 0) x_max = 10; //just to avoid some PVSS error message
	x_min = dynMin(X_data_array);
		DebugN(\"xmin,xmax\",x_min,x_max);

	setValue(curve01, \"xOrigin\", BAR_LEFT);
	//dpGet(systemName+\"IVCurve.Vstep.Send:_online.._value\", x_step);
	//x_step = 10;
	//setValue(curve01, \"xStep\",   x_step);
	setValue(curve01, \"xCenter\", x_min);
	setValue(curve01, \"xRange\",  x_max);
	setValue(curve01, \"xPrec\",   0);
	setValue(curve01, \"xGrid\",   FALSE);
	
	// set the value to the barTrend object
	setValue(curve01, \"data\", X_data_array, Y_data_array);
 
	// step curve
	setValue(curve01, \"connection\", BAR_LINEAR);
	//setValue(curve01, \"connection\", BAR_STEPS);
 	// Fill the area
	setValue(curve01, \"fill\", FALSE);
 	// Update bar trend
	curve01.flush();
}" 0
 E E E
0
LAYER, 1 
1
LANG:1 6 Layer2
0
LAYER, 2 
1
LANG:1 6 Layer3
0
LAYER, 3 
1
LANG:1 6 Layer4
0
LAYER, 4 
1
LANG:1 6 Layer5
0
LAYER, 5 
1
LANG:1 6 Layer6
0
LAYER, 6 
1
LANG:1 6 Layer7
0
LAYER, 7 
1
LANG:1 6 Layer8
0
0