# 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 640 "
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 external axes config."
echo -text ""
echo -text "No ext  = No external axes"
echo -text "GT      = External axes GT"
echo -text "Extaxdc = Ext axes only in drive cabinet"
query -text "No ext    GT    Extaxdc               " \
      -var 10 -fk_text
if -var 10 -value 10 -label NO_EXT
if -var 10 -value 20 -label DC3GT
if -var 10 -value 30 -label DC3
if -var 10 -value 40 -label DC3
if -var 10 -value 50 -label DC3
goto -label END_LABEL
#DC3
echo -text "Installing config for DC link (DC3)"
config -filename  $BOOTPATH/../drive_lib/dc3_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo3c1.cfg -domain MOC -internal
goto -label EXTCAB
#DC3GT
echo -text "Installing config for DC link (DC3GT)"
config -filename  $BOOTPATH/../drive_lib/dc3_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo3c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_8_gt_c1b1.cfg -domain MOC
goto -label EXTCAB
#NO_EXT
echo -text "Installing config for DC link (DC3)"
config -filename  $BOOTPATH/../drive_lib/dc3_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo3c1.cfg -domain MOC -internal
goto -label ROBOT_TYPE

#EXTCAB
if -var 9 -value 50 -label USER_QUERY
setvar -var 10 -value 0
getkey -id "DriveSelectExtCab" -var 10 -strvar $ANSWER -errlabel ROBOT_TYPE
goto -strvar $ANSWER
#USER_QUERY
echo -text "Select external axes in drive cabinet."
echo -text ""
echo -text "None    = No external drive cabinet"
echo -text "2xGT    = Ext axes 2 x GT"
echo -text "3xGT    = Ext axes 3 x GT"
echo -text "2xECB   = Ext axes 2 x ECB"
echo -text "ECB1xGT = Ext axes 1 x ECB + 1 x GT"
echo -text "ECB2xGT = Ext axes 1 x ECB + 2 x GT"
query -text " None    2xGT    3xGT   2xECB    SCAN" \
     -text2 "ECB1xGT ECB2xGT                  SCAN" -var 10 -fk_text
if -var 10 -value 10 -label EMPTY
if -var 10 -value 20 -label EXT_2GT
if -var 10 -value 30 -label EXT_3GT
if -var 10 -value 40 -label EXT_2ECB
if -var 10 -value 110 -label EXT_ECBGT
if -var 10 -value 120 -label EXT_ECB2GT
if -var 10 -value 130 -label EXT_ECB2GT
if -var 10 -value 140 -label EXT_ECB2GT

#EMPTY
goto -label ROBOT_TYPE
#EXT_2GT
echo -text "Installing config for external cabinet"
echo -text "(ext_2gt)"
config -filename  $BOOTPATH/../drive_lib/dc2_c2b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_10_2xgt_c2b2.cfg -domain MOC
goto -label ROBOT_TYPE
#EXT_3GT
echo -text "Installing config for external cabinet"
echo -text "(ext_3gt)"
config -filename  $BOOTPATH/../drive_lib/dc2_c2b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_12_3xgt_c2b2.cfg -domain MOC
goto -label ROBOT_TYPE
#EXT_2ECB
echo -text "Installing config for external cabinet"
echo -text "(ext_2ecb)"
config -filename  $BOOTPATH/../drive_lib/dc2_c2b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_12_2xecb_c2b2.cfg -domain MOC
goto -label ROBOT_TYPE
#EXT_ECBGT
echo -text "Installing config for external cabinet"
echo -text "(ext_ecbgt)"
config -filename  $BOOTPATH/../drive_lib/dc2_c2b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_10_ecgt_c2b2.cfg -domain MOC
goto -label ROBOT_TYPE
#EXT_ECB2GT
echo -text "Installing config for external cabinet"
echo -text "(ext_ecb2gt)"
config -filename  $BOOTPATH/../drive_lib/dc2_c2b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_12_ec2xgt_c2b2.cfg -domain MOC
goto -label ROBOT_TYPE
#ROBOT_TYPE
#IRB640
echo -text "Installing IRB 640"
install -resource Function -name "IRB" -descr "640"
config -filename  $BOOTPATH/irbcfg/IRB640_160s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/IRB640_160i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/IRB640_160e.cfg -domain MOC
config -filename  $BOOTPATH/irbcfg/calibplr.cfg -domain MOC
#END_LABEL
