BlueFlashToolDlg.h
4.96 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
// BlueFlashToolDlg.h : header file
//
//{{AFX_INCLUDES()
#include "mscomm.h"
#include "afxwin.h"
//}}AFX_INCLUDES
#if !defined(AFX_BLUEFLASHTOOLDLG_H__DE44DC07_CA43_417C_A12F_149A2C736BB5__INCLUDED_)
#define AFX_BLUEFLASHTOOLDLG_H__DE44DC07_CA43_417C_A12F_149A2C736BB5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CBlueFlashToolDlg dialog
class CBlueFlashToolDlg;
typedef struct ThreadData
{
CBlueFlashToolDlg* pDlg;
BYTE blue_device_type;
int nIndex;
HANDLE m_hThread;
BLUE_THREAD_STATE StartThread;
CString Filename;
CMSComm *pctrlMSComm;
}FLASH_THREAD_DATA;
class CBlueFlashToolDlg : public CDialog
{
// Construction
public:
void UpdateGroupsCaptions();
CBlueFlashToolDlg(CWnd* pParent = NULL); // standard constructor
CComboBox myctrlComboComPort[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM];
//下载按钮
CButton myctrlStartButton[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM];
//SN显
CStatic myStaticSn[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM];
//进度条
CProgressCtrl myctrlProcess[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM];
//控件
//CMSComm *pctrlMSComm[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM];
//20个PCB检测指示器
CStatic myctrlPcbState[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM];;
//每条线的UART口是否有效
bool ifUartEnable[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM];
//待写入的SN号
//int mySN_readwrite[MAX_TOPWELL_DEVICE_NUM];
//线程数据
FLASH_THREAD_DATA myThreadData[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM];;
//存在UART口
CWordArray myAryExistPort;
//可用UART口
CWordArray myAryNoneOpenedPort;
//已经被占用UART口
CWordArray myAryAlreadyOpenedPort;
//不存在的UART口
CWordArray myAryNotExistPort;
//调试信息列表
CListBox mylistDebugInfo;
//已经被成功下载的文件
CWordArray myAryFlashSuc;
//未被成功下载的文件
CWordArray myAryFlashFail;
char strSignalFlashReady[16];
char strSignalFlashing[20];
//开始下载时, 计时器
INT64 mytickcount[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM];
HBITMAP myBitmapWait;
HBITMAP myBitmapReady;
CFont myfontButton;
CString mystrAppcurrDir;
#ifdef __TOPWELL_EDIT_SN_ENABLE__
BYTE *mybufferForFile;
BYTE *mybufferForFileUSB;
int myLenForFile;
int myLenForFileUSB;
topwell_SN_write_struct *pSN_write;
#endif
BYTE mybufferFromUart[BLUE_TYPE_MAX][MAX_TOPWELL_DEVICE_NUM][BLUE_UART_INPUTBUFFER_SIZE]; //设置BYTE数组 An 8-bit integerthat is not signed.
int DBG_print(const char * strMsg, ...);
void DeletePCB(int device_type, int index);
void calcTImeWhenFinished(int device_type, int index);
// Dialog Data
//{{AFX_DATA(CBlueFlashToolDlg)
enum { IDD = IDD_BLUEFLASHTOOL_DIALOG };
CMSComm mycom_debug;
CMSComm mycom[2][25];;
// CMSComm mycom02;
// CMSComm mycom03;
// CMSComm mycom04;
// CMSComm mycom05;
// CMSComm mycom06;
// CMSComm mycom07;
// CMSComm mycom08;
// CMSComm mycom09;
// CMSComm mycom10;
// CMSComm mycom11;
// CMSComm mycom12;
// CMSComm mycom13;
// CMSComm mycom14;
// CMSComm mycom15;
// CMSComm mycom16;
// CMSComm mycom17;
// CMSComm mycom18;
// CMSComm mycom19;
// CMSComm mycom20;
// CMSComm mycom21;
// CMSComm mycom22;
// CMSComm mycom23;
// CMSComm mycom24;
// CMSComm mycom25;
// CMSComm mycom26;
// CMSComm mycom27;
// CMSComm mycom28;
// CMSComm mycom29;
// CMSComm mycom30;
// CMSComm mycom31;
// CMSComm mycom32;
// CMSComm mycom33;
// CMSComm mycom34;
// CMSComm mycom35;
// CMSComm mycom36;
// CMSComm mycom37;
// CMSComm mycom38;
// CMSComm mycom39;
// CMSComm mycom40;
// CMSComm mycom41;
// CMSComm mycom42;
// CMSComm mycom43;
// CMSComm mycom44;
// CMSComm mycom45;
// CMSComm mycom46;
// CMSComm mycom47;
// CMSComm mycom48;
// CMSComm mycom49;
// CMSComm mycom50;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CBlueFlashToolDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
HICON m_hIcon;
// Generated message map functions
//{{AFX_MSG(CBlueFlashToolDlg)
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnButtonSetting();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
DECLARE_EVENTSINK_MAP()
afx_msg void OnBnClickedButtonInitComport();
afx_msg void OnDestroy();
afx_msg void OnBnClickedStartAll();
void OnCommMscommDebug();
bool OpenComport(int earOrUsb, int index);
bool CloseComport(int earOrUsb, int index);
void OnCommMscomm1(UINT nID);
bool SendFileToComPort(BLUE_DEVICE_TYPE earOrUsb, int index);
// 拔出或者插入UART线, 更新列表信息
void UartDeviceChange(void);
#ifdef __TOPWELL_EDIT_SN_ENABLE__
bool LoadBin(int blueDeviceType);
bool SaveBin(int blueDeviceType);
bool SaveBin(int blueDeviceType,int index);
#endif
afx_msg void OnBnClickedStopAll();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_BLUEFLASHTOOLDLG_H__DE44DC07_CA43_417C_A12F_149A2C736BB5__INCLUDED_)