From d08bbc3b727c0c5071065d5a5fd7e9646c21c267 Mon Sep 17 00:00:00 2001 From: Arthur Golubtsov Date: Tue, 21 Jan 2020 06:16:43 +0300 Subject: [PATCH] Server: Fix start position delta detection --- Server/copter_table_models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Server/copter_table_models.py b/Server/copter_table_models.py index 17dd975..95e4627 100644 --- a/Server/copter_table_models.py +++ b/Server/copter_table_models.py @@ -158,8 +158,8 @@ class StatedCopterData(CopterData): self.states.__dict__[key] = \ ModelChecks.checks_dict[self.attrs_dict.keys().index(key)](value) if key == 'start_position': - if (self.__dict__['position'] is not None) and (self.__dict__['start_position'] is not None): - current_pos = get_position(self.__dict__['position']) + if (self.__dict__['current_position'] is not None) and (self.__dict__['start_position'] is not None): + current_pos = get_position(self.__dict__['current_position']) start_pos = get_position(self.__dict__['start_position']) delta = get_position_delta(current_pos, start_pos) if delta != 'NO_POS': @@ -313,7 +313,7 @@ class CopterDataModel(QtCore.QAbstractTableModel): super(CopterDataModel, self).__init__(parent) # self.headers = list(columns_names.values()) # todo self.headers = (' copter ID ', ' version ', ' animation ID ', ' battery ', ' fcu_status ', ' sensors ', - ' mode ', ' checks ', ' current x y z yaw frame_id ', ' start x y z ', ' task ', ' dt ') + ' mode ', ' checks ', ' current x y z yaw frame_id ', ' start x y z ', ' task ', 'dt') self.data_contents = [] self.checks = checks