Esempio n. 1
0
int  K2400ControlPanelCallback(int panel, int event, void *callbackData, int eventData1, int eventData2)
{
    gpibioPtr dev = callbackData;
    k2400Ptr smu = dev->device;
    int menubar;

    if ((event == EVENT_KEYPRESS && eventData1 == VAL_ESC_VKEY) || event == EVENT_RIGHT_DOUBLE_CLICK) {
        devPanel_Remove (panel);
		DiscardPanel (panel);
		dev->iPanel = 0;
		SetMenuBarAttribute (acquire_GetMenuBar(), dev->menuitem_id, ATTR_DIMMED, FALSE);
    }

    if (event == EVENT_GOT_FOCUS) {
        menubar = GetPanelMenuBar (panel);
        SetPanelAttribute (panel, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K2400MENUS_FILE_SAVE, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K2400MENUS_FILE_LOAD, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K2400MENUS_SOURCE, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K2400MENUS_MEASURE, ATTR_DIMMED, (dev->status != DEV_REMOTE));

        if (!util_TakingData()) k2400_UpdateControls (panel, dev);
    }
    return 0;
}
Esempio n. 2
0
File: K213.c Progetto: gaorlov/DAAS
int  K213ControlPanelCallback(int panel, int event, void *callbackData, int eventData1, int eventData2)
{
    gpibioPtr dev = callbackData;
    k213Ptr quadsrc = dev->device;
    int menubar, port;

    if ((event == EVENT_KEYPRESS && eventData1 == VAL_ESC_VKEY) || (event == EVENT_RIGHT_DOUBLE_CLICK)) {
        devPanel_Remove (panel);

        for (port = 0; port < 4; port++) {
            HidePanel (quadsrc->port[port].panel);
        }
        DiscardPanel (panel);
		dev->iPanel = 0;
		SetMenuBarAttribute (acquire_GetMenuBar(), dev->menuitem_id, ATTR_DIMMED, FALSE);
    }

    if (event == EVENT_GOT_FOCUS && panel == dev->iPanel) {
        menubar = GetPanelMenuBar (panel);
        SetPanelAttribute (panel, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K213MENUS_FILE_SAVE, ATTR_DIMMED, (dev->status != DEV_REMOTE));
        SetMenuBarAttribute (menubar, K213MENUS_FILE_LOAD, ATTR_DIMMED, (dev->status != DEV_REMOTE));

        if (!util_TakingData()) k213_UpdateControls (panel, dev);
    }
    return 0;
}
Esempio n. 3
0
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;
}
Esempio n. 4
0
File: Sr844.c Progetto: gaorlov/DAAS
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;
}
Esempio n. 5
0
File: Sr844.c Progetto: gaorlov/DAAS
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;
}
Esempio n. 6
0
void dda08_Remove (void* ptr)
{
	MCCdevPtr dev = ptr;
	dda08Ptr dda = dev->device;
	int i;
	if(dda->panel)
	{
		devPanel_Remove(dda->panel);
		DiscardPanel(dda->panel);
	}
	for(i = 0; i < 8; i++)
		source_Remove (dda->Achannels[i]->port.analogueIOport.IO.source);
	free(dda);
}
Esempio n. 7
0
File: Sr844.c Progetto: gaorlov/DAAS
int  SR844ControlPanelCallback(int panel, int event, void *callbackData, int eventData1, int eventData2)
{
    gpibioPtr dev;
    sr844Ptr lia;
    if (((event == EVENT_KEYPRESS) && (eventData1 == VAL_ESC_VKEY)) || (event == EVENT_RIGHT_DOUBLE_CLICK))
	{
		dev = callbackData;
        lia = dev->device;
        devPanel_Remove (panel);
        DiscardPanel (panel);
		dev->iPanel = 0;
		SetMenuBarAttribute (acquire_GetMenuBar(), dev->menuitem_id, ATTR_DIMMED, FALSE);
    }
    return 0;
}
Esempio n. 8
0
int das1602_PanelCallback (int panel, int event, void *callbackData, int eventData1, int eventData2)
{
    das1602Ptr das = callbackData;
    if((event == EVENT_KEYPRESS && eventData1 == VAL_ESC_VKEY) || event == EVENT_RIGHT_DOUBLE_CLICK)
    {
        MCCdevPtr dev = das->Achannels[0]->port.analogueIOport.IO.acqchan->dev;
        int i;
        for (i = 0; i < 8; i ++)
            if(das->Achannels[i]->measPanel)
                HidePanel(das->Achannels[i]->measPanel);
        devPanel_Remove(panel);
        HidePanel(panel);
        SetMenuBarAttribute (acquire_GetMenuBar(), dev->menuitem_id, ATTR_DIMMED, FALSE);
    }
    return 0;
}
Esempio n. 9
0
void das1602_Remove (void* ptr)
{
    MCCdevPtr dev = ptr;
    das1602Ptr das = dev->device;
    int i;
    if(das->panel)
    {
        devPanel_Remove(das->panel);
        DiscardPanel(das->panel);
    }
    for(i = 0; i < 8; i++)
        acqchan_Remove(das->Achannels[i]->port.analogueIOport.IO.acqchan);
    for(i = 8; i < 10; i++)
        source_Remove (das->Achannels[i]->port.analogueIOport.IO.source);
    free(das);
}
Esempio n. 10
0
void usb1208ls_Remove(void *ptr)
{
    int i;
    MCCdevPtr dev = ptr;
    usb1208lsPtr pmd = dev->device;
    if(pmd->panel)
    {
        devPanel_Remove(pmd->panel);
        DiscardPanel(pmd->panel);
    }
    for ( i = 0; i < 4; i ++)
        acqchan_Remove(pmd->aiPorts[i]->port.analogueIOport.IO.acqchan);
    for ( i = 0; i < 3; i ++)
    {
        if(pmd->aoPorts[i]->port.analogueIOport.IO.source->panel) DiscardPanel(pmd->aoPorts[i]->port.analogueIOport.IO.source->panel);
        source_Remove (pmd->aoPorts[i]->port.analogueIOport.IO.source);
    }
    acqchan_Remove(pmd->diPort->port.digitalIOport.IO.acqchan);
    if(pmd->doPort->port.analogueIOport.IO.source->panel)DiscardPanel(pmd->doPort->port.analogueIOport.IO.source->panel);
    source_Remove (pmd->doPort->port.digitalIOport.IO.source);
    free(pmd);
}