void ButtonsVA::createButtons(tgui::Gui* gui) 
{
    tgui::Button::Ptr buttonPlay(*gui);
    buttonPlay->load(THEME_CONFIG_FILE);
    buttonPlay->setPosition(0, 570);
    buttonPlay->setText("Play");
    buttonPlay->setCallbackId(1);
    buttonPlay->bindCallback(tgui::Button::LeftMouseClicked);
    buttonPlay->setSize(30, 30);
    _bpl = buttonPlay;
    gui->add(buttonPlay,"buttonPlay");
    

    tgui::Button::Ptr buttonPause(*gui);
    buttonPause->load(THEME_CONFIG_FILE);
    buttonPause->setPosition(60, 570);
    buttonPause->setText("Pause");
    buttonPause->setCallbackId(2);
    buttonPause->bindCallback(tgui::Button::LeftMouseClicked);
    buttonPause->setSize(30, 30);
    _bpa = buttonPause;
    gui->add(buttonPause,"buttonPause");

    tgui::Button::Ptr buttonStop(*gui);
    buttonStop->load(THEME_CONFIG_FILE);
    buttonStop->setPosition(120, 570);
    buttonStop->setText("Stop");
    buttonStop->setCallbackId(3);
    buttonStop->bindCallback(tgui::Button::LeftMouseClicked);
    buttonStop->setSize(30, 30);
    _bst = buttonStop;
    gui->add(buttonStop,"buttonStop");
}
Beispiel #2
0
/******************************************************************************
** ScanSurfaceDialog
*/
ScanSurfaceDialog::ScanSurfaceDialog(QWidget *p)
    : QDialog(p)
{
    setupUi(this);

    parent = static_cast<MainWindow*>(p);

    cnc = parent->mk1;

    setStyleSheet(parent->programStyleSheet);

    selectedX = -1;
    selectedY = -1;

    Scan = false;

    //     QString n = QString::number(1.01);
    //     toDecimalPoint = (n.indexOf(",") > 0) ? ',' : '.';
    //     fromDecimalPoint = (toDecimalPoint == ',') ? '.' : ',';

    indexScanX = 0;
    indexScanY = 0;
    indexMaxScanX = 0;
    indexMaxScanY = 0;

    scanThread = NULL;

    numSpeed->setValue(200);
    numReturn->setValue(400);

    //TODO: loading data from the matrix
    surfaceArr = parent->surfaceMatrix;

    sizeY = surfaceArr.count();
    sizeX = 0;

    if (sizeY > 0) {
        sizeX = surfaceArr[0].count();
    }

    // ruled is the old
    // hermite and cubic are new
    QStringList ls = (QStringList() << "Ruled" << "Hermite-Spline" << "Quadric");
    comboZ->addItems(ls);

    comboGrid->addItems((QStringList() << "10" << "5" << "3" << "2" << "1"));

    translateDialog();

    startOffsetX->setValue(Settings::coord[X].posMm());
    startOffsetY->setValue(Settings::coord[Y].posMm());
    startOffsetZ->setValue(Settings::coord[Z].posMm());


    connect(pushOk, SIGNAL(clicked()), this, SLOT(onSave()));
    connect(pushCancel, SIGNAL(clicked()), this, SLOT(reject()));

    connect(pushButtonScan, SIGNAL(clicked()), this, SLOT(onScan()));
    connect(pushButtonTest, SIGNAL(clicked()), this, SLOT(onTestScan()));

    connect(checkBoxViewOnly,  SIGNAL(stateChanged ( int)), this, SLOT(checkBoxChanged(int)));

    // start offset
    connect(startOffsetX, SIGNAL(valueChanged(QString)), this, SLOT(writeDataGridHeader()));
    connect(startOffsetY, SIGNAL(valueChanged(QString)), this, SLOT(writeDataGridHeader()));

    connect(startOffsetZ, SIGNAL(valueChanged(QString)), this, SLOT(valueChanged()));

    connect(deltaStepX, SIGNAL(valueChanged(QString)), this, SLOT(writeDataGridHeader()));
    connect(numCountX, SIGNAL(valueChanged(QString)), this, SLOT(resizeDataGrid()));
    connect(deltaStepY, SIGNAL(valueChanged(QString)), this, SLOT(writeDataGridHeader()));
    connect(numCountY, SIGNAL(valueChanged(QString)), this, SLOT(resizeDataGrid()));

    connect(numSpeed, SIGNAL(valueChanged(int)), this, SLOT(valueSpeedChanged(int)));
    connect(numReturn, SIGNAL(valueChanged(int)), this, SLOT(valueReturnChanged(int)));

    connect(dataGridView, SIGNAL(itemChanged ( QTableWidgetItem * )), this, SLOT(itemChanged(QTableWidgetItem*)));
    connect(dataGridView, SIGNAL(itemClicked ( QTableWidgetItem * )), this, SLOT(itemClicked(QTableWidgetItem*)));
    connect(dataGridView, SIGNAL(cellActivated ( int, int )), this, SLOT(cellActivated(int, int)));

    connect(toolButtonZUp, SIGNAL(pressed()), this, SLOT(buttonPlusZDown()));
    connect(toolButtonZUp, SIGNAL(released()), this, SLOT(buttonStop()));
    connect(toolButtonZSet, SIGNAL(clicked()), this, SLOT(buttonSetZ()));
    //     connect(toolButtonZSet, SIGNAL(released()), this, SLOT(valueChanged()));
    connect(toolButtonZDown, SIGNAL(pressed()), this, SLOT(buttonMinusZDown()));
    connect(toolButtonZDown, SIGNAL(released()), this, SLOT(buttonStop()));
    connect(toolButtonMove, SIGNAL(clicked(bool)), this, SLOT(valueChanged()));
    //     connect(toolButtonMove, SIGNAL(released()), this, SLOT(valueChanged()));

    label10->setText("");

    adjustSize();
}