Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 251 → Rev 252

/cvi/RedPitaya/soccli/redpitaya_gui.h
1,91 → 1,101
/**************************************************************************/
/* LabWindows/CVI User Interface Resource (UIR) Include File */
/* */
/* WARNING: Do not add to, delete from, or otherwise modify the contents */
/* of this include file. */
/**************************************************************************/
 
#include <userint.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Panels and Controls: */
 
#define PANEL 1
#define PANEL_EXPORT_4 2 /* control type: command, callback function: ExportCB */
#define PANEL_EXPORT_2 3 /* control type: command, callback function: ExportCB */
#define PANEL_EXPORT_1 4 /* control type: command, callback function: ExportCB */
#define PANEL_EXPORT_3 5 /* control type: command, callback function: ExportCB */
#define PANEL_HRESET 6 /* control type: command, callback function: ResetCB */
#define PANEL_EXIT 7 /* control type: command, callback function: ExitCB */
#define PANEL_IP 8 /* control type: string, callback function: (none) */
#define PANEL_FILENAME 9 /* control type: string, callback function: (none) */
#define PANEL_TIMER 10 /* control type: timer, callback function: (none) */
#define PANEL_TWIN1 11 /* control type: numeric, callback function: (none) */
#define PANEL_TWIN0 12 /* control type: numeric, callback function: (none) */
#define PANEL_ITRGLEVEL 13 /* control type: numeric, callback function: (none) */
#define PANEL_TRGLEVEL 14 /* control type: numeric, callback function: (none) */
#define PANEL_EXPORTNAME 15 /* control type: string, callback function: (none) */
#define PANEL_FILETYPE 16 /* control type: ring, callback function: (none) */
#define PANEL_PFREQ 17 /* control type: numeric, callback function: (none) */
#define PANEL_NBEFORE 18 /* control type: numeric, callback function: (none) */
#define PANEL_SAMPLES 19 /* control type: numeric, callback function: (none) */
#define PANEL_NTOTAL 20 /* control type: numeric, callback function: (none) */
#define PANEL_NEVE 21 /* control type: numeric, callback function: (none) */
#define PANEL_CEVE 22 /* control type: numeric, callback function: (none) */
#define PANEL_ADC2 23 /* control type: graph, callback function: (none) */
#define PANEL_TDC2 24 /* control type: graph, callback function: (none) */
#define PANEL_ADC1 25 /* control type: graph, callback function: (none) */
#define PANEL_TDC1 26 /* control type: graph, callback function: (none) */
#define PANEL_DECIMATION 27 /* control type: ring, callback function: (none) */
#define PANEL_TRIGGER 28 /* control type: ring, callback function: (none) */
#define PANEL_OUTWAVE 29 /* control type: radioButton, callback function: (none) */
#define PANEL_ENABLEDOUTPUT 30 /* control type: radioButton, callback function: (none) */
#define PANEL_DEBUG 31 /* control type: radioButton, callback function: (none) */
#define PANEL_CH1 32 /* control type: radioButton, callback function: (none) */
#define PANEL_GRAPH 33 /* control type: graph, callback function: (none) */
#define PANEL_CH0 34 /* control type: radioButton, callback function: (none) */
#define PANEL_TEXTMSG 35 /* control type: textMsg, callback function: (none) */
#define PANEL_STDIO 36 /* control type: textBox, callback function: (none) */
#define PANEL_MAXX_3 37 /* control type: numeric, callback function: (none) */
#define PANEL_MINX_3 38 /* control type: numeric, callback function: (none) */
#define PANEL_NCH_3 39 /* control type: numeric, callback function: (none) */
#define PANEL_MAXX_4 40 /* control type: numeric, callback function: (none) */
#define PANEL_MINX_4 41 /* control type: numeric, callback function: (none) */
#define PANEL_NCH_4 42 /* control type: numeric, callback function: (none) */
#define PANEL_MAXX_2 43 /* control type: numeric, callback function: (none) */
#define PANEL_MINX_2 44 /* control type: numeric, callback function: (none) */
#define PANEL_NCH_2 45 /* control type: numeric, callback function: (none) */
#define PANEL_MAXX_5 46 /* control type: numeric, callback function: (none) */
#define PANEL_MINX_5 47 /* control type: numeric, callback function: (none) */
#define PANEL_MAXX_1 48 /* control type: numeric, callback function: (none) */
#define PANEL_MINX_1 49 /* control type: numeric, callback function: (none) */
#define PANEL_NCH_1 50 /* control type: numeric, callback function: (none) */
#define PANEL_CONNECT 51 /* control type: textButton, callback function: StartCB */
#define PANEL_START 52 /* control type: textButton, callback function: StartCB */
#define PANEL_ADCTYPE 53 /* control type: binary, callback function: (none) */
 
 
/* Control Arrays: */
 
