yaapu / HorusMappingWidget

Offline GPS Mapping Widget for Horus and T16 radios
GNU General Public License v3.0
91 stars 25 forks source link

no default sensor settings #9

Closed StefanKellerAC closed 4 years ago

StefanKellerAC commented 4 years ago

please load a default sensor definition file, when no specific one is found. eg: default_sensors_maps.lua

yaapu commented 4 years ago

Hi, there's no such thing as a default sensors file, each controller exposes telemetry with different sensor names. You're welcome to contribute examples for your specific use cases.

StefanKellerAC commented 4 years ago

I fly gliders and guess I will use for all or most of them the same layout. to avoid multi copies of this file I made a default file with that layout.

Therefore I changed loading this way:

utils.loadCustomSensors = function()
  local success, sensorScript = pcall(loadScript,getSensorsConfigFilename())
  if sensorScript == nil then
    success, sensorScript = pcall(loadScript,"/SCRIPTS/YAAPU/CFG/default_sensors_maps.lua")
  end

another question: what is the difference between ckecking success and sensorscript == nil ?

yaapu commented 4 years ago

ok, this makes much more sense, if a model specific is not found use default, ok I like this approach.

StefanKellerAC commented 4 years ago

lua is better to understand than text :-)