-
Notifications
You must be signed in to change notification settings - Fork 11
/
SMS_SenderDlg.h
121 lines (101 loc) · 2.84 KB
/
SMS_SenderDlg.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// SMS_SenderDlg.h : header file
//
#if !defined(AFX_SMS_SENDERDLG_H__CCB92CCF_FAD6_484C_A9BC_F86812E03A42__INCLUDED_)
#define AFX_SMS_SENDERDLG_H__CCB92CCF_FAD6_484C_A9BC_F86812E03A42__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Sms/SmsTraffic.h"
#include "Dao/dao.h"
#include "Config.h"
#include "Led.h"
#include <Afxmt.h>
#include "liblogger/liblogger.h"
#include "liblogger/file_logger.h"
#include "liblogger/liblogger_levels.h"
// For this file, we choose logs of priority debug and above.
//#define LOG_LEVEL LOG_LEVEL_DEBUG
// The module name for logs done from this file.
//#define LOG_MODULE_NAME "SMS_SenderDlg"
/////////////////////////////////////////////////////////////////////////////
// CSMS_SenderDlg dialog
typedef struct{
BOOL available;
CSmsTraffic* pSmsTraffic;
}SMS_Sender,*PSMS_Sender;
class CSMS_SenderDlg : public CDialog
{
// Construction
public:
CSMS_SenderDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CSMS_SenderDlg)
enum { IDD = IDD_SMS_SENDER_DIALOG };
CListBox m_ListBox_Console;
CString m_SID;
CString m_User;
CString m_Password;
CLed m_Led18;
CLed m_Led17;
CLed m_Led16;
CLed m_Led15;
CLed m_Led14;
CLed m_Led13;
CLed m_Led12;
CLed m_Led11;
CLed m_Led10;
CLed m_Led9;
CLed m_Led8;
CLed m_Led7;
CLed m_Led6;
CLed m_Led5;
CLed m_Led4;
CLed m_Led3;
CLed m_Led2;
CLed m_Led1;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSMS_SenderDlg)
public:
virtual BOOL DestroyWindow();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CSMS_SenderDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnDestroy();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg LRESULT OnInfo(WPARAM, LPARAM); //日志信息显示
afx_msg void OnClose();
//}}AFX_MSG
private:
void Initialize();
void Finalize();
void InitComPool();
void InitLog();
void AddInfo(CString Info);
void setLed(int i,BOOL success);
int getIdleSender();
int getRandIndex(int MaxIndex);
CConfig *m_config;
private:
TCHAR szCause[255];
SMS_Sender m_SmsSenderList[COMPOOL_SIZE+1];
SMS_Sender m_idleSmsSenderList[COMPOOL_SIZE+1];//空闲的短信机数组
int max_width;
UINT m_timer;//定时器,定时获取待发短信
CString m_Msg;
CCriticalSection cs;
CCriticalSection cs_ms;
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SMS_SENDERDLG_H__CCB92CCF_FAD6_484C_A9BC_F86812E03A42__INCLUDED_)