# Install.cmd script for the robot system rel 4.0
#
# Install questions
#    var 1  = irb type
#    var 4  = robot type
#    var 10 = temp use.
echo -text ""
echo -text "IRB 2400W/10 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 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 "DC2    = No external axes DC2"
echo -text "DC4    = No external axes DC4"
echo -text "Ext 1  = Ext axes in controller cabinet"
echo -text "Ext 2  = Ext axes only in drive cabinet"
query -text "No ext   DC2     DC4    Ext 1   Ext 2" \
      -var 10 -fk_text
if -var 10 -value 10 -label NO_EXTAX
if -var 10 -value 20 -label DC2
if -var 10 -value 30 -label DC4
if -var 10 -value 40 -label EXTAXSMALL
if -var 10 -value 50 -label DC1
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"
echo -text "DC4U   = External axes DC4U"
query -text "No ext    T       GT    DC4U" \
      -var 10 -fk_text
if -var 10 -value 10 -label DC1A
if -var 10 -value 20 -label DC2TA
if -var 10 -value 30 -label DC2GTA
if -var 10 -value 40 -label DC4U
if -var 10 -value 50 -label DC4U
goto -label END_LABEL

#NO_EXTAX
echo -text "Installing config for DC link (DC1)"
config -filename  $BOOTPATH/../drive_lib/dc1_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo1c1.cfg -domain MOC -internal
goto -label MOTOR_TYPE
#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 MOTOR_TYPE
#DC1
echo -text "Installing config for DC link (DC1)"
config -filename  $BOOTPATH/../drive_lib/dc1_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo1c1.cfg -domain MOC -internal
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/trafo4c1.cfg -domain MOC -internal
goto -label MOTOR_TYPE
#DC1A
echo -text "Installing config for DC link (DC1A)"
config -filename  $BOOTPATH/../drive_lib/trafo1c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/dc1_c1b1l1.cfg -domain MOC -internal
goto -label MOTOR_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 MOTOR_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 MOTOR_TYPE

#VOID
#EXTAXSMALL
if -var 9 -value 50 -label USER_QUERY
setvar -var 10 -value 0
getkey -id "DriveSelectExtAxSmall" -var 10 -strvar $ANSWER -errlabel USER_QUERY
goto -strvar $ANSWER
#USER_QUERY
echo -text "Select ext axes group in"
echo -text "controller cabinet."
echo -text ""
echo -text "DC2 = Ext axes group DC2"
echo -text "DC4 = Ext axes group DC4"
query -text " DC2     DC4                          " \
      -var 10 -fk_text
if -var 10 -value 10 -label DC2GROUP
if -var 10 -value 20 -label DC4GROUP
if -var 10 -value 30 -label DC4GROUP
if -var 10 -value 40 -label DC4GROUP
if -var 10 -value 50 -label DC4GROUP
goto -label END_LABEL
#DC2GROUP
echo -text "Select ext axes in controller cabinet."
echo -text ""
echo -text "2C    = Ext axes DC2C"
echo -text "2CTGT = Ext axes DC2C TRACK + GT"
echo -text "2CGT  = Ext axes DC2C + GT"
echo -text "2T    = Ext axes DC2T"
echo -text "2TTGT = Ext axes DC2T TRACK + GT"
echo -text "2TGT  = Ext axes DC2T + GT"
echo -text "2GT   = Ext axes DC2 + GT"
query -text "  2C    2CTGT    2CGT     2T     SCAN" \
     -text2 "2TTGT    2TGT    2GT             SCAN" -var 10 -fk_text
if -var 10 -value 10 -label DC2C
if -var 10 -value 20 -label DC2CGT_T
if -var 10 -value 30 -label DC2CGT
if -var 10 -value 40 -label DC2T
if -var 10 -value 110 -label DC2TGT_T
if -var 10 -value 120 -label DC2TGT
if -var 10 -value 130 -label DC2GT
if -var 10 -value 140 -label DC2GT
#DC4GROUP
echo -text "Select ext axes in controller cabinet."
echo -text ""
echo -text "4U    = Ext axes DC4U"
echo -text "4UPD  = Ext axes DC4U Prepared drives"
echo -text "4UGU  = Ext axes DC4U + GU"
echo -text "4UTGU = Ext axes DC4U TRACK + GU"
query -text "  4U    4UPD     4UGU   4UTGU        " \
      -var 10 -fk_text
