Commit 7deb0b50 authored by Milosz Malczak's avatar Milosz Malczak

server: made respective methods private

parent 90b0598f
......@@ -179,21 +179,21 @@ class UserApplication():
def __all_data_aligned(self, max_timestamp):
for channel_idx, channel in self.__channels.items():
timestamp = channel.timestamp_pre_post_data[0]['timestamp']
if(not self.check_if_equal(max_timestamp, timestamp, 1)):
if(not self.__check_if_equal(max_timestamp, timestamp, 1)):
return False
return True
def __remove_old_data(self, max_timestamp):
for channel_idx, channel in self.__channels.items():
timestamp = channel.timestamp_pre_post_data[0]['timestamp']
if(not self.check_if_equal(max_timestamp, timestamp, 1)):
if(not self.__check_if_equal(max_timestamp, timestamp, 1)):
channel.timestamp_pre_post_data.pop(0)
def __find_max(self):
max_timestamp = [0, 0]
for channel_idx, channel in self.__channels.items():
timestamp = channel.timestamp_pre_post_data[0]['timestamp']
if self.check_if_greater(timestamp, max_timestamp):
if self.__check_if_greater(timestamp, max_timestamp):
max_timestamp = timestamp
return max_timestamp
......@@ -229,7 +229,7 @@ class UserApplication():
data[channel_idx] = timestamp_pre_post_data['data_channel']
timestamps.append(timestamp_pre_post_data['timestamp'])
tic_diff = self.tic_difference(timestamp_pre_post_data['timestamp'],
tic_diff = self.__tic_difference(timestamp_pre_post_data['timestamp'],
timestamps[0])
offsets[channel_idx] = int(tic_diff)
pre_post = timestamp_pre_post_data['pre_post']
......@@ -305,7 +305,7 @@ class UserApplication():
'horizontal_settings': self.get_horiz_settings_copy()}
return user_app_settings
def tic_difference(self, timestamp_1, timestamp_2):
def __tic_difference(self, timestamp_1, timestamp_2):
[sec_1, tic_1] = timestamp_1
[sec_2, tic_2] = timestamp_2
......@@ -315,14 +315,14 @@ class UserApplication():
return tic_diff
def check_if_equal(self, timestamp_1, timestamp_2, available_offset_tics):
tic_diff = self.tic_difference(timestamp_1, timestamp_2)
def __check_if_equal(self, timestamp_1, timestamp_2, available_offset_tics):
tic_diff = self.__tic_difference(timestamp_1, timestamp_2)
if(tic_diff <= available_offset_tics
and tic_diff >= -available_offset_tics):
return True
return False
def check_if_greater(self, timestamp_1, timestamp_2):
def __check_if_greater(self, timestamp_1, timestamp_2):
[sec_1, tic_1] = timestamp_1
[sec_2, tic_2] = timestamp_2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment