Server: Add check_git_version parameter

This commit is contained in:
Arthur Golubtsov
2020-02-17 17:52:52 +03:00
parent d87ea4c389
commit 07456bd414
3 changed files with 7 additions and 2 deletions

View File

@@ -29,9 +29,10 @@ config_version = float(default='1.0')
__many__ = preset_param
[CHECKS]
check_git_version = boolean(default=True)
check_current_position = boolean(default=True)
# in meters
battery_min = float(default=50.0, min=0, max=100)
check_current_position = boolean(default=True)
# in meters
start_pos_delta_max = float(default=1.0, min=0)
# in seconds

View File

@@ -46,6 +46,7 @@ class ModelChecks:
start_pos_delta_max = 1.0
time_delta_max = 1.0
check_current_pos = True
check_git = True
@classmethod
def column_check(cls, column, pass_context=False):
@@ -75,6 +76,8 @@ class ModelChecks:
@ModelChecks.column_check("git_version")
def check_ver(item):
if not ModelChecks.check_git:
return True
return get_git_version() == item

View File

@@ -90,8 +90,9 @@ class ExitMsgbox(logging.Handler):
class ServerQt(Server):
def load_config(self):
super().load_config()
table.ModelChecks.battery_min = self.config.checks_battery_min
table.ModelChecks.check_git = self.config.checks_check_git_version
table.ModelChecks.check_current_pos = self.config.checks_check_current_position
table.ModelChecks.battery_min = self.config.checks_battery_min
table.ModelChecks.start_pos_delta_max = self.config.checks_start_pos_delta_max
table.ModelChecks.time_delta_max = self.config.checks_time_delta_max