[tuxdroid-svn] r655 - in software/gadgets/battery_monitor/trunk: . Battery_monitor_svn Battery_moni
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2007-10-31 15:27:36
|
Author: Paul_R Date: 2007-10-31 16:27:35 +0100 (Wed, 31 Oct 2007) New Revision: 655 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml Log: * Changed the gadget to not notify if the battery is full when the manager start Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py 2007-10-31 15:27:35 UTC (rev 655) @@ -264,9 +264,12 @@ # To prevent notifications at startup if self.start_flag == True or self.disable_event == True: + self.start_flag = False self.test_tab[0][7] = False self.disable_event = False self.start_flag = False + self.low_threshold_flag = False + self.high_threshold_flag = False for i in range (len(self.event_tab)): self.event_tab[i][7] = False @@ -289,34 +292,36 @@ # ########################################################### def absolute_threshold_low(self, value, value_off): + if self.absolute_threshold_low_flag == False: val = self.convert_value([0, 1, 0, value]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE - if val_prev >= val and val_act < val: + if val_act < val: self.absolute_threshold_low_flag = True return True else: val = self.convert_value([0, 1, 0, value_off]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE - if val_prev <= val and val_act > val: + if val_act > val: self.absolute_threshold_low_flag = False return False def absolute_threshold_high(self, value, value_off): + print self.absolute_threshold_high_flag if self.absolute_threshold_high_flag == False: val = self.convert_value([0, 1, 0, value]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE - if val_prev <= val and val_act > val: + if val_act > val: self.absolute_threshold_high_flag = True return True else: val = self.convert_value([0, 1, 0, value_off]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE - if val_prev >= val and val_act < val: + if val_act < val: self.absolute_threshold_high_flag = False return False Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp 2007-10-31 15:27:35 UTC (rev 655) @@ -410,6 +410,9 @@ self.measure.high_threshold = float(self.get_widget('txtHighThreshold').get_text()) _me.set_param('high_threshold', self.measure.high_threshold) + + self.measure.absolute_threshold_high_flag = False + self.measure.absolute_threshold_low_flag = False Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-31 15:27:35 UTC (rev 655) @@ -11,7 +11,7 @@ <widget_lblControl type='str'>Contrôle</widget_lblControl> <Increase type='str'>Le niveau de la batterie est passé en dessus du seuil</Increase> <full type='str'>Les batteries sont pleines</full> - <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> <lblLowThreshold type='str'>Limite inférieure</lblLowThreshold> <help_text type='str'>-- Les évènements : Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : @@ -73,7 +73,7 @@ <MainBehavior type='str'>Comportement principal</MainBehavior> <speaker_name type='str'>Bruno8k</speaker_name> <conf_lblSample type='str'>Points</conf_lblSample> - <charging type='str'>En charge</charging> + <conf_lblType type='str'>Type</conf_lblType> <Change type='str'>Le niveau de la batterie a changé</Change> <Both type='str'>Le niveau de la batterie a passé le seuil</Both> <conf_btnModify type='str'>Modifier</conf_btnModify> @@ -102,18 +102,18 @@ <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Changement</widget_lblChange> <name_to_read type='str'>Moniteur de batteries</name_to_read> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <Drop type='str'>Le niveau de la batterie a chuté</Drop> <conf_lblDrop type='str'>Chute</conf_lblDrop> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <Raise type='str'>Le niveau de la batterie a augmenté</Raise> - <conf_lblType type='str'>Type</conf_lblType> + <charging type='str'>En charge</charging> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <Decrease type='str'>Le niveau de la batterie est passé en dessous du seuil</Decrease> <conf_lblValue type='str'>Valeur (V)</conf_lblValue> <conf_lblRate type='str'>Rafraichissement</conf_lblRate> <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> - <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> <conf_lblControl type='str'>Contrôle</conf_lblControl> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-31 15:27:35 UTC (rev 655) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_description type='str'>Battery monitor for tux droid</gadget_description> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_name type='str'>battery_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> - <gadget_name type='str'>battery_monitor</gadget_name> - <gadget_description type='str'>Battery monitor for tux droid</gadget_description> </about> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-31 15:27:35 UTC (rev 655) @@ -1,11 +1,11 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <Sample type='float'>600.0</Sample> + <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <chkMotors type='bool'>True</chkMotors> <low_threshold type='float'>4.8</low_threshold> - <chkMotors type='bool'>True</chkMotors> <MainScript type='str'>None</MainScript> - <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <Sample type='float'>600.0</Sample> <Rate type='float'>1.0</Rate> <high_threshold type='float'>6.0</high_threshold> <config type='list'>[]</config> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-31 15:27:35 UTC (rev 655) @@ -3,15 +3,20 @@ <conf_lblIncrease type='str'>Increase</conf_lblIncrease> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> + <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <battery type='str'>On battery</battery> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <conf_lblRaise type='str'>Raise</conf_lblRaise> + <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> <Increase type='str'>The battery level exceeded the threshold</Increase> - <full type='str'>The level of the batteries is full</full> + <conf_btnModify type='str'>Modify</conf_btnModify> <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <lblLowThreshold type='str'>Lower limit</lblLowThreshold> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <lblMotors type='str'>Disable measurement when the motors are running</lblMotors> <help_text type='str'>--The events: Two main types of events can take place, each containing various options: @@ -47,41 +52,38 @@ When this window is displayed, the events stored in the settings window are not notified. This window makes it possible to try various configurations and to add them in the settings table.</help_text> <end_of_charge type='str'>The load of the battery is finished</end_of_charge> - <conf_btnRemove type='str'>Remove</conf_btnRemove> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> <widget_lblNotified type='str'>Notified</widget_lblNotified> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Update</gui_conf_update_title> <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <absolute_threshold_high type='str'>The batteries are full</absolute_threshold_high> - <conf_lblType type='str'>Type</conf_lblType> <mainscript type='str'>I've found the light !</mainscript> - <MainBehavior type='str'>Main behavior</MainBehavior> - <lblLowThreshold type='str'>Lower limit</lblLowThreshold> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <plugged type='str'>Plugged</plugged> - <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> <charge type='str'>and the batteries are recharging</charge> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> <low type='str'>The level of the batteries is weak</low> - <speaker_name type='str'>Ryan8k</speaker_name> + <conf_btnAdd type='str'>Add</conf_btnAdd> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblSample type='str'>Samples</conf_lblSample> - <charging type='str'>Charging</charging> + <conf_lblType type='str'>Type</conf_lblType> <Change type='str'>The battery level changed</Change> + <conf_lblValue type='str'>Value (V)</conf_lblValue> <Both type='str'>The battery level reached the threshold</Both> - <conf_btnModify type='str'>Modify</conf_btnModify> + <full type='str'>The level of the batteries is full</full> <widget_lblEvent type='str'>Event</widget_lblEvent> <normal type='str'>The level of the batteries is good</normal> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <conf_btnAdd type='str'>Add</conf_btnAdd> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <on_battery type='str'>and I'm powered by the battery</on_battery> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> @@ -89,33 +91,31 @@ <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblDrop type='str'>Drop</widget_lblDrop> - <ChangeD type='str'>The battery level dropped and raised</ChangeD> - <absolute_threshold type='str'>Weak batteries </absolute_threshold> - <lblMotors type='str'>Disable measurement when the motors are running</lblMotors> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> - <lblHighThreshold type='str'>Upper limit</lblHighThreshold> <widget_lblValue type='str'>Value (V)</widget_lblValue> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <speaker_name type='str'>Ryan8k</speaker_name> <plug type='str'>and the power supply is plugged</plug> - <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <absolute_threshold type='str'>Weak batteries </absolute_threshold> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Battery monitor</name_to_read> + <lblHighThreshold type='str'>Upper limit</lblHighThreshold> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <Drop type='str'>The battery level dropped</Drop> <conf_lblDrop type='str'>Drop</conf_lblDrop> - <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> + <ChangeD type='str'>The battery level dropped and raised</ChangeD> <Raise type='str'>The battery level raised</Raise> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <charging type='str'>Charging</charging> <widget_lblSet type='str'>Add to config</widget_lblSet> <Decrease type='str'>The battery level passed below the threshold</Decrease> - <conf_lblValue type='str'>Value (V)</conf_lblValue> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> + <MainBehavior type='str'>Main behavior</MainBehavior> + <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_lblControl type='str'>Control</conf_lblControl> - <widget_lblTest type='str'>Notifications</widget_lblTest> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> |