Project

General

Profile

Feature #2953 » line4c3.h

yan hong, 04/18/2023 10:43 AM

 
1
#pragma once
2

    
3

    
4

    
5
//#include "daq/daq_cmddef.h"
6
#include <string>
7
#include "thirdparty/json.h"
8
#include <vector>
9
#include <map>
10
#include "daq/daq_protocol.h"
11
//?û????ȼ????ɹ?Լ?綨??user_id??ӳ???ϵ???ڻ?ȡcall_station????н???
12

    
13
//ע??vector??map?ij?ʼ??????
14

    
15
//map???뼰???ӳ??????
16

    
17
//?費??Ҫ???Ǹ??೤ʱ???ȡ?б?????map
18

    
19
#define  YX_MIC  1+1//777		//?㲥״̬ң?ŵ?		
20
#define  STATUS	 0+1//888		//ͨ??״̬??̬??
21

    
22
using namespace std;
23

    
24

    
25
struct cstation
26
{
27
	int id;
28
	string name;
29
	string status;
30
};
31

    
32
struct subsystem
33
{
34
	int id;
35
	string name;
36
};
37

    
38

    
39
struct zone
40
{
41
	int id;
42
	string name_en;
43
	string name_zh;
44
};
45

    
46

    
47
class CLine5C3 : public CProtocol
48
{
49
public:
50

    
51
	void ReadIni();
52

    
53
	virtual sint32 TxProc();
54
	virtual sint32 RxProc();
55

    
56
	virtual void Init(S_PROTOCOLCFG* pcfg);
57

    
58
	int postappid(string authName, int userNum);
59
	int posttokenid(string appid, int timeKey);
60

    
61
	int getcall_stations();
62
	int getsubsystems();
63
	
64
	int getzones();
65
	
66
//	int getall_zones();
67

    
68
	int post_startmic(int userid, vector<uint32> stations, vector<uint16> zones);
69
	int post_stopmic(int userid);
70

    
71

    
72
	void Put_AYx(uint16 Rtuno, uint16 YxNo, uint8 YxValue);
73

    
74
	sint32 Get_rtuno();
75
	sint32 Get_CmdNum();
76
	sint32 Get_ACmd(sint32 rtuno, S_RAWCMD* cmd);
77
	sint32 Del_ACmd(sint32 rtuno);
78

    
79
	int Get_AreaNum();
80
	int Get_StationNum();
81

    
82
	string Get_authName();
83
	int Get_userNum();
84

    
85
	string Get_appid();
86
	string Get_tokenid();
87

    
88
	int callstationid(uint8 user);
89
	vector<uint32> stationid(vector<uint32> sta);
90

    
91
	bool rxflag;
92
	bool txflag;
93

    
94
	bool appid_flag;
95
	bool token_flag;
96
	bool zone_flag;
97
	bool cmd_flag;
98
	int appid_lasttime;
99
	int token_lasttime;
100
	int zone_lasttime;
101

    
102
	bool startmic_flag;
103
	bool stopmic_flag;
104

    
105
protected:
106
	vector<cstation> call_stations;
107
	vector<subsystem> subsystems;
108
	
109
	vector<zone> zones;
110
	
111

    
112
	map<uint8, int> map_user;
113
	map<uint32, int> map_station;
114

    
115
private:
116

    
117
	string server_urls;
118
	string authName;
119
	int userNum;
120

    
121
	string token_header;
122

    
123
	string app_id;
124
	string token_id;
125

    
126
	int AreaNum;
127
	int StationNum;
128

    
129
};
(5-5/9)