Merged checklist-rework
Signed-off-by: merspieler <merspieler@users.noreply.github.com>
This commit is contained in:
commit
96306505f9
55 changed files with 154 additions and 690 deletions
__init__.py
dialog/en-us
check.after.ldg.apu.dialogcheck.after.ldg.radar.dialogcheck.after.ldg.spoilers.dialogcheck.after.ldg.wx.dialogcheck.after.start.anti.ice.dialogcheck.after.start.pitch.trim.dialogcheck.after.start.rudder.trim.dialogcheck.appr.min.dialogcheck.before.start.beacon.dialogcheck.before.start.cockpit.preparation.dialogcheck.before.start.fuel.quantity.dialogcheck.before.start.gear.pin.dialogcheck.before.start.thr.lever.dialogcheck.before.start.to.data.dialogcheck.before.start.window.dialogcheck.climb.gear.up.dialogcheck.general.adirs.dialogcheck.general.apu.bleed.dialogcheck.general.baro.ref.dialogcheck.general.briefing.dialogcheck.general.ecam.status.dialogcheck.general.eng.mode.sel.dialogcheck.general.flaps.dialogcheck.general.packs.dialogcheck.general.parking.break.dialogcheck.general.seat.belts.dialogcheck.general.signs.dialogcheck.ldg.no.blue.dialogcheck.parking.eng.dialogcheck.parking.fuel.pumps.dialogcheck.parking.lights.dialogcheck.securing.apu.bat.dialogcheck.securing.emer.exit.lt.dialogcheck.securing.oxygen.dialogcheck.taxi.atc.dialogcheck.taxi.cabin.crew.dialogcheck.taxi.flaps.settings.dialogcheck.taxi.flight.controls.dialogcheck.taxi.flight.instruments.dialogcheck.taxi.tcas.dialogcheck.taxi.to.no.blue.dialogcheck.taxi.to.rwy.dialogcheck.taxi.v.spd.dialog
vocab/en-us
768
__init__.py
768
__init__.py
|
@ -22,6 +22,8 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
self.settings['port'] = 8081
|
self.settings['port'] = 8081
|
||||||
self.write_default_profiles()
|
self.write_default_profiles()
|
||||||
|
|
||||||
|
# TODO make it possible, to play a .mp3 file instead of tts
|
||||||
|
|
||||||
#################################################################
|
#################################################################
|
||||||
# #
|
# #
|
||||||
# Actions #
|
# Actions #
|
||||||
|
@ -214,629 +216,109 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
else:
|
else:
|
||||||
self.speak_dialog("gear.not.retractable")
|
self.speak_dialog("gear.not.retractable")
|
||||||
|
|
||||||
|
|
||||||
#################################################################
|
#################################################################
|
||||||
# #
|
# #
|
||||||
# Checklists #
|
# Checklists #
|
||||||
# #
|
# #
|
||||||
#################################################################
|
#################################################################
|
||||||
|
|
||||||
# TODO make it possible, to play a .mp3 file instead of tts
|
@intent_handler(IntentBuilder('CheckListIntent').require('check.list'))
|
||||||
# TODO read checklists from fg
|
def handle_check_list_intent(self, message):
|
||||||
|
|
||||||
#################################
|
tn = self.connect()
|
||||||
# #
|
|
||||||
# Before Start Check #
|
cl_request = message.data['utterance']
|
||||||
# #
|
|
||||||
#################################
|
checklist_count = self.get_item_count(tn, "/sim/checklists")
|
||||||
|
|
||||||
|
if checklist_count == 0:
|
||||||
|
self.speak("No checklists has been found")
|
||||||
|
self.exit(tn)
|
||||||
|
|
||||||
|
for i in range(0, checklist_count):
|
||||||
|
checklist = i
|
||||||
|
checklist_title = self.get_prop(tn, "/sim/checklists/checklist[" + str(checklist) + "]/title")
|
||||||
|
checklist_title = checklist_title.replace('/', '|')
|
||||||
|
checklist_title = "^" + checklist_title
|
||||||
|
match = re.search(checklist_title, cl_request, re.I)
|
||||||
|
|
||||||
|
if match != None:
|
||||||
|
self.speak(checklist_title + " checklist")
|
||||||
|
break
|
||||||
|
|
||||||
@intent_handler(IntentBuilder('BeforeStartCheckIntent').require('before.start.check'))
|
|
||||||
def handle_before_start_check_intent(self, message):
|
|
||||||
# TODO make checklist plane specific
|
|
||||||
response = self.get_response("check.before.start.cockpit.preparation")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'completed', response, re.I)
|
|
||||||
if match == None:
|
if match == None:
|
||||||
self.speak("Checklist not completed")
|
self.speak("Required checklist wasn't found")
|
||||||
sys.exit(0)
|
self.exit(tn)
|
||||||
|
|
||||||
response = self.get_response("check.before.start.gear.pin")
|
# TODO make the programm use all pages, not only the first
|
||||||
if response == None:
|
page = ""
|
||||||
self.speak("Checklist not completed")
|
if self.prop_exist(tn, "page", "/sim/checklists/checklist[" + str(checklist) + "]") == 1:
|
||||||
sys.exit(0)
|
page = "page/"
|
||||||
match = re.search(r'removed', response, re.I)
|
|
||||||
if match == None:
|
item_count = self.get_item_count(tn, "/sim/checklists/checklist[" + str(checklist) + "]/" + page)
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
if item_count == 0:
|
||||||
|
self.speak("The required checklist has no entrys")
|
||||||
response = self.get_response("check.general.signs")
|
self.exit(tn)
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
for i in range(0, item_count):
|
||||||
sys.exit(0)
|
item = i
|
||||||
match = re.search(r'on', response, re.I)
|
item_name = self.get_prop(tn, "/sim/checklists/checklist[" + str(checklist) + "]/" + page + "item[" + str(item) + "]/name")
|
||||||
if match == None:
|
item_value = self.get_prop(tn, "/sim/checklists/checklist[" + str(checklist) + "]/" + page + "item[" + str(item) + "]/value")
|
||||||
self.speak("Checklist not completed")
|
item_name = self.expand_adverbations(item_name)
|
||||||
sys.exit(0)
|
item_name = item_name.replace('/', ' ') # maybe make the replace '/' -> ' and ' to be spoken out better
|
||||||
|
self.speak(item_name)
|
||||||
response = self.get_response("check.general.adirs")
|
|
||||||
if response == None:
|
response = self.get_response("dummy")
|
||||||
self.speak("Checklist not completed")
|
if response == None:
|
||||||
sys.exit(0)
|
self.speak("Checklist not completed")
|
||||||
match = re.search(r'nav', response, re.I)
|
sys.exit(0)
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
# check if F/O has to confirm as well
|
||||||
sys.exit(0)
|
item_value_check = re.sub("\(BOTH\)", "", item_value, flags=re.I) # Add more indication of this case, that are used in other A/C
|
||||||
|
fo_conf = 0
|
||||||
response = self.get_response("check.before.start.fuel.quantity")
|
if item_value_check != item_value:
|
||||||
if response == None:
|
fo_conf = 1
|
||||||
self.speak("Checklist not completed")
|
item_value = item_value_check
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'check|checked', response, re.I)
|
item_value = self.expand_adverbations(item_value)
|
||||||
if match == None:
|
item_value = re.sub('/', '|', item_value)
|
||||||
self.speak("Checklist not completed")
|
item_value = re.sub('_', '', item_value)
|
||||||
sys.exit(0)
|
item_value = re.sub('\(', ' ', item_value)
|
||||||
|
item_value = re.sub('\)', ' ', item_value)
|
||||||
response = self.get_response("check.before.start.to.data")
|
response = self.expand_adverbations(response)
|
||||||
if response == None:
|
match = re.search(item_value, response, re.I)
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
if match == None:
|
||||||
match = re.search(r'set', response, re.I)
|
self.speak("Checklist not completed")
|
||||||
if match == None:
|
sys.exit(0)
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
if fo_conf == 1:
|
||||||
|
self.speak(item_value)
|
||||||
response = self.get_response("check.general.baro.ref")
|
|
||||||
if response == None:
|
self.speak(checklist_title + " checklist completed")
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
@intent_handler(IntentBuilder('FlightControlCheckIntent').require('flight.control.check'))
|
||||||
match = re.search(r'set', response, re.I)
|
def handle_securing_check_intent(self, message):
|
||||||
if match == None:
|
self.speak("Full up")
|
||||||
self.speak("Checklist not completed")
|
sleep(2)
|
||||||
sys.exit(0)
|
self.speak("Full down")
|
||||||
|
sleep(2)
|
||||||
response = self.get_response("check.before.start.window")
|
self.speak("Neutral")
|
||||||
if response == None:
|
sleep(2)
|
||||||
self.speak("Checklist not completed")
|
self.speak("Full left")
|
||||||
sys.exit(0)
|
sleep(2)
|
||||||
match = re.search(r'close|closed', response, re.I)
|
self.speak("Full right")
|
||||||
if match == None:
|
sleep(2)
|
||||||
self.speak("Checklist not completed")
|
self.speak("Neutral")
|
||||||
sys.exit(0)
|
sleep(2)
|
||||||
|
self.speak("Full left")
|
||||||
response = self.get_response("check.before.start.beacon")
|
sleep(4)
|
||||||
if response == None:
|
self.speak("Full right")
|
||||||
self.speak("Checklist not completed")
|
sleep(4)
|
||||||
sys.exit(0)
|
self.speak("Neutral")
|
||||||
match = re.search(r'on', response, re.I)
|
sleep(2)
|
||||||
if match == None:
|
self.speak("Flight controls checked")
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.before.start.thr.lever")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'idle', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.parking.break")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'on|off|set', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
self.speak("Before start checklist completed")
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# #
|
|
||||||
# After Start Check #
|
|
||||||
# #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
@intent_handler(IntentBuilder('AfterStartCheckIntent').require('after.start.check'))
|
|
||||||
def handle_after_start_check_intent(self, message):
|
|
||||||
# TODO make checklist plane specific
|
|
||||||
response = self.get_response("check.after.start.anti.ice")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'on|off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.ecam.status")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'checked|check', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.after.start.pitch.trim")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'set', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.after.start.rudder.trim")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'0|zero', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
self.speak("After start checklist completed")
|
|
||||||
|
|
||||||
#########################
|
|
||||||
# #
|
|
||||||
# Taxi Check #
|
|
||||||
# #
|
|
||||||
#########################
|
|
||||||
|
|
||||||
@intent_handler(IntentBuilder('TaxiCheckIntent').require('taxi.check'))
|
|
||||||
def handle_taxi_check_intent(self, message):
|
|
||||||
# TODO make checklist plane specific
|
|
||||||
response = self.get_response("check.taxi.flight.controls")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'checked|check', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.taxi.flight.instruments")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'checked|check', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.briefing")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'confirmed', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.taxi.flaps.settings")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'set', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.taxi.v.spd")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'set', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.taxi.atc")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'set', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.taxi.to.no.blue")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'no blue|all green', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.taxi.to.rwy")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'confirmed', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.taxi.cabin.crew")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'confirmed|advised', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.taxi.tcas")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'TA|RA|on', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.eng.mode.sel")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'on|off|norm|normal|start', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.packs")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'on|off|packs?', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
self.speak("Before start checklist completed")
|
|
||||||
|
|
||||||
#########################
|
|
||||||
# #
|
|
||||||
# Climb Check #
|
|
||||||
# #
|
|
||||||
#########################
|
|
||||||
|
|
||||||
@intent_handler(IntentBuilder('ClimbCheckIntent').require('climb.check'))
|
|
||||||
def handle_climb_check_intent(self, message):
|
|
||||||
# TODO make checklist plane specific
|
|
||||||
response = self.get_response("check.climb.gear.up")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'up|retracted', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.flaps")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'up|retracted|0', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.packs")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'on', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.baro.ref")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'set', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
self.speak("After take off checklist completed")
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# #
|
|
||||||
# Approach Check #
|
|
||||||
# #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
@intent_handler(IntentBuilder('ApprCheckIntent').require('appr.check'))
|
|
||||||
def handle_appr_check_intent(self, message):
|
|
||||||
# TODO make checklist plane specific
|
|
||||||
response = self.get_response("check.general.briefing")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'confirmed', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.ecam.status")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'checked|check', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.seat.belts")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'on', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.baro.ref")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'set', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.appr.min")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'set', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.eng.mode.sel")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'on|off|norm|normal|start', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
self.speak("Approach checklist completed")
|
|
||||||
|
|
||||||
#########################
|
|
||||||
# #
|
|
||||||
# LDG Check #
|
|
||||||
# #
|
|
||||||
#########################
|
|
||||||
|
|
||||||
@intent_handler(IntentBuilder('LDGCheckIntent').require('ldg.check'))
|
|
||||||
def handle_ldg_check_intent(self, message):
|
|
||||||
# TODO make checklist plane specific
|
|
||||||
response = self.get_response("check.ldg.no.blue")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'no blue|all green', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
self.speak("Landing checklist completed")
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# #
|
|
||||||
# After LDG Check #
|
|
||||||
# #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
@intent_handler(IntentBuilder('AfterLDGCheckIntent').require('after.ldg.check'))
|
|
||||||
def handle_after_ldg_check_intent(self, message):
|
|
||||||
# TODO make checklist plane specific
|
|
||||||
response = self.get_response("check.general.flaps")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'up|retracted', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.after.ldg.spoilers")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'disarmed', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.after.ldg.apu")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off|on|start', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.after.ldg.radar")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.after.ldg.wx")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
self.speak("After landing checklist completed")
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# #
|
|
||||||
# Parking Check #
|
|
||||||
# #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
@intent_handler(IntentBuilder('ParkingCheckIntent').require('parking.check'))
|
|
||||||
def handle_parking_check_intent(self, message):
|
|
||||||
# TODO make checklist plane specific
|
|
||||||
response = self.get_response("check.general.apu.bleed")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'on', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.parking.eng")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.seat.belts")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.parking.lights")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.parking.fuel.pumps")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.parking.break")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'on|off|set', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
self.speak("Parking checklist completed")
|
|
||||||
|
|
||||||
#################################
|
|
||||||
# #
|
|
||||||
# Securing Check #
|
|
||||||
# #
|
|
||||||
#################################
|
|
||||||
|
|
||||||
@intent_handler(IntentBuilder('SecuringCheckIntent').require('securing.check'))
|
|
||||||
def handle_securing_check_intent(self, message):
|
|
||||||
# TODO make checklist plane specific
|
|
||||||
response = self.get_response("check.general.adirs")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.securing.oxygen")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.apu.bleed")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.securing.emer.exit.lt")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.general.signs")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
response = self.get_response("check.securing.apu.bat")
|
|
||||||
if response == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
match = re.search(r'off', response, re.I)
|
|
||||||
if match == None:
|
|
||||||
self.speak("Checklist not completed")
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
@intent_handler(IntentBuilder('FlightControlCheckIntent').require('flight.control.check'))
|
|
||||||
def handle_securing_check_intent(self, message):
|
|
||||||
self.speak("Full up")
|
|
||||||
sleep(2)
|
|
||||||
self.speak("Full down")
|
|
||||||
sleep(2)
|
|
||||||
self.speak("Neutral")
|
|
||||||
sleep(2)
|
|
||||||
self.speak("Full left")
|
|
||||||
sleep(2)
|
|
||||||
self.speak("Full right")
|
|
||||||
sleep(2)
|
|
||||||
self.speak("Neutral")
|
|
||||||
sleep(2)
|
|
||||||
self.speak("Full left")
|
|
||||||
sleep(4)
|
|
||||||
self.speak("Full right")
|
|
||||||
sleep(4)
|
|
||||||
self.speak("Neutral")
|
|
||||||
sleep(2)
|
|
||||||
self.speak("Flight controls checked")
|
|
||||||
|
|
||||||
#################################################################
|
#################################################################
|
||||||
# #
|
# #
|
||||||
|
@ -1084,7 +566,7 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
|
|
||||||
return tn
|
return tn
|
||||||
|
|
||||||
# running an nasal command
|
# running a nasal command
|
||||||
def nasal_exec(self, tn, call):
|
def nasal_exec(self, tn, call):
|
||||||
tn.write("nasal\r\n")
|
tn.write("nasal\r\n")
|
||||||
tn.write(call + "\r\n")
|
tn.write(call + "\r\n")
|
||||||
|
@ -1108,9 +590,23 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
ret = ret + 1
|
ret = ret + 1
|
||||||
|
|
||||||
ret = ret - 1
|
ret = ret - 1
|
||||||
tn.write("cd /\r\n")
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
# checks if a property exists at a given path
|
||||||
|
def prop_exist(self, tn, prop, path):
|
||||||
|
tn.write("ls " + path + "\r\n")
|
||||||
|
found = 0
|
||||||
|
result = " "
|
||||||
|
|
||||||
|
while result != "":
|
||||||
|
result = tn.read_until("\n", 1)
|
||||||
|
match = re.search(prop, result, re.I)
|
||||||
|
if match != None:
|
||||||
|
found = 1
|
||||||
|
break
|
||||||
|
|
||||||
|
return found
|
||||||
|
|
||||||
# get ip address
|
# get ip address
|
||||||
def get_ip(self):
|
def get_ip(self):
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
@ -1266,6 +762,46 @@ class FlightGearCopilotSkill(MycroftSkill):
|
||||||
self.settings['profiles'] = profiles
|
self.settings['profiles'] = profiles
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# expands adverbations to full words
|
||||||
|
def expand_adverbations(self, text):
|
||||||
|
# TODO reduce collisions when used with other a/c
|
||||||
|
# TODO add more adverbations
|
||||||
|
text = re.sub("\sALT\s?", "altitude", text, flags=re.I)
|
||||||
|
text = re.sub("L/G", "landing gear", text, flags=re.I)
|
||||||
|
text = re.sub("SPLRS", "spoilers", text, flags=re.I)
|
||||||
|
text = re.sub("PREP", "preperation", text, flags=re.I)
|
||||||
|
text = re.sub("^TO ", "take off ", text)
|
||||||
|
text = re.sub(" TO$", " take off", text) # have it twice to prevent collisions with words containing 'to'
|
||||||
|
text = re.sub("REF", "reference", text, flags=re.I)
|
||||||
|
text = re.sub("A/SKID", "anti skid", text, flags=re.I)
|
||||||
|
text = re.sub("N/W", "nose weel", text, flags=re.I)
|
||||||
|
text = re.sub("A/THR", "auto thrust", text, flags=re.I)
|
||||||
|
text = re.sub(" THR ", "thrust", text, flags=re.I)
|
||||||
|
text = re.sub("Eng ", "engine", text, flags=re.I)
|
||||||
|
text = re.sub("Mstr", "master", text, flags=re.I)
|
||||||
|
text = re.sub("PB", "push button", text, flags=re.I)
|
||||||
|
text = re.sub("man", "manual", text, flags=re.I)
|
||||||
|
text = re.sub("FLT", "flight", text, flags=re.I)
|
||||||
|
text = re.sub("INST", "instruments", text, flags=re.I)
|
||||||
|
text = re.sub("TEMP", "temperature", text, flags=re.I)
|
||||||
|
text = re.sub(" LT", "light", text, flags=re.I)
|
||||||
|
text = re.sub("SEL", "selector", text, flags=re.I)
|
||||||
|
text = re.sub("LDG", "landing", text, flags=re.I)
|
||||||
|
text = re.sub("MDA", "minimum decent altitude", text, flags=re.I)
|
||||||
|
text = re.sub("DH", "decision height", text, flags=re.I)
|
||||||
|
text = re.sub("EXT", "external", text, flags=re.I)
|
||||||
|
text = re.sub("FLX", "flex", text, flags=re.I)
|
||||||
|
text = re.sub("EMER", "emergency", text, flags=re.I)
|
||||||
|
text = re.sub("BRK", "break", text, flags=re.I)
|
||||||
|
text = re.sub("KG", "kilogram", text, flags=re.I)
|
||||||
|
text = re.sub("LB", "pounds", text, flags=re.I)
|
||||||
|
text = re.sub("LBS", "pounds", text, flags=re.I)
|
||||||
|
text = re.sub("AS RQRD", "on|set|off|normal", text, flags=re.I) # since we don't know, what is needed in the current situation
|
||||||
|
text = re.sub("CONF", "config", text, flags=re.I)
|
||||||
|
text = re.sub(" OR ", "|", text, flags=re.I)
|
||||||
|
text = re.sub("0", "zero", text, flags=re.I)
|
||||||
|
return text
|
||||||
|
|
||||||
# exit routine to properly close the tn con
|
# exit routine to properly close the tn con
|
||||||
def exit(self, tn):
|
def exit(self, tn):
|
||||||
tn.close
|
tn.close
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
A P U
|
|
|
@ -1 +0,0 @@
|
||||||
Radar
|
|
|
@ -1 +0,0 @@
|
||||||
Spoilers
|
|
|
@ -1 +0,0 @@
|
||||||
Predictive windshear system
|
|
|
@ -1 +0,0 @@
|
||||||
Anti ice
|
|
|
@ -1 +0,0 @@
|
||||||
Pitch trim
|
|
|
@ -1 +0,0 @@
|
||||||
Rudder trim
|
|
|
@ -1 +0,0 @@
|
||||||
Minimum
|
|
|
@ -1 +0,0 @@
|
||||||
Beacon
|
|
|
@ -1 +0,0 @@
|
||||||
Cockpit preparation
|
|
|
@ -1 +0,0 @@
|
||||||
Fuel quantity
|
|
|
@ -1 +0,0 @@
|
||||||
Gear pins and covers
|
|
|
@ -1 +0,0 @@
|
||||||
Thrust lever
|
|
|
@ -1 +0,0 @@
|
||||||
Take off data
|
|
|
@ -1 +0,0 @@
|
||||||
Windows and doors
|
|
|
@ -1 +0,0 @@
|
||||||
Landing gear
|
|
|
@ -1 +0,0 @@
|
||||||
A D I R S
|
|
|
@ -1 +0,0 @@
|
||||||
APU bleed
|
|
|
@ -1 +0,0 @@
|
||||||
Baro reference
|
|
|
@ -1 +0,0 @@
|
||||||
Briefing
|
|
|
@ -1 +0,0 @@
|
||||||
ECAM status
|
|
|
@ -1 +0,0 @@
|
||||||
Engine mode selector
|
|
|
@ -1 +0,0 @@
|
||||||
Flaps
|
|
|
@ -1 +0,0 @@
|
||||||
Packs
|
|
|
@ -1 +0,0 @@
|
||||||
Parking break
|
|
|
@ -1 +0,0 @@
|
||||||
Seat belts
|
|
|
@ -1 +0,0 @@
|
||||||
Signs
|
|
|
@ -1 +0,0 @@
|
||||||
Landing no blue
|
|
|
@ -1 +0,0 @@
|
||||||
Engines
|
|
|
@ -1 +0,0 @@
|
||||||
Fuel pumps
|
|
|
@ -1,2 +0,0 @@
|
||||||
Lights
|
|
||||||
External lights
|
|
|
@ -1 +0,0 @@
|
||||||
APU and Battery
|
|
|
@ -1 +0,0 @@
|
||||||
Emergency exit lights
|
|
|
@ -1 +0,0 @@
|
||||||
Oxygen
|
|
|
@ -1 +0,0 @@
|
||||||
ATC
|
|
|
@ -1 +0,0 @@
|
||||||
Cabin crew
|
|
|
@ -1 +0,0 @@
|
||||||
Flaps settings
|
|
|
@ -1 +0,0 @@
|
||||||
Flight controls
|
|
|
@ -1 +0,0 @@
|
||||||
Flight instruments
|
|
|
@ -1 +0,0 @@
|
||||||
TCAS
|
|
|
@ -1 +0,0 @@
|
||||||
ECAM, take off no blue
|
|
|
@ -1 +0,0 @@
|
||||||
Take off runway
|
|
|
@ -1 +0,0 @@
|
||||||
V1, VR and V2
|
|
|
@ -1,2 +0,0 @@
|
||||||
after landing check list
|
|
||||||
after landing checklist
|
|
|
@ -1,2 +0,0 @@
|
||||||
After start checklist
|
|
||||||
After start check list
|
|
|
@ -1,3 +0,0 @@
|
||||||
approach check
|
|
||||||
approach check list
|
|
||||||
approach checklist
|
|
|
@ -1,2 +0,0 @@
|
||||||
Before start checklist
|
|
||||||
Before start check list
|
|
2
vocab/en-us/check.list.voc
Normal file
2
vocab/en-us/check.list.voc
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
check list
|
||||||
|
checklist
|
|
@ -1,4 +0,0 @@
|
||||||
after take off checklist
|
|
||||||
after take off check list
|
|
||||||
climb checklist
|
|
||||||
climb check list
|
|
|
@ -1,3 +0,0 @@
|
||||||
Flight control check
|
|
||||||
Flight controls check
|
|
||||||
Flight controls
|
|
|
@ -1,2 +0,0 @@
|
||||||
landing check list
|
|
||||||
landing checklist
|
|
|
@ -1,2 +0,0 @@
|
||||||
parking check list
|
|
||||||
parking checklist
|
|
|
@ -1,6 +0,0 @@
|
||||||
Securing checklist
|
|
||||||
Securing check list
|
|
||||||
Securing the aircraft checklist
|
|
||||||
Securing the aircraft check list
|
|
||||||
Securing aircraft checklist
|
|
||||||
Securing aircraft check list
|
|
|
@ -1,4 +0,0 @@
|
||||||
taxi checklist
|
|
||||||
taxi check list
|
|
||||||
before take off checklist
|
|
||||||
before take off check list
|
|
Loading…
Add table
Reference in a new issue