Skip to content

Commit fb66ba1

Browse files
authored
Merge pull request #192 from CWRUbotix/comp-measuring
Find full shipwreck measurements
2 parents e58c526 + 6f6d423 commit fb66ba1

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/surface/gui/gui/widgets/tabs/shipwreck.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949

5050
BLACK = QColor(Qt.GlobalColor.black)
5151

52+
SHIPWRECK_BOW_LENGTH_CM = 30 + 16.6
53+
5254

5355
class Eye(IntEnum):
5456
LEFT = 0
@@ -102,6 +104,10 @@ def has_all_points(
102104
)
103105

104106

107+
def format_length(length: float) -> str:
108+
return f'{length}, {length + SHIPWRECK_BOW_LENGTH_CM}'
109+
110+
105111
class ShipwreckTab(QWidget):
106112
click_left_signal = pyqtSignal(QMouseEvent)
107113
click_right_signal = pyqtSignal(QMouseEvent)
@@ -453,7 +459,7 @@ def calc_world_points(self) -> None:
453459
self.world_points_label.setText(
454460
f'3D (mm): {"\t".join([str(point) for point in world_points])}'
455461
)
456-
self.length_label.setText(f'Length (mm): {length}')
462+
self.length_label.setText(f'Length (mm): {format_length(length)}')
457463

458464
ds: dict[Eye, list[float]] = {Eye.LEFT: [], Eye.RIGHT: []}
459465
thetas: dict[Eye, list[float]] = {Eye.LEFT: [], Eye.RIGHT: []}
@@ -481,9 +487,11 @@ def calc_world_points(self) -> None:
481487
self.underwater_world_points_label.setText(
482488
f'3D (mm): {"\t".join([str(point) for point in uw_world_points])}'
483489
)
484-
self.underwater_length_label.setText(f'Length (mm): {uw_length}')
490+
self.underwater_length_label.setText(f'Length (mm): {format_length(uw_length)}')
485491

486-
self.scaled_length_label.setText(f'Length (mm): {uw_length * LENGTH_SCALE_FACTOR}')
492+
self.scaled_length_label.setText(
493+
'Length (mm): ' + format_length(uw_length * LENGTH_SCALE_FACTOR)
494+
)
487495

488496
@staticmethod
489497
def solve_stereo_projection(

0 commit comments

Comments
 (0)