# 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 6400S/2.9-120"
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 year model"
echo -text ""
query -text "M2000   M2000A" -var 10 -fk_text
if -var 10 -value 10 -label M2000
if -var 10 -value 20 -label M2000A
if -var 10 -value 30 -label M2000A
if -var 10 -value 40 -label M2000A
if -var 10 -value 50 -label M2000A
goto -label END_LABEL

#M2000
echo -text "Select type of external axes config."
echo -text ""
echo -text "No ext  = No external axes"
echo -text "DC2C    = External axes DC2C"
echo -text "DC2T    = External axes DC2T"
echo -text "Extaxdc = Ext axes only in drive cabinet"
query -text "No ext   DC2C    DC2T   Extaxdc" \
      -var 10 -fk_text
if -var 10 -value 10 -label NO_EXT
if -var 10 -value 20 -label DC2C
if -var 10 -value 30 -label DC2T
if -var 10 -value 40 -label DC2
if -var 10 -value 50 -label DC2
goto -label END_LABEL

#M2000A
echo -text "Select type of external axes config."
echo -text ""
echo -text "No ext = No external axes"
echo -text "T      = External axes T"
echo -text "GT     = External axes G+T"
query -text "No ext    T       GT" \
      -var 10 -fk_text
if -var 10 -value 10 -label DC2A
if -var 10 -value 20 -label DC2TA
if -var 10 -value 30 -label DC2GTA
if -var 10 -value 40 -label DC2GTA
if -var 10 -value 50 -label DC2GTA
goto -label END_LABEL

#DC2C
echo -text "Installing config for DC link (DC2C)"
config -filename  $BOOTPATH/../drive_lib/dc2c_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 EXTCAB
#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 EXTCAB
#DC2
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 EXTCAB
#NO_EXT
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
#DC2A
echo -text "Installing config for DC link (DC2A)"
config -filename  $BOOTPATH/../drive_lib/trafo2c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/dc2_c1b1l1.cfg -domain MOC -internal
goto -label ROBOT_TYPE
#DC2TA
echo -text "Installing config for DC link (DC2TA)"
config -filename  $BOOTPATH/../drive_lib/trafo2c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/dc2_c1b1l1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_t_c1b1l2.cfg -domain MOC
goto -label ROBOT_TYPE
#DC2GTA
echo -text "Installing config for DC link (DC2GTA)"
config -filename  $BOOTPATH/../drive_lib/trafo2c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/dc2_c1b1l1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_8_gt_c1b2.cfg -domain MOC
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 ext. axes in drive cabinet or DDU"
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"
echo -text "DDU-U   = Ext axes DDU U"
query -text " None    2xGT    3xGT   2xECB    SCAN" \
     -text2 "ECB1xGT ECB2xGT  DDU-U           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_DDU_U
if -var 10 -value 140 -label EXT_DDU_U

#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
#EXT_DDU_U
echo -text "Installing config for DDU U"
config -filename  $BOOTPATH/../drive_lib/dc4_c2b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive8_u_c2b2.cfg -domain MOC
goto -label ROBOT_TYPE

#ROBOT_TYPE
#IRB6400_S2_9_120
echo -text "Installing IRB 6400S/2.9-120"
install -resource Function -name "IRB" -descr "6400S/2.9-120"
config -filename  $BOOTPATH/irbcfg/SPICE6400_s2.9_120s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/SPICE6400_s2.9_120i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/SPICE6400_s2.9_120e.cfg -domain MOC
goto -label END_LABEL
#END_LABEL
echo -text "No calibration data available"
config -filename  $BOOTPATH/irbcfg/uncalib.cfg -domain MOC