Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Tässä esimerkissä haetaan anturin kalibrointikäyrän arvot Sqlite tietokannasta

Code Block
bool SensorUnlinearityCorrection::LoadFromDatabase()
{
    int i;
    double todellinen, mitattu;
    QSqlQueryModel model;
    model.setQuery("SELECT todellinen, mitattu FROM sensori");
    CorrectVal.clear();
    ValFromSensor.clear();
    for (i = 0; i < model.rowCount(); i++) {
        todellinen = model.record(i).value("todellinen").toDouble();
        mitattu = model.record(i).value("mitattu").toDouble();
        CorrectVal.append(todellinen);
        ValFromSensor.append((mitattu));
    }
    return true;
}

 ddd
Code Block
 ddd
Code Block
 ddd
Code Block
 ddd