Ejemplo n.º 1
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    graphics_ = GraphicsController::createInstance(ui->view_, ui->graphics_tab_);
    graphics_->addScene("Default");

    audio_ = new AudioController;

    stream_ = new StreamController(graphics_, audio_, ui->general_setting_, ui->encoder_setting_);

    connect(ui->show_hide_, SIGNAL(clicked()), this, SLOT(toggleShowHide()));
    connect(ui->start_stop_, SIGNAL(clicked()), this, SLOT(toggleStartStop()));
    connect(&time_updater_, SIGNAL(timeout()), this, SLOT(updateTime()));
}
Ejemplo n.º 2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    // gui independent initialization
    // app specific
    const QString appversion="2.0.2";
    const QString appdate="04.07.2016";
    const QString appname="PIHK";
    const QString appauthor="Frank Zimmermann";
    const QString appemail="*****@*****.**";

    // Timer related
    isTimerStarted=false;
    timerValue=0;
    offset=0;
    const QString version =  appname + "   (V" +appversion +", vom " + appdate + ")";
    timer = new QTimer(this);


    ui->setupUi(this);

    // gui dependent initialization
#ifdef Q_OS_OSX
    // OSX---
    setWindowIcon(QIcon("pihk2.icns"));
#else
    // Windows Q_OS_WIN
    setWindowIcon(QIcon("pihk2.ico"));
#endif
    statusLabel = new QLabel(this);
    statusLabel->setText(appemail);
    this->setFixedSize(this->geometry().width(),this->geometry().height());
    ui->listViewPRFG->setStyleSheet("background-color:lightgray;");
    ui->listViewMEPR->setStyleSheet("background-color:lightgray;");

    // gui stuff
    ui->pDate->setDate(QDate::currentDate());   // set current Date
    ui->lcdNumber->setPalette(Qt::black);       // set color for LCD
    this->setWindowTitle(version);              // set title
    ui->statusBar->addPermanentWidget(statusLabel);
    makeFilename();                             // construct basic file name
    ui->labelGradeA->setStyleSheet("QLabel { color : red; }");
    ui->labelGradeB->setStyleSheet("QLabel { color : red; }");
    ui->labelGradeResultA->setStyleSheet("QLabel { color : red; }");
    ui->labelGradeResultB->setStyleSheet("QLabel { color : red; }");
    ui->labelGradeResult->setStyleSheet("QLabel { color : red; }");
    ui->spinboxGa1E->setEnabled(false);
    ui->spinboxGa1E->hide();
    ui->spinboxGa1E->setValue(0);
    ui->spinboxGa2E->setEnabled(false);
    ui->spinboxGa2E->hide();
    ui->spinboxGa2E->setValue(0);
    ui->spinboxWisoE->setEnabled(false);
    ui->spinboxWisoE->hide();
    ui->spinboxWisoE->setValue(0);
    ui->radioButton1->setEnabled(false);
    ui->radioButton2->setEnabled(false);
    ui->radioButton3->setEnabled(false);


    // Connections
    connect(timer,SIGNAL(timeout()),this,SLOT(updateProgressBar()));
    connect(ui->startTimer,SIGNAL(clicked()),this,SLOT(toggleStartStop()));
    connect(ui->resetTimer,SIGNAL(clicked()),this,SLOT(timerReset()));
    connect(ui->pname,SIGNAL(textChanged(QString)),this,SLOT(makeFilename()));
    connect(ui->pnummer,SIGNAL(textChanged(QString)),this,SLOT(makeFilename()));
    connect(ui->pDate,SIGNAL(dateChanged(QDate)),this,SLOT(makeFilename()));
    connect(ui->folder,SIGNAL(textChanged(QString)),this,SLOT(makeFilename()));
    connect(ui->spinboxDocumentation,SIGNAL(valueChanged(double)),this,SLOT(writeResults()));
    connect(ui->spinboxExamination,SIGNAL(valueChanged(double)),this,SLOT(writeResults()));
    connect(ui->spinboxGa1,SIGNAL(valueChanged(double)),this,SLOT(writeResults()));
    connect(ui->spinboxGa2,SIGNAL(valueChanged(double)),this,SLOT(writeResults()));
    connect(ui->spinboxWiso,SIGNAL(valueChanged(double)),this,SLOT(writeResults()));
    connect(ui->spinboxGa1E,SIGNAL(valueChanged(double)),this,SLOT(writeResults()));
    connect(ui->spinboxGa2E,SIGNAL(valueChanged(double)),this,SLOT(writeResults()));
    connect(ui->spinboxWisoE,SIGNAL(valueChanged(double)),this,SLOT(writeResults()));
    connect(ui->radioButton1,SIGNAL(toggled(bool)),this,SLOT(writeResults()));
    connect(ui->radioButton2,SIGNAL(toggled(bool)),this,SLOT(writeResults()));
    connect(ui->radioButton3,SIGNAL(toggled(bool)),this,SLOT(writeResults()));
    connect(ui->saveFile,SIGNAL(clicked(bool)),this,SLOT(saveData()));
    connect(ui->buttonSimPRFG,SIGNAL(clicked()),this,SLOT(fillPRFG()));
    connect(ui->buttonSimMEPR,SIGNAL(clicked()),this,SLOT(fillMEPR()));
    connect(ui->listViewPRFG,SIGNAL(clicked(const QModelIndex &)),this,SLOT(setPointsPRFG(const QModelIndex &)));
    connect(ui->listViewMEPR,SIGNAL(clicked(const QModelIndex &)),this,SLOT(setPointsMEPR(const QModelIndex &)));
}