Thanx!Een matrix kan een array van arrays zijn (meer is het niet) dus dat moet kunnen. Denk dat je ook een array van structs kan maken, nog mooier. Zoek maar eens op structs.
Ik heb het als volgt opgelost:
Vullen van de tabel:
Code:
-- =======
-- Displaying history
-- =======
history[lnchnr]={} -- declare history table as a "struct"(?)
history[lnchnr]["maxAlt"] = maxAlt -- fill the current maxAlt in the row corresponding with the flight number
history[lnchnr]["lnchAlt"] = lnchAlt -- fill the current Launch alt. in the row corresponding with the flight number
history[lnchnr]["fltTime"] = fltTime -- fill the current flight time in the row corresponding with the flight number
Tekenen van de waarden in de grafiek:
Code:
lcd.drawText ( gRight+5,menuBar+5*rowHeight, "Launch\194:",SMLSIZE)
lcd.drawNumber ( gRight+80,menuBar+5*rowHeight, history[lnchnr-1]["lnchAlt"], SMLSIZE)
lcd.drawText (gRight+100, menuBar+5*rowHeight, "m", SMLSIZE)
lcd.drawText ( gRight+5,menuBar+6*rowHeight, "Max\192:",SMLSIZE)
lcd.drawNumber ( gRight+80,menuBar+6*rowHeight, history[lnchnr-1]["maxAlt"], SMLSIZE)
lcd.drawText (gRight+100, menuBar+6*rowHeight, "m", SMLSIZE)
lcd.drawText ( gRight+5,menuBar+7*rowHeight, "Time:",SMLSIZE)
lcd.drawText ( gRight+75,menuBar+7*rowHeight, SecondsToClock (history[lnchnr-1]["fltTime"]), SMLSIZE)
de grafiek ziet er als volgt uit:
Enige dat ik nog zou willen aanpassen is dat het achtergrond plaatje niet zichtbaar is achter het rechthoek van de grafiek (zoals bij jouw graph widget). Dat volgt nog.