if -var 10 -value 10 -label DC4U
if -var 10 -value 20 -label DC4UPD
if -var 10 -value 30 -label DC4UGU
if -var 10 -value 40 -label DC4UGU_T
if -var 10 -value 50 -label DC4UGU_T
#DC2C
echo -text "Installing config for drive system"
echo -text "(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
#DC2CGT_T
echo -text "Installing config for drive system"
echo -text "(dc2cgt_t)"
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
config -filename  $BOOTPATH/../drive_lib/drive8_9_gt_c1b2.cfg -domain MOC
goto -label MOTOR_TYPE
#DC2CGT
echo -text "Installing config for drive system"
echo -text "(dc2cgt)"
config -filename  $BOOTPATH/../drive_lib/dc2c_c1b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc2c_c1b2.cfg -domain MOC
config -filename  $BOOTPATH/../drive_lib/drive8_9_gt_c1b2.cfg -domain MOC
goto -label MOTOR_TYPE
#DC2T
echo -text "Installing config for drive system"
echo -text "(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
#DC2TGT_T
echo -text "Installing config for drive system"
echo -text "(dc2tgt_t)"
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
config -filename  $BOOTPATH/../drive_lib/drive8_9_gt_c1b2.cfg -domain MOC
goto -label MOTOR_TYPE
#DC2TGT
echo -text "Installing config for drive system"
echo -text "(dc2tgt)"
config -filename  $BOOTPATH/../drive_lib/dc2t_c1b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc2t_c1b2.cfg -domain MOC
config -filename  $BOOTPATH/../drive_lib/drive8_9_gt_c1b2.cfg -domain MOC
goto -label MOTOR_TYPE
#DC2GT
echo -text "Installing config for drive system"
echo -text "(dc2gt)"
config -filename  $BOOTPATH/../drive_lib/dc2_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo2c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_8_gt_c1b2.cfg -domain MOC
goto -label MOTOR_TYPE
#DC4U
echo -text "Installing config for drive system"
echo -text "(dc4u)"
config -filename  $BOOTPATH/../drive_lib/dc4u_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo4c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc4u_c1b1.cfg -domain MOC
goto -label EXTCAB
#DC4UPD
echo -text "Installing config for drive system"
echo -text "(dc4u Prepared drives)"
config -filename  $BOOTPATH/../drive_lib/dc4u_c1b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo4c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc4u_c1b2.cfg -domain MOC
goto -label EXTCAB
#DC4UGU
echo -text "Installing config for drive system"
echo -text "(dc4ugu)"
config -filename  $BOOTPATH/../drive_lib/dc4u_c1b2.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo4c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc4u_c1b2.cfg -domain MOC
config -filename  $BOOTPATH/../drive_lib/drive8_9_gu_c1b2.cfg -domain MOC
goto -label EXTCAB
#DC4UGU_T
echo -text "Installing config for drive system"
echo -text "(dc4ugu_t)"
config -filename  $BOOTPATH/../drive_lib/dc4u_c1b1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/trafo4c1.cfg -domain MOC -internal
config -filename  $BOOTPATH/../drive_lib/drive7_dc4u_c1b1.cfg -domain MOC
config -filename  $BOOTPATH/../drive_lib/drive8_9_gu_c1b2.cfg -domain MOC
goto -label EXTCAB

#EXTCAB
if -var 9 -value 50 -label USER_QUERY
setvar -var 10 -value 0
getkey -id "DriveSelectExtCab" -var 10 -strvar $ANSWER -errlabel MOTOR_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 MOTOR_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 MOTOR_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 MOTOR_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 MOTOR_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 MOTOR_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 MOTOR_TYPE

#MOTOR_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 robot type for IRB2400W/10:"
query -text "Type A  Type B  " -var 4 -fk_text
if -var 4 -value 10 -label IRB2400_98_1_5_10_WALL
if -var 4 -value 20 -label IRB2400_98_1_5_10_Y_WALL
if -var 4 -value 30 -label IRB2400_98_1_5_10_Y_WALL
if -var 4 -value 40 -label IRB2400_98_1_5_10_Y_WALL
if -var 4 -value 50 -label IRB2400_98_1_5_10_Y_WALL
goto -label END_LABEL
#IRB2400_98_1_5_10_WALL
echo -text "Installing IRB 2400/10 M2000 Wall-Mounted"
install -resource Function -name "IRB" -descr "2400/10 M2000 Wall-Mounted"
config -filename  $BOOTPATH/irbcfg/m24810ws.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/m24810wi.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/m24810we.cfg -domain MOC
goto -label END_LABEL
#IRB2400_98_1_5_10_Y_WALL
echo -text "Installing IRB 2400/10 M2000 Y Wall-Mounted"
install -resource Function -name "IRB" -descr "2400/10 M2000 Y Wall-Mounted"
config -filename  $BOOTPATH/irbcfg/m24810yws.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/m24810ywi.cfg -domain MOC -internal
config -filename  $BOOTPATH/irbcfg/m24810ywe.cfg -domain MOC
goto -label END_LABEL
#END_LABEL
echo -text "No calibration data available"
config -filename  $BOOTPATH/irbcfg/uncalib.cfg -domain MOC