/* (no control arrays in the resource file) */
 
 
/* Menu Bars, Menus, and Menu Items: */
 
/* (no menu bars in the resource file) */
 
 
/* Callback Prototypes: */
 
int CVICALLBACK ExitCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK ExportCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK ResetCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK StartCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 
 
#ifdef __cplusplus
}
#endif
/**************************************************************************/
/* LabWindows/CVI User Interface Resource (UIR) Include File */
/* */
/* WARNING: Do not add to, delete from, or otherwise modify the contents */
/* of this include file. */
/**************************************************************************/
 
#include <userint.h>
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Panels and Controls: */
 
#define PANEL 1
#define PANEL_EXPORT_4 2 /* control type: command, callback function: ExportCB */
#define PANEL_EXPORT_2 3 /* control type: command, callback function: ExportCB */
#define PANEL_EXPORT_1 4 /* control type: command, callback function: ExportCB */
#define PANEL_EXPORT_3 5 /* control type: command, callback function: ExportCB */
#define PANEL_HRESET 6 /* control type: command, callback function: ResetCB */
#define PANEL_EXIT 7 /* control type: command, callback function: ExitCB */
#define PANEL_IP 8 /* control type: string, callback function: (none) */
#define PANEL_FILENAME 9 /* control type: string, callback function: (none) */
#define PANEL_TIMER 10 /* control type: timer, callback function: (none) */
#define PANEL_TWIN1 11 /* control type: numeric, callback function: (none) */
#define PANEL_TWIN0 12 /* control type: numeric, callback function: (none) */
#define PANEL_ITRGLEVEL 13 /* control type: numeric, callback function: (none) */
#define PANEL_TRGLEVEL 14 /* control type: numeric, callback function: (none) */
#define PANEL_EXPORTNAME 15 /* control type: string, callback function: (none) */
#define PANEL_FILETYPE 16 /* control type: ring, callback function: (none) */
#define PANEL_PFREQ 17 /* control type: numeric, callback function: (none) */
#define PANEL_NBEFORE 18 /* control type: numeric, callback function: (none) */
#define PANEL_SAMPLES 19 /* control type: numeric, callback function: (none) */
#define PANEL_NTOTAL 20 /* control type: numeric, callback function: (none) */
#define PANEL_NEVE 21 /* control type: numeric, callback function: (none) */
#define PANEL_CEVE 22 /* control type: numeric, callback function: (none) */
#define PANEL_ADC2 23 /* control type: graph, callback function: (none) */
#define PANEL_TDC2 24 /* control type: graph, callback function: (none) */
#define PANEL_ADC1 25 /* control type: graph, callback function: (none) */
#define PANEL_TDC1 26 /* control type: graph, callback function: (none) */
#define PANEL_DECIMATION 27 /* control type: ring, callback function: (none) */
#define PANEL_TRIGGER 28 /* control type: ring, callback function: (none) */
#define PANEL_OUTWAVE 29 /* control type: radioButton, callback function: (none) */
#define PANEL_ENABLEDOUTPUT 30 /* control type: radioButton, callback function: (none) */
#define PANEL_DEBUG 31 /* control type: radioButton, callback function: (none) */
#define PANEL_CH1 32 /* control type: radioButton, callback function: (none) */
#define PANEL_GRAPH 33 /* control type: graph, callback function: (none) */
#define PANEL_CH0 34 /* control type: radioButton, callback function: (none) */
#define PANEL_TEXTMSG 35 /* control type: textMsg, callback function: (none) */
#define PANEL_STDIO 36 /* control type: textBox, callback function: (none) */
#define PANEL_MAXX_3 37 /* control type: numeric, callback function: (none) */
#define PANEL_MINX_3 38 /* control type: numeric, callback function: (none) */
#define PANEL_NCH_3 39 /* control type: numeric, callback function: (none) */
#define PANEL_MAXX_4 40 /* control type: numeric, callback function: (none) */
#define PANEL_MINX_4 41 /* control type: numeric, callback function: (none) */
#define PANEL_NCH_4 42 /* control type: numeric, callback function: (none) */
#define PANEL_MAXX_2 43 /* control type: numeric, callback function: (none) */
#define PANEL_MINX_2 44 /* control type: numeric, callback function: (none) */
#define PANEL_NCH_2 45 /* control type: numeric, callback function: (none) */
#define PANEL_MAXX_6 46 /* control type: numeric, callback function: SetGraphPropertiesCB */
#define PANEL_MINX_6 47 /* control type: numeric, callback function: SetGraphPropertiesCB */
#define PANEL_MAXX_5 48 /* control type: numeric, callback function: SetGraphPropertiesCB */
#define PANEL_MINX_5 49 /* control type: numeric, callback function: SetGraphPropertiesCB */
#define PANEL_MAXX_1 50 /* control type: numeric, callback function: (none) */
#define PANEL_MINX_1 51 /* control type: numeric, callback function: (none) */
#define PANEL_NCH_1 52 /* control type: numeric, callback function: (none) */
#define PANEL_CONNECT 53 /* control type: textButton, callback function: StartCB */
#define PANEL_START 54 /* control type: textButton, callback function: StartCB */
#define PANEL_ADCTYPE 55 /* control type: binary, callback function: (none) */
#define PANEL_AUTOY 56 /* control type: radioButton, callback function: SetGraphPropertiesCB */
#define PANEL_LOGY_4 57 /* control type: radioButton, callback function: SetGraphLogYCB */
#define PANEL_LOGY_3 58 /* control type: radioButton, callback function: SetGraphLogYCB */
#define PANEL_LOGY_2 59 /* control type: radioButton, callback function: SetGraphLogYCB */
#define PANEL_LOGY_1 60 /* control type: radioButton, callback function: SetGraphLogYCB */
#define PANEL_AUTOX 61 /* control type: radioButton, callback function: SetGraphPropertiesCB */
 
 
/* Control Arrays: */
 
/* (no control arrays in the resource file) */
 
 
/* Menu Bars, Menus, and Menu Items: */
 
/* (no menu bars in the resource file) */
 
 
/* Callback Prototypes: */
 
int CVICALLBACK ExitCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK ExportCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK ResetCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK SetGraphLogYCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK SetGraphPropertiesCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
int CVICALLBACK StartCB(int panel, int control, int event, void *callbackData, int eventData1, int eventData2);
 
 
#ifdef __cplusplus
}
#endif
/cvi/RedPitaya/soccli/redpitaya_gui.uir
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/cvi/RedPitaya/soccli/soccli.c
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) );
 
GetCtrlVal(panelHandle,PANEL_MINX_5, &min);
GetCtrlVal(panelHandle,PANEL_MAXX_5, &max);
SetAxisScalingMode (panelHandle, PANEL_GRAPH, VAL_LEFT_YAXIS, VAL_MANUAL, min, max);
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);
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;
}