# Install.cmd script for the robot system rel 4.0
#
# Install questions
#    var 1  = irb type
#    var 2  = mounting type/dclink type
#    var 3  = irb variant
#    var 10 = temp use.
echo -text ""
echo -text "IRB 6400 M97"
echo -text ""
if -var 9 -value 50 -label USER_QUERY
setvar -var 10 -value 0
getkey -id "DriveSelect" -var 10 -strvar $ANSWER -errlabel USER_QUERY
goto -strvar $ANSWER
#USER_QUERY
echo -text "Select type of DC link"
query -text " DC2     DC2T    DC2C" \
      -var 10 -fk_text
if -var 10 -value 10 -label TYPE_EXT_STD
if -var 10 -value 20 -label TYPE_EXT_DC2T
if -var 10 -value 30 -label TYPE_EXT_DC2C
if -var 10 -value 40 -label TYPE_EXT_STD
if -var 10 -value 50 -label TYPE_EXT_STD
goto -label END_LABEL
#TYPE_EXT_STD
echo -text "Installing config for DC link (DC2)"
config -filename  $BOOTPATH/../drive_lib/dc2_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c1.cfg -domain MOC -internal
goto -label ROBOT_TYPE
#TYPE_EXT_DC2T
echo -text "Installing config for DC link (DC2T)"
config -filename  $BOOTPATH/../drive_lib/dc2t_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc2t_c1b1.cfg -domain MOC
goto -label ROBOT_TYPE
#TYPE_EXT_DC2C
echo -text "Installing config for DC link (DC2C)"
config -filename  $BOOTPATH/../drive_lib/dc2t_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc2c_c1b1.cfg -domain MOC
goto -label ROBOT_TYPE
#ROBOT_TYPE
if -var 9 -value 50 -label USER_QUERY
setvar -var 10 -value 0
getkey -id "IrbSelect" -var 10 -strvar $ANSWER -errlabel USER_QUERY
goto -strvar $ANSWER
#USER_QUERY
echo -text "Select IRB6400 model :"
query -text "2.4-120 2.8-120 2.4-150 2.4-200" \
      -var 3 -fk_text
if -var 3 -value 10 -label IRB6400_2_4_120
if -var 3 -value 20 -label IRB6400_2_8_120
if -var 3 -value 30 -label IRB6400_2_4_150
if -var 3 -value 40 -label IRB6400_2_4_200
if -var 3 -value 50 -label IRB6400_2_4_200
goto -label END_LABEL

#IRB6400_2_4_120
echo -text "Installing IRB 6400/2.4-120"
install -resource Function -name "IRB" -descr "6400/2.4-120"
config -filename  $BOOTPATH/irbcfg/p642412s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/p642412i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/p642412e.cfg -domain MOC
goto -label END_LABEL

#IRB6400_2_8_120
echo -text "Installing IRB 6400/2.8-120"
install -resource Function -name "IRB" -descr "6400/2.8-120"
config -filename  $BOOTPATH/irbcfg/p642812s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/p642812i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/p642812e.cfg -domain MOC
goto -label END_LABEL

#IRB6400_2_4_150
echo -text "Installing IRB 6400/2.4-150"
install -resource Function -name "IRB" -descr "6400/2.4-150"
config -filename  $BOOTPATH/irbcfg/p642415s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/p642415i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/p642415e.cfg -domain MOC
goto -label END_LABEL

#IRB6400_2_4_200
echo -text "Installing IRB 6400/2.4-200"
install -resource Function -name "IRB" -descr "6400/2.4-200"
config -filename  $BOOTPATH/irbcfg/p64200s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/p64200i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/p64200e.cfg -domain MOC
goto -label END_LABEL


#END_LABEL
echo -text "No calibration data available"
config -filename  $BOOTPATH/irbcfg/uncalib.cfg -domain MOC
