• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetCtrlVal函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetCtrlVal函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCtrlVal函数的具体用法?C++ GetCtrlVal怎么用?C++ GetCtrlVal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetCtrlVal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ManipulateReadingCallback

int  ManipulateReadingCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    channelPtr chan;
    double reading, min_x, max_x, min_y, max_y;
    int handle, index, scatter, mode, i;

    if (event == EVENT_VAL_CHANGED)
    {
        chan = callbackData;
        GetGraphCursorIndex (chanview.p1, CHANVIEW_GRAPH, 1, &handle, &index);
        GetCtrlVal (panel, control, &reading);
        GetCtrlVal (panel, MANIP_INDEX, &index);
        chan->readings[index] = reading;
        GetCtrlVal (chanview.p1, CHANVIEW_SCATTER, &scatter);
        channel_UpdateViewGraph(chan, scatter);
        GetAxisRange (chanview.p1, CHANVIEW_GRAPH, &mode, &min_x, &max_x,
                      &mode, &min_y, &max_y);
        MaxMin1D (chan->readings + (int)min_x, (int)(max_x - min_x + 1), &max_y,
                  &i, &min_y, &i);
        SetAxisRange (chanview.p1, CHANVIEW_GRAPH, VAL_NO_CHANGE, 0.0, 1.0,
                      VAL_MANUAL, min_y, max_y);
        SetGraphCursor (chanview.p1, CHANVIEW_GRAPH, 1, index, reading);
    }
    return 0;
}
开发者ID:gaorlov,项目名称:DAAS,代码行数:25,代码来源:chanfnc.c


示例2: DoDecimateCallback

int  DoDecimateCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    int i, dfact, ave;
    channelPtr chan, newchan;

    if (event == EVENT_COMMIT)
    {
        GetCtrlVal (panel, DECIMATE_CHANNELS, &i);
        GetCtrlVal (panel, DECIMATE_DFACT, &dfact);
        GetCtrlVal (panel, DECIMATE_AVE, &ave);

        chan = channellist_GetItem (i);

        newchan = channel_Create();
        if (newchan && channel_AllocMem (newchan, (int)(chan->pts/dfact)) &&
            (Decimate (chan->readings, chan->pts, dfact, ave, newchan->readings) == NoErr))
        {
            Fmt (newchan->label, "%s (decimated)", chan->label);
            Fmt (newchan->note, "%s\n%s\ndfact = %i\nave = %i\n",
                 chan->note, newchan->label, dfact, ave);
            channellist_AddChannel (newchan);
            return 1;
        }

        MessagePopup ("Decimate Channel Message", "Error decimating channel--function voided");
        if (newchan)
        {
            if (newchan->readings) free (newchan->readings);
            free (newchan);
        }
    }
    return 0;
}
开发者ID:gaorlov,项目名称:DAAS,代码行数:33,代码来源:chanfnc.c


示例3: DoClipCallback

int  DoClipCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    int i;
    double min, max;
    channelPtr chan, newchan;

    if (event == EVENT_COMMIT)
    {
        GetCtrlVal (panel, CLIP_CHANNELS, &i);
        GetCtrlVal (panel, CLIP_MIN, &min);
        GetCtrlVal (panel, CLIP_MAX, &max);

        chan = channellist_GetItem (i);

        newchan = channel_Create();
        if (newchan && channel_AllocMem (newchan, chan->pts) &&
            (Clip (chan->readings, chan->pts, max, min, newchan->readings) == NoErr))
        {
            Fmt (newchan->label, "%s (clipped)", chan->label);
            Fmt (newchan->note, "%s\n%s\nmin = %f[e2p3]\nmax = %f[e2p3]\n",
                 chan->note, newchan->label, min, max);
            channellist_AddChannel (newchan);
            return 1;
        }

        MessagePopup ("Clip Channel Message", "Error clipping channel--function voided");
        if (newchan)
        {
            if (newchan->readings) free (newchan->readings);
            free (newchan);
        }
    }
    return 0;
}
开发者ID:gaorlov,项目名称:DAAS,代码行数:34,代码来源:chanfnc.c


示例4: main

