void AbstractContent::slotConfigure()
{
    ButtonItem * item = dynamic_cast<ButtonItem *>(sender());
    if (item)
        emit requestConfig(item->scenePos().toPoint());
    else
        emit requestConfig(scenePos().toPoint());
}
void getConfig() {
  if (safeMode) return; // bail out if we're in safemode
  // check with automation server to get latest config version number
  httpVer = requestConfig(false); // request config from server but don't update FS
  if (httpVer!=-1) { // automation server returned valid config version
    // compare FS config to server config - server config always wins
    if ((fsVer==-1) || (fsVer<httpVer)) { // failed to load config from FS or config outdated
      httpVer = requestConfig(true); // request config from server again, write to FS this time
      fsVer = loadConfig(false); // reload config from FS but don't reset firmware version
    }
  }
}
Beispiel #3
0
CriusGUI::CriusGUI(QWidget *parent) :
    QMainWindow(parent),
    ui_(new Ui::CriusGUI),
    active_(false),
    connected_(false)
{
    // Create SerialCommThread
    SerialCommThread* serial_thread = new SerialCommThread();
    QThread*  thread = new QThread;
    serial_thread->moveToThread(thread);
    connect(thread, SIGNAL(started()), serial_thread, SLOT(init()));

    connect(this, SIGNAL(loadFCConfig()), serial_thread, SLOT(requestConfig()));
    connect(this, SIGNAL(sendFCConfig(QByteArray)), serial_thread, SLOT(sendConfig(QByteArray)));
    connect(this, SIGNAL(sendSerialConfig(QString)),
            serial_thread,
            SLOT(connectSerial(QString)));
    connect(this, SIGNAL(sendSerialDisconnect()), serial_thread, SLOT(disconnectSerial()));

    connect(serial_thread, SIGNAL(sendData(QByteArray)), this, SLOT(getSerialData(QByteArray)));
    connect(serial_thread, SIGNAL(sendSerialPortInfo(QStringList)), this, SLOT(receiveSerialPortInfo(QStringList)));
    connect(this, SIGNAL(sendGotACK()), serial_thread, SLOT(receiveACK()));

    thread->start();

    // Setup UI
    ui_->setupUi(this);

    // Initialize plots
    imu_plot_= new TimePlot(ui_->imu_plot, ui_->imu_plot->geometry().width()/2, 6);
    control_plot_ = new TimePlot(ui_->control_plot,  ui_->control_plot->geometry().width()/2, 4);
}
void AbstractContent::mousePressEvent(QGraphicsSceneMouseEvent * event)
{
    QGraphicsItem::mousePressEvent(event);
    if (event->button() == Qt::RightButton) {
        scene()->clearSelection();
        setSelected(true);
        emit requestConfig(event->scenePos().toPoint());
    }
}
Beispiel #5
0
void TextContent::keyPressEvent(QKeyEvent * event){
    // use F2 to edit the text
    if (event->key() == Qt::Key_F2) {
        event->accept();
        emit requestConfig(mapToScene(contentRect().bottomRight()).toPoint());
        return;
    }
    AbstractContent::keyPressEvent(event);
}