📄 awflow.cpp
字号:
case APIBUSGetCommandSendModal ://0x00f20001 //int & mod//GetCommandMsgInfo
//SENDMOD int & sendmod=0,SENDOBJ int & sendobj=0,SENDCMD int & command=0,CMDTYPE int & itype=0,
//MSGIDENT int & ident=0,RECVTIME int & iteme=0,PARMNUM int & pnum=0
if(m_pCurMsg){
pdwCommandList[0]=(int)m_pCurMsg->m_dwSendMode;
pdwCommandList[1]=(int)m_pCurMsg->m_pSender;
pdwCommandList[2]=(int)m_pCurMsg->m_dwCommand;
pdwCommandList[3]=(int)m_pCurMsg->m_pReceivor;
pdwCommandList[4]=(int)m_pCurMsg->m_dwIdent;
pdwCommandList[5]=(int)m_pCurMsg->m_iTimeStamp;
pdwCommandList[6]=(int)m_pCurMsg->m_iNumOfTV;
}
else{
pdwCommandList[0]=0;
pdwCommandList[1]=0;
pdwCommandList[2]=0;
pdwCommandList[3]=0;
pdwCommandList[4]=0;
pdwCommandList[5]=0;
pdwCommandList[6]=0;
}
break;
case APIBUSSetFlowEvent ://0x00f20004 //int obj,MOD int modid=0,FLAG int flag=0,int iEventId, datablock 0 v1,datablock 0 v2
m_iErrorCode=0;
if((int)pdwCommandList[1]==0||(int)pdwCommandList[1]==(int)GetModId()){
CAsynWorker * pWork=(CAsynWorker * )(int)pdwCommandList[0];
if(pWork->IsValid()){
CAWFlow * pFlow=(CAWFlow *)pWork;
if(pFlow->ControlValid()){
if(!pFlow->SetEvent((DWORD)pdwCommandList[3],pdwCommandList[4],pdwCommandList[5])){
m_iErrorCode=-1;
return SetContinue();
}
else{
if((int)pdwCommandList[2]){
//
return SetPause(APIBUSSetFlowEvent);
}
else{
//
return SetContinue();
}
}
}
}
}
else{
//send to the bus
}
break;
case APIBUSExcuteOver ://0x00f20005 //int obj,MOD int modid=0,dword dwCommand,...
if((int)pdwCommandList[1]==0||(int)pdwCommandList[1]==(int)GetModId()){
CAsynWorker * pWork=(CAsynWorker * )(int)pdwCommandList[0];
if(pWork->IsValid()){
CAWFlow * pFlow=(CAWFlow *)pWork;
if(pFlow->ControlValid()){
if((pFlow->m_dwExcuteModId==0||pFlow->m_dwExcuteModId==GetModId())&&
// pFlow->m_pCmdExcutor==this&&
pFlow->m_dwCommandExcute==(DWORD)pdwCommandList[2]){
pFlow->FunctionRet(FALSE,pFlow->m_dwCommandExcute,pdwCommandList+3,iNum-3);
return SetContinue();
}
}
}
//all error from here
}
else{
//send to the bus
CUniMsg um;
um.SetMessage(GetModId(),(DWORD)pdwCommandList[1],this,(CAsynWorker *)(int)pdwCommandList[0],EVT_EXCUTE_OVER,MSG_EVENT,InValidVar);
for(int i=0;i<iNum-2;i++){
um.Add(pdwCommandList[i+2]);
}
m_pBus->SendMessage(&um);
}
break;
case APIBUSStartTransAction ://0x00f20006 //
//
break;
case APIBUSEndTransAction ://0x00f20007 //
break;
case APIBUSStartAtomAction ://0x00f20008 //
break;
case APIBUSEndAtomAction ://0x00f20009 //
break;
case APIBUSApplyExprFunctin ://0x00f2000a //int obj,MOD int modid=0,int startcmd,int endcmd,DIR dir
if((int)pdwCommandList[1]==0||(int)pdwCommandList[1]==(int)GetModId()){
CAsynWorker * pWork=(CAsynWorker * )(int)pdwCommandList[0];
if(pWork->IsValid()){
if(pdwCommandList[4].uv.iv){
CAWFlow * pFlow=(CAWFlow *)pWork;
if(pFlow->ControlValid()){
pFlow->AddExprObj(this,(DWORD)pdwCommandList[2],(DWORD)pdwCommandList[3],0);
}
}
else{
AddExprObj(pWork,(DWORD)pdwCommandList[2],(DWORD)pdwCommandList[3],0);
}
return SetContinue();
}
//error from here
}
else {
if(pdwCommandList[4].uv.iv){
//send event
CUniMsg um;
um.SetMessage(GetModId(),(DWORD)pdwCommandList[1],this,(CAsynWorker *)(int)pdwCommandList[0],0x19731218,MSG_EVENT,pdwCommandList[2],pdwCommandList[3],InValidVar);
m_pBus->SendMessage(&um);
}
else{
AddExprObj((CAsynWorker * )(int)pdwCommandList[2],(DWORD)pdwCommandList[2],(DWORD)pdwCommandList[3],(DWORD)pdwCommandList[1]);
return SetContinue();
}
}
break;
case APIBUSEnableGetIn ://0x00f2001a //FLAG int iflag=0,HANDLE dword dwNotifyhandle=0,string szIdentString,int port,int & iactid
{
int iflag=(int)pdwCommandList[0];
if(m_pBus){
if(iflag<m_pBus->m_Interface.GetSize()&&iflag>=0){
if(m_pBus->m_Interface[iflag]->m_pEnableGetIn){
DWORD dwHandle=(DWORD)pdwCommandList[1];
if(dwHandle==0){
dwHandle=(DWORD)((CAsynWorker *)this);
}
m_pBus->m_Interface[iflag]->m_iCountId++;
pdwCommandList[4]=m_pBus->m_Interface[iflag]->m_iCountId;
LinkParam * pLink=m_pBus->AddLinkParam(iflag,(int)pdwCommandList[3],(LPSTR)pdwCommandList[2],TRUE);
pdwCommandList[4]=(int)pLink;
pdwCommandList[5]=m_pBus->m_Interface[iflag]->m_pEnableGetIn(CommDllCallBack,dwHandle,(LPSTR)pdwCommandList[2],(int)pdwCommandList[3],(int)pLink);
}
}
}
}
break;
case APIBUSStartConnect ://0x00f2001b //FLAG int iflag=0,HANDLE dword dwNotifyhandle=0,string szIdentString,int port,int & iactid
{
int iflag=(int)pdwCommandList[0];
if(m_pBus){
if(iflag<m_pBus->m_Interface.GetSize()&&iflag>=0){
if(m_pBus->m_Interface[iflag]->m_pStartConnect){
DWORD dwHandle=(DWORD)pdwCommandList[1];
if(dwHandle==0){
dwHandle=(DWORD)((CAsynWorker *)this);
}
m_pBus->m_Interface[iflag]->m_iCountId++;
LinkParam * pLink=m_pBus->AddLinkParam(iflag,(int)pdwCommandList[3],(LPSTR)pdwCommandList[2],FALSE);
pdwCommandList[4]=(int)pLink;
pdwCommandList[5]=m_pBus->m_Interface[iflag]->m_pStartConnect(CommDllCallBack,dwHandle,(LPSTR)pdwCommandList[2],(int)pdwCommandList[3],(int)pLink);
}
}
}
}
break;
case APIBUSDisconnected ://0x00f2001c //FLAG int iflag=0,HANDLE dword dwNotifyhandle=0,dword connecthandle
{
int iflag=(int)pdwCommandList[0];
if(m_pBus){
if(iflag<m_pBus->m_Interface.GetSize()&&iflag>=0){
if(m_pBus->m_Interface[iflag]->m_pDisconnected){
m_pBus->RemoveLinker((HANDLE)(DWORD)pdwCommandList[1]);
m_pBus->m_Interface[iflag]->m_pDisconnected((DWORD)pdwCommandList[1]);
}
}
}
}
break;
case APIBUSDisableGetIn ://0x00f2001d //FLAG int iflag=0,HANDLE dword dwNotifyhandle=0,int acdid
{
int iflag=(int)pdwCommandList[0];
if(m_pBus){
if(iflag<m_pBus->m_Interface.GetSize()&&iflag>=0){
if(m_pBus->m_Interface[iflag]->m_pDisableGetIn){
m_pBus->RemoveLinkParam((LinkParam * )(DWORD)pdwCommandList[1]);
m_pBus->m_Interface[iflag]->m_pDisableGetIn((DWORD)pdwCommandList[1]);
}
}
}
}
break;
case APIBUSWriteData ://0x00f2001f //FLAG int iflag=0,dword connecthandle,int acdid,datablock 0 dt,int iLen
{
int iflag=(int)pdwCommandList[0];
if(m_pBus){
if(iflag<m_pBus->m_Interface.GetSize()&&iflag>=0){
if(m_pBus->m_Interface[iflag]->m_pWriteData){
m_pBus->m_Interface[iflag]->m_pWriteData((DWORD)pdwCommandList[1],(void *)pdwCommandList[2],(int)pdwCommandList[3]);
}
}
}
}
break;
case APIBUSChangModName ://0x00f2001f //FLAG int iflag=0,dword connecthandle,int acdid,datablock 0 dt,int iLen
{
if(m_pBus){
DWORD dwmodid=(DWORD)pdwCommandList[1];
m_pBus->ChangeModId((HANDLE)(DWORD)pdwCommandList[0],dwmodid,(LPSTR)pdwCommandList[2]);
pdwCommandList[1]=dwmodid;
CString cs;
cs.Format("ChangeModeName %s 0x%lx",(LPSTR)pdwCommandList[2],dwmodid);
LogEvent(eventLog,0,2,(LPSTR)(LPCTSTR)cs);
}
}
break;
case APIBUSGetLinkBuffer ://0x00f20021 //dword & bhandle,dword connecthandle
{
if(m_pBus){
pdwCommandList[0]=(int)m_pBus->GetLinkerBuffer((HANDLE)(DWORD)pdwCommandList[1]);
}
}
break;
case APIBUSCheckBusLink:
{
SendEvent(&gDllGlobalManager.m_LinkObj,EVT_LINK_ALL);
}
break;
case APIBUSCheckClientModId:// 0x00f20023 //dword & modid
{
if(m_pBus){
m_pBus->CheckClientMod(pdwCommandList[0].uv.hv);
}
}
break;
case APIBUSWriteRemoteData: // 0x00f20024 //dword modid,datablock 0 dt,int len
{//dword modid,
//datablock 0 dt,
//int len,
//TYPE int type=1,
//CONNECT int hconnect=0,
//ZAP int iszap=0,
//CODE int iscode=0
//TIM int times
if(m_pBus){
int len=(int)pdwCommandList[2];
if(!len){
len=pdwCommandList[1].GetDataLength();
if(!len)break;
}
DWORD dwModId=(DWORD)pdwCommandList[0];
HANDLE hSock=(HANDLE)(DWORD)pdwCommandList[4];
int type=(int)pdwCommandList[3];
int iszap=(int)pdwCommandList[5];
int iscode=(int)pdwCommandList[6];
char * Data=(char *)pdwCommandList[1];
if(!Data)break;
if(dwModId==0||dwModId==m_pBus->m_unMod.dwModId){
switch(type){
case 0:
{
long cmd=*((long*)Data);
switch(cmd){
case 10:
break;
case 12:
break;
default:
break;
}
}
break;
case 1:
{
CUniMsg um;
if(um.ReadMessageFromBuffer(pdwCommandList[1])){
if(um.m_pReceivor&&um.m_dwSendMode&&um.m_dwSendMode!=m_pBus->m_unMod.dwModId){
CAsynWorker * pWork=
m_pBus->GetRegisterObject(
(int)um.m_pReceivor);
if(pWork){
um.m_pReceivor=pWork;
}
}
else{
if(um.m_pReceivor&&!um.m_pReceivor->IsValid()){
um.m_pReceivor=m_pBus->GetRegisterObject((int)um.m_pReceivor);
}
}
if(um.m_pReceivor){
if(um.m_btMsgType==MSG_SYNCMD){
if(um.m_hKey){
CSynWorker * pSy=(CSynWorker * )um.m_pReceivor;
if(pSy->IsSynWorker()){
*(pSy->m_pCmdReceive)=um;
pSy->SetTaskOver();
}
else {
//error
}
}
else {
BOOL bRemoteAsyn=um.m_ierror;
um.m_ierror=0;
if(bRemoteAsyn){
if(!m_pBus->DistrabutWork(&um)){
CUniMsg * pMsg=new CUniMsg();
pMsg->m_btMsgType=MSG_SYNCMD;
pMsg->m_dwCommand=um.m_dwCommand;
pMsg->m_pReceivor=um.m_pSender;
pMsg->m_pSender=um.m_pReceivor;
pMsg->m_dwSendMode=um.m_dwReceiveMode;
pMsg->m_dwReceiveMode=um.m_dwSendMode;
pMsg->m_ierror=-4;
m_pBus->SendMessage(pMsg,(void *)pMsg->m_pReceivor);
delete pMsg;
}
}
else {
CUniMsg * pMsg=new CUniMsg();
pMsg->m_btMsgType=MSG_SYNCMD;
pMsg->m_dwCommand=um.m_dwCommand;
pMsg->m_pReceivor=um.m_pSender;
pMsg->m_pSender=um.m_pReceivor;
pMsg->m_dwSendMode=um.m_dwReceiveMode;
pMsg->m_dwReceiveMode=um.m_dwSendMode;
pMsg->m_ierror=0;
BOOL ret=TRUE;
try{
ret=um.m_pReceivor->SynMsgProc(&um,pMsg);
}
catch(...){
pMsg->m_ierror=-2;
ret=TRUE;
}
if(ret)
m_pBus->SendMessage(pMsg,(void *)pMsg->m_pReceivor);
delete pMsg;
}
}
}
else{
m_pBus->SendMessage(&um);
}
}
else {
if(um.m_btMsgType==MSG_SYNCMD){
if(um.m_hKey){
//
}
else{
BOOL bRemoteAsyn=um.m_ierror;
um.m_ierror=0;
if(bRemoteAsyn){
if(!m_pBus->DistrabutWork(&um)){
CUniMsg * pMsg=new CUniMsg();
pMsg->m_btMsgType=MSG_SYNCMD;
pMsg->m_dwCommand=um.m_dwCommand;
pMsg->m_pReceivor=um.m_pSender;
pMsg->m_pSender=um.m_pReceivor;
pMsg->m_dwSendMode=um.m_dwReceiveMode;
pMsg->m_dwReceiveMode=um.m_dwSendMode;
pMsg->m_ierror=-4;
m_pBus->SendMessage(pMsg,(void *)pMsg->m_pReceivor);
delete pMsg;
}
}
else {
CUniMsg * pMsg=new CUniMsg();
pMsg->m_btMsgType=MSG_SYNCMD;
pMsg->m_dwCommand=um.m_dwCommand;
pMsg->m_pReceivor=um.m_pSender;
pMsg->m_pSender=um.m_pReceivor;
pMsg->m_dwSendMode=um.m_dwReceiveMode;
pMsg->m_dwReceiveMode=um.m_dwSendMode;
pMsg->m_ierror=0;
BOOL ret=TRUE;
try{
ret=m_pBus->SynMsgProc(&um,pMsg);
}
catch(...){
pMsg->m_ierror=-2;
ret=TRUE;
}
if(ret)
m_pBus->SendMessage(pMsg,(void *)pMsg->m_pReceivor);
delete pMsg;
}
}
}
else {
try{
if(um.m_dwCommand==CMD_TASK_RUNTASK&&um.m_btMsgType==MSG_COMMAND){
if(um.m_hKey==(HANDLE )1){
if(m_pBus->m_pOdbc){
CHopeKingDatabase * pDbs=NULL;
if((int)um.m_pTV[0]==-1){
pDbs=m_pBus->m_pOdbc->GetDefault();
}
else{
if(um.m_pTV[0].IsString()){
pDbs=(CHopeKingDatabase * )m_pBus->m_pOdbc->GetOdbc((LPCTSTR)um.m_pTV[0]);
}
else{
pDbs=(CHopeKingDatabase * )(int)um.m_pTV[0];
}
}
if(pDbs->IsValid()){
um.m_pReceivor=pDbs;
m_pBus->SendMessage(&um);
break;
}
}
}
else{
if(m_pBus->m_pEdauDllProxy){
um.m_pReceivor=m_pBus->m_pEdauDllProxy;
m_pBus->SendMessage(&um);
break;
}
}
CUniMsg um1;
um1.m_dwCommand=CMD_TASK_RUNTASK;
um1.m_btMsgType=MSG_RESPONSE;
um1.m_dwSendMode=um.m_dwReceiveMode;
um1.m_dwReceiveMode=um.m_dwSendMode;
um1.m_pReceivor=um.m_pSender;
um1.m_pSender=um.m_pReceivor;
um1.m_dwIdent=um.m_dwIdent;
um1.m_ierror=-25012;
um1.Add(-25012);
um1.Add("无此数据原");
m_pBus->SendMessage(&um1);
break;
}
else{
m_pBus->OnBusMsg(&um);
}
}
catch(...){
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -