// Slot - Called everytime a serial device is detected/removed // Refresh the COM ports list // void MenuSettings::updateComboPorts() { ui->cmbPorts->clear(); ui->cmbPorts->addItems( settings->getAvailablePorts() ); selectPort(); }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { scene = new HEESSystemScene; ui->setupUi(this); // Add items to the combo box ui->compTypeBox->addItem(QString("Source")); ui->compTypeBox->addItem(QString("Bank")); ui->compTypeBox->addItem(QString("Load")); ui->compTypeBox->addItem(QString("CTI")); ui->compTypeBox->addItem(QString("Converter")); ui->compTypeBox->addItem(QString("Manager")); ui->compTypeBox->setCurrentIndex(0); ui->graphicsView->setScene( scene ); connect(scene, SIGNAL(selectionChanged()), this, SLOT(selectionChangedInScene()) ); connect(ui->itemWidget, SIGNAL(selectPort()), this, SLOT(selectPortInScene()) ); connect(scene, SIGNAL(portSelected(HEESGraphicsItem*)), ui->itemWidget, SLOT(portSelectedFromScene(HEESGraphicsItem*))); connect(ui->itemWidget, SIGNAL(removeItem(HEESGraphicsItem*)), this, SLOT(removeItemInScene(HEESGraphicsItem*))); connect(ui->openAction, SIGNAL(triggered()), this, SLOT(openFile()) ); connect(ui->saveAction, SIGNAL(triggered()), this, SLOT(saveFile()) ); connect(ui->newAction, SIGNAL(triggered()), this, SLOT(newFile()) ); }
void SerialWaiterDialog::refreshPortList(){ selected = false; form->confirm_button->setEnabled(false); form->port_list->clear(); for(QSerialPortInfo& info : QSerialPortInfo::availablePorts()){ form->port_list->addItem(info.portName()+" "+info.description(),info.portName()); } if(form->port_list->count() == 1){ form->port_list->setCurrentIndex(0); selectPort(0); } }
IOService *SuperIOMonitor::probe(IOService *provider, SInt32 *score) { DebugLog("probing..."); if (super::probe(provider, score) != this) return 0; for (UInt8 i = 0; i < getPortsCount(); i++) { selectPort(i); enter(); if (probePort()) { exit(); return this; } exit(); } return 0; }
int16_t LightSensor::getScaledLight(){ selectPort(inputPort); int16_t input = analogModule->readRawInput(); return (int16_t)(input * scaleFactor); }
float LightSensor::getLight(){ selectPort(inputPort); float reading = analogModule->readInput(); return reading; }
float TemperatureSensor::getTemperature(){ selectPort(inputPort); float reading = analogModule->readInput(); // printf("Reading: %0.2f\n",reading); return reading*(25.0f/0.750f); }
void HEESItemWidget::selectBClicked() { isPortA = false; emit selectPort(); }
void HEESItemWidget::selectAClicked() { isPortA = true; emit selectPort(); }