int main (int argc, char *argv[])
{
    if (InitCVIRTE (0, argv, 0) == 0)
        return -1;  /* out of memory */      
    if ((pBasicFn = LoadPanel (0, "UIRBasicFnct.uir", P_BASIC_FN)) < 0)
        return -1;
    if ((pSystem = LoadPanel (0, "UIRSystem.uir", P_SYSTEM)) < 0)
        return -1;
    if ((pControlPad = LoadPanel (0, "UIRControlPad.uir", P_CTRL_PAD)) < 0)
        return -1;
    
    GetCtrlVal (pBasicFn, P_BASIC_FN_SWH_FNCT_MODE,         &iFnctMode);
    GetCtrlVal (pBasicFn, P_BASIC_FN_SWH_DISPLAY_MODE,      &iDispMode);
    GetCtrlVal (pBasicFn, P_BASIC_FN_SWH_DISPLAY_LAST_FIVE, &iLastFive);
    GetCtrlVal (pBasicFn, P_BASIC_FN_SWITCH_SENSOR,         &iSwitchSens);
    GetCtrlVal (pBasicFn, P_BASIC_FN_SWITCH_DREH_MODE,      &iDrehMode);
    
    SetCtrlAttribute (pSystem, P_SYSTEM_CMD_DEINIT,             ATTR_DIMMED, 1);
    
    DisplayPanel (pBasicFn);
    RunUserInterface ();
    DiscardPanel (pBasicFn);
    
    return 0;
}
开发者ID:hannyyjj,项目名称:C843-Control,代码行数:25,代码来源:UIRBasicFnct.c


示例5: SpotSize_Callback

/// HIFN Callback function for changing the spotmask
int CVICALLBACK SpotSize_Callback (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_VAL_CHANGED:
		{
			double sliderpos;
			unsigned int Nx, Ny;
			GetCtrlVal(panel, TABPANEL_3_inputNx, &Nx);
			GetCtrlVal(panel, TABPANEL_3_inputNy, &Ny);
			
			
			// check if we need to update
			if (eventData1 != SLM_NO_UPDATE)
			{
				// update the SLM panel and the simulation Panel (if toggled)
				SLM_update(pnlSLMpixels, SLMpixels_SLMcanvas, pnlSimPanel, SimPanel_CANVAS, 1);
			}
			
			break;
		}
	}
	return 0;
}
开发者ID:magchipslab,项目名称:SLM-software,代码行数:26,代码来源:SLM+Control+Panel+Spot+Array.c


示例6: PRE_ActualizarTransmision

/*****************************************************************************
.						
. Función C:			PRE_ActualizarTransmision
. Responsable:			César Armando Cruz Mendoza
. Descripcion: 			Actualiza la informacion de la transmision que se
.						ha editado en el sistema
. Parámetro de entrada:	ninguno
. Parámetro de salida:	cero
. Fecha de creación:	11 de Marzo de 2014
.
*****************************************************************************/
int PRE_ActualizarTransmision()
{
	char cMensajeError[500]={0};	//mensaje de error que se haya detectado
	char cDescripcion[250]={0};		//nombre asignado a la transmision
	int iNumVelocidades=0;			//numero de velocidades asociadas
	double dRelacion=0;				//valor de la relacion de velocidad
	char cVelocidad[5]={0};			//numero de velocidad en cadena
	int iLadoManipulador=0;			//indica el lado del manipulador (0 izq 1 der)
	int iId;						//identificador de la transmision
	double *pdListaRelaciones;		//lista de relaciones configuradas
	
	//se requeren implementar algunas validaciones antes de iniciar
	//el proceso de actualización de la transmision
	
	//obtiene el id de la transmision
	GetCtrlVal(iPanelCatTransmisiones, pCatTransm_lstTransmisiones, &iId);
	
	//verifica la informacion del numero de velocidades asocidadas
	GetCtrlVal (iPanelCatTransmisiones, pCatTransm_numNumeroVelocidades, &iNumVelocidades);
	if (iNumVelocidades == 1)
		strcat(cMensajeError,"- Se ha dejado el valor por defecto de 1 velocidad. \n");
	
	//vefifica los valores de relación para las velocidades capturadas
	pdListaRelaciones = malloc(sizeof(double)*iNumVelocidades);
	for (int i=0; i<iNumVelocidades; i++)
	{
		GetTableCellVal (iPanelCatTransmisiones, pCatTransm_tblRelaciones,
						 MakePoint(1,i+1), &dRelacion);
		pdListaRelaciones[i]=dRelacion;
		
		if (dRelacion == 0)
		{
			strcat(cMensajeError,
				   GRA_Strcat(3,"- Para la velocidad ",GRA_IntStr(i+1)," falta indicar la relación. \n"));
		}
	}
	
	GetCtrlVal (iPanelCatTransmisiones, pCatTransm_chkLadoIzquierdo, &iLadoManipulador);
	
	if (strlen(cMensajeError)>0)
	{
		MessagePopup ("Validación de información.", cMensajeError);
	}
	else
	{
		//inicia el proceso de guardado de la informacion, para lo cual obtiene
		//la lista de relaciones de las velocidades que se han configurado
		BDS_ActualizaTransmision(iId, iNumVelocidades, pdListaRelaciones, iLadoManipulador);
		
		MessagePopup ("Registro actualizado",
					  "Se ha actualizado la información correctamente.");
		
		//regresa la interfaz al modo menu principal
		PRE_CancelarProceso();
	}
	
	free(pdListaRelaciones);
	
	return 0;
}
开发者ID:acm573,项目名称:Sincros,代码行数:71,代码来源:PRE_EventosCatTransmisiones.c


