MCPcopy
hub / github.com/dronekit/dronekit-python / upload

Method upload

dronekit/__init__.py:2704–2719  ·  view source on GitHub ↗

Call ``upload()`` after :py:func:`adding ` or :py:func:`clearing ` mission commands. After the return from ``upload()`` any writes are guaranteed to have completed (or thrown an exception) and future reads will see their effects.

(self)

Source from the content-addressed store, hash-verified

2702 self._vehicle._wpts_dirty = True
2703
2704 def upload(self):
2705 """
2706 Call ``upload()`` after :py:func:`adding <CommandSequence.add>` or :py:func:`clearing <CommandSequence.clear>` mission commands.
2707
2708 After the return from ``upload()`` any writes are guaranteed to have completed (or thrown an
2709 exception) and future reads will see their effects.
2710 """
2711 if self._vehicle._wpts_dirty:
2712 self._vehicle._master.waypoint_clear_all_send()
2713 if self._vehicle._wploader.count() > 0:
2714 self._vehicle._wp_uploaded = [False] * self._vehicle._wploader.count()
2715 self._vehicle._master.waypoint_count_send(self._vehicle._wploader.count())
2716 while False in self._vehicle._wp_uploaded:
2717 time.sleep(0.1)
2718 self._vehicle._wp_uploaded = None
2719 self._vehicle._wpts_dirty = False
2720
2721 @property
2722 def count(self):

Callers 6

flushMethod · 0.80
test_empty_clearFunction · 0.80
test_parameterFunction · 0.80
flight_replay.pyFile · 0.80
upload_missionFunction · 0.80
adds_square_missionFunction · 0.80

Calls 1

countMethod · 0.45

Tested by 2

test_empty_clearFunction · 0.64
test_parameterFunction · 0.64