Skip to content

Commit

Permalink
last update before cs
Browse files Browse the repository at this point in the history
Signed-off-by: loowgood <88347485+Lz9000@users.noreply.github.com>
  • Loading branch information
lowg0d committed Mar 24, 2023
1 parent bde649b commit 1983f61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
11 changes: 4 additions & 7 deletions edvs/modules/managers/graph_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def update(self, value):
ping = self.last_update_time.msecsTo(now)
time_mission = ping / 1000

self.update_labels(self.total_time, ping)
self.update_state(value_chain[3])
self.update_labels(self.total_time, ping)

self.graph_temp.update(value_chain[0],time_mission)
self.graph_humidity.update(value_chain[1],time_mission)
Expand Down Expand Up @@ -98,7 +98,6 @@ def data_filter(self, value_chain):
return filtered_values

def update_state(self, altitude):
print(f"{float(altitude)} "+ f" {float(self.previous_altitude)}")
message = f"<b style='color:#16a085;'>// #IDLE</b>"

if float(altitude) > float(self.previous_altitude):
Expand All @@ -123,8 +122,6 @@ def update_state(self, altitude):

self.parent.ui.lb_state.setText(message)



# ================================================================= #

def update_labels(self, time, ping):
Expand All @@ -134,12 +131,12 @@ def update_labels(self, time, ping):
ping_color = "#d79921"
if ping > 5100:
ping_color = "#a8002a"

self.parent.ui.lb_countdown.setText(
f"<b style='color:rgba(235,235,255,0.4);'>{time:.2f}</b>S MIT")
f"<b style='color:rgba(235,235,255,0.4);'>{time:.2f}S</b> MIT")

self.parent.ui.lb_ping.setText(
f"<b style='color:{ping_color};'>{ping}</b>ms")
f"<b style='color:{ping_color};'>{ping} ms</b>")

# ================================================================= #

Expand Down
4 changes: 2 additions & 2 deletions edvs/modules/managers/serial_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def dummy_serial(self):
pressure = np.random.uniform(800, 1200)
random_value = np.random.randint(0, 6)

latitude = self.last_latitude + np.random.uniform(0.0001, 0.00001)
longitude = self.last_longitude + np.random.uniform(0.0001, 0.00001)
latitude = self.last_latitude + np.random.uniform(0.00001, 0.000001)
longitude = self.last_longitude + np.random.uniform(0.00001, 0.000001)

speed = np.random.uniform(0, 200)

Expand Down
1 change: 1 addition & 0 deletions edvs/modules/utility/graph_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def update(self, value, elapsed_time):

self.setXRange(self.ptr1 - elapsed_time, self.ptr1, padding=0.01)
self.graph_plot.setData(x=x_vals, y=smoothed_data)

# ================================================================= #
class GpsPlotWidget(pg.PlotItem):
def __init__(self, parent=None, labels={'bottom': 'Longitude', 'left': 'Latitude'}, title=None,
Expand Down

0 comments on commit 1983f61

Please sign in to comment.