maartentamboer / X-Touch-Mini-FS2020

Control FS2020 with a Behringer X-Touch Mini
https://dev-tty.nl/X-Touch-Mini-FS2020/
MIT License
57 stars 19 forks source link

Exception during execution of template #65

Closed rostykk closed 3 years ago

rostykk commented 3 years ago

is it normal for cj4 and 1.6.0 image

Loading config file: Configurations/config_cj4.json
Exception during execution of template: unsupported operand type(s) for /: 'NoneType' and 'float'
For template: {% set encoder_index = data.get_global_variable('HEADING_ENC_IDX') %}
{% set heading = (data.get_simvar_value('AUTOPILOT_HEADING_LOCK_DIR') / 27.0) | round %}
{{ data.set_encoder_led_value(encoder_index, heading) }}

Exception during execution of template: '>' not supported between instances of 'NoneType' and 'int'
For template: {% set button_index = data.get_global_variable('BATT_BUT_IDX') %}
{% set batt_load = data.get_simvar_value('ELECTRICAL_BATTERY_LOAD') %}
{% set battery_on = data.get_simvar_value('ELECTRICAL_MASTER_BATTERY') %}
{{ data.set_button_led(button_index, battery_on, blink=(batt_load > 0)) }}

Exception during execution of template: unsupported operand type(s) for /: 'NoneType' and 'float'
For template: {% set encoder_index = data.get_global_variable('HEADING_ENC_IDX') %}
{% set heading = (data.get_simvar_value('AUTOPILOT_HEADING_LOCK_DIR') / 27.0) | round %}
{{ data.set_encoder_led_value(encoder_index, heading) }}
elewarr commented 3 years ago

Is this happening continuously or only when loading/unloading aircraft?

rostykk commented 3 years ago

only when loading. in flight for sure heading lock is working

maartentamboer commented 3 years ago

When you're in the loading screen it can happen that the simconnect API does not respond because the system is too busy loading. This causes the get_simvar_value to return None. So you can ignore these exceptions