示例7: plot_data

void plot_data (int color)
{
	int pix_num,bckgrd_satus;
	double bckgrd_val;

	GetCtrlVal (ERG_panel, ERG_panel_bckgrd_sub, &bckgrd_satus); 
	if (bckgrd_satus==1)
	{
		GetCtrlVal (ERG_panel, ERG_panel_bckgrd, &pix_num);
		Mean (&data2fit[pix_num-50], 100, &bckgrd_val);
		j=0;
		while (j<10000)
		{
			buffer[j] = data2fit[j]-bckgrd_val;
			j++;
		}
	}
	else
	{
		  j=0;
		while (j<10000)
		{
			buffer[j] = data2fit[j];
			j++;
		}
	}
	
	PlotY (ERG_panel, ERG_panel_scope, buffer, 10000,VAL_DOUBLE , VAL_THIN_LINE, VAL_EMPTY_SQUARE, VAL_SOLID, 1, MakeColor(color,color,color));
}
开发者ID:cedschmidt,项目名称:QC-Vision,代码行数:29,代码来源:gpibrw.c


示例8: SR844RefCallback

int  SR844RefCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    gpibioPtr dev = callbackData;
    double r;
    char cmd[256];

    switch (control) {
        case SR844_REF_FREQ:
            if (event == EVENT_VAL_CHANGED) {
                GetCtrlVal (panel, control, &r);
                Fmt (cmd, "FREQ%f", r);
                gpibio_Out (dev, cmd);
                r = sr844_GetDoubleVal (dev, "FREQ?");
                SetCtrlVal (panel, control, r);
                SetCtrlAttribute (panel, control, ATTR_INCR_VALUE, r/10);
            }
            break;
        case SR844_REF_PHASE:
            if (event == EVENT_VAL_CHANGED) {
                GetCtrlVal (panel, control, &r);
                Fmt (cmd, "PHAS%f", r);
                gpibio_Out (dev, cmd);
                SetCtrlVal (panel, control, sr844_GetDoubleVal(dev, "PHAS?"));
            }
            break;
    }
    return 0;
}
开发者ID:gaorlov,项目名称:DAAS,代码行数:28,代码来源:Sr844.c


示例9: K2400MeasControlCallback

