l shems's blog View Details
Archive for November, 2017
Posted by l shems | Nov 14, 2017 @ 02:45 PM | 4,521 Views
OK, last topic to cover in this series.

We have succesfully made a graph showing some source value with a 'One-time' script, and used some library functions to get it loaded as a widget.

Now I want to use it on the Taranis as well. Let's first just run it and see what happens:

Quote:
Script error: /Scripts/TELEM/Graph.lua:68: bad argument #6 to 'drawLine' (number expected, got nil)
So what's on line 68:
Code:
    lcd.drawLine(0          ,P.y0    ,LCD_W-1    ,P.y0      ,DOTTED ,CURVE_AXIS_COLOR)
Well, something must be provided here, but this global is not known on the Taranis, so it get's a nil value.
Let's add it at the first line of the script, and give it some value we DO know in the Taranis. And at the same time define the other colors:
Code:
CURVE_AXIS_COLOR = GREY(12)
LINE_COLOR = GREY(8)
CURVE_COLOR = GREY(4)
TEXT_COLOR = GREY(15) 
MAINVIEW_PANES_COLOR = GREY_DEFAULT
Well, it's running (either use the standard "go.lua" script we wrote in the other post, or add the 'background()' call to the first line of the 'run' command.)

Name: screenshot_x9d+_17-11-14_20-41-16.png
Views: 61
Size: 1.4 KB
Description:


Posted by l shems | Nov 05, 2017 @ 08:09 AM | 3,981 Views
We are going to create a graphing script from scratch, using the widget framework to support Horus as well . Main requirements:
  1. Any source, selectable as option
  2. Fully scalable to support different lcd and widget sizes
  3. First-In-First-Out fixed timeframe drawing buffer
  4. Adjustable timeframe width with 'plus' and 'minus'
  5. Autoscale on height
  6. Reset on 'exit' and restart on 'enter'

Name: screenshot_x12s_17-11-15_19-01-22.png
Views: 186
Size: 35.3 KB
Description:

Well, that sounds nice, no?

Let's start .....