📄 server3.h
字号:
// Server3.h: Definition of the Server3 class
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SERVER3_H__0CA26678_61A7_11D5_B050_0050BAF2A927__INCLUDED_)
#define AFX_SERVER3_H__0CA26678_61A7_11D5_B050_0050BAF2A927__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// Server3
class Server3 :
public IDispatchImpl<IDataProcess, &IID_IDataProcess, &LIBID_COMSERVERLib>,
public IDispatchImpl<IProcControl, &IID_IProcControl, &LIBID_COMSERVERLib>,
public ISupportErrorInfo,
public CComObjectRoot,
public CComCoClass<Server3,&CLSID_Server3>
{
public:
Server3() {
//Timedata.DataNum=1;
// Timedata.NowdataRec[0].addr_sensor=201;
//Timedata.NowdataRec[0].nowdata=1.4;
}
BEGIN_COM_MAP(Server3)
COM_INTERFACE_ENTRY2(IDispatch, IDataProcess)
COM_INTERFACE_ENTRY(IDataProcess)
COM_INTERFACE_ENTRY(IProcControl)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()
//DECLARE_NOT_AGGREGATABLE(Server3)
// Remove the comment from the line above if you don't want your object to
// support aggregation.
DECLARE_REGISTRY_RESOURCEID(IDR_Server3)
// ISupportsErrorInfo
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
// IDataProcess
// IProcControl
public:
STDMETHOD(procdrive)();
STDMETHOD(del_devPT)(/*[in]*/ BYTE sensor,/*[in]*/ short pos,/*[out]*/ short *rb);
STDMETHOD(set_devPT)(/*[in]*/ BYTE sensor,/*[in]*/ short pos,/*[in]*/ BYTE xing, LPSTR exp,/*[out]*/ short *rb);
STDMETHOD(loadrjfile)();
STDMETHOD(getErrct)(/*[out]*/ int *ct);
STDMETHOD(getstinfo)(/*[out]*/ short *currentno,/*[out]*/ float *percent,/*[out]*/ int *ct,/*[out]*/ unsigned char *state,/*[out]*/ unsigned char *info);
STDMETHOD(gethost)(/*[out]*/ short *rb);
STDMETHOD(ifrjst)(/*[in]*/ int n,/*[out]*/ int *rb);
STDMETHOD(killClient)();
STDMETHOD(reloadOPC)();
STDMETHOD(set_stinfo)(/*[in,size_is(255)]*/ short *st);
STDMETHOD(getststate)(/*[in]*/ short stno,/*[out]*/ short *state,/*[out]*/short *kzstate);
STDMETHOD(getoneError)(/*[in]*/ int no,/*[out]*/ int *addr_sensor,/*[out]*/ DATE *starttime,/*[out]*/ short *errflag,/*[out]*/ short *errtyp,/*[out]*/ short *rb);
STDMETHOD(getonealarm)(/*[in]*/ int no,/*[out]*/ int *addr_sensor,/*[out]*/ DATE *starttime,/*[out]*/ float *maxv,/*[out]*/ float *minv,/*[out]*/ float *avgv,/*[out]*/ short *rb);
STDMETHOD(getflag)(/*[out]*/ int *stno);
STDMETHOD(loadsysfile)();
STDMETHOD(getonektp)(/*[in]*/ int addr_sensor,/*[out]*/ short* ctm,/*[out]*/long* kt0,/*[out]*/long* kt1,/*[out]*/long* kt2,/*[out]*/long* kt3,/*[out]*/ short *rb);
STDMETHOD(setcontrol)(/*[in]*/ int stno,/*[in]*/ int ctr_ord);
STDMETHOD(get_stinfo)(/*[out,size_is(255)]*/ short *st);
STDMETHOD(getErrorct)(/*[out]*/ int * abc);
STDMETHOD(getalarmct)(/*[out]*/ int * almct);
STDMETHOD(get_nwd_ct)(/*[out]*/ int * nct);
STDMETHOD(set_only_st)(int stnum,int state);
STDMETHOD(set_ini_st)(int stnum);
STDMETHOD(set_del_flag)();
STDMETHOD(addonetodeltab)(/*[in]*/ int addr_sensor,/*[out]*/ int *ct);
STDMETHOD(clear_con_del)();
STDMETHOD(setkz)(/*[in]*/ int i);
STDMETHOD(getstct)(/*[in]*/ int i,/*[out]*/ int *ct);
STDMETHOD(clearhour)();
STDMETHOD(cleartab)();
STDMETHOD(deltab)(/*[out]*/ int *delct);
STDMETHOD(ifclear)(/*[out]*/ int *ml,/*[out]*/ int *hl);
STDMETHOD(setdel)();
STDMETHOD(ifdel)(/*[out]*/ int *bl);
STDMETHOD(clearflag)(/*[in]*/ int i);
STDMETHOD(setktp)(/*[in]*/ int i,/*[in]*/ int j,/*[in]*/ int addr_sensor);
STDMETHOD(getype)(/*[in]*/ int i,/*[in]*/ int j,/*[out]*/ int * sensor,/*[out]*/ int * xing,/*[out]*/ int * rule,/*[out]*/ int * position);
STDMETHOD(iflag)(/*[in]*/int i,/*[out]*/ int* rb);
STDMETHOD(setnowdata)(/*[in]*/ int i,/*[in]*/ int j,/*[in]*/ int sensor,/*[in]*/ int xing,/*[in]*/ int rule,/*[in]*/ int position,/*[out]*/ int * addr_sensor);
STDMETHOD(getoneptinf)(/*[in]*/ int addr_sensor,/*[out]*/ float * ndt,/*[out]*/ float * dt1,/*[out]*/ float *dt2,/*[out]*/ float * dt3,/*[out]*/ float * dt4,/*[out]*/ int * state,/*[out]*/ int * alm,/*[out]*/ int * rcdw,/*[out]*/ short *rb);
static void setkgch(short addr_sensor,DATE starttime,DATE steptime,long addtime,long staus);
private:
void setkgl(int n,long vl);
void setmnl(int n,int sensor,long vl);
bool initmnl(int n,int sensor,long vl);
void get_stcfg(int i,int n,int j,int k,int m,int* sensor,int* xing,int* rule,int* position);
};
// Server3.h : Declaration of the Cpersonproc
/////////////////////////////////////////////////////////////////////////////
// Cpersonproc
class ATL_NO_VTABLE Cpersonproc :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<Cpersonproc, &CLSID_personproc>,
public ISupportErrorInfo,
public IDispatchImpl<Ipersonproc, &IID_Ipersonproc, &LIBID_COMSERVERLib>
{
public:
Cpersonproc()
{
SYSTEMTIME pdt;
rj_ct=0;
//2004-8-12 lpf add
// for(int i=0;i<4096;i++)
// perstmb[i].localtm=0;
//2004-8-12 mod end
GetLocalTime(&pdt);
lastime[0]=pdt.wHour;
lastime[1]=pdt.wMinute;
lastime[2]=pdt.wSecond;
demosys=1;
}
DECLARE_REGISTRY_RESOURCEID(IDR_PERSONPROC)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(Cpersonproc)
COM_INTERFACE_ENTRY(Ipersonproc)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
END_COM_MAP()
// ISupportsErrorInfo
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
// Ipersonproc
public:
STDMETHOD(processrj)(/*[in]*/ int n);
STDMETHOD(ifrjst)(/*[in]*/ int n,/*[out]*/ int *rb);
private:
void tjaddr(short rid,short rno,short styp,double dt,double curdt,short *prevAddrNo,short *addrno,bool *upflg);
void testxutj();
bool getnwd(int no,short rid);
bool trace_rec(short rid,short rno,double dt,short addr);
short checklocal(short rid);
void tjupdown(short rid);
bool getreno(int no,short dirc,short *rno,short *styp,short *ref,short *alm);
DATE dateCal(int year,int month,int day,int hour,int minute,int second);
int if_leapyear(int year);
void processchkup();
void preprocessReno(short rfid,DATE dt,short stno,short *bl);
void Write_rj_MemData();
short stno_of_addrno(short addrno);
protected:
bool JudgeTrouble(short rfid,short rno,DATE dtmp,short styp,short addrno,short alm);
void RecordTrace(short rfid,short rno,DATE dtmp,short addrno,short alm);
void AddToTable(short rfid,short reno,DATE tm,short stype,short addrno,short alm);
void MakeUpPrstUpDown(short rfid);
void MakeUpAllUpDown();
bool GetAllUpDownStaNull();
bool GetAllUpDownStaInfo();
int getFiledPersonCT(short addr);
void SetControl(short stno,short prevstno,short prevaddrno,short addrno);
};
// Server3.h : Declaration of the Crjinteface
/////////////////////////////////////////////////////////////////////////////
// Crjinteface
class ATL_NO_VTABLE Crjinteface :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<Crjinteface, &CLSID_rjinteface>,
public IDispatchImpl<Irjinteface, &IID_Irjinteface, &LIBID_COMSERVERLib>
{
public:
Crjinteface()
{
}
DECLARE_REGISTRY_RESOURCEID(IDR_RJINTEFACE)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(Crjinteface)
COM_INTERFACE_ENTRY(Irjinteface)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
// Irjinteface
public:
STDMETHOD(GetAllRyInfo)(/*[out]*/ short *count,/*[out,size_is(4096)]*/ short *wno,/*[out,size_is(4096)]*/ short *idno,/*[out,size_is(4096)]*/ short *addr,/*[out,size_is(4096)]*/ short *rno,/*[out,size_is(4096)]*/ DATE *dt,/*[out,size_is(4096)]*/ DATE *downdt,/*[out,size_is(4096)]*/ DATE *updt);
STDMETHOD(getDeptField)(/*[in]*/ LPSTR dept,/*[in]*/ short addr,/*[out]*/ short *count,/*[out,size_is(400)]*/ short *wno,/*[out,size_is(400)]*/ short *idno,/*[out,size_is(400)]*/ short *rno,/*[out,size_is(400)]*/ DATE *dt);
STDMETHOD(getDeptRenotrace)(/*[in]*/ LPSTR dept,/*[in]*/ short reno,/*[out]*/ short *count,/*[out,size_is(200)]*/ short *wno,/*[out,size_is(200)]*/ short *idno,/*[out,size_is(200)]*/ DATE *dt);
STDMETHOD(getDeptuptj)(/*[in]*/ LPSTR name,/*[out]*/ short *count,/*[out,size_is(500)]*/ short *wno,/*[out,size_is(500)]*/ short *idno,/*[out,size_is(500)]*/ DATE *downdt,/*[out,size_is(500)]*/ DATE *updt,/*[out,size_is(500)]*/ short *dw_rno,/*[out,size_is(500)]*/ short *up_rno,/*[out,size_is(500)]*/ short *tag);
STDMETHOD(getDepttrace)(/*[in]*/ LPSTR dept, /*[out]*/ short *count,/*[out,size_is(500)]*/ short *wno,/*[out,size_is(500)]*/ short *idno,/*[out,size_is(500)]*/ short *rno,/*[out,size_is(500)]*/ DATE *dt,/*[out,size_is(500)]*/ short *addrn);
STDMETHOD(getDeptdown)(/*[in]*/ LPSTR dept,/*[out]*/ short *count);
STDMETHOD(checkup)(/*[in]*/ short count,/*[in,size_is(count)]*/ short *idno);
STDMETHOD(getRenoTrace)(/*[in]*/ short rno,/*[out]*/short *count,/*[out,size_is(100)]*/ short *wno,/*[out,size_is(100)]*/ short *idno,/*[out,size_is(100)]*/ DATE *dt);
STDMETHOD(getFiledPersonCT)(/*[in]*/ short addr,/*[out]*/ short *count);
STDMETHOD(getRenoState)(/*[out]*/ short *count,/*[out,size_is(400)]*/ short *st);
STDMETHOD(getrfidlamp)(/*[in]*/ short wno,/*[out]*/ short *id,/*[out]*/ short *lamp,/*[out]*/ short *rb);
STDMETHOD(removTab_mod)(/*[in]*/ short rfid,/*[in]*/ int lampno,/*[out]*/ short *rb);
STDMETHOD(removTab_del)(/*[in]*/ short rfid,/*[out]*/ short *rb);
STDMETHOD(removTab_add)(/*[in]*/ short rfid,/*[in]*/ int lampno,/*[out]*/ short *rb);
STDMETHOD(addrTab_mod)(/*[in]*/ short addr,/*[in]*/ LPSTR name,/*[in]*/ short addtyp,/*[in,size(8)]*/ short *ent,/*[in]*/ short personNum,/*[out]*/ short *rb);
STDMETHOD(addrTab_del)(/*[in]*/ short addr,/*[out]*/ short *rb);
STDMETHOD(addrTab_add)(/*[in]*/ short addr,/*[in]*/ LPSTR name,/*[in]*/ short addtyp,/*[in,size(8)]*/ short *ent,/*[in]*/ short personNum,/*[out]*/ short *rb);
STDMETHOD(sensorTab_mod)(/*[in]*/ short reno,/*[in]*/ LPSTR name,/*[in]*/ short stype,/*[in]*/ short alarm,/*[in]*/ short state,/*[in]*/ short stno,/*[in]*/ short dirc,/*[in]*/ short ref,/*[out]*/ short *rb);
STDMETHOD(sensorTab_del)(/*[in]*/ short reno,/*[out]*/ short *rb);
STDMETHOD(sensorTab_add)(/*[in]*/ LPSTR name,/*[in]*/ short reno,/*[in]*/ short stype,/*[in]*/ short alarm,/*[in]*/ short state,/*[in]*/ short stno,/*[in]*/ short dirc,/*[in]*/ short ref,/*[out]*/ short *rb);
STDMETHOD(personTab_mod)(/*[in]*/ short wno,/*[in,size_is(16)]*/ LPSTR name,/*[in,size_is(16)]*/ LPSTR depart,/*[in]*/ short rfid,/*[in]*/ int lampno,/*[in]*/ short rfidbak,/*[in]*/ int lampnobak,/*[in]*/ short prioty,/*[in]*/ short monthct,/*[in]*/ short validt,/*[out]*/ short *rb);
STDMETHOD(personTab_del)(/*[in]*/ short wno,/*[out]*/ short *rb);
STDMETHOD(personTab_add)(/*[in,size_is(16)]*/ LPSTR name,/*[in,size_is(16)]*/ LPSTR depart,/*[in]*/ short wno,/*[in]*/ short rfid,/*[in]*/ int lampno,/*[in]*/ short rfidbak,/*[in]*/ int lampnobak,/*[in]*/ short prioty,/*[in]*/ short monthct,/*[in]*/ short validt,/*[out]*/ short *rb);
STDMETHOD(getOnetrace)(/*[in]*/ short wno,/*[out]*/ short *count,/*[out,size_is(100)]*/ short *idno,/*[out,size_is(100)]*/ short *reno,/*[out,size_is(100)]*/ short *addrno,/*[out,size_is(100)]*/ DATE *dt);
STDMETHOD(getOneInfo)(/*[in]*/ short wno,/*[out]*/ short *idno,/*[out]*/ short *addr,/*[out]*/ short *rno,/*[out]*/ DATE *dt,/*[out]*/ DATE *downdt,/*[out]*/ DATE *updt);
STDMETHOD(getPasstime)(/*[out]*/ short *count,/*[out,size_is(200)]*/ short *wno,/*[out,size_is(200)]*/ short *idno,/*[out,size_is(200)]*/ DATE *downdt,/*[out,size_is(200)]*/ short *dw_rno,/*[out,size_is(200)]*/ short *addrno,/*[out,size_is(200)]*/ DATE *dt,/*[out,size_is(200)]*/ short *rno);
STDMETHOD(getPasstimeCT)(/*[out]*/ short *count);
STDMETHOD(getdowntime)(/*[in]*/ short typ,/*[in]*/ short t,/*[out]*/ short *count,/*[out,size_is(2000)]*/ short *wno,/*[out,size_is(2000)]*/ short *idno,/*[out,size_is(2000)]*/ DATE *downdt,/*[out,size_is(2000)]*/ short *dw_rno,/*[out,size_is(2000)]*/ short *addrno,/*[out,size_is(2000)]*/ DATE *dt,/*[out,size_is(2000)]*/ short *rno);
STDMETHOD(getPassRecord)(/*[in]*/ short reno,/*[out]*/ short *count,/*[out,size_is(1000)]*/ short *wno,/*[out,size_is(1000)]*/ short *idno,/*[out,size_is(1000)]*/ short *addr,/*[out,size_is(1000)]*/ DATE *dt);
STDMETHOD(getFieldPerson)(/*[in]*/ short addr,/*[out]*/ short *count,/*[out,size_is(4000)]*/ short *wno,/*[out,size_is(4000)]*/ short *idno,/*[out,size_is(4000)]*/ short *rno,/*[out,size_is(4000)]*/ DATE *dt);
STDMETHOD(getupdown)(/*[out]*/ short *count,/*[out,size_is(500)]*/ short *wno,/*[out,size_is(500)]*/ short *idno,/*[out,size_is(500)]*/ DATE *downdt,/*[out,size_is(500)]*/ DATE *updt,/*[out,size_is(500)]*/ short *dw_rno,/*[out,size_is(500)]*/ short *up_rno,/*[out,size_is(500)]*/ short *tag);
STDMETHOD(getTrace)(/*[in]*/ short typ,/*[out]*/ short *count,/*[out,size_is((typ+1)*500)]*/ short *wno,/*[out,size_is((typ+1)*500)]*/ short *idno,/*[out,size_is((typ+1)*500)]*/ short *rno,/*[out,size_is((typ+1)*500)]*/ DATE *dt,/*[out,size_is((typ+1)*500)]*/ short *addrn);
DATE dateCal(int year,int month,int day,int hour,int minute,int second);
int if_leapyear(int year);
private:
bool compname(unsigned char sdep[16], unsigned char ddep[16]);
LPWSTR wszFromSTR(LPCTSTR szSTR);
void AnsiToUnicode(LPCSTR pszA, LPOLESTR* ppszW);
void setRemotechkup(short count);
short checklocal(short rid);
};
#endif // !defined(AFX_SERVER3_H__0CA26678_61A7_11D5_B050_0050BAF2A927__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -