130,6 → 130,62 |
return(ret); |
} |
|
|
int CVICALLBACK SetGraphLogYCB (int panel, int control, int event, |
void *callbackData, int eventData1, int eventData2) |
{ |
|
int cid=0; |
int logy=0; |
switch (event) |
{ |
case EVENT_COMMIT: |
GetCtrlVal(panel,control, &logy); |
switch (control){ |
case PANEL_LOGY_1: cid = PANEL_TDC1; break; |
case PANEL_LOGY_2: cid = PANEL_ADC1; break; |
case PANEL_LOGY_3: cid = PANEL_TDC2; break; |
case PANEL_LOGY_4: cid = PANEL_ADC2; break; |
} |
if (logy) SetCtrlAttribute (panel, cid, ATTR_YMAP_MODE, VAL_LOG); |
else SetCtrlAttribute (panel, cid, ATTR_YMAP_MODE, VAL_LINEAR); |
break; |
} |
return 0; |
} |
|
int CVICALLBACK SetGraphPropertiesCB (int panel, int control, int event, |
void *callbackData, int eventData1, int eventData2) |
{ |
|
float min, max; |
int autoscale; |
switch (event) |
{ |
case EVENT_COMMIT: |
GetCtrlVal(panelHandle,PANEL_MINX_5, &min); |
GetCtrlVal(panelHandle,PANEL_MAXX_5, &max); |
GetCtrlVal(panelHandle,PANEL_AUTOY, &autoscale); |
if (autoscale) |
SetAxisScalingMode (panelHandle, PANEL_GRAPH, VAL_LEFT_YAXIS, VAL_AUTOSCALE, min, max); |
else |
SetAxisScalingMode (panelHandle, PANEL_GRAPH, VAL_LEFT_YAXIS, VAL_MANUAL, min, max); |
|
GetCtrlVal(panelHandle,PANEL_MINX_6, &min); |
GetCtrlVal(panelHandle,PANEL_MAXX_6, &max); |
GetCtrlVal(panelHandle,PANEL_AUTOX, &autoscale); |
if (autoscale) |
SetAxisScalingMode (panelHandle, PANEL_GRAPH, VAL_BOTTOM_XAXIS, VAL_AUTOSCALE, min, max); |
else |
SetAxisScalingMode (panelHandle, PANEL_GRAPH, VAL_BOTTOM_XAXIS, VAL_MANUAL, min, max); |
|
|
break; |
} |
return 0; |
} |
|
|
int histoinit() { |
int nch; |
float min,max; |
175,10 → 231,13 |
SetCtrlAttribute (panelHandle, PANEL_TDC1, ATTR_YNAME, H1D_GetTitleY(3) ); |
SetCtrlAttribute (panelHandle, PANEL_TDC2, ATTR_XNAME, H1D_GetTitleX(4) ); |
SetCtrlAttribute (panelHandle, PANEL_TDC2, ATTR_YNAME, H1D_GetTitleY(4) ); |
SetGraphLogYCB( panelHandle, PANEL_LOGY_1, EVENT_COMMIT,NULL,0,0); |
SetGraphLogYCB( panelHandle, PANEL_LOGY_2, EVENT_COMMIT,NULL,0,0); |
SetGraphLogYCB( panelHandle, PANEL_LOGY_3, EVENT_COMMIT,NULL,0,0); |
SetGraphLogYCB( panelHandle, PANEL_LOGY_4, EVENT_COMMIT,NULL,0,0); |
|
GetCtrlVal(panelHandle,PANEL_MINX_5, &min); |
GetCtrlVal(panelHandle,PANEL_MAXX_5, &max); |
SetAxisScalingMode (panelHandle, PANEL_GRAPH, VAL_LEFT_YAXIS, VAL_MANUAL, min, max); |
SetGraphPropertiesCB( panelHandle, PANEL, EVENT_COMMIT,NULL,0,0); |
|
SetCtrlAttribute (panelHandle, PANEL_GRAPH, ATTR_LABEL_TEXT , "sampling adc data"); |
SetCtrlAttribute (panelHandle, PANEL_GRAPH, ATTR_XNAME, "t(us)" ); |
SetCtrlAttribute (panelHandle, PANEL_GRAPH, ATTR_YNAME, "U(V)" ); |
229,9 → 288,8 |
const int col[4]= {VAL_RED,VAL_GREEN,VAL_BLUE,VAL_WHITE}; |
if (plothandle[id]) DeleteGraphPlot (panelHandle, PANEL_GRAPH, plothandle[id], VAL_IMMEDIATE_DRAW); |
|
plothandle[id] = PlotXY (panelHandle, PANEL_GRAPH, timebins, fdata, nsamples, VAL_FLOAT, VAL_FLOAT, VAL_THIN_LINE, VAL_NO_POINT, VAL_SOLID, 1, col[id]); |
plothandle[id] = PlotXY (panelHandle, PANEL_GRAPH, timebins, fdata, nsamples, VAL_FLOAT, VAL_FLOAT, VAL_FAT_LINE, VAL_NO_POINT, VAL_SOLID, 1, col[id]); |
|
//plothandle[id] = PlotXY (panelHandle, PANEL_GRAPH, timebins, data, nsamples, VAL_FLOAT, VAL_INTEGER, VAL_THIN_LINE, VAL_NO_POINT, VAL_SOLID, 1, col[id]); |
H1D_Draw(1,panelHandle,PANEL_ADC1,&adcplothandle[0]); |
H1D_Draw(2,panelHandle,PANEL_ADC2,&adcplothandle[1]); |
H1D_Draw(3,panelHandle,PANEL_TDC1,&tdcplothandle[0]); |
523,3 → 581,5 |
} |
return 0; |
} |
|
|