!
! Macro to test Bug 1048 - Raster Plot mask significant features when in X vs Y
! views (when compressing raster). It can also help with testing Bug 1043 - poor
! detail in rendering of compressed rasters.
!
! NOTE: Original DR was written to compare YX with iYX
!
! Author:  J. Hallam / Neon Ngo
! Version: $Id: test_plot_layer2d_view_rendering.mm,v 1.8 2009/08/24 19:33:25 ntn Exp $
!
startmacro
  set testfile0 test_plot_layer2d_view_wave
  set testfile test_plot_layer2d_view_waveu
  waveform ^testfile0 sf 1e6 square ,,1e4 0 0 1/1e5
  fft/psd/pack=DC ^testfile0 ^testfile 31250,,0.5 10

  res inst "Four lines should show up in all views. Note: two of the lines are at &
            the edges of the frequency range. Prior to fix for Bug 1048, lines did &
            not appear due to no compression in the X vs Y views. Zoom into some of &
            of the plots in each view to make sure the lines are still visible. &
            KNOWN ISSUE: sometimes the last line (at 50 kHz) does not render unless &
            zoomed in on it."
  pipe on
    panel/controls=gc/setup

    plot/id=plot1_yx   ^testfile type=raster cm=10log view=YX
    plot/id=plot2_iyx  ^testfile type=raster cm=10log view=IYX
    plot/id=plot3_yix  ^testfile type=raster cm=10log view=YIX
    plot/id=plot4_iyix ^testfile type=raster cm=10log view=IYIX
    plot/id=plot5_xy   ^testfile type=raster cm=10log view=XY
    plot/id=plot6_xiy  ^testfile type=raster cm=10log view=XIY
    plot/id=plot7_ixy  ^testfile type=raster cm=10log view=IXY
    plot/id=plot8_ixiy ^testfile type=raster cm=10log view=IXIY

    gcontrol label mainLabel "Main" AlwaysOpen
      gcontrol menu main "Exit with Status = " "PASS,FAIL" /tleft
      gcontrol text idtext "Instructions" "^inst" 24 15 /title
      set gc.main.itemColors {PASS=GREEN,FAIL=RED}

  pipe off

  erase/quiet ^testfile0 ^testfile
endmacro

!**************************************************************************************************!
procedure processMessage

  !say "msg.name ^msg.name, data ^msg.data"

  if msg.name eqs "MAIN" then
!    assert/text="BUG #1043: poor detail in rendering of compressed rasters" msg.data eqss "PASS"
     assert/text="BUG #1048: raster plot masks significant features." msg.data eqss "PASS"
    pipe stop
  else
    say "^reg.main.name: Unhandled message name: ^msg.name from fid: ^msg.fid data: ^msg.data"
  endif

return
