📄 dpf_lclpferr.cpp
字号:
/**************************************************************
* 所属模块 : dpflow
* 文件路径 : pas/dpflow
* 文 件 名 : dpf_lclpferr.cpp
* 文件功能 : 统计局部厂站的计算误差
* 继承关系 :
* 操作系统 : PC & UNIX
* 备 注 :
* 历史记录 :
* 时间 版本 作者 原因
*===============================================================
* 2004年04月08日 1.0 pas created
***************************************************************/
#include "dpf_pub.h"
#include "dpf_fun.h"
#include "system.h"
#ifndef _WINDOWS32
#ifdef _ALPHA
#include <sys/uswitch.h>
#endif
#endif
#ifndef _DEFINE_HIDBVAR_AS_GLOBAL_
#define _DEFINE_HIDBVAR_AS_GLOBAL_
#endif
#include "dpf_pas.h"
struct FAC_INFO_T
{
int fac_id;
unsigned char repair_flag;
};
#define FAC_INFO_T_DEFFIELDS "fac_id, repair_flag"
int main(int argc, char**argv)
{
#ifdef _ALPHA
long uval = uswitch(USC_GET, 0);
uval = uswitch(USC_SET, uval | USW_CORE);
if (uval < 0) perror("uswitch");
#endif
CContext::SetContextNo(argc, argv,AC_REALTIME_NO);
CCommArgs::Set(argc,argv,AP_PAS_DPF);
if (AP_PAS_DPF != CCommArgs::AppNo()/10*10)
{
cerr << "++++++++++ appno error, valid no is 2120 -- 2129, please check your input again!\n";
return 0;
}
int pnt(0), st(0), record_num(0);
float err(0.0);
char msg[80];
int app_no = CCommArgs::AppNo();
string app_name = CAppMap::GetSdbAppName(app_no);
cout << "appno = " << app_no << " appname = " << app_name << endl;
dpf_access_db();
ODB::CTableOp table_fac(app_no, FAC_INFO_NO);
CBuffer get_buffer;
if(table_fac.TableGet(FAC_INFO_T_DEFFIELDS, get_buffer) >= 0)
{
record_num = get_buffer.GetLength()/sizeof(FAC_INFO_T);
FAC_INFO_T * table_ptr = (FAC_INFO_T *)get_buffer.GetBufPtr();
if (NULL == table_ptr)
{
cout << "dpf_lclpferr Error: getbufptr from buffer failed!" << endl;
return 0;
}
for(int i=0; i<record_num; i++)
{
st = ipmap_->NETSUB_STID[table_ptr[i].fac_id%DB_BASE_NUM - 1]-1;
if (st >= 0)
{
netse_->QSE_ST[st].NOTIN$M_ST = 0;
if (table_ptr[i].repair_flag > 0) netse_->QSE_ST[st].NOTIN$M_ST = 1;
}
}
}
dpf_local_pferr_();
pnt = pferr1_->LOCALPNT;
err = pferr1_->LOCALERR;
strcpy (msg, "完成局部厂站误差统计");
cout << "pnt = " << pnt << " err = " << err << endl;
ODB::CTableOp table_para(app_no, PARA_DPFLOW_EMS_NO);
table_para.TableModify("localpnt", (const char*)&pnt, sizeof(int));
table_para.TableModify("localerr", (const char*)&err, sizeof(float));
table_para.TableModify("runmsg", msg, 80);
short ctx_no;
CContext::GetContextNo(ctx_no);
string fam_name = merge_famnm_with_ctx(ctx_no);
ListRefresh ("LCPFER", app_name, fam_name);
SendAppChangeDataMsg(app_no);
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -