diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym index 606fe54..eef86d7 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_sym differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab index 26f302a..cb992b3 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xab differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad index 2b98549..92d9e21 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xad differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc index a4a2671..3a1154b 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xc differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf index 198c9af..53134de 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xf differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr index 25fbf87..224a8e1 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xr differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb index aff8aa7..4ff40b1 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsb differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd index fe48855..1503ae1 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd and b/si4/soft_gsm_main.si4project/soft_gsm_main.sip_xsd differ diff --git a/si4/soft_gsm_main.si4project/soft_gsm_main.siwork b/si4/soft_gsm_main.si4project/soft_gsm_main.siwork index 16ad282..6eae4c1 100644 Binary files a/si4/soft_gsm_main.si4project/soft_gsm_main.siwork and b/si4/soft_gsm_main.si4project/soft_gsm_main.siwork differ diff --git a/source/app/app_common.c b/source/app/app_common.c index a45957c..a7634ed 100644 --- a/source/app/app_common.c +++ b/source/app/app_common.c @@ -20,6 +20,8 @@ void Lu_register_init() G.p.hold_ratio = 9; //0.1 G.total_weight = 0; + G.pi_weight = 0; + G.jing_weight = 0; G.thrombolytic_val = G.bolus_val = G.hold_val = 0; G.asga.xaxis = G.asga.yaxis = G.asga.zaxis = 0; G.rfid = 0; @@ -50,7 +52,7 @@ void Lu_register_init() G.md_slaver_info[2].reg = 0x02; G.md_slaver_info[2].regnum = 0x05; G.md_slaver_info[2].bytes = G.md_slaver_info[2].regnum * 2; - G.md_slaver_info[2].buf = (U8*)&G.total_weight; + G.md_slaver_info[2].buf = (U8*)&G.jing_weight; G.md_slaver_info[2].mask = 0; G.md_slaver_info[3].slaver = SLAVER_SHOW01_ID; //RFID @@ -101,7 +103,7 @@ void Lu_register_init() G.ccmd_slaver_info[3].reg = 0x10; G.ccmd_slaver_info[3].regnum = 0x11; G.ccmd_slaver_info[3].bytes = G.ccmd_slaver_info[3].regnum * 2; - G.ccmd_slaver_info[3].buf = (U8*)&G.total_weight; + G.ccmd_slaver_info[3].buf = (U8*)&G.jing_weight; G.ccmd_slaver_info[3].mask = 0; G.modbusstmp = 0; diff --git a/source/app/app_common.h b/source/app/app_common.h index 8e480ed..133fe1f 100644 --- a/source/app/app_common.h +++ b/source/app/app_common.h @@ -183,11 +183,12 @@ typedef struct cc_asga_info U16 zaxis; }CCAsGaInfo; +#if 1 typedef struct printer_maintenance_global { GlobalNeedPersistParam p; - S32 total_weight; + S32 jing_weight; U16 thrombolytic_val; U16 bolus_val; U16 hold_val; @@ -208,8 +209,40 @@ typedef struct printer_maintenance_global TS_BoardStatus boardstatus; U8 _keyled; U8 _rfid; + S32 pi_weight; + S32 total_weight; }PMGlobal; +#else +typedef struct printer_maintenance_global +{ + GlobalNeedPersistParam p; + + S32 jing_weight; + U16 pi_weight; + U16 total_weight; + U16 hold_val; + CCAsGaInfo asga; + U16 rfid; + S32 weight[4]; + //U16 reserved2[16 - 9]; + MD_SLAVER_INFO md_slaver_info[MD_SLAVER_INFO_MAX]; + CCMD_SLAVER_INFO ccmd_slaver_info[CCMD_SLAVER_INFO_MAX]; + + vU32 modbusstmp; + U16 authed; + U16 flowStarted; + U16 flowStartVal; + + U8 ccid[21]; //保存ccid卡号空间 20+'\0' + TS_BoardStatus boardstatus; + U8 _keyled; + U8 _rfid; + U16 thrombolytic_val; + U16 bolus_val; +}PMGlobal; + +#endif //寄存器内存基地址 #define REG_MEM_BASE ((U16*)(&G)) //寄存器基础地址(本文件外部不应该使用该宏定义) diff --git a/source/app/app_task_485.c b/source/app/app_task_485.c index 29cf828..df1d6f1 100644 --- a/source/app/app_task_485.c +++ b/source/app/app_task_485.c @@ -70,6 +70,13 @@ void L3_task_485_handle(TS_485 *s) G.total_weight = (S32)(s->pAckPkg->buf[1]) << 24 | (S32)(s->pAckPkg->buf[2]) << 16 | (S32)(s->pAckPkg->buf[3]) << 8 | (S32)(s->pAckPkg->buf[4]); + + if(G.total_weight <= G.pi_weight){ + G.jing_weight = 0; + }else + { + G.jing_weight = G.total_weight - G.pi_weight; + } } else if(s->pAckPkg->salver == G.md_slaver_info[1].slaver) { @@ -81,7 +88,16 @@ void L3_task_485_handle(TS_485 *s) { if(s->pAckPkg->buf[2] != G._keyled) //按键发生改变 { - G.rfid = G._keyled = s->pAckPkg->buf[2]; + G._keyled = s->pAckPkg->buf[2]; + if(G._keyled == 0x28) + { + L0_uart0_uc('#'); + G.pi_weight = G.total_weight; + } + else + { + G.rfid = G._keyled; + } } } } diff --git a/source/app/app_task_485_control.c b/source/app/app_task_485_control.c index 034b719..c70e280 100644 --- a/source/app/app_task_485_control.c +++ b/source/app/app_task_485_control.c @@ -36,14 +36,14 @@ void L3_task_485_control_handle(TS_485_control *s) s->rfid_pool = G.rfid; } #else - if(s->total_weight_pool != G.total_weight) + if(s->total_weight_pool != G.jing_weight) { - G.thrombolytic_val = G.total_weight / 10 * G.p.thrombolytic_ratio / 10; + G.thrombolytic_val = G.jing_weight / 10 * G.p.thrombolytic_ratio / 10; G.bolus_val = G.thrombolytic_val * G.p.bolus_ratio / 10; G.hold_val = G.thrombolytic_val * G.p.hold_ratio / 10; G.md_slaver_info[2].mask = 1; - s->total_weight_pool = G.total_weight; + s->total_weight_pool = G.jing_weight; } if(s->rfid_pool != G.rfid) diff --git a/source/app/main.c b/source/app/main.c index 974ae48..1b6c76e 100644 --- a/source/app/main.c +++ b/source/app/main.c @@ -140,7 +140,7 @@ void main(void) //master->slaver发送逻辑控制 L3_task_485_control_handle(&ts_485_control); - +#if 1 //gm35维持连接 L3_task_gm35_core_handle(); L3_UARTcom4_exp_protocol(&s_uart4_at_rec); @@ -150,6 +150,7 @@ void main(void) //master->slaver发送逻辑控制 L3_task_tcp_control_handle(&ts_tcp_control); +#endif } }//end main