Author Topic: A better way to set numbers ?  (Read 3300 times)

Nico1854

  • Guest
A better way to set numbers ?
« on: December 17, 2016, 12:20:11 AM »
I have to collect desired altitude and did it like in the attached printscreen :

I also have to request how much time a flight is planned to last and did it the same way, 1 hour, 1 hour 30 minutes, 2 hours, 2 hours 30 minutes ...

The question is to know if there would be a smarter way of doing this ?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: A better way to set numbers ?
« Reply #1 on: December 17, 2016, 06:04:23 AM »
Because the speech engine works best with predefined phrases, you're best off defining your values like you're doing.

If you want less command list clutter though, you can use dynamic command names:
Desired altitude [3..7][5;0]00 [feet;];Desired Altitude [8..18],000 [feet;]
Code: [Select]
Set integer [DesiredAltitude] value to the converted value of {TXTNUM:"{CMD}"}
Write '[Purple] Desired altitude {INT:DesiredAltitude}' to log

However, this does not currently work(in v1.6.1.7), even though it should. A bug report has been filed.

Also, "[feet]" won't make saying "feet" optional, "[feet;]" will.

EDIT: Alright, so the above example is a bust, for now. However, you can still use a single command to do it, it'll just have a longer name:
Desired altitude [3500;4000;4500;5000;5500;6000;6500;7000;7500;8000;9000;10000;11000;12000;13000;14000;15000;16000;17000;18000] [feet;]
Code: [Select]
Set integer [DesiredAltitude] value to the converted value of {TXTNUM:"{CMD}"}
Write '[Purple] Desired altitude {INT:DesiredAltitude}' to log
« Last Edit: December 17, 2016, 09:55:49 AM by Pfeil »