bool LMReader::nextFrame() {

	bool status = getline(infile, buf);
	fillFields();

	return status;

}
OsagoBlankDataForm::OsagoBlankDataForm(Driver *d, Driver::DriverTypes dType, bool *insurancerIsOwner, QWidget *parent) : OsagoBlankDataForm(parent)
{
    data = d;
    isOwner = insurancerIsOwner;
    fillFields();
    hideFields(dType);
    driverType = dType;
    on_checkBox_stateChanged(ui->checkBox->checkState());
}
Example #3
0
bool Simple::start(vpz::Condition& condition)
{
    build(false);
    fillFields(condition);

    if (m_dialog->run() == Gtk::RESPONSE_ACCEPT) {
	assign(condition);
    }
    m_dialog->hide();
    destroy();
    return true;
}
Example #4
0
ReceiptManager::ReceiptManager(const QString dbConnectionsString, const int id, QWidget *parent) :
    QDialog(parent),
    SqlExtension(dbConnectionsString),
    ui(new Ui::ReceiptManager)
{
    ui->setupUi(this);
    clearFields();
    fillFields(id);
    ui->pushButtonAddReceipt->setText("Обновить квитанцию");
    ui->pushButtonAddReceipt->setProperty("mode",id);
    setWindowTitle("Управление квитанцией №"+id);
    connect(ui->pushButtonAddReceipt, SIGNAL(clicked()), this, SLOT(accept()));
    connect(ui->pushButtonClose,SIGNAL(clicked()),this, SLOT(reject()));
}
Example #5
0
AddQuoteDialog::AddQuoteDialog(bool isBilling, int idCustomer, int id, bool copy, QWidget *parent) :
    QDialog(parent),
    _quote(0),
    ui(new Ui::AddQuoteDialog),
    _copy(copy),
    _idCustomer(idCustomer)
{
    ui->setupUi(this);
    Gui::Utils::WindowSettings::setPositionToCenter(*this);
    ui->wdgContributories =
            new Gui::Widgets::ContributoriesWidget(
                QSharedPointer<Customer>(new Customer(idCustomer)), this);
    connect(ui->wdgContributories,
            SIGNAL(contributoryChanged()),
            this,
            SLOT(updateBtn()));

    if (id != 0) {
        _quote = new Billing(id);
        fillFields();
        if (copy) {
            setQuoteIdNumber(0,isBilling);
            fillQuoteBillingCopy(isBilling);
            ui->dateEditQuote->setDate(QDate::currentDate());
        }
        else {
            ui->btnDocChange->hide();
            setWindowTitle((isBilling ? "Modifier la facture " : "Modifier le devis ")+
                           QString::number(getNumber())+ " de " +
                           (Customer(idCustomer).getCompany()));
        }
    } else {
        _quote = new Billing();
        setQuoteIdNumber(id, isBilling);
        ui->dateEditQuote->setDate(QDate::currentDate());
        ui->btnDocChange->hide();
        fillQuoteBilling(isBilling);
    }
    _quote->setIsBilling(isBilling);

    ui->_2->addWidget(ui->wdgContributories, 5, 0, 1, 2);
    emit ui->leQuoteTitle->textChanged(_quote->getTitle());
    ((Gui::Widgets::ContributoriesWidget*)ui->wdgContributories)->updateUi();
}
Example #6
0
bool TextReader::processOne(PointRef& point)
{
    if (!fillFields())
        return false;

    double d;
    for (size_t i = 0; i < m_fields.size(); ++i)
    {
        if (!Utils::fromString(m_fields[i], d))
        {
            log()->get(LogLevel::Error) << "Can't convert "
                "field '" << m_fields[i] << "' to numeric value on line " <<
                m_line << " in '" << m_filename << "'.  Setting to 0." <<
                std::endl;
            d = 0;
        }
        point.setField(m_dims[i], d);
    }
    return true;
}
Example #7
0
/// actual computation
void PoissonSolver::computeField(VField_Edge_t & EFD,
                                 VField_Cell_t & HFD,
                                 VField_Edge_t & JFD,
                                 const double & dt,
                                 const double & tol,
                                 const int & maxIterations)
{
    Mesh_t & mesh = EFD.get_mesh();
    FieldLayout<DIM> & FL = EFD.getLayout();
    const NDIndex<DIM> lDom = FL.getLocalNDIndex();

    _bunch.saveR();

    const GCS_t & gcs = EFD.getGuardCellSizes();

    Timings::startTimer(_setupTimer);
    Epetra_Map* Map = getGlobalElements();

    Teuchos::RCP<Epetra_Vector> LHS;
    LHS = Teuchos::rcp(new Epetra_Vector(*Map));

    Teuchos::RCP<Epetra_Vector> RHS;
    RHS = Teuchos::rcp(new Epetra_Vector(*Map));

    Teuchos::RCP<Epetra_CrsMatrix> A;
    A = Teuchos::rcp(new Epetra_CrsMatrix(Copy, *Map, 5));

    StencilGeometry(RHS, A);

    // print("PoissonMatrix.dat", RHS, A);

    Teuchos::ParameterList belosList;
    belosList.set( "Maximum Iterations", maxIterations );  // Maximum number of iterations allowed
    belosList.set( "Convergence Tolerance", tol );
    belosList.set( "Verbosity", (Belos::Errors +
                                 Belos::Warnings +
                                 Belos::TimingDetails +
                                 Belos::FinalSummary +
                                 Belos::StatusTestDetails) );

    Teuchos::ParameterList MLList;
    SetupMLList(MLList);

    Teuchos::RCP<ML_Epetra::MultiLevelPreconditioner> MLPrec =
        Teuchos::rcp(new ML_Epetra::MultiLevelPreconditioner(*A, MLList,false));

    MLPrec->ComputePreconditioner();
    Teuchos::RCP<Belos::EpetraPrecOp> prec = Teuchos::rcp(new Belos::EpetraPrecOp(MLPrec));

    Belos::LinearProblem<ST, MV, OP> problem;
    problem.setOperator(A);
    problem.setLHS(LHS);
    problem.setRHS(RHS);
    problem.setLeftPrec(prec);

    if (!problem.isProblemSet()) {
        if (!problem.setProblem()) {
            std::cerr << "\nERROR: Belos::LinearProblem failed to set up correctly!" << std::endl;
        }
    }

    Teuchos::RCP< Belos::SolverManager<ST, MV, OP> > solver;
    solver = Teuchos::rcp( new Belos::BlockCGSolMgr<ST, MV, OP>(Teuchos::rcp(&problem, false), Teuchos::rcp(&belosList, false)));
    Timings::stopTimer(_setupTimer);

    BinaryVtkFile vtkFile;
    SField_t rho(mesh, FL, gcs);

    _bunch.drift_particles(dt / 2);
    _bunch.scatterQ(rho);
    _bunch.drift_particles(-dt / 2);

    fillRHS(rho, RHS);
    LHS->Random();
    problem.setProblem(Teuchos::null, RHS);
    Timings::startTimer(_solveTimer);
    solver->solve();
    Timings::stopTimer(_solveTimer);
    plotPotential(vtkFile, LHS, EFD, 1);
    fillFields(LHS, EFD, HFD, 1);

    _bunch.move_by(Vector_t(-0.5 * _hr[0] / _gamma, 0.0));
    _bunch.scatterQ(rho);

    fillRHS(rho, RHS);
    shiftLHS(rho, LHS, 1.0);
    problem.setProblem(Teuchos::null, RHS);
    belosList.set("Convergence Tolerance", 1e-6);
    solver->setParameters(Teuchos::rcp(&belosList, false));
    Timings::startTimer(_solveTimer);
    solver->solve();
    Timings::stopTimer(_solveTimer);
    plotPotential(vtkFile, LHS, EFD, 2);
    fillFields(LHS, EFD, HFD, 2);

    _bunch.restoreR();

    _bunch.scatterQ(rho);

    vtkFile.addScalarField(rho, "rho");

    JFD = 0.0;
    JFD[lDom[0]][lDom[1]](0) += Physics::c * sqrt(1.0 - 1.0 / (_gamma * _gamma)) * rho[lDom[0]][lDom[1]];

    fillRHS(rho, RHS);
    shiftLHS(rho, LHS, -0.5);
    problem.setProblem(Teuchos::null, RHS);
    Timings::startTimer(_solveTimer);
    solver->solve();
    Timings::stopTimer(_solveTimer);
    plotPotential(vtkFile, LHS, EFD, 0);
    fillFields(LHS, EFD, HFD, 0);

    vtkFile.writeFile("Data/potential");

    delete Map;
}