Ejemplo n.º 1
0
unsigned long
setRTCalarmMinutes(unsigned int minutes) {
	unsigned int h = *P_Hour;
	unsigned int m = *P_Minute;
	unsigned int delta_min, delta_hour;

	delta_min = minutes + m;
	delta_hour = delta_min / 60;
	delta_min = delta_min % 60;

	delta_hour += h;

	return(addAlarm(delta_hour, delta_min, *P_Second));
}
Ejemplo n.º 2
0
unsigned long
setRTCalarmSeconds(unsigned long seconds) {
	unsigned int h = *P_Hour;
	unsigned int m = *P_Minute;
	unsigned int s = *P_Second;
	unsigned int delta_min, delta_sec, delta_hour;
	
	delta_sec = (seconds + s) % 60;
	delta_min = (seconds + s) / 60;

	delta_min += m;
	delta_hour = delta_min / 60;
	delta_min = delta_min % 60;
	
	delta_hour += h;
	
	return(addAlarm(delta_hour, delta_min, delta_sec));
}
Ejemplo n.º 3
0
void
setPlus(int i) {
	unsigned int sec, min, hr;
	
	sec = *P_Second;
	min = *P_Minute;
	hr  = *P_Hour;
	min += i;
	if(min >= 60) {
		min = min - 60;
		hr++;
	}
	if(hr >= 24) {
		hr = 0;
		min = 0;
		sec = 2;
	}
	addAlarm(hr, min, sec);

}
Ejemplo n.º 4
0
void HAlarm::on_pushButton_clicked()
{

   if(action=="i")
   {


        if(addAlarm())
        {
            mod->select();
            filterTargets();
            QMessageBox::information(this,QApplication::applicationName(),"notifica registrata",QMessageBox::Ok);
        }
        else
        {
            QMessageBox::warning(this,QApplication::applicationName(),"errore\n"+db.lastError().text(),QMessageBox::Ok);
        }
        toggleUIInteractivity(false);
       }
   else if (action=="m")
   {


       if(updateAlarm())
       {
           mod->select();
           filterTargets();
           QMessageBox::information(this,QApplication::applicationName(),"modifiche salvate",QMessageBox::Ok);
       }
       else
       {
           QMessageBox::warning(this,QApplication::applicationName(),"errore salvando le modifiche",QMessageBox::Ok);
       }
       toggleUIInteractivity(false);
   }

   action="n";

   updateButtons(true,true,true,false,false);
   filterTargets();
}
Ejemplo n.º 5
0
unsigned long
setRTCalarmHours(unsigned int hours) {
	return(addAlarm(*P_Hour + hours, *P_Minute, *P_Second));
}