| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- #PRJS="PRJ_XIAN_AC_I1_O1_P4"
- #PRJS="PRJ_XIAN_AC_I1_O1_P8"
- #PRJS="PRJ_ITK_AC_I1_O1"
- #PRJS="PRJ_ITK_AC_I3_O1"
- #PRJS="PRJ_LITECH_AC_I1_O1"
- #PRJS="PRJ_LITECH_AC_I3_O1"
- #PRJS="PRJ_ANDERSON_AC_I3_O3"
- #PRJS="PRJ_USASL_AC_I3_O1"
- #PRJS="PRJ_USASL_AC_I3_O3"
- #PRJS="PRJ_HYPERTEC_AC_I3_O1"
- #PRJS="PRJ_INSPUR_DC_I_DC_O"
- #PRJS="PRJ_INSPUR_DC_I_DC_O_NEW_96"
- #PRJS="PRJ_RELEASE_DC_I_DC_O"
- #PRJS="PRJ_RELEASE_AC_I1_O1"
- #PRJS="PRJ_RELEASE_AC_I3_O1"
- #PRJS="PRJ_RELEASE_AC_I3_O3"
- #PRJS="PRJ_STSC_I3_O3"
- #PRJS="PRJ_STSC_I3_O1_OLED"
- #PRJS="PRJ_SG_I3_O3"
- #PRJS="PRJ_ESOUTH_DC_I1_O4_RGB5"
- #PRJS="PRJ_TEST"
- #PRJS="PRJ_TEST_AC_I1_O1"
- PRJS="PRJ_JUNGONG_AC_I1_O1"
- #PRJS="PRJ_TEST_AC_I3_O1"
- #PRJS="PRJ_TEST_AC_I3_O3"
- #PRJS="PRJ_INST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DEBIAO_AC_I3_O1"
- #PRJS="PRJ_IP_GOX001_7_AC_I3_O1"
- #PRJS="PRJ_IP_GOX001_4_AC_I3_O1"
- #PRJS="PRJ_IP_GANGKEDA_AC_I3_O1"
- #PRJS="PRJ_TCT_AC_I3_O1"
- #PRJS="PRJ_709_AC_I3_O1_OLED"
- #PRJS="PRJ_New_Malaysia_AC_I3_O1"
- #PRJS="PRJ_IP_XXXXXXXXXX_AC_I1_O1"
- #PRJS="PRJ_IP_AC_WANGXIAOPIN_I3_O3"
- fulldir=$(realpath $0)
- curdir=$(dirname $fulldir)
- ip_flag=0
- custdir=$curdir/cust_data
- name=null
- rootdir=$curdir/output/t113i/pack_dir
- appdir=$rootdir/mnt/UDISK/run/app
- function prj_enable()
- {
- fcfg=$curdir/pro/config/cfg.h
- fmak=$curdir/pro/CMakefile.txt
- #clear space
- sed -i 's|^[[:space:]]\(#define PRJ_*\)|\1|g' $fcfg
- #mask all PRJ_XXX define
- sed -i 's|^\(.*\)\(#define PRJ_*\)|//\2|g' $fcfg
- #enable the needed PRJ_XXX define
- sed -i "s|^//\(#define $1\s*$\)|\1|g" $fcfg
- }
- function prj_unmask()
- {
- prj=$1
- }
- function do_copy()
- {
- echo do_copy ...
-
- if [[ "$1" == "PRJ_IP_"* ]]; then
- ip_flag=1
- fi
- if [ $ip_flag -eq 1 ]; then
- rootdir=$curdir/output/t113s/pack_dir
- appdir=$rootdir/mnt/UDISK/app
- fi
- rm -rf $appdir/image_qt
- mkdir -p $appdir/image
- mkdir -p $appdir/cert
- cp -f $custdir/cert/server.* $appdir/cert/
- cp -f $custdir/changes.txt $appdir/
- cp -f $custdir/db/pdu_dat.db $appdir/
- cp -f $custdir/logo/logo_neuter.png $appdir/image/logo.png
- cp -f $custdir/qt/S90PDUApp $rootdir/etc/init.d/
- cp -f $custdir/smartPDU_PhList.ini $appdir/
- if [ $ip_flag -eq 1 ]; then
- cp -f $custdir/qt/IP/Qt_Test $appdir/
- cp -f $custdir/db/pdu_dat_ip.db $appdir/pdu_dat.db
- else
- cp -f $custdir/qt/Qt_Test $appdir/
- fi
- if [ "$1" = "PRJ_XIAN_AC_I1_O1_P4" ]; then
- name=ac_in1_out1_p4_xian
- elif [ "$1" = "PRJ_XIAN_AC_I1_O1_P8" ]; then
- name=ac_in1_out1_p8_xian
- elif [ "$1" = "PRJ_ITK_AC_I1_O1" ]; then
- name=ac_in1_out1_russia_itk
- cp -f $custdir/db/pdu_dat_itk.db $appdir/pdu_dat.db
- cp -f $custdir/logo/logo_itk.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_ITK_AC_I3_O1" ]; then
- name=ac_in3_out1_russia_itk
- cp -f $custdir/logo/logo_itk.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_RELEASE_DC_I_DC_O" ]; then
- name=dc_in_dc_out_release
- elif [ "$1" = "PRJ_RELEASE_AC_I1_O1" ]; then
- name=ac_in1_out1_release
- elif [ "$1" = "PRJ_IP_GANGKEDA_AC_I3_O1" ];then
- name=ip_gangkeda_ac_i3_o1
- elif [ "$1" = "PRJ_RELEASE_AC_I3_O1" ]; then
- name=ac_in3_out1_release
- elif [ "$1" = "PRJ_RELEASE_AC_I3_O3" ]; then
- name=ac_in3_out3_release
- elif [ "$1" = "PRJ_LITECH_AC_I1_O1" ]; then
- name=ac_in1_out1_litech
- cp -f $custdir/logo/logo_litech.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_LITECH_AC_I3_O1" ]; then
- name=ac_in3_out1_litech
- cp -f $custdir/logo/logo_litech.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_ANDERSON_AC_I3_O3" ]; then
- name=ac_in3_out3_anderson
- elif [ "$1" = "PRJ_USASL_AC_I3_O1" ]; then
- name=ac_in3_out1_usa_sl
- elif [ "$1" = "PRJ_USASL_AC_I3_O3" ]; then
- name=ac_in3_out3_usa_sl
- elif [ "$1" = "PRJ_HYPERTEC_AC_I3_O1" ]; then
- name=ac_in3_out1_hypertec
- cp -f $custdir/logo/logo_hypertec.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_INSPUR_DC_I_DC_O" ]; then
- name=dc_in1_out1_inspur
- elif [ "$1" = "PRJ_INSPUR_DC_I_DC_O_NEW_96" ]; then
- name=dc_in1_out1_inspur_new_96
- cp -f $custdir/logo/upulsepower.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_STSC_I3_O3" ]; then
- name=ac_in3_out3_stsc
- elif [ "$1" = "PRJ_SG_I3_O3" ]; then
- name=ac_in2_out1_sg24016
- elif [ "$1" = "PRJ_TEST" ]; then
- name=ac_in3_out1_test
- elif [ "$1" = "PRJ_TEST_AC_I1_O1" ]; then
- name=ac_in1_out1_test
- cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_TCT_AC_I3_O1" ]; then
- name=tct_ac_in3_out1_test
- elif [ "$1" = "PRJ_TEST_AC_I3_O1" ]; then
- name=ac_in3_out1_test
- cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_TEST_AC_I3_O3" ]; then
- name=ac_in3_out3_test
- cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_TEST" ]; then
- name=ac_in3_out1_test
- elif [ "$1" = "PRJ_IP_AC_I3_O3" ];then
- name=ac_in3_out3_ip
- elif [ "$1" = "PRJ_YST_AC_I1_O1" ];then
- name=ac_in1_out1_YST
- elif [ "$1" = "PRJ_BYD_UPS_AC_I1_O1" ];then
- name=ac_in1_out1_byd_ups
- cp -f $custdir/db/pdu_dat_byd_ups.db $appdir/pdu_dat.db
- elif [ "$1" = "PRJ_INST2302_DC_OLED" ];then
- name=dc_in_dc_out_oled
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_INST2106_AC_I1_O1_OLED" ];then
- name=ac_in1_out1_inst2106_oled
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_STSC_I3_O1_OLED" ];then
- name=ac_in3_out1_stsc_oled
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_ESOUTH_DC_I1_O4_RGB5" ];then
- name=dc_in1_out4_esouth_rgb5
- cp -f $custdir/qt/rgb/Qt_Test $appdir/
- cp -rf $custdir/qt/rgb/image_qt $appdir/
- cp -f $custdir/qt/rgb/S90PDUApp $rootdir/etc/init.d/
- cp -f $custdir/db/pdu_dat_esouth_dc.db $appdir/pdu_dat.db
- elif [ "$1" = "PRJ_IP_AC_I3_O1" ];then
- name=ip_ac_in3_out1_release
- elif [ "$1" = "PRJ_IP_DEBIAO_AC_I3_O1" ];then
- name=ip_ac_debiao_in3_out1_release
- cp -f $custdir/db/pdu_dat_no_sensor.db $appdir/pdu_dat.db
- elif [ "$1" = "PRJ_IP_GOX001_7_AC_I3_O1" ];then
- name=ip_ac_gox001_7_in3_out1_release
- elif [ "$1" = "PRJ_IP_GOX001_4_AC_I3_O1" ];then
- name=ip_ac_gox001_4_in3_out1_release
- elif [ "$1" = "PRJ_IP_AC_I1_O1" ];then
- name=ip_ac_in1_out1_release
- elif [ "$1" = "PRJ_IP_XXXXXXXXXX_AC_I1_O1" ];then
- name=ip_ac_xxxxxxxxxx_in1_out1_release
- elif [ "$1" = "PRJ_IP_YUNNAN_AC_I1_O1" ];then
- name=ip_ac_yunnan_in1_out1_release
- elif [ "$1" = "PRJ_YUNNAN_AC_I1_O1" ];then
- name=ac_yunnan_in1_out1_release
- cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_GOWONE_125A_AC_I3_O1" ];then
- name=ac_in3_out1_gowone_125A
- cp -f $custdir/db/pdu_dat_no_dry.db $appdir/pdu_dat.db
- cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
- elif [ "$1" = "PRJ_DUALWIRES_AC_I3_O2" ];then
- name=ac_DualWires_in3_out2_release
- elif [ "$1" = "PRJ_TIDA_AC_I3_O1" ];then
- name=ac_tida_in3_out1_release
- elif [ "$1" = "PRJ_IP_CHONGQING_AC_I1_O1" ];then
- cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
- name=ip_ac_chongqing_in1_out1_release
- elif [ "$1" = "PRJ_IP_AOSENS_AC_I1_O1" ];then
- # cp -f $custdir/logo/logo_aosens.png $appdir/image/logo.png
- name=ip_ac_in1_out1_release
- elif [ "$1" = "PRJ_IP_AOSENS_DC_I_O" ]; then
- cp -f $custdir/logo/logo_aosens.png $appdir/image/logo.png
- name=ip_dc_aosens_in1_out1_release
- elif [ "$1" = "PRJ_Malaysia_AC_I3_O1" ];then
- name=ac_Malaysia_in3_out1_release
- cp -f $custdir/db/pdu_dat_malaysia_front.db $appdir/pdu_dat.db
- cp -f $custdir/logo/logo_litech.png $appdir/image/logo.png
- cp -f $custdir/qt/rgb_lcd/S90PDUApp $rootdir/etc/init.d/
- elif [ "$1" = "PRJ_New_Malaysia_AC_I3_O1" ];then
- name=ac_Malaysia_new_back_in3_out1_release
- cp -f $custdir/db/pdu_dat_malaysia_new_back.db $appdir/pdu_dat.db
- cp -f $custdir/logo/logo_neuter.png $appdir/image/logo.png
- cp -f $custdir/qt/rgb_lcd/S90PDUApp $rootdir/etc/init.d/
- elif [ "$1" = "PRJ_2405_AC_I1_O1_OLED" ];then
- name=ac_in1_out1_2405_OLED_release
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_JUNGONG_AC_I1_O1" ];then
- name=ac_in1_out1_jungong_OLED_release
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_709_AC_I3_O1_OLED" ];then
- name=ac_in3_out1_709_oled_release
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_2503_AC_I1_O1_OLED" ];then
- name=ac_in1_out1_2503_OLED_release
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_CHANGCHUN_AC_I1_O1_OLED" ];then
- name=ac_in1_out1_changchun_OLED_release
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_JUNGONG_KEKONG_AC_I1_O1_OLED" ];then
- name=ac_in1_out1_jungongkekong_OLED_release
- rm -f $appdir/Qt_Test
- elif [ "$1" = "PRJ_INSPUR_AC_I1_O1" ];then
- name=ac_in1_out1_inspur_release
- cp -f $custdir/logo/upulsepower.png $appdir/image/logo.png
- else
- echo error! $RPJ not define!!!
- exit 1
- fi
- rm -rf $appdir/../web
- cp -rf $custdir/web/unique $appdir/../web
- prj_enable $1
- }
- function do_compile()
- {
- echo do_compile ...
- cd $curdir/pro
- rm -rf build; mkdir build; cd build
- if [[ "$1" == "PRJ_IP_"* ]];then
- cmake .. -DCHIP=t113s && make
- else
- cmake .. -DCHIP=t113i && make
- fi
- if [ $? -gt 0 ]; then
- exit 1
- fi
- }
- function do_pack()
- {
- echo do_pack ...
- if [[ "$1" == "PRJ_IP_"* ]];then
- $curdir/output/t113s/pack.sh
- else
- $curdir/output/t113i/pack.sh
- fi
- }
- function do_zip()
- {
- echo do_zip ...
-
- ztm=`date +%Y%m%d_%H%M%S`
- if [[ "$1" == "PRJ_IP_"* ]];then
- zname="upgrade_"$ztm"_$name"
- zdir=$curdir/output/t113s/push
- files="push.bat push_retain.bat pdutar tools/*"
- cd $zdir; zip -q $zname.zip $files
- mv $zname.zip $curdir/output/t113s/
- else
- zname="upgrade_"$ztm"_$name"
- zdir=$curdir/output/t113i/push2
- files="push.bat push_retain.bat pdutar tools/*"
- cd $zdir; zip -q $zname.zip $files
- mv $zname.zip $curdir/output/t113i/
- fi
- }
- function do_one()
- {
- echo $PATH
- do_copy $1
- do_compile $1
- do_pack $1
- do_zip $1
- }
- function do_all()
- {
- for s in $PRJS; do
- do_one $s
- done
- }
- do_all
|