# 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 6400R Family"
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 "DC4U    = External axes DC4U"
echo -text "DC4U2   = External axes DC4U AXC2"
echo -text "DC4C    = External axes DC4C"
echo -text "Extaxdc = Ext axes only in drive cabinet"
query -text "No ext   DC4U    DC4U2   DC4C   Extaxdc" \
      -var 10 -fk_text
if -var 10 -value 10 -label NO_EXT
if -var 10 -value 20 -label DC4U
if -var 10 -value 30 -label DC4U2
if -var 10 -value 40 -label DC4C
if -var 10 -value 50 -label DC4
goto -label END_LABEL
#DC4U
echo -text "Installing config for DC link (DC4U)"
config -filename  $BOOTPATH/../drive_lib/dc4u_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo5c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc4u_c1b1.cfg -domain MOC
goto -label EXTCAB
#DC4U2
echo -text "Installing config for DC link (DC4U AXC2)"
config -filename  $BOOTPATH/../drive_lib/dc4u_c1b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo5c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc4u_c1b2.cfg -domain MOC
goto -label EXTCAB
#DC4C
echo -text "Installing config for DC link (DC4C)"
config -filename  $BOOTPATH/../drive_lib/dc4c_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo5c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc4c_c1b1.cfg -domain MOC
goto -label EXTCAB
#DC4
echo -text "Installing config for DC link (DC4)"
config -filename  $BOOTPATH/../drive_lib/dc4_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo5c1.cfg -domain MOC -internal
goto -label EXTCAB
#NO_EXT
echo -text "Installing config for DC link (DC4)"
config -filename  $BOOTPATH/../drive_lib/dc4_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo5c1.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 ext. axes in drive cabinet or DDU"
echo -text ""
query -text "Cabinet  DDU" -var 10 -fk_text
if -var 10 -value 10 -label CABINET
if -var 10 -value 20 -label DDU
if -var 10 -value 30 -label DDU
if -var 10 -value 40 -label DDU
if -var 10 -value 50 -label DDU
goto -label END_LABEL
#CABINET
echo -text "Select ext. 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"
echo -text "2xGU    = Ext axes 2 x GU"
echo -text "3xGU    = Ext axes 3 x GU"
query -text " None    2xGT    3xGT   2xECB    SCAN" \
     -text2 "ECB1xGT ECB2xGT  2xGU    3xGU    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_2GU
if -var 10 -value 140 -label EXT_3GU
goto -label END_LABEL
#DDU
echo -text "Select ext. axes in DDU"
echo -text ""
echo -text "None    = No external drive cabinet"
echo -text "DDU-U   = Ext axes DDU U"
query -text " None   DDU-U" -var 10 -fk_text
if -var 10 -value 10 -label EMPTY
if -var 10 -value 20 -label EXT_DDU_U
if -var 10 -value 30 -label EXT_DDU_U
if -var 10 -value 40 -label EXT_DDU_U
if -var 10 -value 50 -label EXT_DDU_U
goto -label END_LABEL
#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_2GU
echo -text "Installing config for external cabinet"
echo -text "(ext_2gu)"
config -filename  $BOOTPATH/../drive_lib/dc4_c2b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_10_2xgu_c2b2.cfg -domain MOC
goto -label ROBOT_TYPE
#EXT_3GU
echo -text "Installing config for external cabinet"
echo -text "(ext_3gu)"
config -filename  $BOOTPATH/../drive_lib/dc4_c2b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_12_3xgu_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
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.5-120 2.5-150 2.5-200          SCAN" \
     -text2 "2.8-150 2.8-200 3.0-100          SCAN" -var 3 -fk_text
