mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
rc.autostart: add error reporting (#12527)
-Fixed bug : cd to /etc/init.d/airframes, but no cd after -Added error report to user if value of SYS_AUTOSTART param value is incorrect
This commit is contained in:
parent
a90c87a791
commit
487addbba5
@ -28,10 +28,10 @@ class RCOutput():
|
||||
"# 12000 .. 12999 Octo Cox\n"
|
||||
"# 13000 .. 13999 VTOL\n"
|
||||
"# 14000 .. 14999 Tri Y\n"
|
||||
""
|
||||
""
|
||||
"cd /etc/init.d/airframes\n"
|
||||
"\n")
|
||||
result += "\n"
|
||||
result += "set AIRFRAME none\n"
|
||||
result += "\n"
|
||||
for group in groups:
|
||||
result += "# GROUP: %s\n\n" % group.GetName()
|
||||
for param in group.GetParams():
|
||||
@ -62,7 +62,7 @@ class RCOutput():
|
||||
result += "# %s\n" % param.GetName()
|
||||
result += "if param compare SYS_AUTOSTART %s\n" % id_val
|
||||
result += "then\n"
|
||||
result += "\tsh %s\n" % path
|
||||
result += "\tset AIRFRAME %s\n" % path
|
||||
result += "fi\n"
|
||||
|
||||
#if long_desc is not None:
|
||||
@ -70,6 +70,17 @@ class RCOutput():
|
||||
result += "\n"
|
||||
|
||||
result += "\n"
|
||||
result += "\n"
|
||||
result += "if [ ${AIRFRAME} != none ]\n"
|
||||
result += "then\n"
|
||||
result += "\tsh /etc/init.d/airframes/${AIRFRAME}\n"
|
||||
if not post_start:
|
||||
result += "else\n"
|
||||
result += "\techo \"ERROR [init] No file matches SYS_AUTOSTART value found in : /etc/init.d/airframes\"\n"
|
||||
result += "\techo \"ERROR [init] No file matches SYS_AUTOSTART value found in : /etc/init.d/airframes\" >> $LOG_FILE\n"
|
||||
result += "\ttone_alarm ${TUNE_ERR}\n"
|
||||
result += "fi\n"
|
||||
result += "unset AIRFRAME"
|
||||
self.output = result
|
||||
|
||||
def Save(self, filename):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user