int  K2400MeasControlCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    acqchanPtr acqchan = callbackData;
    switch (control) {
        case K2400_MEAS_ACQ:
            if (event == EVENT_VAL_CHANGED) {
                GetCtrlVal (panel, control, &acqchan->acquire);
                if (acqchan->acquire) acqchanlist_AddChannel (acqchan);
                    else acqchanlist_RemoveChannel (acqchan);
            }
            break;
        case K2400_MEAS_COEFF:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, &acqchan->coeff);
                if (acqchan->p) SetCtrlVal (acqchan->p, ACQDATA_COEFF, acqchan->coeff);
            }
            break;
        case K2400_MEAS_LABEL:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, acqchan->channel->label);
                acqchanlist_ReplaceChannel (acqchan);
                if (acqchan->p) SetPanelAttribute (acqchan->p, ATTR_TITLE, acqchan->channel->label);
            }
            break;
        case K2400_MEAS_CLOSE:
            if (event == EVENT_COMMIT) {
                devPanel_Remove(panel);
                
                DiscardPanel (panel);
            }
            break;
    }
    return 0;
}
开发者ID:homer362s,项目名称:DAAS_2015,代码行数:34,代码来源:K2400.c


示例10: chanfunc_CalcStatistics

static void chanfunc_CalcStatistics (channelPtr chan)
{
    double mean, std_dev, variance, rms, moment, median, mode, min, max;
    int err, order, min_i, max_i, intervals;
    char newnote[256];

    Fmt (chanfunc.note, "");
    err = MaxMin1D (chan->readings, chan->pts, &max, &max_i, &min, &min_i);
    SetInputMode (chanfunc.p, STATISTICS_MIN, !err);
    SetCtrlVal (chanfunc.p, STATISTICS_MIN, min);
    SetInputMode (chanfunc.p, STATISTICS_MAX, !err);
    SetCtrlVal (chanfunc.p, STATISTICS_MAX, max);
    if (err == NoErr)
    {
        Fmt (chanfunc.note, "%s<Min: %f[e2p5]\n", min);
        Fmt (chanfunc.note, "%s[a]<Max: %f[e2p5]\n", max);
    }

    err = Mean (chan->readings, chan->pts, &mean);
    SetInputMode (chanfunc.p, STATISTICS_MEAN, !err);
    SetCtrlVal (chanfunc.p, STATISTICS_MEAN, mean);
    if (err == NoErr) Fmt (chanfunc.note, "%s[a]<Mean: %f[e2p5]\n", mean);

    err = StdDev (chan->readings, chan->pts, &mean, &std_dev);
    SetInputMode (chanfunc.p, STATISTICS_STDDEV, !err);
    SetCtrlVal (chanfunc.p, STATISTICS_STDDEV, std_dev);
    if (err == NoErr) Fmt (chanfunc.note, "%s[a]<StdDev: %f[e2p5]\n", std_dev);

    err = Variance (chan->readings, chan->pts, &mean, &variance);
    SetInputMode (chanfunc.p, STATISTICS_VAR, !err);
    SetCtrlVal (chanfunc.p, STATISTICS_VAR, variance);
    if (err == NoErr) Fmt (chanfunc.note, "%s[a]<Variance: %f[e2p5]\n", variance);

    err = RMS (chan->readings, chan->pts, &rms);
    SetInputMode (chanfunc.p, STATISTICS_RMS, !err);
    SetCtrlVal (chanfunc.p, STATISTICS_RMS, rms);
    if (err == NoErr) Fmt (chanfunc.note, "%s[a]<RMS: %f[e2p5]\n", rms);

    GetCtrlVal (chanfunc.p, STATISTICS_ORDER, &order);
    err = Moment (chan->readings, chan->pts, order, &moment);
    SetInputMode (chanfunc.p, STATISTICS_MOMENT, !err);
    SetInputMode (chanfunc.p, STATISTICS_ORDER, !err);
    SetCtrlVal (chanfunc.p, STATISTICS_MOMENT, moment);
    if (err == NoErr) Fmt (chanfunc.note, "%s[a]<Moment: %f[e2p5] (order: %i)\n", moment, order);

    err = Median (chan->readings, chan->pts, &median);
    SetInputMode (chanfunc.p, STATISTICS_MEDIAN, !err);
    SetCtrlVal (chanfunc.p, STATISTICS_MEDIAN, median);
    if (err == NoErr) Fmt (chanfunc.note, "%s[a]<Median: %f[e2p5]\n", median);

    GetCtrlVal (chanfunc.p, STATISTICS_INTERVAL, &intervals);
    err = Mode (chan->readings, chan->pts, min, max, intervals, &mode);
    SetInputMode (chanfunc.p, STATISTICS_INTERVAL, !err);
    SetInputMode (chanfunc.p, STATISTICS_MODE, !err);
    SetCtrlVal (chanfunc.p, STATISTICS_INTERVAL, intervals);
    SetCtrlVal (chanfunc.p, STATISTICS_MODE, mode);
    if (err == NoErr) Fmt (chanfunc.note, "%s[a]<Mode: %f[e2p5] (intervals: %i)\n", mode, intervals);
}
开发者ID:gaorlov,项目名称:DAAS,代码行数:58,代码来源:chanfnc.c


