Quellcode durchsuchen

全满启用ini
改cfg配置和打包脚本

guohui vor 2 Jahren
Ursprung
Commit
adb0495e6f
5 geänderte Dateien mit 21 neuen und 54 gelöschten Zeilen
  1. 13 7
      pro/config/cfg.h
  2. 0 9
      pro/src/app.c
  3. 0 26
      pro/src/appweb_handle.c
  4. 0 4
      pro/src/sys.c
  5. 8 8
      pub

+ 13 - 7
pro/config/cfg.h

@@ -6,15 +6,18 @@
 #define PROD_ID                                 0
 #define PROD_ID                                 0
 #define PROD_TYPE                               1
 #define PROD_TYPE                               1
 
 
+#define USE_INI
 
 
 /////////////customer demannd//////////////////////
 /////////////customer demannd//////////////////////
 //#define PRJ_XIAN_AC_I1_O1_P4
 //#define PRJ_XIAN_AC_I1_O1_P4
-//#define PRJ_XIAN_AC_I1_O1_P8
+#define PRJ_XIAN_AC_I1_O1_P8
 //#define PRJ_USASL_AC_I3_O1
 //#define PRJ_USASL_AC_I3_O1
 //#define PRJ_USASL_AC_I3_O3
 //#define PRJ_USASL_AC_I3_O3
 //#define PRJ_ITK_AC_I1_O1
 //#define PRJ_ITK_AC_I1_O1
-#define PRJ_ITK_AC_I3_O1
+//#define PRJ_ITK_AC_I3_O1
 //#define PRJ_STSC_I3_O3
 //#define PRJ_STSC_I3_O3
+//#define PRJ_LITECH_AC_I1_O1
+//#define PRJ_LITECH_AC_I3_O1
 //#define PRJ_INSPUR_DC_I_DC_O
 //#define PRJ_INSPUR_DC_I_DC_O
 //#define PRJ_ANDERSON_AC_I3_O3
 //#define PRJ_ANDERSON_AC_I3_O3
 //#define PRJ_HYPERTEC_AC_I3_O1
 //#define PRJ_HYPERTEC_AC_I3_O1
@@ -90,17 +93,20 @@
     #define CASCADE_CNT                         0
     #define CASCADE_CNT                         0
 
 
     #define MAX_CHN_COUNT                       16
     #define MAX_CHN_COUNT                       16
-    #define PHASE_GROUP                         8
-    #define CHANNEL_DELAY                       8
-    
     #define USE_LOGO_LITECH
     #define USE_LOGO_LITECH
 
 
     #define USE_SMTP
     #define USE_SMTP
     #define SMTP_SEND_BUILTIN
     #define SMTP_SEND_BUILTIN
 
 
     #ifdef PRJ_LITECH_AC_I1_O1
     #ifdef PRJ_LITECH_AC_I1_O1
+        #define PHASE_GROUP                     8
+        #define CHANNEL_DELAY                   8
+
         #define PROD_POWER_TYPE                 0
         #define PROD_POWER_TYPE                 0
     #else
     #else
+        #define PHASE_GROUP                     6
+        #define CHANNEL_DELAY                   6
+
         #define PROD_POWER_TYPE                 5
         #define PROD_POWER_TYPE                 5
     #endif
     #endif
 #elif defined PRJ_STSC_I3_O3
 #elif defined PRJ_STSC_I3_O3
@@ -176,8 +182,8 @@
     //#define USE_SMTP
     //#define USE_SMTP
     //#define SMTP_SEND_BUILTIN
     //#define SMTP_SEND_BUILTIN
 
 
-    //#define USE_MQTT
-    //#define MQTT_SERVER_BUILTIN
+    #define USE_MQTT
+    #define MQTT_SERVER_BUILTIN
 
 
     #define PROD_POWER_TYPE                     3
     #define PROD_POWER_TYPE                     3
 #else
 #else

+ 0 - 9
pro/src/app.c

