pub 12 KB

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