Skip to content

Commit ba14adf

Browse files
committed
Address copilot review comments
1 parent c9034af commit ba14adf

2 files changed

Lines changed: 21 additions & 14 deletions

File tree

gcs/src/missions.jsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -611,17 +611,17 @@ export default function Missions() {
611611
</p>
612612
)}
613613

614-
{(missionProgressModalData.progress !== null ||
615-
missionProgressModalData !== undefined) && (
616-
<Progress
617-
color="lime"
618-
animated
619-
size="lg"
620-
transitionDuration={300}
621-
value={missionProgressModalData.progress * 100}
622-
className="w-full mx-auto my-auto"
623-
/>
624-
)}
614+
{missionProgressModalData.progress !== null &&
615+
missionProgressModalData.progress !== undefined && (
616+
<Progress
617+
color="lime"
618+
animated
619+
size="lg"
620+
transitionDuration={300}
621+
value={missionProgressModalData.progress * 100}
622+
className="w-full mx-auto my-auto"
623+
/>
624+
)}
625625
</div>
626626
</Modal>
627627

radio/app/controllers/missionController.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,17 @@ def _getCommandName(self, command: int) -> str:
9090
return f"Unknown command {command}"
9191

9292
def getCurrentMission(
93-
self, mission_type: int, progressUpdateCallback: Optional[Callable] = None
93+
self,
94+
mission_type: int,
95+
progressUpdateCallback: Optional[Callable[[str, float], None]] = None,
9496
) -> Response:
9597
"""
9698
Get the current mission of a specific type from the drone.
9799
98100
Args:
99101
mission_type (int): The type of mission to get. 0=Mission,1=Fence,2=Rally.
100102
progressUpdateCallback (Optional[Callable]): A callback function to update the progress of the mission fetch.
103+
The callback should accept a string message and a float progress value.
101104
"""
102105
mission_type_check = self._checkMissionType(mission_type)
103106
if not mission_type_check.get("success"):
@@ -159,14 +162,17 @@ def getCurrentMissionAll(self) -> Response:
159162
}
160163

161164
def getMissionItems(
162-
self, mission_type: int, progressUpdateCallback: Optional[Callable] = None
165+
self,
166+
mission_type: int,
167+
progressUpdateCallback: Optional[Callable[[str, float], None]] = None,
163168
) -> Response:
164169
"""
165170
Get all mission items of a specific type from the drone.
166171
167172
Args:
168173
mission_type (int): The type of mission to get. 0=Mission,1=Fence,2=Rally.
169174
progressUpdateCallback (Optional[Callable]): A callback function to update the progress of the mission fetch.
175+
The callback should accept a string message and a float progress value.
170176
"""
171177
mission_type_check = self._checkMissionType(mission_type)
172178
if not mission_type_check.get("success"):
@@ -537,7 +543,7 @@ def uploadMission(
537543
self,
538544
mission_type: int,
539545
waypoints: List[dict],
540-
progressUpdateCallback: Optional[Callable] = None,
546+
progressUpdateCallback: Optional[Callable[[str, float], None]] = None,
541547
) -> Response:
542548
"""
543549
Uploads the current mission to the drone. This method overwrites the current loader if the upload is successful.
@@ -546,6 +552,7 @@ def uploadMission(
546552
mission_type (int): The type of mission to upload. 0=Mission,1=Fence,2=Rally.
547553
waypoints (List[dict]): The list of waypoints to upload. Each waypoint should be a dict with the required fields.
548554
progressUpdateCallback (Optional[Callable]): A callback function to update the progress of the mission writing.
555+
The callback should accept a string message and a float progress value.
549556
"""
550557
mission_type_check = self._checkMissionType(mission_type)
551558
if not mission_type_check.get("success"):

0 commit comments

Comments
 (0)