/*********************************************************** * * incSetting * * * ***********************************************************/ void BulbRamp::incSetting(char buffer[],int inc) { switch (select_) { case BULB_DELAY: incOption(BULB_DELAY, 54000,inc); //max time in secs if(option(BULB_DELAY) == 0) //delay 0 is infinity { buffer[0] = 0; strcat(buffer,"Off"); strcat(buffer,"\0"); } else { formatTimeString(option(BULB_DELAY),buffer); } break; case BULB_DELTA: incOption(BULB_DELTA, 54000,inc); //max time in secs setIntervalLimits(); if(option(BULB_DELTA) == 0) //delay 0 is none { buffer[0] = 0; strcat(buffer,"-"); strcat(buffer,"\0"); } else { formatTimeString(option(BULB_DELTA),buffer); } break; case BULB_DURATION: incOption(BULB_DURATION, 54000,inc); setIntervalLimits(); if(option(BULB_DURATION) == 0) //duration 0 is none { buffer[0] = 0; strcat(buffer,"-"); strcat(buffer,"\0"); } else { formatTimeString(option(BULB_DURATION),buffer); } break; case BULB_STARTEXP: incDecFraction(BULB_STARTEXP,true,inc,buffer); setIntervalLimits(); break; case BULB_ENDEXP: incDecFraction(BULB_ENDEXP,true,inc,buffer); setIntervalLimits(); break; default: break; } }
/*********************************************************** * * decSetting * * * ***********************************************************/ void TimeLapse::decSetting(char buffer[],int dec) { switch (select_) { case TIME_DELAY: decOption(TIME_DELAY, 54000,dec); //max time in secs if(option(TIME_DELAY) == 0) //delay 0 is infinity { buffer[0] = 0; strcat(buffer,"Off"); strcat(buffer,"\0"); } else { formatTimeString(option(TIME_DELAY),buffer); //format and save string in buffer } break; case TIME_DELTA: decOption(TIME_DELTA, 54000,dec); //max time in secs if(option(TIME_DELTA) == 0) //delay 0 is none { buffer[0] = 0; strcat(buffer,"-"); strcat(buffer,"\0"); } else { formatTimeString(option(TIME_DELTA),buffer); } break; case TIME_NUMSHOTS: decOption(TIME_NUMSHOTS, 50000,dec); if(option(TIME_NUMSHOTS) == 0) //numshots 0 is infinity { buffer[0] = 0; char inf[2]; inf[0] = (char)243; inf[1] = '\0'; strcat(buffer,inf); strcat(buffer,"\0"); } else { utoa (option(TIME_NUMSHOTS),buffer,10); } break; default: break; } }
void WeatherWidget::setStatusFailed() { //return if were already in a failed state if(m_currentStatus == WeatherWidget::UpdateFailed) return; //start on the first status message statusStackedWidget->setCurrentIndex(0); //stop the updating movie and hide it statusMovie->stop(); statusMovieLabel->setVisible(false); QString updatedString; //generate a string to say when the last update occurred if(m_weatherData) updatedString = m_weatherData->lastUpdated().toString("MMM d ") + formatTimeString(m_weatherData->lastUpdated().time(), m_globalSettings->timeFormat()); else updatedString = "Never"; statusLabel->setText("Update Failed"); statusLabel2->setText("Last Update " + updatedString); //switch between failure message and last update message every 3 seconds statusMessageTimer.start(3000); m_currentStatus = WeatherWidget::UpdateFailed; }
/*********************************************************** * * getActiveMessage * * get the current sensors LCD message to print during trap Active mode. * ***********************************************************/ void TimeLapse::getActiveMessage(char buffer[]) { //buffer[0] = 0; //itoa (countDownInt(),buffer,10); formatTimeString(countDownInt(),buffer); }
QString SchedulePoint::time() { // output the current time represnted by this point's location int timeBlockCount = positionToTimeBlocks(); int hours = (timeBlockCount/4.0f); int minutes = (timeBlockCount%4) *15; QTime time(hours%24, minutes); return formatTimeString(time, m_globalSettings->timeFormat()); }
void WeatherWidget::setStatusUpdated() { statusMessageTimer.stop(); //start on the first status message statusStackedWidget->setCurrentIndex(0); statusMovieLabel->setVisible(false); statusMovie->stop(); if(m_weatherData) { QString updatedString = m_weatherData->lastUpdated().toString("MMM d 'at' ") + formatTimeString(m_weatherData->lastUpdated().time(), m_globalSettings->timeFormat()); statusLabel->setText("Updated " + updatedString); } else statusLabel->setText("Updated"); m_currentStatus = WeatherWidget::UpdateSuccess; }