示例#1
0
//  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();
}
示例#2
0
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);
    }
}
示例#4
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;
}
示例#5
0
int16_t LightSensor::getScaledLight(){
    selectPort(inputPort);
    int16_t input = analogModule->readRawInput();
    return (int16_t)(input * scaleFactor);
}
示例#6
0
float LightSensor::getLight(){
    selectPort(inputPort);
    float reading = analogModule->readInput();
    return reading;
}
示例#7
0
float TemperatureSensor::getTemperature(){
    selectPort(inputPort);
    float reading = analogModule->readInput();
//    printf("Reading: %0.2f\n",reading);
    return reading*(25.0f/0.750f);
}
示例#8
0
void HEESItemWidget::selectBClicked()
{
    isPortA = false;
    emit selectPort();
}
示例#9
0
void HEESItemWidget::selectAClicked()
{
    isPortA = true;
    emit selectPort();
}