! Test integration of Jay/Wayne's LayerAircraft Layer
!
! Author:  Jay Hallam / J Bauer
! Version: $Id: test_plot_layeraircraft.mm,v 1.1 2011/06/09 19:09:36 jwb Exp $
!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE
  switch BASELINE    baseline GET DEF=FALSE SDEF=TRUE
  
  set instr "The map in the background should not flicker as the Aircraft moves. &
             The Aircraft itself may flicker or blink, though."
  
  res ac_table {}
  res ac_table.channel "XX1"
  res ac_table.gcs     "XX1"
  res ac_table.COLOR   "FF0000"
  res ac_table.alt     10000.0
  res ac_table.lat     0.0
  res ac_table.lon     0.0
  
  
  pipe on
    panel/msgid=MAIN/setup/controls=gc
    
    gcontrol label  macro   "MACRO"
      gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
      set gc.main.itemColors {PASS=GREEN,FAIL=RED}
      gcontrol text idtext "Instructions" "^instr" 24 10 /title
      
    plot/id=gplot/msgid="MAIN" nxm.sys.dat.world.shp{TAG="WORLD",&
            LAYER={LABEL=NAME,COLORS="#303030,#353535,#404040,#505050"},ENABLE=+BS}
    
    layer "nxm.ucl.libg.LayerAircraft" aircraft {NAME="LayerAircraft"} gplot
    
    set this.timer(0) 1.0
  
  pipe off
endmacro

procedure processMessage m:msg

  if msg.name eqs "MAIN" then
    assert/text="Plot files tests" msg.data eqss "PASS"
    pipe stop
    
  elseif msg.name EQS "TIMER" then
    calc ac_table.lat ac_table.lat 0.02 + 89.0 MOD
    calc ac_table.lon ac_table.lat 0.02 + 180.0 MOD
    set ac_table.head 45.0
    !invoke ac_table.head nxm.sys.lib.Position.computeHeading(prevSimPos, simPos, 0.0)
    invoke ,, aircraft.updateAircraft(ac_table)
  endif

return