; --------------------------------------------------------------------------------
; @Props: NoMetaTags, NoIndex
; @Copyright: (C) 1989-2014 Lauterbach GmbH, licensed for use with TRACE32(R) only
; --------------------------------------------------------------------------------
; $Id: t8260diatlin.cmm 7020 2014-04-28 10:10:12Z kjmal $

; --------------------------------------------------------------------------------
;                          Dialog Counter
; --------------------------------------------------------------------------------
  LOCAL &closewin
  ENTRY &VButton &tout &tlines

;  if "&tlines"==""
;     &tlines="0yxxxxxxxx"
  &closewin=0.
  print ""
  dialog
  (
	header "Define Test Lines"

; --------------------------------------------------------------------------------
;                          Definition
; --------------------------------------------------------------------------------

	  pos 1. 1. 6
	  text "Test-7"
	  pos 7. 1. 6
	  text "Test-6"
	  pos 13. 1. 6
	  text "Test-5"
	  pos 19. 1. 6
	  text "Test-4"
	  pos 25. 1. 6
	  text "Test-3"
	  pos 31. 1. 6
	  text "Test-2"
	  pos 37. 1. 6
	  text "Test-1"
	  pos 43. 1. 6
	  text "Test-0"
	  pos 1. 2. 5
TT7:    PULLDOWN "x,0,1" "" 
	  pos 7. 2. 5
TT6:    PULLDOWN "x,0,1" "" 
	  pos 13. 2. 5
TT5:    PULLDOWN "x,0,1" "" 
	  pos 19. 2. 5
TT4:    PULLDOWN "x,0,1" "" 
	  pos 25. 2. 5
TT3:    PULLDOWN "x,0,1" "" 
	  pos 31. 2. 5
TT2:    PULLDOWN "x,0,1" "" 
	  pos 37. 2. 5
TT1:    PULLDOWN "x,0,1" "" 
	  pos 43. 2. 5
TT0:    PULLDOWN "x,0,1" "" 

	  pos 1. 3. 6
	  text "Cond-B"
	  pos 7. 3. 6
	  text "Cond-A"
	  pos 13. 3. 6
	  text "Count"
	  pos 1. 4. 16.
	  text "Trigger Outputs"
	  pos 1. 5. 17.
TOUT:   PULLDOWN "enabled,disabled" "gosub InitToutLines"
        pos 21. 6. 7.
        BUTTON "CLEAR" "gosub InitDialogTLines"
        pos 31. 6. 7.
        DEFBUTTON "Cancel" "jumpto winclose"
        pos 41. 6. 7.
        DEFBUTTON "OK" "jumpto okclose"
        CLOSE "jumpto winclose"
  )        

  gosub InitDialogTLines &tlines
backloop:
  &closewin=0.
  stop
okclose: 
  &closewin=1.
winclose:
  if (&closewin==0.)&&(&VButton==1)
    &tlines=0.
  else if (&closewin==0.)&&(&VButton!=1)
    &tlines="0yxxxxxxxx"
  else 
    (
     &TTS7=dialog.string(TT7) 
     &TTS6=dialog.string(TT6) 
     &TTS5=dialog.string(TT5) 
     &TTS4=dialog.string(TT4) 
     &TTS3=dialog.string(TT3) 
     &TTS2=dialog.string(TT2) 
     &TTS1=dialog.string(TT1) 
     &TTS0=dialog.string(TT0)
     &tlines="0y"+"&TTS7"+"&TTS6"+"&TTS5"+"&TTS4"+"&TTS3"+"&TTS2"+"&TTS1"+"&TTS0"   
    ) 
  dialog.end
ENDDO &tlines &tout

; --------------------------------------------------------------------------------
InitDialogTLines:
  ENTRY &dummy    

  &dummy= "&dummy"+"@"
  &len=    string.scan("&dummy","@",0x0)

  if (&len!=10.)||("&dummy"=="@")
     &tlines="0yxxxxxxxx"
  

  &TT0=STRING.MID("&tlines",9,1)
  &TT1=STRING.MID("&tlines",8,1)
  &TT2=STRING.MID("&tlines",7,1)
  &TT3=STRING.MID("&tlines",6,1)
  &TT4=STRING.MID("&tlines",5,1)
  &TT5=STRING.MID("&tlines",4,1)
  &TT6=STRING.MID("&tlines",3,1)
  &TT7=STRING.MID("&tlines",2,1)     

  if "&tout"=="enabled"
  (
    dialog.set TT7 "x"
    dialog.set TT6 "x"
    dialog.set TT5 "x"
    dialog.disable TT7
    dialog.disable TT6
    dialog.disable TT5
  )
  else
  (
    dialog.set TT7 "&TT7"
    dialog.set TT6 "&TT6"
    dialog.set TT5 "&TT5"
    dialog.enable TT7
    dialog.enable TT6
    dialog.enable TT5
  )

  dialog.set TT4 "&TT4"
  dialog.set TT3 "&TT3"
  dialog.set TT2 "&TT2"
  dialog.set TT1 "&TT1"
  dialog.set TT0 "&TT0"

  dialog.set TOUT "&tout"  

  RETURN
; --------------------------------------------------------------------------------
InitToutLines:

  &tout=dialog.string(TOUT) 
  
  if "&tout"=="enabled"
  (
    dialog.set TT7 "x"
    dialog.set TT6 "x"
    dialog.set TT5 "x"
    dialog.disable TT7
    dialog.disable TT6
    dialog.disable TT5
  )
  else
  (
    dialog.enable TT7
    dialog.enable TT6
    dialog.enable TT5
  )

  RETURN





