本文整理汇总了C++中SetCtrlVal函数的典型用法代码示例。如果您正苦于以下问题:C++ SetCtrlVal函数的具体用法?C++ SetCtrlVal怎么用?C++ SetCtrlVal使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetCtrlVal函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: acquire_Init
void acquire_Init (void)
{
if (utilG.acq.status != ACQ_NONE) {
util_ChangeInitMessage ("Acquisition Utilities...");
util_WriteLog("acquire_Init()\nStarting...\n");
acqG.p.setup = LoadPanel (utilG.p, "acquireu.uir", ACQSETUP);
//SetPanelPos (acqG.p.setup, VAL_AUTO_CENTER, VAL_AUTO_CENTER);
// Set default data dir and suffix
int dirNameLen;
if(FileExists(DFLT_DATA_DIR, &dirNameLen) ) {
strcpy(dataFile.dataDir, DFLT_DATA_DIR);
} else {
char msg[MAX_PATHNAME_LEN*2];
sprintf(msg, "Default Data Does not exist:\n%s\nUsing application dir.", DFLT_DATA_DIR);
MessagePopup ("Acquisition Setup", msg );
GetProjectDir (dataFile.dataDir);
}
SetCtrlVal (acqG.p.setup, ACQSETUP_DATADIR, dataFile.dataDir);
strcpy(dataFile.fileSuffix, DFLT_FILE_SUFFIX);
SetCtrlVal(acqG.p.setup, ACQSETUP_FILESUFFIX, dataFile.fileSuffix);
// This control is a button on startup panel, "control. acquisition, and analysis"
InstallCtrlCallback (utilG.p, BG_ACQSETUP, AcqSetupCallback, 0);
} else SetCtrlAttribute (utilG.p, BG_ACQSETUP, ATTR_VISIBLE, FALSE);
}
示例2: Save
int CVICALLBACK Save (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
char *value = "";
switch (event)
{
case EVENT_COMMIT:
value = (char*)malloc(50);
memset(value,0,50);
GetPanelAttribute (configHandle, ATTR_TITLE, value);
if (strcmp("CheckBBUIP", value)==0)
{
if(1==WriteConfig(MENUBAR_CONFIG_CONFIGIP))
{
SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_CTRL_MODE, VAL_INDICATOR);
SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Save bbuip.txt successfully!\r\n");
}
}
if (strcmp("CheckCMD", value)==0)
{
if(1==WriteConfig(BBUCOMMON_CONFIGCMD))
{
SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_CTRL_MODE, VAL_INDICATOR);
SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Save command.txt successfully!\r\n");
}
}
free(value);
break;
}
return 0;
}
示例3: ManipulateGraphCallback
int ManipulateGraphCallback(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
int handle, index;
channelPtr chan;
double x, y, above, below;
if (event == EVENT_VAL_CHANGED)
{
chan = callbackData;
GetGraphCursor (chanview.p1, CHANVIEW_GRAPH, 1, &x, &y);
SetCtrlVal (chanview.p2, MANIP_INDEX, (int)x);
SetCtrlVal (chanview.p2, MANIP_READING, y);
}
if (event == EVENT_COMMIT)
{
chan = callbackData;
GetGraphCursorIndex (chanview.p1, CHANVIEW_GRAPH, 1, &handle, &index);
GetGraphCursor (chanview.p1, CHANVIEW_GRAPH, 1, &x, &y);
SetCtrlVal (chanview.p2, MANIP_INDEX, index);
SetCtrlVal (chanview.p2, MANIP_READING, y);
if (x == 0) below = 0.0;
else below = chan->readings[(int)x-1];
if (x == (chan->pts-1)) above = 0.0;
else above = chan->readings[(int)x+1];
if (fabs(above - chan->readings[(int)x]) < fabs(below - chan->readings[(int)x]))
SetCtrlAttribute (chanview.p2, MANIP_READING, ATTR_INCR_VALUE,
fabs(above - chan->readings[(int)x])/2);
else
SetCtrlAttribute (chanview.p2, MANIP_READING, ATTR_INCR_VALUE,
fabs(below - chan->readings[(int)x])/2);
}
return 0;
}
示例4: usb1208ls_UpdateReadings
void usb1208ls_UpdateReadings (int panel, void *ptr)
{
int i;
MCCdevPtr dev = ptr;
usb1208lsPtr pmd = dev->device;
acqchanPtr acqchan;
for(i = 0; i < 4; i++)
{
acqchan = pmd->aiPorts[i]->port.analogueIOport.IO.acqchan;
acqchan->GetReading(acqchan);
if(pmd->aiPorts[i]->control)
{
SetCtrlVal (pmd->panel, USB1208LS_ANALOGUE_IN, acqchan->reading);
SetCtrlVal (pmd->panel, USB1208LS_RANGE, pmd->aiPorts[i]->port.analogueIOport.range);
SetCtrlVal (pmd->panel, USB1208LS_ACQ, acqchan->acquire);
}
}
/* SetCtrlVal (pmd->panel, USB1208LS_DIGITAL_OUT_0, ((int)pmd->doPort->port.digitalIOport.IO.source->biaslevel % 2));
SetCtrlVal (pmd->panel, USB1208LS_DIGITAL_OUT_1, ((int)pmd->doPort->port.digitalIOport.IO.source->biaslevel / 2 % 2));
SetCtrlVal (pmd->panel, USB1208LS_DIGITAL_OUT_2, ((int)pmd->doPort->port.digitalIOport.IO.source->biaslevel / 4 % 2));
SetCtrlVal (pmd->panel, USB1208LS_DIGITAL_OUT_3, ((int)pmd->doPort->port.digitalIOport.IO.source->biaslevel / 8 % 2));
SetCtrlVal (pmd->panel, USB1208LS_DIGITAL_OUT_4, ((int)pmd->doPort->port.digitalIOport.IO.source->biaslevel / 16 % 2));
SetCtrlVal (pmd->panel, USB1208LS_DIGITAL_OUT_5, ((int)pmd->doPort->port.digitalIOport.IO.source->biaslevel / 32 %2));
*/
pmd->diPort->port.digitalIOport.IO.acqchan->GetReading(pmd->diPort->port.digitalIOport.IO.acqchan);
SetCtrlVal (pmd->panel, USB1208LS_DIGITAL_IN_0, ((int)pmd->diPort->port.digitalIOport.IO.acqchan->reading % 4 % 2));
//SetCtrlVal (pmd->panel, USB1208LS_DIGITAL_IN_1, ((int)pmd->diPort->port.digitalIOport.IO.acqchan->reading % 4 / 2));
}
示例5: 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;
}
示例6: acquire_UpdatePanel
void acquire_UpdatePanel(void)
{
int menuBar;
if (expG.UpdatePanel) expG.UpdatePanel();
menuBar = GetPanelMenuBar (acqG.p.setup);
SetMenuBarAttribute (menuBar, ACQMENUS_EXP_GENERAL, ATTR_DIMMED, util_TakingData());
SetMenuBarAttribute (menuBar, ACQMENUS_EXP_SOURCE, ATTR_DIMMED, util_TakingData());
SetMenuBarAttribute (menuBar, ACQMENUS_EXP_BEGIN, ATTR_DIMMED, util_TakingData());
SetMenuBarAttribute (menuBar, ACQMENUS_EXP_PAUSE, ATTR_DIMMED, !(utilG.acq.status == ACQ_BUSY));
SetMenuBarAttribute (menuBar, ACQMENUS_EXP_CONTINUE, ATTR_DIMMED, !(utilG.acq.status == ACQ_PAUSED));
SetMenuBarAttribute (menuBar, ACQMENUS_EXP_END, ATTR_DIMMED, !util_TakingData());
SetMenuBarAttribute (menuBar, ACQMENUS_EXP_INFO, ATTR_DIMMED, !util_TakingData());
acqchanlist_Dimmed (util_TakingData());
switch (utilG.acq.status) {
case ACQ_BUSY:
SetCtrlVal (acqG.p.setup, ACQSETUP_STATUS, "BUSY");
break;
case ACQ_STOPPED:
SetCtrlVal (acqG.p.setup, ACQSETUP_STATUS, "STOPPED");
break;
case ACQ_DONE:
SetCtrlVal (acqG.p.setup, ACQSETUP_STATUS, "DONE");
break;
case ACQ_PAUSED:
SetCtrlVal (acqG.p.setup, ACQSETUP_STATUS, "PAUSED");
break;
}
}
示例7: 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);
}
示例8: 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;
}
示例9: k2400_UpdateReadings
static void k2400_UpdateReadings (int panel, void *dev)
{
gpibioPtr my_dev = dev;
k2400Ptr smu = my_dev->device;
acqchanPtr acqchan = smu->source->acqchan;
short statusbyte;
char rsp[256];
int control, dim, bg, mode, m;
if (smu->operate) {
if (utilG.acq.status == ACQ_BUSY)
Delay(.05);
if (!util_TakingData() || !(smu->source->acqchan->acquire || smu->measure->acquire)) {
gpibio_GetStatusByte (dev, &statusbyte);
if (statusbyte & K2400_SRE_READINGDONE)
{
//k2400_In (dev, rsp);
//Scan (rsp, "%s>%f,%f", &smu->source->acqchan->reading,
// &smu->measure->reading);
}
//if (statusbyte & K2400_SRE_READYFORTRIGGER)
//k2400_Out (dev, "H0X", .02);
}
time(&present);
if(difftime(present, past) >= delay)
{
k2400_GetReadings(acqchan);
time(&past);
}
//if (expG.acqstatus != utilG.acq.status)
{
m = GetPanelMenuBar (panel);
dim = (util_TakingData() && smu->source->inlist &&
(utilG.exp == EXP_SOURCE));
if (dim) { mode = VAL_INDICATOR; bg = VAL_PANEL_GRAY;}
else { mode = VAL_HOT; bg = VAL_WHITE;}
SetCtrlAttribute (panel, K2400_SOURCE, ATTR_CTRL_MODE, mode);
SetCtrlAttribute (panel, K2400_SOURCE, ATTR_TEXT_BGCOLOR, bg);
SetInputMode (panel, K2400_OPERATE, !dim);
SetInputMode (panel, K2400_SELECT, !dim);
SetInputMode (panel, K2400_SENSE, !dim);
SetMenuBarAttribute (m, K2400MENUS_FILE_LOAD, ATTR_DIMMED, dim);
}
k2400_CheckforProblems (my_dev);
SetCtrlVal (panel, K2400_OVERLIMIT, smu->overLimit);
control = GetActiveCtrl (panel);
if (util_TakingData() || (control != K2400_SOURCE))
SetCtrlVal (panel, K2400_SOURCE, smu->source->acqchan->reading);
SetCtrlVal (panel, K2400_MEASURE, smu->measure->reading);
}
}
示例10: UpdateBarProgress
int UpdateBarProgress ( int hProgressHandle , int iBreakAllowFromBarNumber , int iBarNumber , int iProgress , int iCount )
{
int iBarCtrlID = 0,
iCountCtrlID = 0;
int iGetPanel = 0,
iGetControl = 0,
event = 0;
char szCount[32] = {0};
if ( hProgressHandle < 1 )
return 0;
if ( iProgress < 0 )
iProgress = 0;
if ( iProgress > 100 )
iProgress = 100;
if ( iCount > 0 )
sprintf ( szCount , "%d" , iCount );
else
strcpy ( szCount , "" );
switch (iBarNumber)
{
case 1: iBarCtrlID = PROGRESS_BAR_1; iCountCtrlID = PROGRESS_COUNT_1; break;
case 2: iBarCtrlID = PROGRESS_BAR_2; iCountCtrlID = PROGRESS_COUNT_2; break;
case 3: iBarCtrlID = PROGRESS_BAR_3; iCountCtrlID = PROGRESS_COUNT_3; break;
case 4: iBarCtrlID = PROGRESS_BAR_4; iCountCtrlID = PROGRESS_COUNT_4; break;
case 5: iBarCtrlID = PROGRESS_BAR_5; iCountCtrlID = PROGRESS_COUNT_5; break;
case 6: iBarCtrlID = PROGRESS_BAR_6; iCountCtrlID = PROGRESS_COUNT_6; break;
case 7: iBarCtrlID = PROGRESS_BAR_7; iCountCtrlID = PROGRESS_COUNT_7; break;
case 8: iBarCtrlID = PROGRESS_BAR_8; iCountCtrlID = PROGRESS_COUNT_8; break;
case 9: iBarCtrlID = PROGRESS_BAR_9; iCountCtrlID = PROGRESS_COUNT_9; break;
default: break;
}
SetCtrlVal ( hProgressHandle , iBarCtrlID , iProgress );
SetCtrlVal ( hProgressHandle , iCountCtrlID , szCount );
ProcessDrawEvents();
if (( iBarNumber != 0 ) && ( iBarNumber <= iBreakAllowFromBarNumber ))
{
event = GetUserEvent ( 0 , &iGetPanel , &iGetControl );
if ( iGetPanel == hProgressHandle )
if ( event == USER_REQUEST_BREAK )
return 1;
}
return 0;
}
示例11: das1602_UpdateMeasurePanel
void das1602_UpdateMeasurePanel(portPtr port)
{
if(port->measPanel)
{
SetCtrlVal (port->measPanel, MEASURE_RANGE, port->port.analogueIOport.range);
SetCtrlVal (port->measPanel, MEASURE_LABEL, port->port.analogueIOport.IO.acqchan->channel->label);
SetCtrlVal (port->measPanel, MEASURE_COEFF, port->port.analogueIOport.IO.acqchan->coeff);
SetCtrlVal (port->measPanel, MEASURE_ACQ, port->port.analogueIOport.IO.acqchan->acquire);
}
}
示例12: usb1208ls_MenuCallback
void usb1208ls_MenuCallback(int menubar, int menuItem, void *callbackData, int panel)
{
switch (menuItem)
{
case USBMENU_MEAS_IN_0:
case USBMENU_MEAS_IN_1:
case USBMENU_MEAS_IN_2:
case USBMENU_MEAS_IN_3:
if(utilG.acq.status != ACQ_BUSY){
portPtr port = callbackData;
MCCdevPtr dev = port->port.analogueIOport.IO.acqchan->dev;
usb1208lsPtr pmd = dev->device;
port->measPanel = port->measPanel? port->measPanel : LoadPanel(utilG.p, "USB-1208LSu.uir", MEASURE);
SetCtrlAttribute (port->measPanel, MEASURE_RANGE, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
SetCtrlAttribute (port->measPanel, MEASURE_LABEL, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
SetCtrlAttribute (port->measPanel, MEASURE_COEFF, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
SetCtrlAttribute (port->measPanel, MEASURE_NOTE, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
SetCtrlAttribute (port->measPanel, MEASURE_ACQ, ATTR_CALLBACK_DATA, port->port.analogueIOport.IO.acqchan);
SetPanelAttribute (port->measPanel, ATTR_TITLE, port->port.analogueIOport.IO.acqchan->channel->label);
SetCtrlVal (port->measPanel, MEASURE_LABEL, port->port.analogueIOport.IO.acqchan->channel->label);
SetCtrlVal (port->measPanel, MEASURE_RANGE, port->port.analogueIOport.range);
SetCtrlVal (port->measPanel, MEASURE_COEFF, port->port.analogueIOport.IO.acqchan->coeff);
SetCtrlVal (port->measPanel, MEASURE_NOTE, port->port.analogueIOport.IO.acqchan->note);
SetCtrlVal (port->measPanel, MEASURE_ACQ, port->port.analogueIOport.IO.acqchan->acquire);
DisplayPanel (port->measPanel);
}
break;
case USBMENU_SOURCE_DAC1:
case USBMENU_SOURCE_DAC2:
case USBMENU_SOURCE_DAC3:
{
sourcePtr src = callbackData;
switch(utilG.exp)
{
case EXP_SOURCE: source_InitPanel(src); break;
case EXP_FLOAT : gensrc_InitPanel(src); break;
}
}
break;
case USBMENU_SOURCE_DAC4:
{
portPtr port = callbackData;
boards_DigitalSourceInit(port);
}
break;
case USBMENU_FILE_SAVE:
boards_Save(callbackData, usb1208ls_Save);
break;
case USBMENU_FILE_LOAD:
boards_Load(callbackData, usb1208ls_Load);
break;
}
}
示例13: sr844_UpdateControls
void sr844_UpdateControls(int panel, gpibioPtr dev)
{
sr844_CheckClear(dev);
SetCtrlIndex(panel, SR844_CTRL_TC, sr844_GetIntVal(dev, "OFLT?"));
sr844_CheckClear(dev);
SetCtrlIndex(panel, SR844_CTRL_SENS, sr844_GetIntVal(dev, "SENS?"));
sr844_CheckClear(dev);
SetCtrlVal(panel, SR844_CTRL_1MO50O, sr844_GetIntVal(dev, "INPZ?"));
sr844_CheckClear(dev);
SetCtrlVal(panel, SR844_CTRL_FILTSLOPE, sr844_GetIntVal(dev, "OFSL?"));
}
示例14: sr844_XYRP_UpdateReadings
void sr844_XYRP_UpdateReadings (int panel, void *lia)
{
sr844Ptr my_lia = lia;
SetCtrlVal (panel, SR844_XYMP_XMEAS, my_lia->channels[X]->reading);
SetCtrlVal (panel, SR844_XYMP_YMEAS, my_lia->channels[Y]->reading);
SetCtrlVal (panel, SR844_XYMP_RMEAS, my_lia->channels[R]->reading);
SetCtrlVal (panel, SR844_XYMP_PMEAS, my_lia->channels[T]->reading);
if(utilG.acq.status == ACQ_BUSY)
HidePanel(panel);
}
示例15: BasicFunctions
int CVICALLBACK BasicFunctions (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
double dState;
char sTmp [4096];
switch (event)
{
case EVENT_COMMIT:
switch(control)
{
case P_BASIC_FN_RNG_SHOW_UI:
GetCtrlVal (pBasicFn, P_BASIC_FN_RNG_SHOW_UI, &iCtrlVal);
switch(iCtrlVal)
{
case 0:
DisplayPanel (pSystem);
break;
case 1:
DisplayPanel (pControlPad);
SetCtrlAttribute (pBasicFn, P_BASIC_FN_TIM_DATA, ATTR_ENABLED, 1);
break;
}
}
break;
case EVENT_TIMER_TICK:
switch (control)
{
case P_BASIC_FN_TIM_DATA:
// DebugPrintf ("---> [P_BASIC_FN_TIM_DATA]\n");
PiCardFnct (PI_GET_POS);
GetPiCardScrtItem (PI_POS, 1, &dState);
sprintf (sTmp, "%f", dState);
SetCtrlVal (pControlPad, P_CTRL_PAD_LBL_CURRENT_POS_4, sTmp);
GetPiCardScrtItem (PI_LAST_POS, 1, &dState);
sprintf (sTmp, "%f", dState);
SetCtrlVal (pControlPad, P_CTRL_PAD_LBL_LAST_POS, sTmp);
break;
}
}
return 0;
}