示例11: GenExpControlCallback

int  GenExpControlCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    if (event == EVENT_VAL_CHANGED){
        GetCtrlVal (panel, ACQSETUP_GEN_POINTS, &utilG.acq.nPts);
        GetCtrlVal (panel, ACQSETUP_GEN_DELAY, &expG.delay);
        SetCtrlVal (panel, ACQSETUP_GEN_TIME, (double)utilG.acq.nPts*expG.delay/60);
    }
    return 0;
}
开发者ID:homer362s,项目名称:DAAS_2015,代码行数:9,代码来源:acquire.c


示例12: das1602_ControlCallback

int das1602_ControlCallback (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    portPtr port = callbackData;
    switch (control)
    {
        case DAS_CTRL_RANGE:
            if(event == EVENT_COMMIT && port)
                GetCtrlVal(panel, control, &port->port.analogueIOport.range);
            break;
        case DAS_CTRL_INPUT:
            if(event == EVENT_COMMIT && port)
            {
                int i;
                MCCdevPtr dev = port->port.analogueIOport.IO.acqchan->dev;
                das1602Ptr das = dev->device;
                GetCtrlVal(panel, control, &i);
                port->control = 0;
                if(i != -1)
                {
                    das->Achannels[i]->control = control;
                    SetCtrlAttribute (panel, control, ATTR_CALLBACK_DATA, das->Achannels[i]);
                    SetCtrlAttribute (panel, DAS_CTRL_RANGE, ATTR_CALLBACK_DATA, das->Achannels[i]);
                    SetCtrlAttribute (panel, DAS_CTRL_ACQ, ATTR_CALLBACK_DATA, das->Achannels[i]);
                    SetCtrlIndex (panel, DAS_CTRL_RANGE, das1602_IndexFromRange(das->Achannels[i]->port.analogueIOport.range));
                    SetCtrlVal (panel, DAS_CTRL_ACQ, das->Achannels[i]->port.analogueIOport.IO.acqchan->acquire);
                }
                SetCtrlAttribute (panel, DAS_CTRL_RANGE, ATTR_DIMMED, (i == -1));
                SetCtrlAttribute (panel, DAS_CTRL_ACQ, ATTR_DIMMED, (i == -1));
                if(i == -1)SetCtrlVal (panel, DAS_CTRL_ACQ, 0);
            }
            break;
        case DAS_CTRL_ACQ:
        if(event == EVENT_COMMIT && port && utilG.acq.status != ACQ_BUSY)
        {
            int i;
            MCCdevPtr dev = port->port.analogueIOport.IO.acqchan->dev;
            das1602Ptr das = dev->device;
            GetCtrlIndex (panel, DAS_CTRL_INPUT, &i);
            if(i)
            {
                GetCtrlVal (panel, control, &port->port.analogueIOport.IO.acqchan->acquire);
                    if (port->port.analogueIOport.IO.acqchan->acquire)
                    acqchanlist_AddChannel(port->port.analogueIOport.IO.acqchan);
                else
                    acqchanlist_RemoveChannel(port->port.analogueIOport.IO.acqchan);
                SetMenuBarAttribute (das->menu, port->menuitem_id, ATTR_CHECKED, port->port.analogueIOport.IO.acqchan->acquire);
            }
        else if(event == EVENT_COMMIT && utilG.acq.status == ACQ_BUSY)
            SetCtrlVal (panel, control, port->port.analogueIOport.IO.acqchan->acquire);
            
        }
        break;
    }
    if(event == EVENT_COMMIT && port)
        das1602_UpdateMeasurePanel (port);
    return 0;
}
开发者ID:homer362s,项目名称:DAAS_SOFT,代码行数:57,代码来源:DAS-1602.c


