Skip to content

Commit

Permalink
fieldcheck: make and mark flake8-clean
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jan 2, 2024
1 parent abf0ff5 commit 4787a55
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions MAVProxy/modules/mavproxy_fieldcheck/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
- ensure parameters are correct
- add check that battery is within tolerances (chemistry issues...)
- autodetect numcells being incorrect
AP_FLAKE8_CLEAN
'''

import math
Expand All @@ -31,6 +34,7 @@
from MAVProxy.modules.lib.mp_menu import MPMenuItem
from MAVProxy.modules.lib.mp_menu import MPMenuSubMenu


class FieldCheck(object):
def __init__(self):
self.is_armed = False
Expand Down Expand Up @@ -370,7 +374,7 @@ def idle_task(self):
self.check_map_menu()

def FC_MPSetting(self, name, atype, default, description):
xname = "fc_%s_%s" % (self.lc_name, name)
# xname = "fc_%s_%s" % (self.lc_name, name)
return MPSetting(name, atype, default, description)

def select(self):
Expand Down Expand Up @@ -443,18 +447,22 @@ def cmd_fieldcheck(self, args):
print(usage)
return


class FieldCMAC(FieldCheck):
lc_name = "cmac"
location = mavutil.location(-35.363261, 149.165230, 584, 353)


class FieldSpringValley(FieldCheck):
location = mavutil.location(-35.281315, 149.005329, 581, 280)
lc_name = "springvalley"


class FieldSpringValleyBottom(FieldCheck):
location = mavutil.location(-35.2824450, 149.0053668, 593, 0)
lc_name = "springvalleybottom"


class FieldCheckModule(mp_module.MPModule):
def __init__(self, mpstate):

Expand Down Expand Up @@ -489,7 +497,6 @@ def try_select_field(self, loc):
self.whinge("Selecting field (%s)" % field.lc_name)
self.select_field(field)


def idle_task(self):
'''run periodic tasks'''
if self.field is not None:
Expand All @@ -510,6 +517,7 @@ def mavlink_packet(self, m):
return
self.field.mavlink_packet(m)


def init(mpstate):
'''initialise module'''
return FieldCheckModule(mpstate)

0 comments on commit 4787a55

Please sign in to comment.