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

    QObject::connect(FlowMeterManager::Instance, SIGNAL(PourStarted()), this, SLOT(onPourStarted()));
    QObject::connect(FlowMeterManager::Instance, SIGNAL(PourFinished()), this, SLOT(onPourFinished()));
    QObject::connect(FlowMeterManager::Instance, SIGNAL(FlowMeterTicked()), this, SLOT(onFlowMeterTick()));

    connect(&updateTimer, SIGNAL(timeout()), this, SLOT(updateUI()));
    connect(this, SIGNAL(updateCamImageSignal()), this, SLOT(updateCamImageSlot()));

    ticksPerLiter = Settings::GetDouble("ticksPerLiter");
    logPours = Settings::GetBool("logPours");
    photoFrequency = Settings::GetInt("pourPhotoFrequency");

    currentUser = User::UnknownUser;
    currentPour = NULL;

    ui->usersComboBox->view()->setItemDelegate(new CustomComboBoxItem(this));
    vector<User*>::iterator iter;
    for (iter = User::UsersList.begin(); iter != User::UsersList.end(); ++iter)
    {
        User* user = (*iter);
        ui->usersComboBox->addItem(QString(user->Name.c_str()));
    }
    connect(ui->usersComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(userSelectedSlot(int)));
}
Ejemplo n.º 2
0
void FlowMeterManager::FinishPour()
{
    IsPouring = false;
    updateTimer.stop();

    emit PourFinished();
}