if -var 3 -value 10 -label IRB6400_SELECT_BAL_B_OR_STD
if -var 3 -value 20 -label IRB6400_SELECT_2_5_150
if -var 3 -value 30 -label IRB6400_SELECT_BAL_B_OR_STD
if -var 3 -value 40 -label IRB6400_SELECT_BAL_B_OR_STD
if -var 3 -value 110 -label IRB6400_SELECT_BAL_B_OR_STD
if -var 3 -value 120 -label IRB6400_2_8_200_99
if -var 3 -value 130 -label IRB6400_3_0_100_99
if -var 3 -value 140 -label IRB6400_3_0_100_99
goto -label END_LABEL
#IRB6400_SELECT_BAL_B_OR_STD
echo -text "Select bal.B or standard:"
query -text "bal.B  standard" -var 10 -fk_text
if -var 10 -value 10 -label IRB6400_BAL_B
if -var 10 -value 20 -label IRB6400_STANDARD
if -var 10 -value 30 -label IRB6400_STANDARD
if -var 10 -value 40 -label IRB6400_STANDARD
if -var 10 -value 50 -label IRB6400_STANDARD
goto -label END_LABEL
#IRB6400_SELECT_2_5_150
echo -text "Select bal.B, standard or 120 kg:"
query -text "bal.B  standard 120kg" -var 10 -fk_text
if -var 10 -value 10 -label IRB6400_BAL_B
if -var 10 -value 20 -label IRB6400_STANDARD
if -var 10 -value 30 -label IRB6400_2_5_150_99_120
if -var 10 -value 40 -label IRB6400_2_5_150_99_120
if -var 10 -value 50 -label IRB6400_2_5_150_99_120
goto -label END_LABEL
#IRB6400_BAL_B
if -var 3 -value 10 -label IRB6400_2_5_120_99_BAL_B
if -var 3 -value 20 -label IRB6400_2_5_150_99_BAL_B
if -var 3 -value 30 -label IRB6400_2_5_200_99_BAL_B
if -var 3 -value 40 -label IRB6400_2_5_200_99_BAL_B
if -var 3 -value 110 -label IRB6400_2_8_150_99_BAL_B
goto -label END_LABEL
#IRB6400_STANDARD
if -var 3 -value 10 -label IRB6400_2_5_120_99
if -var 3 -value 20 -label IRB6400_2_5_150_99
if -var 3 -value 30 -label IRB6400_2_5_200_99
if -var 3 -value 40 -label IRB6400_2_5_200_99
if -var 3 -value 110 -label IRB6400_2_8_150_99
goto -label END_LABEL
#IRB6400_2_5_120_99
echo -text "Installing IRB 6400/2.5-120"
install -resource Function -name "IRB" -descr "6400/2.5-120"
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_120s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_120i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_120e.cfg -domain MOC
goto -label END_LABEL
#IRB6400_2_5_150_99
echo -text "Installing IRB 6400/2.5-150"
install -resource Function -name "IRB" -descr "6400/2.5-150"
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_150s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_150i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_150e.cfg -domain MOC
goto -label END_LABEL
#IRB6400_2_5_150_99_120
echo -text "Installing IRB 6400/2.5-150 120 kg"
install -resource Function -name "IRB" -descr "6400/2.5-150-120"
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_150_120s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_150_120i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_150_120e.cfg -domain MOC
goto -label END_LABEL
#IRB6400_2_5_200_99
echo -text "Installing IRB 6400/2.5-200"
install -resource Function -name "IRB" -descr "6400/2.5-200"
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_200s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_200i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_200e.cfg -domain MOC
goto -label END_LABEL
#IRB6400_2_8_150_99
echo -text "Installing IRB 6400/2.8-150"
install -resource Function -name "IRB" -descr "6400/2.8-150"
config -filename  $BOOTPATH/irbcfg/REX6400_2.8_150s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.8_150i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.8_150e.cfg -domain MOC
goto -label END_LABEL
#IRB6400_2_8_200_99
echo -text "Installing IRB 6400/2.8-200"
install -resource Function -name "IRB" -descr "6400/2.8-200"
config -filename  $BOOTPATH/irbcfg/REX6400_2.8_200s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.8_200i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.8_200e.cfg -domain MOC
goto -label END_LABEL
#IRB6400_3_0_100_99
echo -text "Installing IRB 6400/3.0-100"
install -resource Function -name "IRB" -descr "6400/3.0-100"
config -filename  $BOOTPATH/irbcfg/REX6400_3.0_100s.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_3.0_100i.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_3.0_100e.cfg -domain MOC
goto -label END_LABEL
#IRB6400_2_5_120_99_BAL_B
echo -text "Installing IRB 6400/2.5-120 balB"
install -resource Function -name "IRB" -descr "6400/2.5-120 balB"
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_120_bal_Bs.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_120_bal_Bi.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_120_bal_Be.cfg -domain MOC
goto -label END_LABEL
#IRB6400_2_5_150_99_BAL_B
echo -text "Installing IRB 6400/2.5-150 balB"
install -resource Function -name "IRB" -descr "6400/2.5-150 balB"
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_150_bal_Bs.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_150_bal_Bi.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_150_bal_Be.cfg -domain MOC
goto -label END_LABEL
#IRB6400_2_5_200_99_BAL_B
echo -text "Installing IRB 6400/2.5-200 balB"
install -resource Function -name "IRB" -descr "6400/2.5-200 balB"
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_200_bal_Bs.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_200_bal_Bi.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.5_200_bal_Be.cfg -domain MOC
goto -label END_LABEL
#IRB6400_2_8_150_99_BAL_B
echo -text "Installing IRB 6400/2.8-150 balB"
install -resource Function -name "IRB" -descr "6400/2.8-150 balB"
config -filename  $BOOTPATH/irbcfg/REX6400_2.8_150_bal_Bs.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.8_150_bal_Bi.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/REX6400_2.8_150_bal_Be.cfg -domain MOC
goto -label END_LABEL
#END_LABEL
echo -text "No calibration data available"
config -filename  $BOOTPATH/irbcfg/uncalib.cfg -domain MOC
