Skip to content

Commit

Permalink
make instance
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Jun 15, 2024
1 parent 7db8d5e commit f4581da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/surface/gui/gui/widgets/float_comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def __init__(self) -> None:
self.received_second_half = False
self.completed_profile_one = False

counter = 0

@pyqtSlot(FloatData)
def handle_data(self, msg: FloatData) -> None:
"""
Expand Down Expand Up @@ -162,11 +164,10 @@ def handle_serial(self, msg: FloatSerial) -> None:
self.console.moveCursor(QTextCursor.MoveOperation.End)
self.console.insertPlainText(f'{msg.serial}\n')

counter = 0

@pyqtSlot(FloatSingle)
def handle_single(self, msg: FloatSingle) -> None:
FloatComm.counter += 1
self.counter += 1

self.team_number.setText(f"Team #: {msg.team_number}")
self.time.setText(f"Time: {msg.time_ms} (ms)")
Expand All @@ -178,4 +179,4 @@ def handle_single(self, msg: FloatSingle) -> None:
if msg.average_pressure != float():
self.average_pressure.setText(f"Avg Pressure: {avg_pressure} (kPa)")
else:
self.average_pressure.setText(f"Avg Pressure: {FloatComm.counter}/5")
self.average_pressure.setText(f"Avg Pressure: {self.counter}/5")

0 comments on commit f4581da

Please sign in to comment.