1
|
// CdtZf.h: interface for the CZFCasco class.
|
2
|
//
|
3
|
//////////////////////////////////////////////////////////////////////
|
4
|
|
5
|
#if !defined(AFX_ZFCASCO_H__B4D62291_5002_4D1A_B5EE_C9606A1837EB__INCLUDED_)
|
6
|
#define AFX_ZFCASCO_H__B4D62291_5002_4D1A_B5EE_C9606A1837EB__INCLUDED_
|
7
|
|
8
|
#if _MSC_VER > 1000
|
9
|
#pragma once
|
10
|
#endif // _MSC_VER > 1000
|
11
|
#include "se_btl.h"
|
12
|
#include "se_log.h"
|
13
|
#include "daq/daq_protocol.h"
|
14
|
#include "redisats.h"
|
15
|
|
16
|
|
17
|
#define StaNums 13
|
18
|
|
19
|
|
20
|
class CZFCasco : public CProtocol {
|
21
|
public:
|
22
|
CZFCasco();
|
23
|
virtual ~CZFCasco();
|
24
|
public:
|
25
|
virtual sint32 TxProc();
|
26
|
virtual sint32 RxProc();
|
27
|
virtual sint32 GetZfFlag() { return 1; };
|
28
|
virtual void Init(S_PROTOCOLCFG * pcfg);
|
29
|
void readini();
|
30
|
|
31
|
private:
|
32
|
void IscsAtsPlannedTrain();
|
33
|
void IscsAtsPracticalTrain();
|
34
|
void IscsAtsFasInfo();
|
35
|
void IscsAtsScadaInfo();
|
36
|
void IscsAtsEmcsInfo();
|
37
|
void MsgPolling();
|
38
|
uint8 RxAtsTrainLocation(uint8 *buf);
|
39
|
uint8 RxAtsBlockInfo(uint8 *buf);
|
40
|
uint8 RxAtsPlannedTrain(uint8 *buf);
|
41
|
uint8 RxAtsPracticalTrain(uint8 *buf);
|
42
|
uint8 RxAtsDynamicTrain(uint8 *buf);
|
43
|
uint8 GetZf();
|
44
|
uint8 zfYX[400];
|
45
|
// float zfYC[30];
|
46
|
uint8 zfYCmx[30];
|
47
|
uint8 zfFas[30];
|
48
|
uint8 zfScada[200];
|
49
|
uint8 zfEmcs[48 * 3];
|
50
|
uint8 Fas[30];
|
51
|
uint8 ScadaZone[15][4];
|
52
|
uint8 Emcs[48][2];//onoff-dir
|
53
|
uint8 bInited;
|
54
|
uint8 bFas;
|
55
|
uint8 bEmcs;
|
56
|
uint8 bScada;
|
57
|
uint8 bIdle;
|
58
|
void zfScadaToATS(uint8 *yc, uint8 *yx, int len);
|
59
|
void zfEmcsToATS(uint8 *buf, int len);
|
60
|
uint16 winHan[1500]; //winHan[???δ???]=?г??????
|
61
|
uint8 m_SysId;
|
62
|
sint32 GetNowSecond();
|
63
|
sint32 m_LastSendTime;
|
64
|
sint32 m_LastCallAllTime;
|
65
|
sint32 m_LastCallKWHTime;
|
66
|
sint32 m_RcvTimeOuts; //??ʱʱ??
|
67
|
sint32 m_CallAllData; //???ٻ?ʱ??
|
68
|
sint32 m_CallKWH; //?ٻ????ʱ??
|
69
|
|
70
|
sint32 m_LastSynctime;
|
71
|
sint32 m_SyncTime;
|
72
|
uint16 cnt_sequence;
|
73
|
|
74
|
void PrtBuf(uint8 *buf, int len);
|
75
|
sint32 PrintLog(unsigned int type, char *fmt, ...) {
|
76
|
char buffer[8000];
|
77
|
va_list data;
|
78
|
va_start(data, fmt);
|
79
|
int count = vsprintf(buffer, fmt, data);
|
80
|
va_end(data);
|
81
|
|
82
|
int module = 1;
|
83
|
if (pLink)
|
84
|
module = pLink->GetRtuNo();
|
85
|
|
86
|
if (count>0)
|
87
|
return kprintf(LOG_COMM, module, type, buffer);
|
88
|
|
89
|
return 0;
|
90
|
};
|
91
|
|
92
|
|
93
|
CTrainDataOpt *m_popt_train;
|
94
|
char redisip[100];
|
95
|
int redisport;
|
96
|
|
97
|
};
|
98
|
#endif // !defined(AFX_ZFCASCO_H__B4D62291_5002_4D1A_B5EE_C9606A1837EB__INCLUDED_)
|