MobileDive::MobileDive(dive *d) { m_thisDive = d; setDiveNumber(QString::number(d->number)); setDiveId(QString::number(d->id)); dive_trip *trip = d->divetrip; if(trip) { //trip is valid setTrip(trip->location); } setDate(get_dive_date_string(d->when)); setDepth(get_depth_string(d->maxdepth)); setDuration(get_dive_duration_string(d->duration.seconds, "h:","min")); setupDiveTempDetails(); weight_t tw = { total_weight(d) }; setWeight(weight_string(tw.grams)); setSuit(QString(d->suit)); setCylinder(QString(d->cylinder[0].type.description)); setSac(QString::number(d->sac)); setLocation(get_dive_location(d)); setNotes(d->notes); setBuddy(d->buddy); setDivemaster(d->divemaster); }
bool UniPAX::SBase::setAttribute(std::string& attribute, std::string& value, PersistenceManager& manager) { if (UniPAX::UIBase::setAttribute(attribute, value, manager)) return true; if (boost::iequals(attribute,"sboTerm")) { setSboTerm(value); return true; } if (boost::iequals(attribute,"metaId")) { setMetaId(value); return true; } if (boost::iequals(attribute,"notes")) { setNotes(value); return true; } if (boost::iequals(attribute,"annotation")) { setAnnotation(value); return true; } return false; }
void NotesDialog::testData() { QList<QPair<QString, QString> > notes; notes << qMakePair(QString("1"), QString("1")); notes << qMakePair(QString("2"), QString("2")); notes << qMakePair(QString("3"), QString("3")); setNotes(notes); }
//-------------------------------------------------------------- void AppCore::parameterChanged(int id, float value) { // cout << "slider id: " << ofToString(id) << " value: " << ofToString(value) << endl; switch (id) { case P_TRIGGER_THRESHOLD: reader->triggerThreshold = value; break; case P_MAX_VARIANCE: reader->maxVariance = value; break; case P_MAX_AVERAGE_WEIGHT: reader->maxAverageWeight = value; break; case P_NUM_LINES: numLines = (int) value; setNumLines(numLines); break; case P_ROOT_NOTE: rootNote = (int) value; setNotes(rootNote, mood); break; case P_ENVELOPE: setEnvelopeFactor(value); break; case P_VOLUME: volume = value; setVolume(volume); break; } }
int main(void) { //Code geoptimaliseerd voor bordje 3 //###1### //Initialize subsystems ClockInit(); //Initialize system clock (16 MHz) USARTInit(); //Initialize USART and bind to stdout,stdin AnalogInit(); //Initialize ADC AccInit(); //Initialize accelerometer system LEDInit(); //Initialize LEDs SwitchInit(); //Initialize switches EncoderInit(); //Initialize encoder SpeakerInit(); //Initialize speaker system //Enable interrupts PMIC.CTRL|=0b00000111; //Enable low, medium, high priority interrupts SREG|=0b10000000; //Globale interrupt enable //###2### //Print the digits 0 to 9 5x on terminal device //Reason this section didn't work: de variabelen 'a' is globaal gedefinieerd. In het subprogramma 'SimpleFunction()' wordt //de variabelen 'a' gebruikt. Na dit subprogramma is de waarde van 'a' gelijk aan 10 en zal de lus (a<5) onderbroken worden. for (a=0; a<5; a++) { SimpleFunction(); printf ("\r\n"); } //###3### //Main program loop a=0; ledOn=0b00001000; //Beeps(); //Genereer 3 beeps van 500hz, 1000hz, 1500hz (500 ms) setNotes(); //Stel een reeks van noten in playNextNote(); //Speel de eerste noot uit de reeks while(1) { LoopLicht(); //LoopLicht sequentie AccLezen(); //Accelerometer lezen printf("$SWITCH %d\r\n", SwitchGet()); //Switchwaarde over USARTD: 1: center, 2: rechts, 4: beneden, 8: links, 16: boven printf("$ACCRAW %d %d %d\r\n", RawAccX, RawAccY, RawAccZ); //Ongecalibreerde waardes accelerometer x, y, z over USARTD printf("$ACC__ %d %d %d\r\n", AccGetXAxis(RawAccX), AccGetYAxis(RawAccY), AccGetZAxis(RawAccZ)); //Gecalibreerde waardes accelerometer x, y, z over USARTD printf("$ENC__ %d\r\n", EncoderGetPos()); //printf ("Counter:%d\r\n",a); //printf("%c", 0x55); //Stuur de waarde 0x55 uit (0b01010101) //a++; _delay_ms(20); } }
void playNextNote(void) { if(notePointer != NULL) { SpeakerBeep(notePointer->Frequency, notePointer->Length); //Speel een noot lastNote = notePointer; notePointer = notePointer->Next; //Wijzig de pointer naar de nieuwe noot free(lastNote); //Verwijder de laatst afgespeelde noot uit het geheugen } else //Geen volgende noot beschikbaar { free(notePointer); //Verwijder de laatst afgespeelde noot uit het geheugen setNotes(); //Stel een reeks van noten in //playNextNote(); //Speel de eerste noot uit de reeks } }
void TestKeePass2Format::initTestCase() { QVERIFY(Crypto::init()); // read raw XML database bool hasError; QString errorString; m_xmlDb = readXml(QString(KEEPASSX_TEST_DATA_DIR).append("/NewDatabase.xml"), true, hasError, errorString); if (hasError) { QFAIL(qPrintable(QString("Error while reading XML: ").append(errorString))); } QVERIFY(m_xmlDb.data()); // construct and write KDBX to buffer auto key = QSharedPointer<CompositeKey>::create(); key->addKey(QSharedPointer<PasswordKey>::create("test")); m_kdbxSourceDb = QSharedPointer<Database>::create(); m_kdbxSourceDb->setKey(key); m_kdbxSourceDb->metadata()->setName("TESTDB"); Group* group = m_kdbxSourceDb->rootGroup(); group->setUuid(QUuid::createUuid()); group->setNotes("I'm a note!"); auto entry = new Entry(); entry->setPassword(QString::fromUtf8("\xc3\xa4\xa3\xb6\xc3\xbc\xe9\x9b\xbb\xe7\xb4\x85")); entry->setUuid(QUuid::createUuid()); entry->attributes()->set("test", "protectedTest", true); QVERIFY(entry->attributes()->isProtected("test")); entry->attachments()->set("myattach.txt", QByteArray("this is an attachment")); entry->attachments()->set("aaa.txt", QByteArray("also an attachment")); entry->setGroup(group); auto groupNew = new Group(); groupNew->setUuid(QUuid::createUuid()); groupNew->setName("TESTGROUP"); groupNew->setNotes("I'm a sub group note!"); groupNew->setParent(group); m_kdbxTargetBuffer.open(QBuffer::ReadWrite); writeKdbx(&m_kdbxTargetBuffer, m_kdbxSourceDb.data(), hasError, errorString); if (hasError) { QFAIL(qPrintable(QString("Error while writing database: ").append(errorString))); } // call sub class init method initTestCaseImpl(); }
//-------------------------------------------------------------- void AppCore::parameterChanged(int id, bool value) { // cout << "checkbox id: " << ofToString(id) << " value: " << ofToString(value) << endl; switch (id) { case P_REGULATION: reader->regulationActive = value; break; case P_MAJOR: mood = value ? MAJOR : MINOR; setNotes(rootNote, mood); break; #ifdef TARGET_ANDROID case P_USE_TORCH: ofxAndroidVideoGrabber * grabber = (ofxAndroidVideoGrabber *) reader->getGrabber(); grabber->setTorchActivated(value); break; #endif } }
AccessEventObject::AccessEventObject(int objectId, QString eventDate, QString physicianName, QString hospitalName, QString eventType, QString notes, int imageId, int documentId, int patientId, int accessId, QObject *parent) : QObject(parent) { setObjectId(objectId); setEventDate(eventDate); setPhysicianName(physicianName); setHospitalName(hospitalName); setEventType(eventType); setNotes(notes); setImageId(imageId); setDocumentId(documentId); setPatientId(patientId); setAccessId(accessId); }
//-------------------------------------------------------------- void AppCore::setNumLines(int arg){ numLines = arg; reader->numLines = numLines; triggers.resize(numLines, 0); // create / delete voices as needed if (numLines < synths.size()){ while (synths.size() > numLines){ Synth * st = synths.back(); synths.pop_back(); delete st; } } else { // open one patch per line / voice for(int i = synths.size(); i < numLines; ++i) { synths.push_back(new Synth()); } } setNotes(rootNote, mood); setVolume(volume); setEnvelopeFactor(envelopeFactor); }