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)
| 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): |