void LightSettings::saveConfig() { // safe call, always one selected. powerTypeChanged( b->powerSource->currentIndex() ); // Set settings for current power source if ( powerStatus.wallStatus() == QPowerStatus::Available ) currentMode = &externalMode; else currentMode = &batteryMode; QSettings cfg("Trolltech","qpe"); cfg.beginGroup("LockPower"); writeMode(cfg, &lockMode); cfg.endGroup(); cfg.beginGroup("BatteryPower"); writeMode(cfg, &batteryMode); cfg.endGroup(); cfg.beginGroup("ExternalPower"); writeMode(cfg, &externalMode); cfg.sync(); int i_dim = (currentMode->dim ? currentMode->intervalDim : 0); int i_lightoff = (currentMode->lightoff ? currentMode->intervalLightOff : 0); int i_suspend = (currentMode->suspend ? currentMode->intervalSuspend : 0); set_fl(currentMode->brightness); QtopiaServiceRequest e("QtopiaPowerManager", "setIntervals(int,int,int)" ); e << i_dim << i_lightoff << i_suspend; e.send(); }
void seissol::checkpoint::sionlib::Wavefield::write(const void* header, size_t headerSize) { SCOREP_USER_REGION("CheckPoint_write", SCOREP_USER_REGION_TYPE_FUNCTION); logInfo(rank()) << "Checkpoint backend: Writing."; int file = open(dataFile(odd()), writeMode()); checkErr(file); // Write the header SCOREP_USER_REGION_DEFINE(r_write_header); SCOREP_USER_REGION_BEGIN(r_write_header, "checkpoint_write_header", SCOREP_USER_REGION_TYPE_COMMON); checkErr(sion_coll_fwrite(header, headerSize, 1, file), 1); SCOREP_USER_REGION_END(r_write_header); // Save data SCOREP_USER_REGION_DEFINE(r_write_wavefield); SCOREP_USER_REGION_BEGIN(r_write_wavefield, "checkpoint_write_wavefield", SCOREP_USER_REGION_TYPE_COMMON); checkErr(sion_coll_fwrite(dofs(), sizeof(real), numDofs(), file), numDofs()); SCOREP_USER_REGION_END(r_write_wavefield); // Finalize the checkpoint finalizeCheckpoint(file); logInfo(rank()) << "Checkpoint backend: Writing. Done."; }
void VC1541::executeByteReady() { assert(bitoffset % 8 == 0); if (readMode() && !sync) { byteReady(read_shiftreg); } if (writeMode()) { write_shiftreg = via2.ora; byteReady(); } }
bool seissol::checkpoint::sionlib::Wavefield::init(size_t headerSize, unsigned long numDofs, unsigned int groupSize) { if (groupSize != 1) // TODO To read the sionlib file, we must use the same number of processes // (otherwise it gets very complicated). logError() << "The SIONlib backend does not support asynchronous MPI mode yet."; setChunkElementCount(numDofs); seissol::checkpoint::Wavefield::init(headerSize, numDofs, groupSize); logInfo(rank()) << "Using SIONlib mode" << writeMode() << "for writing checkpoints"; return exists(); }