@@ -1729,15 +1729,6 @@ int _global_device_manage_init(GlobalDeviceManager* _globalDeviceManager)
     }
     }
     log_i("database %s open ok.\n", path);
     log_i("database %s open ok.\n", path);
 
 
-#ifndef USE_INI
-    if(dev_get_device_info(_globalDeviceManager->db,&_globalDeviceManager->_globalDevInfo)!=0)
-    {
-        log_e("get device info error.\n");
-        return -1 ;
-    }
-    log_i("get device info ok.\n");
-#endif
-
     if(_globalDeviceManager->_globalDevInfo.product.pwr_type == SmartPDU_AC ||
     if(_globalDeviceManager->_globalDevInfo.product.pwr_type == SmartPDU_AC ||
         _globalDeviceManager->_globalDevInfo.product.pwr_type == SmartPDU_DC)       // single AC
         _globalDeviceManager->_globalDevInfo.product.pwr_type == SmartPDU_DC)       // single AC
     {
     {

+ 0 - 26
pro/src/appweb_handle.c

@@ -275,11 +275,7 @@ static void changeLanguages(void* conn)
     char* rx_body_buf=(char*)hm->body.buf;
     char* rx_body_buf=(char*)hm->body.buf;
 
 
     json_to_switch_language(rx_body_buf);
     json_to_switch_language(rx_body_buf);
-#ifdef USE_INI
     paras_save();
     paras_save();
-#else
-    dev_update_device_genera_info(__globalDeviceManage.db,&__globalDeviceManage._globalDevInfo);
-#endif
     ack_str = ctrl_sts_ack_to_json();
     ack_str = ctrl_sts_ack_to_json();
     http_reply(conn, 200, ack_str);
     http_reply(conn, 200, ack_str);
     cJSON_free((void*)ack_str);
     cJSON_free((void*)ack_str);
@@ -3431,11 +3427,7 @@ static void communicationManagement(void *conn)
         ///////////////////////////////////////////////////////////////////////////////
         ///////////////////////////////////////////////////////////////////////////////
         r = cascade_set_modbus(info);
         r = cascade_set_modbus(info);
         if(r==0) {
         if(r==0) {
-        #ifdef USE_INI
             paras_save();
             paras_save();
-        #else
-            dev_update_device_modus_info(__globalDeviceManage.db,devInfo);
-        #endif
         }
         }
         char buff[256];
         char buff[256];
         if (!info->mode)
         if (!info->mode)
@@ -4674,16 +4666,6 @@ static void equipmentMintenance(void *conn)
     //查询设备列表
     //查询设备列表
     if(strcmp(_Over_equipment_mintenance.type,"listSbRestartQuery")==0 || strcmp(_Over_equipment_mintenance.type,"listSbWhQuery")==0)
     if(strcmp(_Over_equipment_mintenance.type,"listSbRestartQuery")==0 || strcmp(_Over_equipment_mintenance.type,"listSbWhQuery")==0)
     {
     {
-        // 查询设备总体参数
-    #ifndef USE_INI
-       if (dev_get_device_info(__globalDeviceManage.db,&__globalDeviceManage._globalDevInfo) != 0)
-        {
-            log_e("get device info error.\n");
-            http_reply(conn, 400, NULL);
-            return;
-        }
-    #endif
-
         _over_back_sts_info.product_name = __globalDeviceManage._globalDevInfo.product.name;
         _over_back_sts_info.product_name = __globalDeviceManage._globalDevInfo.product.name;
         _over_back_sts_info.product_number = __globalDeviceManage._globalDevInfo.product.number;
         _over_back_sts_info.product_number = __globalDeviceManage._globalDevInfo.product.number;
         _over_back_sts_info.product_id = __globalDeviceManage._globalDevInfo.product.id;
         _over_back_sts_info.product_id = __globalDeviceManage._globalDevInfo.product.id;
@@ -4745,14 +4727,6 @@ static void equipmentMintenance(void *conn)
     }else if(strcmp(_Over_equipment_mintenance.type,"listKgSbQuery")==0)    // part of device infomation 
     }else if(strcmp(_Over_equipment_mintenance.type,"listKgSbQuery")==0)    // part of device infomation 
     {
     {
         _OverBackBreakerInfo breaker_info;
         _OverBackBreakerInfo breaker_info;
-    #ifndef USE_INI
-        if (dev_get_device_info(__globalDeviceManage.db,&__globalDeviceManage._globalDevInfo) != 0)
-        {
-            log_e("get device info error.\n");
-            http_reply(conn, 400, NULL);
-            return;
-        }
-    #endif
 
 
         printf("get listKgSbQuery infomation!!!\n");
         printf("get listKgSbQuery infomation!!!\n");
         breaker_info.product_id = __globalDeviceManage._globalDevInfo.product.id;
         breaker_info.product_id = __globalDeviceManage._globalDevInfo.product.id;

+ 0 - 4
pro/src/sys.c

@@ -1204,13 +1204,9 @@ static void* polling_thread(void *arg)
 
 
 int sys_init(void)
 int sys_init(void)
 {
 {
-    //userShellInit();
     initLogger();
     initLogger();
     lock_s_init();
     lock_s_init();
-    
-#ifdef USE_INI
     paras_init();
     paras_init();
-#endif
     
     
     thread_start(THREAD_ID_POLLING, polling_thread, NULL, 4*MB, 0);
     thread_start(THREAD_ID_POLLING, polling_thread, NULL, 4*MB, 0);
 
 

+ 8 - 8
pub

@@ -19,9 +19,10 @@
 
 
 #PRJS="PRJ_USASL_AC_I3_O1 PRJ_USASL_AC_I3_O3"
 #PRJS="PRJ_USASL_AC_I3_O1 PRJ_USASL_AC_I3_O3"
 #PRJS="PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
 #PRJS="PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
-PRJS="PRJ_ITK_AC_I1_O1 PRJ_ITK_AC_I3_O1"
+#PRJS="PRJ_ITK_AC_I1_O1 PRJ_ITK_AC_I3_O1"
 #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1"
 #PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1"
 #PRJS="PRJ_RELEASE_DC_I_DC_O PRJ_RELEASE_AC_I1_O1 PRJ_RELEASE_AC_I3_O1 PRJ_RELEASE_AC_I3_O3"
 #PRJS="PRJ_RELEASE_DC_I_DC_O PRJ_RELEASE_AC_I1_O1 PRJ_RELEASE_AC_I3_O1 PRJ_RELEASE_AC_I3_O3"
+PRJS="PRJ_LITECH_AC_I1_O1 PRJ_LITECH_AC_I3_O1 PRJ_XIAN_AC_I1_O1_P4 PRJ_XIAN_AC_I1_O1_P8"
 
 
 
 
 fulldir=$(realpath $0)
 fulldir=$(realpath $0)
@@ -36,14 +37,13 @@ function prj_enable()
     fcfg=$curdir/pro/config/cfg.h
     fcfg=$curdir/pro/config/cfg.h
 
 
     #clear space
     #clear space
-    sed -i 's|^[[:space:]]*||g' $fcfg
+    sed -i 's|^[[:space:]]\(#define PRJ_*\)|\1|g' $fcfg
 
 
     #mask all PRJ_XXX define
     #mask all PRJ_XXX define
     sed -i 's|^\(.*\)\(#define PRJ_*\)|//\2|g' $fcfg
     sed -i 's|^\(.*\)\(#define PRJ_*\)|//\2|g' $fcfg
 
 
     #enable the needed PRJ_XXX define
     #enable the needed PRJ_XXX define
-    
-    sed -i "s|^//\(#define $1*\)|\1|g" $fcfg
+    sed -i "s|^//\(#define $1.*\)|\1|g" $fcfg
 }
 }
 function prj_unmask()
 function prj_unmask()
 {
 {
@@ -71,7 +71,7 @@ function do_copy()
     elif [ "$1" = "PRJ_XIAN_AC_I1_O1_P8" ]; then
     elif [ "$1" = "PRJ_XIAN_AC_I1_O1_P8" ]; then
         name=ac_in1_out1_p8_xian
         name=ac_in1_out1_p8_xian
         
         
-        cp -f $custdir/db/ac_i1_o1_chinese_xian.db $curdir/output/t113i/root/run/app/pdu_dat.db
+        #cp -f $custdir/db/ac_i1_o1_chinese_xian.db $curdir/output/t113i/root/run/app/pdu_dat.db
         cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
         cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
     elif [ "$1" = "PRJ_ITK_AC_I1_O1" ]; then
     elif [ "$1" = "PRJ_ITK_AC_I1_O1" ]; then
         name=ac_in1_out1_russia_itk
         name=ac_in1_out1_russia_itk
@@ -81,7 +81,7 @@ function do_copy()
     elif [ "$1" = "PRJ_ITK_AC_I3_O1" ]; then
     elif [ "$1" = "PRJ_ITK_AC_I3_O1" ]; then
         name=ac_in3_out1_russia_itk
         name=ac_in3_out1_russia_itk
 
 
-        cp -f $custdir/db/ac_i3_o1_russian.db $curdir/output/t113i/root/run/app/pdu_dat.db
+        #cp -f $custdir/db/ac_i3_o1_russian.db $curdir/output/t113i/root/run/app/pdu_dat.db
         cp -f $custdir/logo/logo_itk.png $curdir/output/t113i/root/run/app/image/logo.png
         cp -f $custdir/logo/logo_itk.png $curdir/output/t113i/root/run/app/image/logo.png
     elif [ "$1" = "PRJ_RELEASE_DC_I_DC_O" ]; then
     elif [ "$1" = "PRJ_RELEASE_DC_I_DC_O" ]; then
         name=dc_in_dc_out_release
         name=dc_in_dc_out_release
@@ -103,7 +103,7 @@ function do_copy()
 
 
         #cp -f $custdir/db/ac_i3_o3_chinese.db $curdir/output/t113i/root/run/app/pdu_dat.db
         #cp -f $custdir/db/ac_i3_o3_chinese.db $curdir/output/t113i/root/run/app/pdu_dat.db
         cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
         cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
-    elif [ "$PRJ" = "PRJ_LITECH_AC_I1_O1" ]; then
+    elif [ "$1" = "PRJ_LITECH_AC_I1_O1" ]; then
         name=ac_in1_out1_litech
         name=ac_in1_out1_litech
 
 
         #cp -f $custdir/db/ac_i1_o1_english.db $curdir/output/t113i/root/run/app/pdu_dat.db
         #cp -f $custdir/db/ac_i1_o1_english.db $curdir/output/t113i/root/run/app/pdu_dat.db
@@ -123,7 +123,7 @@ function do_copy()
         
         
         #cp -f $custdir/db/ac_i3_o1_english.db $curdir/output/t113i/root/run/app/pdu_dat.db
         #cp -f $custdir/db/ac_i3_o1_english.db $curdir/output/t113i/root/run/app/pdu_dat.db
         cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
         cp -f $custdir/logo/logo_neuter.png $curdir/output/t113i/root/run/app/image/logo.png
-    elif [ "$PRJ" = "PRJ_USASL_AC_I3_O3" ]; then
+    elif [ "$1" = "PRJ_USASL_AC_I3_O3" ]; then
         name=ac_in3_out3_usa_sl
         name=ac_in3_out3_usa_sl
         
         
         #cp -f $custdir/db/ac_i3_o3_english.db $curdir/output/t113i/root/run/app/pdu_dat.db
         #cp -f $custdir/db/ac_i3_o3_english.db $curdir/output/t113i/root/run/app/pdu_dat.db