/*
    xtdpd_liv_option.dlg
 
*!  VERSION 1.0.1  17apr2009
 
*/

VERSION 11.0

INCLUDE _std_medium
DEFINE _dlght 290
INCLUDE header_gr_child

DEFINE c1 20
DEFINE c1wd 70

DEFINE c2 95
DEFINE c2wd 260

DEFINE c3h 345
DEFINE c3hwd 120
DEFINE c3 345
DEFINE c3wd 140


HELP hlp1, view("help xtdpd")
RESET res1


DIALOG main, tabtitle("Main")	///
	label("Standard instruments for the level equation")
BEGIN
  GROUPBOX gb_instruments	_lft	_top	_iwd	_ht23h,		///
	label("Standard instruments for the level equation")

  //Headings
  TEXT     tx_eq		_ilft	_ms	c1wd	.,		///
  	label("Instruments")

  TEXT     tx_level		c2	@	c2wd	.,		///
  	label("Variables")


//Instrument 1
  CHECKBOX ck_1			c1	_ms	c1wd	.,		///
  	label("Inst. 1")						///
  	onclickon(program main_1_on)					///
  	onclickoff(script main_1_off)
  VARLIST  vl_level_1		c2	@	c2wd	.,		///
  	label("Variables for instrument 1") ts


//Instrument 2
  CHECKBOX ck_2			c1	_ms	c1wd	.,		///
  	label("Inst. 2")						///
  	onclickon(program main_2_on)					///
  	onclickoff(script main_2_off)
  VARLIST  vl_level_2		c2	@	c2wd	.,		///
  	label("Variables for instrument 2") ts


//Instrument 3
  CHECKBOX ck_3			c1	_ms	c1wd	.,		///
  	label("Inst. 3")						///
  	onclickon(program main_3_on)					///
  	onclickoff(script main_3_off)
  VARLIST  vl_level_3		c2	@	c2wd	.,		///
  	label("Variables for instrument 3") ts

//Instrument 4
  CHECKBOX ck_4			c1	_ms	c1wd	.,		///
  	label("Inst. 4")						///
  	onclickon(program main_4_on)					///
  	onclickoff(script main_4_off)
  VARLIST  vl_level_4		c2	@	c2wd	.,		///
  	label("Variables for instrument 4") ts

//Instrument 5
  CHECKBOX ck_5			c1	_ms	c1wd	.,		///
  	label("Inst. 5")						///
  	onclickon(program main_5_on)					///
  	onclickoff(script main_5_off)
  VARLIST  vl_level_5		c2	@	c2wd	.,		///
  	label("Variables for instrument 5") ts

//Instrument 6
  CHECKBOX ck_6			c1	_ms	c1wd	.,		///
  	label("Inst. 6")						///
  	onclickon(program main_6_on)					///
  	onclickoff(script main_6_off)
  VARLIST  vl_level_6		c2	@	c2wd	.,		///
  	label("Variables for instrument 6") ts

//Instrument 7
  CHECKBOX ck_7			c1	_ms	c1wd	.,		///
  	label("Inst. 7")						///
  	onclickon(program main_7_on)					///
  	onclickoff(script main_7_off)
  VARLIST  vl_level_7		c2	@	c2wd	.,		///
  	label("Variables for instrument 7") ts

//Instrument 8
  CHECKBOX ck_8			c1	_ms	c1wd	.,		///
  	label("Inst. 8")						///
  	onclickon(program main_8_on)					///
  	onclickoff(script main_8_off)
  VARLIST  vl_level_8		c2	@	c2wd	.,		///
  	label("Variables for instrument 8") ts
END

// Instrument 1
PROGRAM main_1_on
BEGIN
	call main.vl_level_1.enable

END
SCRIPT main_1_off
BEGIN
	main.vl_level_1.disable
END

// Instrument 2
PROGRAM main_2_on
BEGIN
	call main.vl_level_2.enable

END
SCRIPT main_2_off
BEGIN
	main.vl_level_2.disable
END

// Instrument 3
PROGRAM main_3_on
BEGIN
	call main.vl_level_3.enable
END
SCRIPT main_3_off
BEGIN
	main.vl_level_3.disable
END

// Instrument 4
PROGRAM main_4_on
BEGIN
	call main.vl_level_4.enable
END
SCRIPT main_4_off
BEGIN
	main.vl_level_4.disable
END

// Instrument 5
PROGRAM main_5_on
BEGIN
	call main.vl_level_5.enable
END
SCRIPT main_5_off
BEGIN
	main.vl_level_5.disable
END

// Instrument 6
PROGRAM main_6_on
BEGIN
	call main.vl_level_6.enable
END
SCRIPT main_6_off
BEGIN
	main.vl_level_6.disable
END

// Instrument 7
PROGRAM main_7_on
BEGIN
	call main.vl_level_7.enable
END
SCRIPT main_7_off
BEGIN
	main.vl_level_7.disable
END

// Instrument 8
PROGRAM main_8_on
BEGIN
	call main.vl_level_8.enable
END
SCRIPT main_8_off
BEGIN
	main.vl_level_8.disable
END

PROGRAM main_1_output
BEGIN
	varlist main.vl_level_1
END

PROGRAM main_2_output
BEGIN
	varlist main.vl_level_2
END

PROGRAM main_3_output
BEGIN
	varlist main.vl_level_3
END

PROGRAM main_4_output
BEGIN
	varlist main.vl_level_4
END

PROGRAM main_5_output
BEGIN
	varlist main.vl_level_5
END

PROGRAM main_6_output
BEGIN
	varlist main.vl_level_6
END

PROGRAM main_7_output
BEGIN
	varlist main.vl_level_7
END

PROGRAM main_8_output
BEGIN
	varlist main.vl_level_8
END

PROGRAM command
BEGIN
	if main.ck_1 {
		put "liv("
		put /program main_1_output
		put ") "
	}
	if main.ck_2 {
		put "liv("
		put /program main_2_output
		put ") "
	}
	if main.ck_3 {
		put "liv("
		put /program main_3_output
		put ") "
	}
	if main.ck_4 {
		put "liv("
		put /program main_4_output
		put ") "
	}
	if main.ck_5 {
		put "liv("
		put /program main_5_output
		put ") "
	}
	if main.ck_6 {
		put "liv("
		put /program main_6_output
		put ") "
	}
	if main.ck_7 {
		put "liv("
		put /program main_7_output
		put ") "
	}
	if main.ck_8 {
		put "liv("
		put /program main_8_output
		put ") "
	}
END
