# !/bin/csh
#
# This script starts the display programs for the imaging demonstration.
# $Revision: 1.12 $

if( $1 == "" ) then
	echo Usage: $0 ctn_name
	exit
endif

set SUCCESS = 1
set V1 = ""
set V2 = ""
set V3 = ""
set V4 = ""
set V5 = ""
set Q1 = 0
set Q2 = 0
set Q3 = 0
set Q4 = 0
set Q5 = 0
setenv ROOT /mir_ctn/img
setenv QUEUE_DIRECTORY $ROOT/q
setenv D $ROOT/db
setenv I $ROOT/db
if ($DISPLAY == "") setenv DISPLAY dicom2:0

switch($1)
	case "ctn1":
		set HOST = "ctn1"
		set V1 = "Cemax"
		set V2 = "Mitra"
		set V3 = "Siemens"
		set Q1 = 10
		set Q2 = 12
		set Q3 = 14
		breaksw
	case "ctn2":
		set HOST = "ctn2"
		set V1 = "AAAI"
		set V2 = "Konica"
		set Q1 = 20
		set Q2 = 22
		breaksw
	case "ctn3":
		set HOST = "ctn3"
		set V1 = "Acuson"
		set V2 = "ALI"
		set V3 = "Kodak"
		set Q1 = 30
		set Q2 = 32
		set Q3 = 34
		breaksw
	case "ctn4":
		set HOST = "ctn4"
		set V1 = "GE"
		set V2 = "ISG"
		set Q1 = 40
		set Q2 = 42
		breaksw
	case "ctn5":
		set HOST = "ctn5"
		set V1 = "3M"
		set V2 = "Merge"
		set V3 = "Picker"
		set V4 = "Picker"
		set Q1 = 50
		set Q2 = 52
		set Q3 = 54
		set Q4 = 55
		breaksw
	case "ctn6":
		set HOST = "ctn6"
		set V1 = "ATL"
		set V2 = "Loral"
		set Q1 = 60
		set Q2 = 62
		breaksw
	case "ctn7":
		set HOST = "ctn7"
		set V1 = "ADAC"
		set V2 = "Agfa"
		set V3 = "Philips"
		set Q1 = 70
		set Q2 = 72
		set Q3 = 74
		breaksw
	case "ctn8":
		set HOST = "ctn8"
		set V1 = "Dupont"
		set V2 = "Star"
		set Q1 = 80
		set Q2 = 82
		breaksw
	case "demo":
		set HOST = "demo"
		set V1 = "GE"
		set V2 = "Siemens"
		set V3 = "Philips"
		set Q1 = 40
		set Q2 = 14
		set Q3 = 74
		breaksw
	default:
		set SUCCESS = 0
		echo $0\: $1 not found.
		breaksw
endsw

if( $SUCCESS == 1 ) then

if ($Q1 != 0) ctndisp -n $V1 -q $Q1 -w 300 -h 425 &
if ($Q2 != 0) ctndisp -n $V2 -q $Q2 -w 300 -h 425 &
if ($Q3 != 0) ctndisp -n $V3 -q $Q3 -w 300 -h 425 &
if ($Q4 != 0) then 
setenv DISPLAY $D4
ctndisp -n $V4 -q $Q4 -w 300 -h 425 &
endif

ctnnetwork -n 10 -q 100 -w 200 -h 425 &
endif

exit
