#include "NewDcsDialog.h" NewDcsDialog::NewDcsDialog(std::vector grpNames, QWidget* parent, Qt::WFlags fl) : QDialog(parent, fl) { setupUi(this); objectGenType->insertItem("USB"); objectGenType->insertItem("RS232"); #ifdef HAVE_GPIB objectGenType->insertItem("GPIB"); #endif #ifdef HAVE_GOEUSB objectGenType->insertItem("GoeUSB"); #endif showCtrlBox(objectGenType->currentItem()); QObject::connect(objectGenType, SIGNAL(activated(int)), this, SLOT(showCtrlBox(int))); for(std::vector::iterator it= grpNames.begin(); it!=grpNames.end(); it++) objectAssCtrlName->insertItem((*it).c_str()); } NewDcsDialog::~NewDcsDialog(){ } void NewDcsDialog::showCtrlBox(int type){ if(type==0){ // Silab USB ctrlLabel->show(); objectAssCtrlName->show(); }else if(type==3){ // GoeUSB ctrlLabel->hide(); objectAssCtrlName->hide(); // GoeUSB DCS items can only be ADCs objectDevType->setCurrentItem(1); objectDevType->setEnabled(false); }else{ ctrlLabel->hide(); objectAssCtrlName->hide(); objectDevType->setEnabled(true); } }