pub 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. #PRJS="PRJ_XIAN_AC_I1_O1_P4"
  2. #PRJS="PRJ_XIAN_AC_I1_O1_P8"
  3. #PRJS="PRJ_ITK_AC_I1_O1"
  4. #PRJS="PRJ_ITK_AC_I3_O1"
  5. #PRJS="PRJ_LITECH_AC_I1_O1"
  6. #PRJS="PRJ_LITECH_AC_I3_O1"
  7. #PRJS="PRJ_ANDERSON_AC_I3_O3"
  8. #PRJS="PRJ_USASL_AC_I3_O1"
  9. #PRJS="PRJ_USASL_AC_I3_O3"
  10. #PRJS="PRJ_HYPERTEC_AC_I3_O1"
  11. #PRJS="PRJ_INSPUR_DC_I_DC_O"
  12. #PRJS="PRJ_INSPUR_DC_I_DC_O_NEW_96"
  13. #PRJS="PRJ_RELEASE_DC_I_DC_O"
  14. #PRJS="PRJ_RELEASE_AC_I1_O1"
  15. #PRJS="PRJ_RELEASE_AC_I3_O1"
  16. #PRJS="PRJ_RELEASE_AC_I3_O3"
  17. #PRJS="PRJ_STSC_I3_O3"
  18. #PRJS="PRJ_STSC_I3_O1_OLED"
  19. #PRJS="PRJ_SG_I3_O3"
  20. #PRJS="PRJ_ESOUTH_DC_I1_O4_RGB5"
  21. #PRJS="PRJ_TEST"
  22. #PRJS="PRJ_TEST_AC_I1_O1"
  23. PRJS="PRJ_JUNGONG_AC_I1_O1"
  24. #PRJS="PRJ_TEST_AC_I3_O1"
  25. #PRJS="PRJ_TEST_AC_I3_O3"
  26. #PRJS="PRJ_INST2302_DC_OLED"
  27. #PRJS="PRJ_INST2106_AC_I1_O1_OLED"
  28. #PRJS="PRJ_YST_AC_I1_O1"
  29. #PRJS="PRJ_YUNNAN_AC_I1_O1"
  30. #PRJS="PRJ_DUALWIRES_AC_I3_O2"
  31. #PRJS="PRJ_GOWONE_125A_AC_I3_O1"
  32. #PRJS="PRJ_Malaysia_AC_I3_O1"
  33. #PRJS="PRJ_2405_AC_I1_O1_OLED"
  34. #PRJS="PRJ_2503_AC_I1_O1_OLED"
  35. #PRJS="PRJ_CHANGCHUN_AC_I1_O1_OLED"
  36. #PRJS="PRJ_TIDA_AC_I3_O1"
  37. #PRJS="PRJ_BYD_UPS_AC_I1_O1"
  38. #PRJS="PRJ_JUNGONG_KEKONG_AC_I1_O1_OLED"
  39. #PRJS="PRJ_INSPUR_AC_I1_O1"
  40. #PRJS="PRJ_USASL_AC_I3_O1 PRJ_USASL_AC_I3_O3"
  41. #PRJS="PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
  42. #PRJS="PRJ_ITK_AC_I1_O1 PRJ_ITK_AC_I3_O1"
  43. #PRJS="PRJ_TEST_AC_I1_O1 PRJ_TEST_AC_I3_O1"
  44. #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1"
  45. #PRJS="PRJ_RELEASE_DC_I_DC_O PRJ_RELEASE_AC_I1_O1 PRJ_RELEASE_AC_I3_O1 PRJ_RELEASE_AC_I3_O3"
  46. #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1 PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
  47. #PRJS="PRJ_IP_AC_I3_O3"
  48. #PRJS="PRJ_IP_AC_I3_O1"
  49. #PRJS="PRJ_IP_AC_I1_O1"
  50. #PRJS="PRJ_IP_YUNNAN_AC_I1_O1"
  51. #PRJS="PRJ_IP_CHONGQING_AC_I1_O1"
  52. #PRJS="PRJ_IP_AOSENS_AC_I1_O1"
  53. #PRJS="PRJ_IP_AOSENS_DC_I_O"
  54. #PRJS="PRJ_IP_DEBIAO_AC_I3_O1"
  55. #PRJS="PRJ_IP_GOX001_7_AC_I3_O1"
  56. #PRJS="PRJ_IP_GOX001_4_AC_I3_O1"
  57. #PRJS="PRJ_IP_GANGKEDA_AC_I3_O1"
  58. #PRJS="PRJ_TCT_AC_I3_O1"
  59. #PRJS="PRJ_709_AC_I3_O1_OLED"
  60. #PRJS="PRJ_New_Malaysia_AC_I3_O1"
  61. #PRJS="PRJ_IP_XXXXXXXXXX_AC_I1_O1"
  62. #PRJS="PRJ_IP_AC_WANGXIAOPIN_I3_O3"
  63. fulldir=$(realpath $0)
  64. curdir=$(dirname $fulldir)
  65. ip_flag=0
  66. custdir=$curdir/cust_data
  67. name=null
  68. rootdir=$curdir/output/t113i/pack_dir
  69. appdir=$rootdir/mnt/UDISK/run/app
  70. function prj_enable()
  71. {
  72. fcfg=$curdir/pro/config/cfg.h
  73. fmak=$curdir/pro/CMakefile.txt
  74. #clear space
  75. sed -i 's|^[[:space:]]\(#define PRJ_*\)|\1|g' $fcfg
  76. #mask all PRJ_XXX define
  77. sed -i 's|^\(.*\)\(#define PRJ_*\)|//\2|g' $fcfg
  78. #enable the needed PRJ_XXX define
  79. sed -i "s|^//\(#define $1\s*$\)|\1|g" $fcfg
  80. }
  81. function prj_unmask()
  82. {
  83. prj=$1
  84. }
  85. function do_copy()
  86. {
  87. echo do_copy ...
  88. if [[ "$1" == "PRJ_IP_"* ]]; then
  89. ip_flag=1
  90. fi
  91. if [ $ip_flag -eq 1 ]; then
  92. rootdir=$curdir/output/t113s/pack_dir
  93. appdir=$rootdir/mnt/UDISK/app
  94. fi
  95. rm -rf $appdir/image_qt
  96. mkdir -p $appdir/image
  97. mkdir -p $appdir/cert
  98. cp -f $custdir/cert/server.* $appdir/cert/
  99. cp -f $custdir/changes.txt $appdir/
  100. cp -f $custdir/db/pdu_dat.db $appdir/
  101. cp -f $custdir/logo/logo_neuter.png $appdir/image/logo.png
  102. cp -f $custdir/qt/S90PDUApp $rootdir/etc/init.d/
  103. cp -f $custdir/smartPDU_PhList.ini $appdir/
  104. if [ $ip_flag -eq 1 ]; then
  105. cp -f $custdir/qt/IP/Qt_Test $appdir/
  106. cp -f $custdir/db/pdu_dat_ip.db $appdir/pdu_dat.db
  107. else
  108. cp -f $custdir/qt/Qt_Test $appdir/
  109. fi
  110. if [ "$1" = "PRJ_XIAN_AC_I1_O1_P4" ]; then
  111. name=ac_in1_out1_p4_xian
  112. elif [ "$1" = "PRJ_XIAN_AC_I1_O1_P8" ]; then
  113. name=ac_in1_out1_p8_xian
  114. elif [ "$1" = "PRJ_ITK_AC_I1_O1" ]; then
  115. name=ac_in1_out1_russia_itk
  116. cp -f $custdir/db/pdu_dat_itk.db $appdir/pdu_dat.db
  117. cp -f $custdir/logo/logo_itk.png $appdir/image/logo.png
  118. elif [ "$1" = "PRJ_ITK_AC_I3_O1" ]; then
  119. name=ac_in3_out1_russia_itk
  120. cp -f $custdir/logo/logo_itk.png $appdir/image/logo.png
  121. elif [ "$1" = "PRJ_RELEASE_DC_I_DC_O" ]; then
  122. name=dc_in_dc_out_release
  123. elif [ "$1" = "PRJ_RELEASE_AC_I1_O1" ]; then
  124. name=ac_in1_out1_release
  125. elif [ "$1" = "PRJ_IP_GANGKEDA_AC_I3_O1" ];then
  126. name=ip_gangkeda_ac_i3_o1
  127. elif [ "$1" = "PRJ_RELEASE_AC_I3_O1" ]; then
  128. name=ac_in3_out1_release
  129. elif [ "$1" = "PRJ_RELEASE_AC_I3_O3" ]; then
  130. name=ac_in3_out3_release
  131. elif [ "$1" = "PRJ_LITECH_AC_I1_O1" ]; then
  132. name=ac_in1_out1_litech
  133. cp -f $custdir/logo/logo_litech.png $appdir/image/logo.png
  134. elif [ "$1" = "PRJ_LITECH_AC_I3_O1" ]; then
  135. name=ac_in3_out1_litech
  136. cp -f $custdir/logo/logo_litech.png $appdir/image/logo.png
  137. elif [ "$1" = "PRJ_ANDERSON_AC_I3_O3" ]; then
  138. name=ac_in3_out3_anderson
  139. elif [ "$1" = "PRJ_USASL_AC_I3_O1" ]; then
  140. name=ac_in3_out1_usa_sl
  141. elif [ "$1" = "PRJ_USASL_AC_I3_O3" ]; then
  142. name=ac_in3_out3_usa_sl
  143. elif [ "$1" = "PRJ_HYPERTEC_AC_I3_O1" ]; then
  144. name=ac_in3_out1_hypertec
  145. cp -f $custdir/logo/logo_hypertec.png $appdir/image/logo.png
  146. elif [ "$1" = "PRJ_INSPUR_DC_I_DC_O" ]; then
  147. name=dc_in1_out1_inspur
  148. elif [ "$1" = "PRJ_INSPUR_DC_I_DC_O_NEW_96" ]; then
  149. name=dc_in1_out1_inspur_new_96
  150. cp -f $custdir/logo/upulsepower.png $appdir/image/logo.png
  151. elif [ "$1" = "PRJ_STSC_I3_O3" ]; then
  152. name=ac_in3_out3_stsc
  153. elif [ "$1" = "PRJ_SG_I3_O3" ]; then
  154. name=ac_in2_out1_sg24016
  155. elif [ "$1" = "PRJ_TEST" ]; then
  156. name=ac_in3_out1_test
  157. elif [ "$1" = "PRJ_TEST_AC_I1_O1" ]; then
  158. name=ac_in1_out1_test
  159. cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
  160. elif [ "$1" = "PRJ_TCT_AC_I3_O1" ]; then
  161. name=tct_ac_in3_out1_test
  162. elif [ "$1" = "PRJ_TEST_AC_I3_O1" ]; then
  163. name=ac_in3_out1_test
  164. cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
  165. elif [ "$1" = "PRJ_TEST_AC_I3_O3" ]; then
  166. name=ac_in3_out3_test
  167. cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
  168. elif [ "$1" = "PRJ_TEST" ]; then
  169. name=ac_in3_out1_test
  170. elif [ "$1" = "PRJ_IP_AC_I3_O3" ];then
  171. name=ac_in3_out3_ip
  172. elif [ "$1" = "PRJ_YST_AC_I1_O1" ];then
  173. name=ac_in1_out1_YST
  174. elif [ "$1" = "PRJ_BYD_UPS_AC_I1_O1" ];then
  175. name=ac_in1_out1_byd_ups
  176. cp -f $custdir/db/pdu_dat_byd_ups.db $appdir/pdu_dat.db
  177. elif [ "$1" = "PRJ_INST2302_DC_OLED" ];then
  178. name=dc_in_dc_out_oled
  179. rm -f $appdir/Qt_Test
  180. elif [ "$1" = "PRJ_INST2106_AC_I1_O1_OLED" ];then
  181. name=ac_in1_out1_inst2106_oled
  182. rm -f $appdir/Qt_Test
  183. elif [ "$1" = "PRJ_STSC_I3_O1_OLED" ];then
  184. name=ac_in3_out1_stsc_oled
  185. rm -f $appdir/Qt_Test
  186. elif [ "$1" = "PRJ_ESOUTH_DC_I1_O4_RGB5" ];then
  187. name=dc_in1_out4_esouth_rgb5
  188. cp -f $custdir/qt/rgb/Qt_Test $appdir/
  189. cp -rf $custdir/qt/rgb/image_qt $appdir/
  190. cp -f $custdir/qt/rgb/S90PDUApp $rootdir/etc/init.d/
  191. cp -f $custdir/db/pdu_dat_esouth_dc.db $appdir/pdu_dat.db
  192. elif [ "$1" = "PRJ_IP_AC_I3_O1" ];then
  193. name=ip_ac_in3_out1_release
  194. elif [ "$1" = "PRJ_IP_DEBIAO_AC_I3_O1" ];then
  195. name=ip_ac_debiao_in3_out1_release
  196. cp -f $custdir/db/pdu_dat_no_sensor.db $appdir/pdu_dat.db
  197. elif [ "$1" = "PRJ_IP_GOX001_7_AC_I3_O1" ];then
  198. name=ip_ac_gox001_7_in3_out1_release
  199. elif [ "$1" = "PRJ_IP_GOX001_4_AC_I3_O1" ];then
  200. name=ip_ac_gox001_4_in3_out1_release
  201. elif [ "$1" = "PRJ_IP_AC_I1_O1" ];then
  202. name=ip_ac_in1_out1_release
  203. elif [ "$1" = "PRJ_IP_XXXXXXXXXX_AC_I1_O1" ];then
  204. name=ip_ac_xxxxxxxxxx_in1_out1_release
  205. elif [ "$1" = "PRJ_IP_YUNNAN_AC_I1_O1" ];then
  206. name=ip_ac_yunnan_in1_out1_release
  207. elif [ "$1" = "PRJ_YUNNAN_AC_I1_O1" ];then
  208. name=ac_yunnan_in1_out1_release
  209. cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
  210. elif [ "$1" = "PRJ_GOWONE_125A_AC_I3_O1" ];then
  211. name=ac_in3_out1_gowone_125A
  212. cp -f $custdir/db/pdu_dat_no_dry.db $appdir/pdu_dat.db
  213. cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
  214. elif [ "$1" = "PRJ_DUALWIRES_AC_I3_O2" ];then
  215. name=ac_DualWires_in3_out2_release
  216. elif [ "$1" = "PRJ_TIDA_AC_I3_O1" ];then
  217. name=ac_tida_in3_out1_release
  218. elif [ "$1" = "PRJ_IP_CHONGQING_AC_I1_O1" ];then
  219. cp -f $custdir/logo/logo_gowone.png $appdir/image/logo.png
  220. name=ip_ac_chongqing_in1_out1_release
  221. elif [ "$1" = "PRJ_IP_AOSENS_AC_I1_O1" ];then
  222. # cp -f $custdir/logo/logo_aosens.png $appdir/image/logo.png
  223. name=ip_ac_in1_out1_release
  224. elif [ "$1" = "PRJ_IP_AOSENS_DC_I_O" ]; then
  225. cp -f $custdir/logo/logo_aosens.png $appdir/image/logo.png
  226. name=ip_dc_aosens_in1_out1_release
  227. elif [ "$1" = "PRJ_Malaysia_AC_I3_O1" ];then
  228. name=ac_Malaysia_in3_out1_release
  229. cp -f $custdir/db/pdu_dat_malaysia_front.db $appdir/pdu_dat.db
  230. cp -f $custdir/logo/logo_litech.png $appdir/image/logo.png
  231. cp -f $custdir/qt/rgb_lcd/S90PDUApp $rootdir/etc/init.d/
  232. elif [ "$1" = "PRJ_New_Malaysia_AC_I3_O1" ];then
  233. name=ac_Malaysia_new_back_in3_out1_release
  234. cp -f $custdir/db/pdu_dat_malaysia_new_back.db $appdir/pdu_dat.db
  235. cp -f $custdir/logo/logo_neuter.png $appdir/image/logo.png
  236. cp -f $custdir/qt/rgb_lcd/S90PDUApp $rootdir/etc/init.d/
  237. elif [ "$1" = "PRJ_2405_AC_I1_O1_OLED" ];then
  238. name=ac_in1_out1_2405_OLED_release
  239. rm -f $appdir/Qt_Test
  240. elif [ "$1" = "PRJ_JUNGONG_AC_I1_O1" ];then
  241. name=ac_in1_out1_jungong_OLED_release
  242. rm -f $appdir/Qt_Test
  243. elif [ "$1" = "PRJ_709_AC_I3_O1_OLED" ];then
  244. name=ac_in3_out1_709_oled_release
  245. rm -f $appdir/Qt_Test
  246. elif [ "$1" = "PRJ_2503_AC_I1_O1_OLED" ];then
  247. name=ac_in1_out1_2503_OLED_release
  248. rm -f $appdir/Qt_Test
  249. elif [ "$1" = "PRJ_CHANGCHUN_AC_I1_O1_OLED" ];then
  250. name=ac_in1_out1_changchun_OLED_release
  251. rm -f $appdir/Qt_Test
  252. elif [ "$1" = "PRJ_JUNGONG_KEKONG_AC_I1_O1_OLED" ];then
  253. name=ac_in1_out1_jungongkekong_OLED_release
  254. rm -f $appdir/Qt_Test
  255. elif [ "$1" = "PRJ_INSPUR_AC_I1_O1" ];then
  256. name=ac_in1_out1_inspur_release
  257. cp -f $custdir/logo/upulsepower.png $appdir/image/logo.png
  258. else
  259. echo error! $RPJ not define!!!
  260. exit 1
  261. fi
  262. rm -rf $appdir/../web
  263. cp -rf $custdir/web/unique $appdir/../web
  264. prj_enable $1
  265. }
  266. function do_compile()
  267. {
  268. echo do_compile ...
  269. cd $curdir/pro
  270. rm -rf build; mkdir build; cd build
  271. if [[ "$1" == "PRJ_IP_"* ]];then
  272. cmake .. -DCHIP=t113s && make
  273. else
  274. cmake .. -DCHIP=t113i && make
  275. fi
  276. if [ $? -gt 0 ]; then
  277. exit 1
  278. fi
  279. }
  280. function do_pack()
  281. {
  282. echo do_pack ...
  283. if [[ "$1" == "PRJ_IP_"* ]];then
  284. $curdir/output/t113s/pack.sh
  285. else
  286. $curdir/output/t113i/pack.sh
  287. fi
  288. }
  289. function do_zip()
  290. {
  291. echo do_zip ...
  292. ztm=`date +%Y%m%d_%H%M%S`
  293. if [[ "$1" == "PRJ_IP_"* ]];then
  294. zname="upgrade_"$ztm"_$name"
  295. zdir=$curdir/output/t113s/push
  296. files="push.bat push_retain.bat pdutar tools/*"
  297. cd $zdir; zip -q $zname.zip $files
  298. mv $zname.zip $curdir/output/t113s/
  299. else
  300. zname="upgrade_"$ztm"_$name"
  301. zdir=$curdir/output/t113i/push2
  302. files="push.bat push_retain.bat pdutar tools/*"
  303. cd $zdir; zip -q $zname.zip $files
  304. mv $zname.zip $curdir/output/t113i/
  305. fi
  306. }
  307. function do_one()
  308. {
  309. echo $PATH
  310. do_copy $1
  311. do_compile $1
  312. do_pack $1
  313. do_zip $1
  314. }
  315. function do_all()
  316. {
  317. for s in $PRJS; do
  318. do_one $s
  319. done
  320. }
  321. do_all