!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Test for plotting correct coneflags
!
! @author  J. Bauer
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
startmacro
  switch INTERACTIVE interAct GET DEF=TRUE  SDEF=TRUE

  call setDatDir

  set instr "Zoom in on the geodetic plot of the coneflags in the left pane. &
             You should see a dotted line extending off the Earth, &
             as shown in the screenshot in the right pane."
  if interAct then
    pipe init 
      panel/setup/controls=gc
  
      plot/id=world/nice/msgid=main ^{datDir}.world.prm|^{datDir}.coneflags5000.prm{LAYER={FLAGS=+ConeFlagVert}} view=geodetic
      plot/id=screenshot nxm.sys.test.test_plot_coneflags5000.png
  
      gcontrol label macro  "MACRO"
        gcontrol menu  MAIN   "Exit with Status = " "PASS,FAIL" /tleft
        gcontrol text  idtext "Instructions" "^instr" 12 12 /title
        set gc.MAIN.itemColors {PASS=GREEN,FAIL=RED}
     
    pipe off
  endif
endmacro

procedure processMessage m:msg
  !say "Got message name=^msg.name info=^msg.info data=^msg.data fid=^msg.fid"
  if msg.name EQS "MAIN" then
    assert/text="^reg.main.name: ConeFlagVert" "PASS" SUBS msg.data
    pipe stop
  else
    !say "^reg.main.name: Unhandled message name=^msg.name info=^msg.info data=^msg.data"
  endif
return

!******************************************************************************!
! Set the dat directory
!******************************************************************************!
procedure setDatDir
  invoke nxmMajor env.nmversion.subString(0,1)
  invoke major java.lang.Integer.valueOf(nxmMajor)
  if major GE 4 then
    invoke s:datDir           nxm.sys.test.DatLocator.getDatDirLocation()
    invoke s:datDirSlash      nxm.sys.test.DatLocator.getDatDirSlashLocation()
    invoke z:sysDatFull       nxm.sys.test.DatLocator.sysDatFull()
    invoke z:sysTestDatExists nxm.sys.test.DatLocator.sysTestDatExists()
  else
    set s:datDir           "nxm.sys.dat"
    set s:datDirSlash      "nxm/sys/dat"
    set z:sysDatFull       true
    set z:sysTestDatExists false
  endif
return
