STDTLCHK.H
上传用户:ywlong9188
上传日期:2022-05-31
资源大小:2656k
文件大小:9k
- //////////////////////////////////////////
- // STDtlChk.H
- //SOURCE STDtlChk.cpp
- #ifndef __STRU_STDTLEDITDATA__
- #define __STRU_STDTLEDITDATA__
- #include <afxtempl.h>
- #include "cfginsdt.h"
- #include "checkdef.h"
- struct STDtlEditData{
- int nSTTableNo; //current ST Detail Table Number
- CString sExtTableNo; //should be deleted
- int nPriorTableNo; //the priror detail table : 0 = none ,
- int nExtTableNo; //the next detail table : 0 = none
- CString sMode; //scan mode ,H,L,T,E,I
- BOOL bScanOn; //indicate Scan status: True = ON; False = OFF
- CString sarStep[CFG_NUM_STDETAIL_RULE];
- CString sarElse[CFG_NUM_STDETAIL_RULE];
- CString sarThen[CFG_NUM_STDETAIL_RULE];
- CString sarCond[CFG_NUM_STDETAIL_COND][CFG_NUM_STDETAIL_RULE +2 ];
- CString sarAct[CFG_NUM_STDETAIL_ACT][CFG_NUM_STDETAIL_RULE +2 ];
- };
- class AFX_EXT_CLASS CCfgSTDtlBase: public CCfgCheckBase{
- public:
-
- CFCUTagSet m_FCUTagListSet;
- int m_nCurSTTableNo;
- public:
- CCfgSTDtlBase();
- ~CCfgSTDtlBase();
- void ReadBinFile(BYTE *pbuf);
- void WriteBinFile(BYTE *pbuf);
- virtual void ReadFileToEditStr(struct STDtlEditData& struEdData){ };
- virtual void WriteEditStrToFile(struct STDtlEditData& struEdData){ };
- void CopyTable(int srcTableNo,int dstTableNo);
- void InitialPointer(CDaoDatabase* pOPSDB,CDaoDatabase* pFCUDB,BYTE* pbinbuf,int nOnlineMode,CFile* pFile,CCommunication* pComm);
- void DividDWORDtoFourByte(DWORD dword,BYTE *pbyte);
- void CombFourBytetoDWORD(BYTE *pbyte,DWORD& dword);
- void DividWORDtoTwoByte(WORD word,BYTE *pbyte);
- void CombTwoBytetoWORD(BYTE *pbyte,WORD& word);
- };
- //class for ST table's operation table
- class AFX_EXT_CLASS CCfgSTDtl_Oper : public CCfgSTDtlBase{
- //attribute
- private:
- BYTE m_arBinItem[0x20];
- //operation
- public:
- CCfgSTDtl_Oper();
- void ReadFileToEditStr(struct STDtlEditData& struEdData);
- };
- //class for ST table's configure table
- class CCfgSTDtl_Cfg : public CCfgSTDtlBase {
- //attribute
- private:
- BYTE m_arBinItem[0x10];
- //operation
- public:
- CCfgSTDtl_Cfg();
- void ReadFileToEditStr(struct STDtlEditData& struEdData);
- };
- //class for ST Detail table's Y/N pattern block
- class AFX_EXT_CLASS CCfgSTDtl_YNBlk : public CCfgSTDtlBase{
- //attribute
- private:
- BYTE m_arBinItem[0xd0];
- //operation
- public:
- CCfgSTDtl_YNBlk();
- void ReadFileToEditStr(struct STDtlEditData& struEdData) ;
- void WriteEditStrToFile(struct STDtlEditData& struEdData);
-
- };
- class CCfgSTDtl_CondYNLst : public CCfgSTDtlBase{
- private:
- //attribute
- BYTE m_arBinItem[0x100];
- //operation
- public:
- CCfgSTDtl_CondYNLst();
- void ReadFileToEditStr(struct STDtlEditData& struEdData) ;
- void WriteEditStrToFile(struct STDtlEditData& struEdData);
- };
- class CCfgSTDtl_ActYNLst : public CCfgSTDtlBase{
- //attribute
- private:
- BYTE m_arBinItem[0x100];
- //operation
- public:
- CCfgSTDtl_ActYNLst();
- void ReadFileToEditStr(struct STDtlEditData& struEdData) ;
- void WriteEditStrToFile(struct STDtlEditData& struEdData);
- };
- class AFX_EXT_CLASS CCfgSTDtl_StubLst : public CCfgSTDtlBase{
- //attribute
- public:
- BYTE m_arBinItem[0x80];
- CMap<CString,LPCSTR,UINT,UINT> m_InsStrToIntMap;
- CMap<UINT,UINT,CString,LPCSTR> m_CondIntToStrMap;
- CMap<CString,LPCSTR,UINT,UINT> m_CondStrToIntMap;
- CMap<UINT,UINT,CString,LPCSTR> m_ALMIntToStrMap;
- CMap<CString,LPCSTR,UINT,UINT> m_ALMStrToIntMap;
- //operation
- public:
- CCfgSTDtl_StubLst();
- ~CCfgSTDtl_StubLst();
- BOOL Analyze_TagNo(const CString& sTagNo,UINT& nInsType,UINT& nElementNo);
- };
- class CCfgSTDtl_CondLst : public CCfgSTDtl_StubLst{
- public:
- CCfgSTDtl_CondLst();
- void ReadFileToEditStr(struct STDtlEditData& struEdData) ;
- void WriteEditStrToFile(struct STDtlEditData& struEdData) ;
- void TransBinToEdStr(BYTE *pbyte,CString& sEdStr);
- void TransEdStrToBin(CString& sEdStr,BYTE *pbyte);
- CString BinToEdStr_TM(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_SW(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_DI(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_DO(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_SU(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_SD(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_ST(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_RL(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_LP(UINT Sign1,UINT nByte3, UINT nElementNo);
- BOOL CheckData(const CString& sEditstr,CString& sErrMsg);
- BOOL AnalyzeData(const CString& sEditstr,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeCond_TMCTCICO(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeCond_SWAN(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeCond_DIDO(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeCond_SU(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeCond_SD(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeCond_ST(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeCond_RL(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeCond_LP(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- };
- class CCfgSTDtl_ActLst : public CCfgSTDtl_StubLst{
- public:
- CCfgSTDtl_ActLst();
- void ReadFileToEditStr(struct STDtlEditData& struEdData) ;
- void WriteEditStrToFile(struct STDtlEditData& struEdData) ;
- void TransBinToEdStr(BYTE *pbyte,CString& sEdStr);
- void TransEdStrToBin(CString& sEdStr,BYTE *pbyte);
- CString BinToEdStr_TM(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_SW(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_DO(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_SU(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_SD(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_ST(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_CL(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_PROGRQ(UINT nSign1,UINT nByte3, UINT nElementNo);
- CString BinToEdStr_BASIC(UINT nSign1,UINT nByte3, short nElementNo);
- CString BinToEdStr_LP(UINT Sign1,UINT nByte3, UINT nElementNo);
- BOOL CheckData(const CString& sEditstr,CString& sErrMsg);
- BOOL AnalyzeData(const CString& sEditstr,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeAct_TMCTCICO(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeAct_SWAN(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeAct_DO(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeAct_SU(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeAct_SD(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeAct_ST(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeAct_CL(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeAct_LP(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeAct_PROGRQ(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- BOOL AnalyzeAct_BASIC(const UINT nInsType,const UINT nElementNo,const CString& sPara,CString& sErrMsg,DWORD& dstDWord);
- };
- class AFX_EXT_CLASS CCfgSTDtlInstrData : public CCfgCheckBase{
- //attribute
- private:
- CCfgSTDtl_Oper m_oOper;
- CCfgSTDtl_Cfg m_oCfg;
- CCfgSTDtl_YNBlk m_oYNBlk;
- CCfgSTDtl_CondYNLst m_oCondYNLst;
- CCfgSTDtl_ActYNLst m_oActYNLst;
- CCfgSTDtl_CondLst m_oCondLst;
- CCfgSTDtl_ActLst m_oActLst;
- CString m_sarCondCmt[CFG_NUM_STDETAIL_COND];
- CString m_sarActCmt[CFG_NUM_STDETAIL_COND];
- int m_nCurSTTableNo;
- CFCUSTCondSet m_STCondSet;
- CFCUSTCondSet m_STActSet;
- // CFile* m_pBinFile;
- // CDaoDatabase* m_pFCUDB;
- // CDaoDatabase* m_pOPSDB;
- public:
- CCfgSTDtlInstrData();
- ~CCfgSTDtlInstrData();
- void InitialPointer(CDaoDatabase* pOPSDB,CDaoDatabase* pFCUDB,BYTE* pbinbuf,int nOnlineMode,CFile* pFile,CCommunication* pComm);
- void ReadData(struct STDtlEditData& struEdData);
- void WriteData(struct STDtlEditData& struEdData);
- BOOL CheckData(CString& sEditstr,int nCondOrActType,CString& sErrMsg,struct STDtlEditData& struEdData,int nRowNo,BOOL& bRetIsChanged);
- BOOL CheckAllData(struct STDtlEditData& struEdData,int& nErrAreaNo,int& nErrColNo,CString& sErrMsg);
- void CopyDetailTable(int srcTableNo,int dstTableNo,int copyMode);
- //used in UXL
- void InitialPointer(int nUnitNo,CDaoDatabase* pOPSDB,CDaoDatabase* pFCUDB,BYTE* pbinbuf,CCommunication* pComm);
- void ReadData(int nTableNo,struct STDtlEditData& struEdData);
- };
- #endif