示例13: XYMPControlCallback844

int  XYMPControlCallback844(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    sr844Ptr lia;
    acqchanPtr acqchan;

    acqchan = callbackData;

    switch (control) {
        case SR844_XYMP_NOTE_1:
        case SR844_XYMP_NOTE_2:
        case SR844_XYMP_NOTE_3:
        case SR844_XYMP_NOTE_4:
            AcqDataNoteCallback (panel, control, event, callbackData, eventData1, eventData2);
            break;
        case SR844_XYMP_XACQ:
        case SR844_XYMP_YACQ:
        case SR844_XYMP_RACQ:
        case SR844_XYMP_PACQ:
            if (event == EVENT_VAL_CHANGED) {
                GetCtrlVal (panel, control, &acqchan->acquire);
                if (acqchan->acquire) acqchanlist_AddChannel (acqchan);
                    else acqchanlist_RemoveChannel (acqchan);
            }
            break;
        case SR844_XYMP_XCOEFF:
        case SR844_XYMP_YCOEFF:
        case SR844_XYMP_RCOEFF:
        case SR844_XYMP_PCOEFF:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, &acqchan->coeff);
                if (acqchan->p) SetCtrlVal (acqchan->p, ACQDATA_COEFF, acqchan->coeff);
            }
            break;
        case SR844_XYMP_XLABEL:
        case SR844_XYMP_YLABEL:
        case SR844_XYMP_RLABEL:
        case SR844_XYMP_PLABEL:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, acqchan->channel->label);
                acqchanlist_ReplaceChannel (acqchan);
                if (acqchan->p) SetPanelAttribute (acqchan->p, ATTR_TITLE, acqchan->channel->label);
            }
            break;
        case SR844_XYMP_CLOSE:
            if (event == EVENT_COMMIT) {
                lia = callbackData;
                devPanel_Remove(panel);
                DiscardPanel (panel);
            }
            break;
    }
	updateGraphSource();
    return 0;
}
开发者ID:gaorlov,项目名称:DAAS,代码行数:54,代码来源:Sr844.c


示例14: ADCControlCallback844

int  ADCControlCallback844(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
    sr844Ptr lia;
    acqchanPtr acqchan;

    acqchan = callbackData;

    switch (control) {
        case SR844_ADC_NOTE_1:
        case SR844_ADC_NOTE_2:
            AcqDataNoteCallback (panel, control, event, callbackData, eventData1, eventData2);
            break;
        case SR844_ADC_ACQ_1:
        case SR844_ADC_ACQ_2:
            if (event == EVENT_VAL_CHANGED) {
                GetCtrlVal (panel, control, &acqchan->acquire);
                if (acqchan->acquire) acqchanlist_AddChannel (acqchan);
                    else acqchanlist_RemoveChannel (acqchan);
            }
            break;
        case SR844_ADC_CONVERSION_1:
        case SR844_ADC_CONVERSION_2:
            if (event == EVENT_VAL_CHANGED) {
                GetCtrlVal (panel, control, &acqchan->conversion);
                if (acqchan->p) SetCtrlVal (acqchan->p, ACQDATA_CONV, acqchan->conversion);
            }
            break;
        case SR844_ADC_COEFF_1:
        case SR844_ADC_COEFF_2:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, &acqchan->coeff);
                if (acqchan->p) SetCtrlVal (acqchan->p, ACQDATA_COEFF, acqchan->coeff);
            }
            break;
        case SR844_ADC_LABEL_1:
        case SR844_ADC_LABEL_2:
            if (event == EVENT_COMMIT) {
                GetCtrlVal (panel, control, acqchan->channel->label);
                acqchanlist_ReplaceChannel (acqchan);
                if (acqchan->p) SetPanelAttribute (acqchan->p, ATTR_TITLE, acqchan->channel->label);
            }
            break;
        case SR844_ADC_CLOSE:
            if (event == EVENT_COMMIT) {
                lia = callbackData;
                devPanel_Remove(panel);
                DiscardPanel (panel);
            }
            break;
    }
    return 0;
}
开发者ID:gaorlov,项目名称:DAAS,代码行数:52,代码来源:Sr844.c


示例15: setPhaseGratingFromParameters

/// HIFN gets the parameters for the phase grating pattern and sets the SLM
void setPhaseGratingFromParameters()
{
	// read out the parameters from the phase grating tab page
	double a1, a2, b1, b2, angle;	
	GetCtrlVal(TabPage_1_1, TABPANEL_4_Amplitude1, &a1);
	GetCtrlVal(TabPage_1_1, TABPANEL_4_Amplitude2, &a2);
	GetCtrlVal(TabPage_1_1, TABPANEL_4_Period1,    &b1);
	GetCtrlVal(TabPage_1_1, TABPANEL_4_Period2,   &b2);
	GetCtrlVal(TabPage_1_1, TABPANEL_4_Angle,      &angle);
	
	// set the SLM pattern to a phase grating
	SLM_setPhaseGrating(a1, b1, a2, b2, angle);
}
开发者ID:magchipslab,项目名称:SLM-software,代码行数:14,代码来源:SLM+Control+Panel+Spot+Array.c


示例16: ManualInput

int CVICALLBACK ManualInput (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
			if(control == PANEL_RB_CHECKBOX ){
				int state;
				GetCtrlVal (panel, PANEL_RB_CHECKBOX, &state); 
				if(state)
				{
					SetCtrlAttribute (panel, PANEL_RB_UNLOCKX, ATTR_CTRL_MODE,  VAL_NORMAL);
					SetCtrlAttribute (panel, PANEL_RB_UNLOCKY, ATTR_CTRL_MODE,  VAL_NORMAL);
					SetCtrlAttribute (panel, PANEL_RB_LOCKX, ATTR_CTRL_MODE,  VAL_NORMAL); 
					SetCtrlAttribute (panel, PANEL_RB_LOCKY, ATTR_CTRL_MODE,  VAL_NORMAL);

					SetCtrlAttribute (panel, PANEL_RB_SAV_HI, ATTR_CTRL_MODE,  VAL_NORMAL);
				}
				else
				{
					SetCtrlAttribute (panel, PANEL_RB_UNLOCKX, ATTR_CTRL_MODE,  VAL_INDICATOR);
					SetCtrlAttribute (panel, PANEL_RB_UNLOCKY, ATTR_CTRL_MODE,  VAL_INDICATOR);
					SetCtrlAttribute (panel, PANEL_RB_LOCKX, ATTR_CTRL_MODE,  VAL_INDICATOR); 
					SetCtrlAttribute (panel, PANEL_RB_LOCKY, ATTR_CTRL_MODE,  VAL_INDICATOR);

					SetCtrlAttribute (panel, PANEL_RB_SAV_HI, ATTR_CTRL_MODE,  VAL_INDICATOR);
				}
			}else if(control == PANEL_RB_CHECKBOX_2 ){
				int state;
				GetCtrlVal (panel, PANEL_RB_CHECKBOX_2, &state); 
				if(state)
				{
					SetCtrlAttribute(panel,PANEL_RB_SET_POS, ATTR_DIMMED, 0); 
					SetCtrlAttribute(panel,PANEL_RB_SET_LCK, ATTR_DIMMED, 0);
					SetCtrlAttribute(panel,PANEL_RB_SET_SAV_HI, ATTR_DIMMED, 0);
				}
				else
				{
					SetCtrlAttribute(panel,PANEL_RB_SET_POS, ATTR_DIMMED, 1); 
					SetCtrlAttribute(panel,PANEL_RB_SET_LCK, ATTR_DIMMED, 1);
					SetCtrlAttribute(panel,PANEL_RB_SET_SAV_HI, ATTR_DIMMED, 1);
				}
			}
			
			break;
	}
	return 0;
}
开发者ID:wft999,项目名称:25m,代码行数:48,代码来源:robot_panel.c


示例17: GaussianPeaks_Callback

/// HIFN Callback function for toggling the phase grating mode to a pattern Gaussian peaks
int CVICALLBACK GaussianPeaks_Callback (int panel, int control, int event,
		void *callbackData, int eventData1, int eventData2)
{
	switch (event)
	{
		case EVENT_COMMIT:
		{	
			// check if the button is on or off
			int gptoggle;
			GetCtrlVal(panel, control, &gptoggle);
			
			// toggle the Gaussian peaks setting
			SLM_togglePhaseGratingGaussianPeaks(gptoggle);
			
			// check if we need to update
			if (eventData1 != SLM_NO_UPDATE)
			{
				// update the SLM panel and the simulation Panel (if toggled)
				SLM_update(pnlSLMpixels, SLMpixels_SLMcanvas, pnlSimPanel, SimPanel_CANVAS, 1);
			}
			
			break;
		}
	}
	return 0;
}
开发者ID:magchipslab,项目名称:SLM-software,代码行数:27,代码来源:SLM+Control+Panel+Spot+Array.c


示例18: loaded_mask

int  CVICALLBACK loaded_mask(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{	
	char dummy[500];
	switch (event)
			
	{
	case EVENT_COMMIT:
		GetCtrlVal (Main_pnl_handle, ERG_panel_loaded_mask_list, &mask_index);
		GetLabelFromIndex (Main_pnl_handle, ERG_panel_loaded_mask_list, mask_index, &mask_filename);
		if (mask_index==0){
			for (i=0;i<Npixel;i++){
					drive_level[i]=0;
				}
		
		}
		else{
			strcpy (dummy, mask_path);
			strcat (dummy, "\\");
			strcat(dummy, mask_filename);
		
			FileToArray (dummy, drive_level, VAL_INTEGER, Npixel, 1, VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_COLUMNS, VAL_ASCII);
		}
		
		display_masks();



			  
			break;
	}
	return 0;
}
开发者ID:achauvet,项目名称:QC-Vision,代码行数:32,代码来源:gpibrw.c


示例19: logBoxRightClickMenuCallback

/* 辅助函数-Log信息台-右键菜单-回调函数 */
void CVICALLBACK logBoxRightClickMenuCallback(int menuBarHandle, int menuItemID, 
			void *callbackData, int panelHandle){
	switch(menuItemID){
		case 3:
			SYSTEMTIME localTime;
			char dirName[MAX_PATHNAME_LEN];
			char filePath[MAX_PATHNAME_LEN]; 
			char fileName[200]; fileName[0]='\0';
			GetProjectDir(dirName);
			strcat(dirName, "\\Logs");
			GetLocalTime(&localTime);
			sprintf(fileName, "Log,%04d-%d-%d,%d_%02d_%02d.txt", 
					localTime.wYear, localTime.wMonth, localTime.wDay,
					localTime.wHour, localTime.wMinute, localTime.wSecond);
			MakePathname(dirName, fileName, filePath);
			FILE *fp = fopen(filePath, "w");
			int len=0;
			GetCtrlAttribute(panelHdl, MainPanel_MainLogBox, ATTR_STRING_TEXT_LENGTH, &len);
			char tempLog[10000];
			GetCtrlVal(panelHdl, MainPanel_MainLogBox, tempLog);
			fwrite(tempLog, sizeof(char), len, fp);
			fclose(fp);
			ResetTextBox(panelHdl, MainPanel_MainLogBox, "Logs have been saved!");
			break;
		case 4:
			ResetTextBox(panelHdl, MainPanel_MainLogBox, "");
			break;
	}
}
开发者ID:HelloLyfing,项目名称:Signal_Monitor_System_Based_On_LabWindows-CVI,代码行数:30,代码来源:MainCode.c


示例20: main

void main()

{
int handle, panel, id;
int var;

id = 0;

 panel = LoadPanel (0, "primcvi.uir", mipanel1);

 DisplayPanel (panel);


while (id != mipanel1_salir) 
	{
	GetUserEvent (0, &handle, &id);
	
    GetCtrlVal (panel, mipanel1_pot1, &var);
	SetCtrlVal (panel, mipanel1_tanque1, var);
	
	}

DiscardPanel (panel);

} /* del main */
开发者ID:francisjpo,项目名称:universidad,代码行数:25,代码来源:primcvi.c



注:本文中的GetCtrlVal函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetCtx函数代码示例发布时间:2022-05-30
下一篇:
C++ GetCtrl函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap