QuakeGod
2024-01-16 6ff05a44b01c6ac6e33db2ec28dcf6e2a7c2abb0
提交 | 用户 | age
df0321 1 // MyFormLog.cpp : 实现文件
Q 2 //
3
4 #include "pch.h"
5 #include "MTerm1.h"
6 #include "MyFormInputShow.h"
7
8 #include "MainFrm.h"
ad1b4b 9 static int flag = 0;
4ed7fc 10 static int showPage = 0;
df0321 11
Q 12 // CMyFormLog
13 structButton myButtons[6][3][11] =
14 {
4ed7fc 15     {{IDC_BUTTON_AND,_T("-|  |-"), IDC_BUTTON_OR,_T("└┤├┘") ,IDC_BUTTON_VLINE,_T("|"), IDC_BUTTON_OUT,_T("-[OUT]") ,IDC_BUTTON_TMCT,_T("TM/CT") ,IDC_BUTTON_FUN,_T("Fun") ,IDC_BUTTON_HLINE,_T("——") ,IDC_BUTTON_NOT,_T("NOT/") ,IDC_BUTTON_INDEX,_T("INDEX") ,IDC_BUTTON_MC,_T("(MC)") ,IDC_BUTTON_MCE,_T("(MCE)") },
Z 16     {IDC_BUTTON_SET,_T("-<SET>-"), IDC_BUTTON_RESET,_T("-<RESET>") ,IDC_BUTTON_DF,_T("(DF(/))"), IDC_BUTTON_END,_T("(END)") ,IDC_BUTTON_COMPARE,_T("比较") ,IDC_BUTTON_PFUN,_T("PFun") ,IDC_BUTTON_UPDOWN,_T("↑↓") ,IDC_BUTTON_BIT,_T("[位]") ,IDC_BUTTON_WORD,_T("[字]") ,IDC_BUTTON_INSTRUCTION1,_T("指令1") ,IDC_BUTTON_INSTRUCTION2,_T("指令2") },
17     {IDC_BUTTON_PGCONVERT,_T("PG转换"), IDC_BUTTON_ONLINE,_T("在线") ,IDC_BUTTON_OFFLINE,_T("离线"), IDC_BUTTON_COLSE,_T("关闭") ,IDC_BUTTON_FIND,_T("查找") ,IDC_BUTTON_NEXTWIN,_T("次Win") ,IDC_BUTTON_MONITOR,_T("监控Go") ,IDC_BUTTON_STATUS,_T("状态") ,IDC_BUTTON_RUNPROG,_T("Run/Prog") ,IDC_BUTTON_PLCREAD,_T("PLC读取") ,IDC_BUTTON_PLCWRITE,_T("PLC写入") } },
df0321 18
4ed7fc 19     {{IDC_BUTTON_X,_T("X"), IDC_BUTTON_Y,_T("Y") ,IDC_BUTTON_R,_T("R"), IDC_BUTTON_L,_T("L") ,IDC_BUTTON_P,_T("P") ,IDC_BUTTON_COMPARE1,_T("比较") ,33407,_T("") ,IDC_BUTTON_NOT1,_T("NOT/") ,IDC_BUTTON_INDEX,_T("INDEX") ,IDC_BUTTON_NOCLEAR,_T("No.清除") ,33411,_T("") },
Z 20     {IDC_BUTTON_T,_T("T"), 33502,_T("C") ,33503,_T("E"), 33504,_T("") ,33505,_T("") ,33506,_T("") ,IDC_BUTTON_UPDOWN1,_T("↑↓") ,33508,_T("") ,33509,_T("") ,33510,_T("") ,33511,_T("") },
df0321 21     {33601,_T(""), 33602,_T("") ,33603,_T(""), 33604,_T("") ,33605,_T("") ,33606,_T("") ,33607,_T("") ,33608,_T("") ,33609,_T("") ,33610,_T("") ,33611,_T("") }},
Q 22
4ed7fc 23     {{IDC_BUTTON_D,_T("D"), IDC_BUTTON_F,_T("F") ,33703,_T(""), 33704,_T("") ,33705,_T("") ,IDC_BUTTON_NEQ,_T("=") ,IDC_BUTTON_GT,_T(">") ,IDC_BUTTON_LT,_T("<") ,33709,_T("") ,33710,_T("") ,33711,_T("") },
df0321 24     {33801,_T(""), 33802,_T("") ,33803,_T(""), 33804,_T("") ,33805,_T("") ,33806,_T("") ,33807,_T("") ,33808,_T("") ,33809,_T("") ,33810,_T("") ,33811,_T("") },
Q 25     {33901,_T(""), 33902,_T("") ,33903,_T(""), 33904,_T("") ,33905,_T("") ,33906,_T("") ,33907,_T("") ,33908,_T("") ,33909,_T("") ,33910,_T("") ,33911,_T("") }},
26
4ed7fc 27     {{IDC_BUTTON_WX,_T("WX"), IDC_BUTTON_WY,_T("WY") ,IDC_BUTTON_WR,_T("WR"), IDC_BUTTON_WL,_T("WL") ,IDC_BUTTON_DT,_T("DT") ,IDC_BUTTON_LD,_T("LD") ,IDC_BUTTON_FL,_T("FL") ,34108,_T("") ,IDC_BUTTON_INDEX,_T("INDEX") ,IDC_BUTTON_NOCLEAR,_T("No.清除") ,34111,_T("") },
Z 28     {IDC_BUTTON_SV,_T("SV"), IDC_BUTTON_EV,_T("EV") ,IDC_BUTTON_K,_T("K"), IDC_BUTTON_H,_T("H") ,IDC_BUTTON_M,_T("M") ,IDC_BUTTON_f,_T("f") ,34207,_T("") ,34208,_T("") ,34209,_T("") ,34210,_T("") ,34211,_T("") },
29     {IDC_BUTTON_PGCONVERT,_T("PG转换"), 34302,_T("") ,34303,_T(""), 34304,_T("") ,34305,_T("") ,34306,_T("") ,34307,_T("") ,34308,_T("") ,34309,_T("") ,34310,_T("") ,34311,_T("") }},
df0321 30
4ed7fc 31     {{IDC_BUTTON_IXI0,_T("IX(I0)"), IDC_BUTTON_IYI1,_T("IY(I1)") ,IDC_BUTTON_I2,_T("I2"), IDC_BUTTON_I3,_T("I3") ,IDC_BUTTON_I4,_T("I4") ,IDC_BUTTON_I5,_T("I5") ,IDC_BUTTON_I6,_T("I6") ,IDC_BUTTON_I7,_T("I7") ,IDC_BUTTON_I8,_T("I8") ,34410,_T("") ,34411,_T("") },
Z 32     {IDC_BUTTON_I9,_T("I9"), IDC_BUTTON_IA,_T("IA") ,IDC_BUTTON_IB,_T("IB"), IDC_BUTTON_IC,_T("IC") ,IDC_BUTTON_ID,_T("ID") ,34506,_T("") ,IDC_BUTTON_UPDOWN,_T("↑↓") ,34508,_T("") ,34509,_T("") ,34510,_T("") ,34511,_T("") },
df0321 33     {34601,_T(""), 34602,_T("") ,34603,_T(""), 34604,_T("") ,34605,_T("") ,34606,_T("") ,34607,_T("") ,34608,_T("") ,34609,_T("") ,34610,_T("") ,34611,_T("") }},
Q 34
4ed7fc 35     {{IDC_BUTTON_TMX,_T("TMX"), IDC_BUTTON_TMY,_T("TMY") ,IDC_BUTTON_TMR,_T("TMR"), IDC_BUTTON_TML,_T("TML") ,34705,_T("") ,IDC_BUTTON_CT,_T("-[CT]-") ,34707,_T("") ,34708,_T("") ,IDC_BUTTON_INDEX,_T("INDEX") ,34710,_T("") ,34711,_T("") },
df0321 36     {34801,_T(""), 34802,_T("") ,34803,_T(""), 34804,_T("") ,34805,_T("") ,34806,_T("") ,34807,_T("") ,34808,_T("") ,34809,_T("") ,34810,_T("") ,34811,_T("") },
Q 37     {34901,_T(""), 34902,_T("") ,34903,_T(""), 34904,_T("") ,34905,_T("") ,34906,_T("") ,34907,_T("") ,34908,_T("") ,34909,_T("") ,3490,_T("") ,34911,_T("") }},
38 };
4ed7fc 39
df0321 40
Q 41 static int myButtonCount = sizeof(myButtons[6][3][11]) / sizeof(structButton);
42
43 structButton myNumButtons[18] =
44 {
45     ID_BUTTON_0,_T("0"), ID_BUTTON_1,_T("1") ,ID_BUTTON_2,_T("2"), ID_BUTTON_3,_T("3") ,ID_BUTTON_4,_T("4") ,ID_BUTTON_5,_T("5") ,ID_BUTTON_6,_T("6") ,ID_BUTTON_7,_T("7") ,
46     ID_BUTTON_8,_T("8") ,ID_BUTTON_9,_T("9") ,ID_BUTTON_A,_T("A"),ID_BUTTON_B,_T("B"),ID_BUTTON_C,_T("C"),ID_BUTTON_D,_T("D"),ID_BUTTON_E,_T("E"),ID_BUTTON_F,_T("F"),
47     ID_BUTTON_MINUS,_T("-"),ID_BUTTON_DOT,_T(".")
48 };
49
50 static int myNumButtonCount = sizeof(myNumButtons) / sizeof(structButton);
51
52 structButton myCmdButtons[4] =
53 {
54     ID_BUTTON_RET, _T("↙"), ID_BUTTON_INSERT, _T("Ins"), ID_BUTTON_DELETE, _T("Del"), ID_BUTTON_ESC, _T("Esc")
55 };
56 static int myCmdButtonCount = sizeof(myCmdButtons) / sizeof(structButton);
57
58
59 IMPLEMENT_DYNCREATE(CMyFormInputShow, CFormView)
60
61 CMyFormInputShow::CMyFormInputShow()
62     : CFormView(CMyFormInputShow::IDD)
63 {
64
65 }
66
67 CMyFormInputShow::~CMyFormInputShow()
68 {
69 }
70
71 void CMyFormInputShow::DoDataExchange(CDataExchange* pDX)
72 {
73     CFormView::DoDataExchange(pDX);
74     DDX_Control(pDX, IDC_EDIT_INPUT, m_edit_input);
75 }
76
77 BEGIN_MESSAGE_MAP(CMyFormInputShow, CFormView)
78     ON_WM_CREATE()
79     ON_WM_DESTROY()
80     ON_WM_SIZE()
81     ON_WM_MOUSEACTIVATE()
4ed7fc 82     ON_WM_TIMER() 
df0321 83
Q 84     ON_BN_CLICKED(IDC_BUTTON1, &CMyFormInputShow::OnBnClickedButton1)
85
86     ON_BN_CLICKED(IDC_BUTTON_AND, &CMyFormInputShow::OnBnClickedBtnAnd)
87     ON_BN_CLICKED(IDC_BUTTON_OR, &CMyFormInputShow::OnBnClickedBtnOr)
88     ON_BN_CLICKED(IDC_BUTTON_VLINE, &CMyFormInputShow::OnBnClickedBtnVline)
89     ON_BN_CLICKED(IDC_BUTTON_OUT, &CMyFormInputShow::OnBnClickedBtnOut)
90     ON_BN_CLICKED(IDC_BUTTON_TMCT, &CMyFormInputShow::OnBnClickedBtnTmCt)
91     ON_BN_CLICKED(IDC_BUTTON_FUN, &CMyFormInputShow::OnBnClickedBtnFun)
92     ON_BN_CLICKED(IDC_BUTTON_HLINE, &CMyFormInputShow::OnBnClickedBtnHLine)
93     ON_BN_CLICKED(IDC_BUTTON_NOT, &CMyFormInputShow::OnBnClickedBtnNot)
94     ON_BN_CLICKED(IDC_BUTTON_INDEX, &CMyFormInputShow::OnBnClickedBtnIndex)
95     ON_BN_CLICKED(IDC_BUTTON_MC, &CMyFormInputShow::OnBnClickedBtnMc)
96     ON_BN_CLICKED(IDC_BUTTON_MCE, &CMyFormInputShow::OnBnClickedBtnMce)
97
98     ON_BN_CLICKED(IDC_BUTTON_SET, &CMyFormInputShow::OnBnClickedBtnSet)
99     ON_BN_CLICKED(IDC_BUTTON_RESET, &CMyFormInputShow::OnBnClickedBtnReset)
100     ON_BN_CLICKED(IDC_BUTTON_DF, &CMyFormInputShow::OnBnClickedBtnDf)
101     ON_BN_CLICKED(IDC_BUTTON_END, &CMyFormInputShow::OnBnClickedBtnEnd)
102     ON_BN_CLICKED(IDC_BUTTON_COMPARE, &CMyFormInputShow::OnBnClickedBtnCompare)
103     ON_BN_CLICKED(IDC_BUTTON_PFUN, &CMyFormInputShow::OnBnClickedBtnPFun)
104     ON_BN_CLICKED(IDC_BUTTON_UPDOWN, &CMyFormInputShow::OnBnClickedBtnUpDown)
105     ON_BN_CLICKED(IDC_BUTTON_BIT, &CMyFormInputShow::OnBnClickedBtnBit)
106     ON_BN_CLICKED(IDC_BUTTON_WORD, &CMyFormInputShow::OnBnClickedBtnWord)
107     ON_BN_CLICKED(IDC_BUTTON_INSTRUCTION1, &CMyFormInputShow::OnBnClickedBtnInc1)
108     ON_BN_CLICKED(IDC_BUTTON_INSTRUCTION2, &CMyFormInputShow::OnBnClickedBtnInc2)
109
110     ON_BN_CLICKED(IDC_BUTTON_PGCONVERT, &CMyFormInputShow::OnBnClickedBtnPgConvert)
111     ON_BN_CLICKED(IDC_BUTTON_ONLINE, &CMyFormInputShow::OnBnClickedBtnOnline)
112     ON_BN_CLICKED(IDC_BUTTON_OFFLINE, &CMyFormInputShow::OnBnClickedBtnOffline)
113     ON_BN_CLICKED(IDC_BUTTON_COLSE, &CMyFormInputShow::OnBnClickedBtnClose)
114     ON_BN_CLICKED(IDC_BUTTON_FIND, &CMyFormInputShow::OnBnClickedBtnFind)
115     ON_BN_CLICKED(IDC_BUTTON_NEXTWIN, &CMyFormInputShow::OnBnClickedBtnNextWin)
116     ON_BN_CLICKED(IDC_BUTTON_MONITOR, &CMyFormInputShow::OnBnClickedBtnMonitor)
117     ON_BN_CLICKED(IDC_BUTTON_STATUS, &CMyFormInputShow::OnBnClickedBtnStatus)
118     ON_BN_CLICKED(IDC_BUTTON_RUNPROG, &CMyFormInputShow::OnBnClickedBtnRunProg)
119     ON_BN_CLICKED(IDC_BUTTON_PLCREAD, &CMyFormInputShow::OnBnClickedBtnPlcRead)
120     ON_BN_CLICKED(IDC_BUTTON_PLCWRITE, &CMyFormInputShow::OnBnClickedBtnPlcWrite)
121
122     ON_BN_CLICKED(IDC_BUTTON_X, &CMyFormInputShow::OnBnClickedBtnX)
123     ON_BN_CLICKED(IDC_BUTTON_Y, &CMyFormInputShow::OnBnClickedBtnY)
124     ON_BN_CLICKED(IDC_BUTTON_R, &CMyFormInputShow::OnBnClickedBtnR)
125     ON_BN_CLICKED(IDC_BUTTON_L, &CMyFormInputShow::OnBnClickedBtnL)
126     ON_BN_CLICKED(IDC_BUTTON_P, &CMyFormInputShow::OnBnClickedBtnP)
127     ON_BN_CLICKED(IDC_BUTTON_COMPARE1, &CMyFormInputShow::OnBnClickedBtnCompare1)
128     ON_BN_CLICKED(IDC_BUTTON_NOT1, &CMyFormInputShow::OnBnClickedBtnNot)
129     ON_BN_CLICKED(IDC_BUTTON_T, &CMyFormInputShow::OnBnClickedBtnT)
130     ON_BN_CLICKED(IDC_BUTTON_C, &CMyFormInputShow::OnBnClickedBtnC)
131     ON_BN_CLICKED(IDC_BUTTON_E, &CMyFormInputShow::OnBnClickedBtnE)
132     ON_BN_CLICKED(IDC_BUTTON_UPDOWN1, &CMyFormInputShow::OnBnClickedBtnUpDown)
133
134     ON_BN_CLICKED(IDC_BUTTON_TMX, &CMyFormInputShow::OnBnClickedBtnTmx)
135     ON_BN_CLICKED(IDC_BUTTON_TMY, &CMyFormInputShow::OnBnClickedBtnTmy)
136     ON_BN_CLICKED(IDC_BUTTON_TMR, &CMyFormInputShow::OnBnClickedBtnTmr)
137     ON_BN_CLICKED(IDC_BUTTON_TML, &CMyFormInputShow::OnBnClickedBtnTml)
138     ON_BN_CLICKED(IDC_BUTTON_CT, &CMyFormInputShow::OnBnClickedBtnCt)
139
140     ON_BN_CLICKED(IDC_BUTTON_D, &CMyFormInputShow::OnBnClickedBtnD)
141     ON_BN_CLICKED(IDC_BUTTON_F, &CMyFormInputShow::OnBnClickedBtnF)
142     ON_BN_CLICKED(IDC_BUTTON_NEQ, &CMyFormInputShow::OnBnClickedBtnNEQ)
143     ON_BN_CLICKED(IDC_BUTTON_GT, &CMyFormInputShow::OnBnClickedBtnGT)
144     ON_BN_CLICKED(IDC_BUTTON_LT, &CMyFormInputShow::OnBnClickedBtnLT)
145
146     ON_BN_CLICKED(ID_BUTTON_0, &CMyFormInputShow::OnBtn0)
147     ON_BN_CLICKED(ID_BUTTON_1, &CMyFormInputShow::OnBtn1)
148     ON_BN_CLICKED(ID_BUTTON_2, &CMyFormInputShow::OnBtn2)
149     ON_BN_CLICKED(ID_BUTTON_3, &CMyFormInputShow::OnBtn3)
150     ON_BN_CLICKED(ID_BUTTON_4, &CMyFormInputShow::OnBtn4)
151     ON_BN_CLICKED(ID_BUTTON_5, &CMyFormInputShow::OnBtn5)
152     ON_BN_CLICKED(ID_BUTTON_6, &CMyFormInputShow::OnBtn6)
153     ON_BN_CLICKED(ID_BUTTON_7, &CMyFormInputShow::OnBtn7)
154     ON_BN_CLICKED(ID_BUTTON_8, &CMyFormInputShow::OnBtn8)
155     ON_BN_CLICKED(ID_BUTTON_9, &CMyFormInputShow::OnBtn9)
156     ON_BN_CLICKED(ID_BUTTON_A, &CMyFormInputShow::OnBtnA)
157     ON_BN_CLICKED(ID_BUTTON_B, &CMyFormInputShow::OnBtnB)
158     ON_BN_CLICKED(ID_BUTTON_C, &CMyFormInputShow::OnBtnC)
159     ON_BN_CLICKED(ID_BUTTON_D, &CMyFormInputShow::OnBtnD)
160     ON_BN_CLICKED(ID_BUTTON_E, &CMyFormInputShow::OnBtnE)
161     ON_BN_CLICKED(ID_BUTTON_F, &CMyFormInputShow::OnBtnF)
162     ON_BN_CLICKED(ID_BUTTON_MINUS, &CMyFormInputShow::OnBtnMinus)
163     ON_BN_CLICKED(ID_BUTTON_DOT, &CMyFormInputShow::OnBtnDot)
164     ON_BN_CLICKED(ID_BUTTON_RET, &CMyFormInputShow::OnBtnRet)
165     ON_BN_CLICKED(ID_BUTTON_INSERT, &CMyFormInputShow::OnBtnInsert)
166     ON_BN_CLICKED(ID_BUTTON_DELETE, &CMyFormInputShow::OnBtnDelete)
167     ON_BN_CLICKED(ID_BUTTON_ESC, &CMyFormInputShow::OnBtnEsc)
168
169
170     ON_WM_CHAR()
0200a3 171     ON_COMMAND(ID_KEY_X, &CMyFormInputShow::OnKeyX)
df0321 172 END_MESSAGE_MAP()
Q 173
174 // CMyFormLog 诊断
175
176 #ifdef _DEBUG
177 void CMyFormInputShow::AssertValid() const
178 {
179     CFormView::AssertValid();
180 }
181
182 #ifndef _WIN32_WCE
183 void CMyFormInputShow::Dump(CDumpContext& dc) const
184 {
185     CFormView::Dump(dc);
186 }
187 #endif
188 #endif //_DEBUG
189
190 // CMyFormLog 消息处理程序
191
192 BOOL CMyFormInputShow::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
193 {
194     // TODO: 在此添加专用代码和/或调用基类
195
196     return CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
197 }
198
199 int CMyFormInputShow::OnCreate(LPCREATESTRUCT lpCreateStruct)
200 {
201     if (CFormView::OnCreate(lpCreateStruct) == -1)
202         return -1;
203
204     // TODO:  在此添加您专用的创建代码
205
206     return 0;
207 }
208
209 void CMyFormInputShow::OnDestroy()
210 {
211     CFormView::OnDestroy();
212
213     // TODO: 在此处添加消息处理程序代码
214 }
215
216 void CMyFormInputShow::OnSize(UINT nType, int cx, int cy)
217 {
218     CFormView::OnSize(nType, cx, cy);
219     // TODO: 在此处添加消息处理程序代码
220     CWnd * pwnd;
221 /*
222     pwnd=GetDlgItem(IDC_EDIT_LOG);
223     if (pwnd!=NULL)
224     {
225 //        RECT    rect1;
226         pwnd->SetWindowPos(NULL,0,0,cx,cy-20,NULL);
227     }
228 //*/
229
230 /*
231     pwnd = GetDlgItem(IDC_RICHEDIT2_LOG);
232     if (pwnd != NULL)
233     {
234         //        RECT    rect1;
235         pwnd->SetWindowPos(NULL, 0, 0, cx, cy - 20, NULL);
236     }
237     pwnd=GetDlgItem(IDC_CHECK_PAUSE);
238     if (pwnd!=NULL)
239     {
240         //RECT    rect1;
241         CRect rect1;
242         pwnd->GetWindowRect(rect1);
243         ScreenToClient(&rect1);
244         pwnd->SetWindowPos(NULL,0, cy - rect1.Height()-4,rect1.Width(),rect1.Height(),NULL);
245     }
246     pwnd=GetDlgItem(IDC_CHECK_NOSCROLL);
247     if (pwnd!=NULL)
248     {
249         CRect rect1;
250         pwnd->GetWindowRect(rect1);
251         ScreenToClient(&rect1);
252         pwnd->SetWindowPos(NULL,cx-rect1.Width(),cy-rect1.Height()-4,rect1.Width(),rect1.Height(),NULL);
253     }
254 //*/
255
256 }
257
258 void CMyFormInputShow::OnInitialUpdate()
259 {
260     CFormView::OnInitialUpdate();
261 /*
262     CString VersionStr = _T("V1.02");
263     CString BuildStr = _T("20210728");
264     // TODO: 在此添加专用代码和/或调用基类
265     myLogger1.SetLogPathName(_T("D:\\Logs\\MTerm1"), _T("MTerm1"));
266     myLogger1.AttachWnd(m_richedit_log.m_hWnd);
267     myLogger1.bShowLog[0] = 1;
268     myLogger1.bShowThreadId = 0;
269     myLogger1.bShowChannel = 0;
270     myLogger1.bSaveLog[0] = 1;
271     myLogger1.bShowDate = 1;
272     SysLog(_T(" Start ") + VersionStr + _T(" ") + BuildStr + _T("\r\n"));
273     myLogger1.bShowDate = 0;
274 //    myLogger1.bShowLineCount=0;
275 //    myLogger1.bShowTime=0;
276     myLogger1.UpdateLogDisplay();
277     SetTimer(1, 100, NULL);
278 */
279
280     CString(s1);
281
282     s1.Format(_T(" MyDlgBarFuncKey Onupdate "));
283     SysLog(s1);
284
285 //    LRESULT bRet = HandleInitDialog(wParam, lParam);
286 //    if (!UpdateData(FALSE))
287 //    {
288 //        TRACE("InitDialogBar Failed!");
289 //    }
290
291     CRect rect0;
292     GetClientRect(&rect0);
293     int nWidth = rect0.Width();
294     int nHeight = rect0.Height();
295     nWidth = 720; // rect0.Width();
296     nHeight = 60;
297     int nTopMargin = 32;
298     s1.Format(_T("Width %d Height %d "), nWidth, nHeight);
299     SysLog(s1);
300     int nLeftMargin = 48;
301
302     int nSpace = nWidth - nLeftMargin;
303     int x1, y1, x2, y2;
304     CRect rect1(0, 20, 300, 40);
305     for (int i = 0; i < myNumButtonCount; i++) {
306         x1 = nLeftMargin * 3 + i * (nSpace - nLeftMargin * 2) / 24;
307         y1 = 2;
308         x2 = x1 + (nSpace - nLeftMargin * 2) / 24 -2;
309         y2 = y1 + nHeight / 3;
310         rect1.SetRect(x1, y1, x2, y2);
311         m_NumButtons[i].Create(myNumButtons[i].sCaption, BS_FLAT | WS_CHILD | WS_TABSTOP | WS_VISIBLE | BS_PUSHBUTTON, rect1, this, myNumButtons[i].nID);
312         m_NumButtons[i].ShowWindow(SW_SHOW);
313     }
314
315     for (int i = 0; i < myCmdButtonCount; i++) {
316         x1 = nLeftMargin * 3 + (i +16) * (nSpace - nLeftMargin * 2) / 20;
317         y1 = 2;
318         x2 = x1 + nSpace / 24;
319         y2 = y1 + nHeight / 3;
320         rect1.SetRect(x1, y1, x2, y2);
321         m_CmdButtons[i].Create(myCmdButtons[i].sCaption, BS_FLAT | WS_CHILD | WS_TABSTOP | WS_VISIBLE | BS_PUSHBUTTON, rect1, this, myCmdButtons[i].nID);
322         m_CmdButtons[i].ShowWindow(SW_SHOW);
323     }
324     //    font1.CreatePointFont(95, _T("楷体"));
325     for (int i = 0; i < m_Lines; i++) {
326         for (int j = 0; j < 11; j++) {
327             x1 = nLeftMargin + j * nSpace / 11;
328             y1 = nTopMargin + i * nHeight / 3;
329             x2 = x1 + nSpace / 11;
330             y2 = y1 + nHeight / 3;
331             rect1.SetRect(x1, y1, x2, y2);
332             m_buttons[0][i][j].Create(myButtons[0][i][j].sCaption, BS_FLAT | WS_CHILD | WS_TABSTOP | WS_VISIBLE | BS_PUSHBUTTON, rect1, this, myButtons[0][i][j].nID);
333             m_buttons[0][i][j].ShowWindow(SW_SHOW);
334             //            init;
335         }
336     }
337     for (int i = 0; i < m_Lines; i++) {
338         for (int j = 0; j < 11; j++) {
339             x1 = nLeftMargin + j * nSpace / 11;
340             y1 = nTopMargin + i * nHeight / 3;
341             x2 = x1 + nSpace / 11;
342             y2 = y1 + nHeight / 3;
343             rect1.SetRect(x1, y1, x2, y2);
344             m_buttons[1][i][j].Create(myButtons[1][i][j].sCaption, BS_FLAT | WS_CHILD | WS_TABSTOP | BS_PUSHBUTTON, rect1, this, myButtons[1][i][j].nID);
345             //            bit;
346         }
347     }
348     for (int i = 0; i < m_Lines; i++) {
349         for (int j = 0; j < 11; j++) {
350             x1 = nLeftMargin + j * nSpace / 11;
351             y1 = nTopMargin + i * nHeight / 3;
352             x2 = x1 + nSpace / 11;
353             y2 = y1 + nHeight / 3;
354             rect1.SetRect(x1, y1, x2, y2);
355             m_buttons[2][i][j].Create(myButtons[2][i][j].sCaption, BS_FLAT | WS_CHILD | WS_TABSTOP | BS_PUSHBUTTON, rect1, this, myButtons[2][i][j].nID);
356             //            compare;
357         }
358     }
359     for (int i = 0; i < m_Lines; i++) {
360         for (int j = 0; j < 11; j++) {
361             x1 = nLeftMargin + j * nSpace / 11;
362             y1 = nTopMargin + i * nHeight / 3;
363             x2 = x1 + nSpace / 11;
364             y2 = y1 + nHeight / 3;
365             rect1.SetRect(x1, y1, x2, y2);
366             m_buttons[3][i][j].Create(myButtons[3][i][j].sCaption, BS_FLAT | WS_CHILD | WS_TABSTOP | BS_PUSHBUTTON, rect1, this, myButtons[3][i][j].nID);
367             //            word;
368         }
369     }
370     for (int i = 0; i < m_Lines; i++) {
371         for (int j = 0; j < 11; j++) {
372             x1 = nLeftMargin + j * nSpace / 11;
373             y1 = nTopMargin + i * nHeight / 3;
374             x2 = x1 + nSpace / 11;
375             y2 = y1 + nHeight / 3;
376             rect1.SetRect(x1, y1, x2, y2);
377             m_buttons[4][i][j].Create(myButtons[4][i][j].sCaption, BS_FLAT | WS_CHILD | WS_TABSTOP | BS_PUSHBUTTON, rect1, this, myButtons[4][i][j].nID);
378             //            index;
379         }
380     }
381     for (int i = 0; i < m_Lines; i++) {
382         for (int j = 0; j < 11; j++) {
383             x1 = nLeftMargin + j * nSpace / 11;
384             y1 = nTopMargin + i * nHeight / 3;
385             x2 = x1 + nSpace / 11;
386             y2 = y1 + nHeight / 3;
387             rect1.SetRect(x1, y1, x2, y2);
388             m_buttons[5][i][j].Create(myButtons[5][i][j].sCaption, BS_FLAT | WS_CHILD | WS_TABSTOP | BS_PUSHBUTTON, rect1, this, myButtons[5][i][j].nID);
389             //            TMCT;
390         }
391     }
392
393     return ;   
394
395 }
396
397 int CMyFormInputShow::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
398 {
399     return CFormView::OnMouseActivate(pDesktopWnd, nHitTest, message);
400 }
401     
402 void CMyFormInputShow::OnTimer(UINT_PTR nIDEvent)
403 {
404     // TODO: 在此添加消息处理程序代码和/或调用默认值
405 /*
406     if (nIDEvent == 1)
407     {
408         KillTimer(1);
409         SetTimer(2, 200, NULL);
410     }
411     else if (nIDEvent == 2)
412     {
413         myLogger1.UpdateLogDisplay();
414     }
415     else
416     {
417
418     }
419 */
420     CFormView::OnTimer(nIDEvent);
421 }
422
423 void CMyFormInputShow::OnBnClickedButton1()
424 {
425     CString s1;
426     s1.Format(_T("Button1 Clicked"));
427     SysLog(s1);
428 }
429
430 void CMyFormInputShow::SetBtnDisplayESC(int n)
431 {
432     for (int n = 1; n < 5; n++)
433     {
434         for (int i = 0; i < 3; i++) {
435             for (int j = 0; j < 11; j++) {
436                 m_buttons[n][i][j].ShowWindow(SW_HIDE);
437             }
438         }
439     }
440     for (int i = 0; i < 3; i++) {
441         for (int j = 0; j < 11; j++) {
442             m_buttons[0][i][j].ShowWindow(SW_SHOW);
443         }
444     }
445     current_btn_window = 0;
446 }
447
ad1b4b 448 /// <summary>
Z 449 /// 展示第几页的按钮
450 /// </summary>
451 /// <param name="n"></param>
df0321 452 void CMyFormInputShow::SetBtnDisplay(int n)
Q 453 {
454
455     for (int i = 0; i < 3; i++) {
d34256 456           for (int j = 0; j < 11; j++) {
df0321 457             m_buttons[current_btn_window][i][j].ShowWindow(SW_HIDE);
d34256 458          }
df0321 459     }
Q 460
461     for (int i = 0; i < 3; i++) {
462         for (int j = 0; j < 11; j++) {
463             m_buttons[n][i][j].ShowWindow(SW_SHOW);
464         }
465     }
466     current_btn_window = n;
467 }
468
469 void CMyFormInputShow::stInit()
470 {
471     m_InputCell =
472     {
473          CMTerm1View::typeNO,
474          false,
475          false,
476          false,
477          false,
478          false,
479          false,
480          false,
481          false,
482          false,
483          false,
484          false,
485          false,
486          0x10,
d34256 487         _T(""),
Z 488         0,
489         0
df0321 490     };
Q 491 }
492
493
494 int CMyFormInputShow::display(tagInputCell stDisplayCell)
495 {
4ed7fc 496     static CString strOp, strParam , strNum;
df0321 497     static CString str;
Q 498     switch (stDisplayCell.OP)
499     {
500     case CMTerm1View::typeNO:
501         if ((m_InputCell.bLeftLineUp) && (m_InputCell.brightLineUp))
502         {
503             strOp = _T("└┤├┘");
504         }
505         else
506         {
507             strOp = _T("-| |-");
508         }
509
510         break;
511     case CMTerm1View::typeNC:
512         if ((m_InputCell.bLeftLineUp) && (m_InputCell.brightLineUp))
513         {
514             strOp = _T("└┤/├┘");
515         }
516         else
517         {
518             strOp = _T("-|/|-");
519         }
520
521         break;
522     case CMTerm1View::typeOUT:
523         strOp = _T("-[ ]");
524         break;
525     case CMTerm1View::typeSET:
526         strOp = _T("-<S>");
527         break;
528     case CMTerm1View::typeRESET:
529         strOp = _T("-<R>");
530         break;
531     case CMTerm1View::typeDF:
532         strOp = _T("(DF)");
533         break;
534     case CMTerm1View::typeDF_:
535         strOp = _T("(DF/)");
536         break;
537     case CMTerm1View::typeNOT:
538         strOp = _T("-/-");
539         break;
540     case CMTerm1View::typeTM:
541         strOp = _T("-[TM]");
542         break;
543     case CMTerm1View::typeCMP:
544         break;
545     default:
546         break;
547     }
548
549     if (stDisplayCell.bnot)
550     {
551         switch (stDisplayCell.OP)
552         {
553         case CMTerm1View::typeNO:
554             if ((m_InputCell.bLeftLineUp) && (m_InputCell.brightLineUp))
555             {
556                 strOp = _T("└┤/├┘");
557             }
558             else
559             {
560                 strOp = _T("-|/|-");
561             }
562             break;
563         case CMTerm1View::typeOUT:
564             strOp = _T("-/-");
565             break;
566         case CMTerm1View::typeSET:
567             strOp = _T("-/-");
568             break;
569         case CMTerm1View::typeRESET:
570             strOp = _T("-/-");
571             break;
572         case CMTerm1View::typeDF:
573             strOp = _T("(DF/)");
574             break;
575         case CMTerm1View::typeDF_:
576             strOp = _T("(DF)");
577             break;
578         case CMTerm1View::typeNOT:
579             strOp = _T("-/-");
580             break;
581         case CMTerm1View::typeTM:
582             strOp = _T("-/-");
583             break;
584         default:
585             break;
586         }
587     }
588     if (stDisplayCell.bpp)
589     {
590         switch (stDisplayCell.OP)
591         {
592         case CMTerm1View::typeNO:
593             if ((m_InputCell.bLeftLineUp) && (m_InputCell.brightLineUp))
594             {
595                 strOp = _T("└┤↑├┘");
596             }
597             else
598             {
599                 strOp = _T("-|↑|-");
600             }
601             break;
602         case CMTerm1View::typeOUT:
603             strOp = _T("-[↑]");
604             break;
605         default:
606             break;
607         }
608     }
609     if (stDisplayCell.bpn)
610     {
611         switch (stDisplayCell.OP)
612         {
613         case CMTerm1View::typeNO:
614             if ((m_InputCell.bLeftLineUp) && (m_InputCell.brightLineUp))
615             {
616                 strOp = _T("└┤↓├┘");
617             }
618             else
619             {
620                 strOp = _T("-|↓|-");
621             }
622             break;
623         case CMTerm1View::typeOUT:
624             strOp = _T("-[↓]");
625             break;
626         default:
627             break;
628         }
629     }
630
631     if (stDisplayCell.bDouble)
632     {
633         switch (stDisplayCell.OP)
634         {
635         case CMTerm1View::typeNO:
636             if ((m_InputCell.bLeftLineUp) && (m_InputCell.brightLineUp))
637             {
638                 strOp = _T("└┤├┘D");
639             }
640             else
641             {
642                 strOp = _T("-| |-D");
643             }
644             break;
645         case CMTerm1View::typeOUT:
646             strOp = _T("-| |-D");
647             break;
648         case CMTerm1View::typeSET:
649             strOp = _T("-| |-D");
650             break;
651         case CMTerm1View::typeRESET:
652             strOp = _T("-| |-D");
653             break;
654         case CMTerm1View::typeDF:
655             strOp = _T("-| |-D");
656             break;
657         case CMTerm1View::typeDF_:
658             strOp = _T("-| |-D");
659             break;
660         case CMTerm1View::typeNOT:
661             strOp = _T("-| |-D");
662             break;
663         case CMTerm1View::typeTM:
664             strOp = _T("-| |-D");
665             break;
666         default:
667             break;
668         }
669     }
670
671
672     if (stDisplayCell.bDouble1)
673     {
674         switch (stDisplayCell.OP)
675         {
676         case CMTerm1View::typeNO:
677             if ((m_InputCell.bLeftLineUp) && (m_InputCell.brightLineUp))
678             {
679                 strOp = _T("└┤├┘");
680             }
681             else
682             {
683                 strOp = _T("-| |-");
684             }
685             break;
686         case CMTerm1View::typeOUT:
687             strOp = _T("-| |-");
688             break;
689         case CMTerm1View::typeSET:
690             strOp = _T("-| |-");
691             break;
692         case CMTerm1View::typeRESET:
693             strOp = _T("-| |-");
694             break;
695         case CMTerm1View::typeDF:
696             strOp = _T("-| |-");
697             break;
698         case CMTerm1View::typeDF_:
699             strOp = _T("-| |-");
700             break;
701         case CMTerm1View::typeNOT:
702             strOp = _T("-| |-");
703             break;
704         case CMTerm1View::typeTM:
705             strOp = _T("-| |-");
706             break;
707         default:
708             break;
709         }
710     }
711
712     if (stDisplayCell.bFloat)
713     {
714         switch (stDisplayCell.OP)
715         {
716         case CMTerm1View::typeNO:
717             if ((m_InputCell.bLeftLineUp) && (m_InputCell.brightLineUp))
718             {
719                 strOp = _T("└┤├┘F");
720             }
721             else
722             {
723                 strOp = _T("-| |-F");
724             }
725             break;
726         case CMTerm1View::typeOUT:
727             strOp = _T("-| |-F");
728             break;
729         case CMTerm1View::typeSET:
730             strOp = _T("-| |-F");
731             break;
732         case CMTerm1View::typeRESET:
733             strOp = _T("-| |-F");
734             break;
735         case CMTerm1View::typeDF:
736             strOp = _T("-| |-F");
737             break;
738         case CMTerm1View::typeDF_:
739             strOp = _T("-| |-F");
740             break;
741         case CMTerm1View::typeNOT:
742             strOp = _T("-| |-F");
743             break;
744         case CMTerm1View::typeTM:
745             strOp = _T("-| |-F");
746             break;
747         default:
748             break;
749         }
750     }
751
752     if (stDisplayCell.bFloat1)
753     {
754         switch (stDisplayCell.OP)
755         {
756         case CMTerm1View::typeNO:
757             if ((m_InputCell.bLeftLineUp) && (m_InputCell.brightLineUp))
758             {
759                 strOp = _T("└┤├┘");
760             }
761             else
762             {
763                 strOp = _T("-| |-");
764             }
765         case CMTerm1View::typeOUT:
766             strOp = _T("-| |-");
767             break;
768         case CMTerm1View::typeSET:
769             strOp = _T("-| |-");
770             break;
771         case CMTerm1View::typeRESET:
772             strOp = _T("-| |-");
773             break;
774         case CMTerm1View::typeDF:
775             strOp = _T("-| |-");
776             break;
777         case CMTerm1View::typeDF_:
778             strOp = _T("-| |-");
779             break;
780         case CMTerm1View::typeNOT:
781             strOp = _T("-| |-");
782             break;
783         case CMTerm1View::typeTM:
784             strOp = _T("-| |-");
785             break;
786         default:
787             break;
788         }
789     }
790     switch (stDisplayCell.param)
791     {
792     case KLCoilTypeX:
793         strParam = _T("X");
794         break;
795     case KLCoilTypeY:
796         strParam = _T("Y");
797         break;
798     case KLCoilTypeR:
799         strParam = _T("R");
800         break;
801     case KLCoilTypeLR:
802         strParam = _T("L");
803         break;
4ed7fc 804     case KLCoilTypeP:
Z 805         strParam = _T("P");
806         break;
df0321 807     case KLCoilTypeT:
Q 808         strParam = _T("T");
809         break;
810     case KLCoilTypeC:
811         strParam = _T("C");
4ed7fc 812         break;
Z 813     case KLCoilTypeE:
814         strParam = _T("E");
df0321 815         break;
Q 816     case OP_TMX:
817         if (strOp == _T("-[TM]"))
818             strOp = "";
819         strParam = _T("-[TMX]");
820         break;
821     case OP_TMY:
822         if (strOp == _T("-[TM]"))
823             strOp = "";
824         strParam = _T("-[TMY]");
825         break;
826     case OP_TMR:
827         if (strOp == _T("-[TM]"))
828             strOp = "";
829         strParam = _T("-[TMR]");
830         break;
831     case OP_TML:
832         if (strOp == _T("-[TM]"))
833             strOp = "";
834         strParam = _T("-[TML]");
835         break;
836     default:
837         strParam = " ";
838         break;
839     }
840
4ed7fc 841
df0321 842     if ((m_InputCell.bcmpEq) && (!m_InputCell.bcmpLt) && (!m_InputCell.bcmpGt))
Q 843     {
844         strParam = "=";
845     }
846     if ((!m_InputCell.bcmpEq) && (m_InputCell.bcmpLt) && (!m_InputCell.bcmpGt))
847     {
848         strParam = "<";
849     }
850     if ((!m_InputCell.bcmpEq) && (!m_InputCell.bcmpLt) && (m_InputCell.bcmpGt))
851     {
852         strParam = ">";
853     }
854     if ((m_InputCell.bcmpEq) && (m_InputCell.bcmpLt))
855     {
856         strParam = "<=";
857     }
858     if ((m_InputCell.bcmpEq) && (m_InputCell.bcmpGt))
859     {
860         strParam = ">=";
861     }
862     if ((m_InputCell.bcmpLt) && (m_InputCell.bcmpGt))
863     {
864         strParam = "<>";
865     }
4ed7fc 866
Z 867     if (strParam.Trim() == _T(""))
868     {
869         strParam = m_InputCell.sParamName.Trim();;
870     }
df0321 871     strNum = stDisplayCell.num;
Q 872     str = strOp + _T(" ") + strParam + " " + strNum;
d34256 873     //设置输入框中的文本
df0321 874     SetDlgItemText(IDC_EDIT_INPUT, str);
Q 875     return 0;
876 }
877
ad1b4b 878 //设置输入框属性
df0321 879 int CMyFormInputShow::SetCurCellPos(int nRow, int nCol, CMTerm1View::stCell theCell)
Q 880 {
881     m_InputCell.clear();
d34256 882     m_InputCell.row = nRow;
Z 883     m_InputCell.col = nCol;
df0321 884     int nType = theCell.nType;
Q 885     switch (nType)
886     {
887     case CMTerm1View::typeNone:
888         m_InputCell.OP = CMTerm1View::typeNO;
889         break;
890     case CMTerm1View::typeLine1:
891         m_InputCell.OP = nType;
892         break;
893     case CMTerm1View::typeLine2:
894         m_InputCell.OP = nType;
895         break;
896     case CMTerm1View::typeNO:
897         m_InputCell.OP = nType;
898         m_InputCell.sCellName = theCell.sCoilName;
4ed7fc 899         
Z 900         m_InputCell.sParamName = theCell.sParam.SpanExcluding(_T("0123456789ABCDEF-."));
df0321 901         m_InputCell.num.Format(_T("%d"), theCell.nDataAddr);
Q 902         break;
903     case CMTerm1View::typeNC:
904         m_InputCell.OP = nType;
905         break;
906     case CMTerm1View::typePP:
907         m_InputCell.OP = nType;
908         break;
909     case CMTerm1View::typePN:
910         m_InputCell.OP = nType;
911         break;
912     case CMTerm1View::typeNOT:
913         m_InputCell.OP = nType;
914         break;
915     case CMTerm1View::typeDF:
916         m_InputCell.OP = nType;
917         break;
918     case CMTerm1View::typeDF_:
919         m_InputCell.OP = nType;
920         break;
921     case CMTerm1View::typeOUT:
922         m_InputCell.OP = nType;
923         m_InputCell.sCellName = theCell.sCoilName;
4ed7fc 924         m_InputCell.sParamName = theCell.sParam.SpanExcluding(_T("0123456789ABCDEF-."));
df0321 925         m_InputCell.num.Format(_T("%d"), theCell.nDataAddr);
Q 926         break;
927     case CMTerm1View::typeSET:
928         m_InputCell.OP = nType;
929         m_InputCell.sCellName = theCell.sCoilName;
4ed7fc 930         m_InputCell.sParamName = theCell.sParam.SpanExcluding(_T("0123456789ABCDEF-."));
df0321 931         m_InputCell.num.Format(_T("%d"), theCell.nDataAddr);
Q 932         break;
933     case CMTerm1View::typeRESET:
934         m_InputCell.OP = nType;
935         m_InputCell.sCellName = theCell.sCoilName;
4ed7fc 936         m_InputCell.sParamName = theCell.sParam.SpanExcluding(_T("0123456789ABCDEF-."));
df0321 937         m_InputCell.num.Format(_T("%d"), theCell.nDataAddr);
Q 938         break;
939     case CMTerm1View::typeCMP:
940         m_InputCell.OP = nType;
941         break;
942     case CMTerm1View::typeExt1:
943         m_InputCell.sCellName = theCell.sParam;
4ed7fc 944         m_InputCell.sParamName = theCell.sParam.SpanExcluding(_T("0123456789ABCDEF-."));
df0321 945         m_InputCell.num.Format(_T("%d"), theCell.nDataAddr);
Q 946         m_InputCell.OP = nType;
947         break;
948     case CMTerm1View::typeExt2:
949         break;
950     case CMTerm1View::typeExt3:
951         break;
952     case CMTerm1View::typeTM:
953         m_InputCell.OP = CMTerm1View::typeTM;
954         break;
955     case CMTerm1View::typeFN1:
956         m_InputCell.OP = CMTerm1View::typeFN1;
957         break;
958     case CMTerm1View::typeFN2:
959         m_InputCell.OP = CMTerm1View::typeFN2;
960         break;
961     case CMTerm1View::typeFN3:
962         m_InputCell.OP = CMTerm1View::typeFN3;
963         break;
964     case CMTerm1View::typeCoil:
965         break;
966     default:
967         break;
968     }
969
970     display(m_InputCell);
971     return 0;
972 }
973
974
975 void CMyFormInputShow::OnBtnRet()
976 {
977     // TODO: 在此添加命令处理程序代码
978     CString strName;
979     CMTerm1View::stCell cell1;
980     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
981     CMDIChildWnd* pChild = (CMDIChildWnd*)p1->GetActiveFrame();
982     CView* p2 = (CView*)pChild->GetActiveView();
983     if (p2 == NULL) return;
984     CMTerm1View* p3 = (CMTerm1View*)p2;
985     //    m_wndDlgBar_InputShow.SetDisplay(0x00140000);
4ed7fc 986     showPage = 0;
Z 987     SetBtnDisplay(showPage);
df0321 988
Q 989     switch (m_InputCell.OP)
990     {
991     case CMTerm1View::typeNO:
992     case CMTerm1View::typeNC:
993     case CMTerm1View::typeOUT:
994     case CMTerm1View::typeSET:
995     case CMTerm1View::typeRESET:
996     case CMTerm1View::typeTM:
997         switch (m_InputCell.param)
998         {
999         case KLCoilTypeX:
1000             strName = "X";
1001             break;
1002         case KLCoilTypeY:
1003             strName = "Y";
1004             break;
1005         case KLCoilTypeR:
1006             strName = "R";
1007             break;
1008         case KLCoilTypeLR:
1009             strName = "L";
1010             break;
1011         case KLCoilTypeT:
1012             strName = "T";
1013             break;
1014         case KLCoilTypeC:
1015             strName = "C";
1016             break;
1017         case OP_TMX:
1018             strName = "TMX   ";
1019         case OP_TMY:
1020             strName = "TMY   ";
1021         case OP_TMR:
1022             strName = "TMR   ";
1023         case OP_TML:
1024             strName = "TML   ";
1025         default:
1026             break;
1027         }
1028     default:
1029         break;
1030     }
1031
1032     cell1.sCoilName = strName + m_InputCell.num;
1033     cell1.nType = m_InputCell.OP;
1034     cell1.nProgStep = 0;
1035     cell1.bEditing = 1;
1036     cell1.sParam = strName + m_InputCell.num;;
1037     cell1.bLeftLineUp = 0;
1038     cell1.nDataType = CMTerm1View::typeCoil;
1039     cell1.nDataAddr = _tstoi(m_InputCell.num);
1040     cell1.bModified = 1;
1041     p3->SetCellToView(cell1);
1042
1043     //    m_wndDlgBar_Func_Key.SetBtnDisplayESC();
1044 }
d34256 1045
Z 1046
1047 /// <summary>
1048 /// 插入按钮点击事件
1049 /// </summary>
df0321 1050 void CMyFormInputShow::OnBtnInsert()
Q 1051 {
4ed7fc 1052     if (m_InputCell.OP == NULL)
Z 1053     {
1054         DbgLog(_T("Error:插入失败,未选择要插入的操作"));
1055         return;
1056     }
1057     if (m_InputCell.param == -1)
1058     {
1059         DbgLog(_T("Error:插入失败,未设置序号"));
1060         return;
1061     }
1062     if (m_InputCell.num == (_T("")))
1063     {
1064         DbgLog(_T("Error:插入失败,未设置编号"));
1065         return;
1066     }
d34256 1067
Z 1068     CString s1;
1069
1070     CString strName;
ad1b4b 1071
d34256 1072     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
Z 1073     CMDIChildWnd* pChild = (CMDIChildWnd*)p1->GetActiveFrame();
1074     CView* p2 = (CView*)pChild->GetActiveView();
1075     if (p2 == NULL) return;
1076     CMTerm1View* p3 = (CMTerm1View*)p2;
ad1b4b 1077     //新属性匹配前,检查原单元格是否是竖线格
Z 1078     if (focusCell.nType == CMTerm1View::typeLine2)
1079     {
1080         focusCell.bLeftLineUp = 1;
1081         flag = 1;
1082     }
1083     else
1084     {
1085         flag = 0;
1086     }
d34256 1087     switch (m_InputCell.OP)
Z 1088     {
1089     case CMTerm1View::typeNO:
1090     case CMTerm1View::typeNC:
1091     case CMTerm1View::typeOUT:
1092     case CMTerm1View::typeSET:
1093     case CMTerm1View::typeRESET:
1094     case CMTerm1View::typeTM:
1095         switch (m_InputCell.param)
1096         {
1097         case KLCoilTypeX:
1098             strName = "X";
1099             break;
1100         case KLCoilTypeY:
1101             strName = "Y";
1102             break;
1103         case KLCoilTypeR:
1104             strName = "R";
1105             break;
1106         case KLCoilTypeLR:
1107             strName = "L";
1108             break;
1109         case KLCoilTypeT:
1110             strName = "T";
1111             break;
1112         case KLCoilTypeC:
1113             strName = "C";
1114             break;
1115         case OP_TMX:
1116             strName = "TMX   ";
1117         case OP_TMY:
1118             strName = "TMY   ";
1119         case OP_TMR:
1120             strName = "TMR   ";
1121         case OP_TML:
1122             strName = "TML   ";
1123         default:
1124             break;
1125         }
1126     default:
1127         break;
1128     }
1129
ad1b4b 1130     focusCell.sCoilName = strName + m_InputCell.num;
Z 1131     focusCell.nType = m_InputCell.OP;
d34256 1132
ad1b4b 1133     focusCell.nProgStep = 0;
Z 1134     focusCell.bEditing = 1;
d34256 1135
ad1b4b 1136     focusCell.sParam = strName + m_InputCell.num;;
d34256 1137
ad1b4b 1138     focusCell.nDataType = CMTerm1View::typeCoil;
Z 1139     focusCell.nDataAddr = _tstoi(m_InputCell.num);
1140     focusCell.bModified = 1;
1141
1142     p3->SetCellToView(focusCell, flag);
d34256 1143     //插入完成后,设置按钮返回第一页
4ed7fc 1144     showPage = 0;
Z 1145     SetBtnDisplay(showPage);
ad1b4b 1146     DbgLog(focusCell.sCoilName);
d34256 1147
df0321 1148 }
Q 1149
d34256 1150 /// <summary>
Z 1151 /// 删除按钮点击事件
1152 /// </summary>
df0321 1153 void CMyFormInputShow::OnBtnDelete()
Q 1154 {
ad1b4b 1155     CString s1;
Z 1156     CString strName;
1157
1158     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
1159     CMDIChildWnd* pChild = (CMDIChildWnd*)p1->GetActiveFrame();
1160     CView* p2 = (CView*)pChild->GetActiveView();
1161     if (p2 == NULL) return;
1162     CMTerm1View* p3 = (CMTerm1View*)p2;
1163
1164     focusCell.clear();
1165     //
1166     p3->SetCellToView(focusCell);
1167     //插入完成后,设置按钮返回第一页
4ed7fc 1168     showPage = 0;
Z 1169     SetBtnDisplay(showPage);
ad1b4b 1170     DbgLog(focusCell.sCoilName);
df0321 1171 }
d34256 1172
df0321 1173 void CMyFormInputShow::OnBtnEsc()
Q 1174 {
1175     SetBtnDisplayESC(0);
1176 }
1177
1178 int CMyFormInputShow::SetDisplay(int inputInfo)
1179 {
1180     /*stInputCell.OP = CMTerm1View::typeNO;
1181     stInputCell.param = KLCoilTypeY;
1182     stInputCell.num = _T("1234");*/
1183
1184     static int clickCounter = 0;
1185     static int clickCounterDF = 0;
1186     static int clickCounterNot = 0;
1187     static int clickCounterCMP = 0;
1188     static int clickCounterD = 0;
1189     static int clickCounterF = 0;
1190     static char curTaskState = 'A';
1191     static int lastLParam = 0;
1192     static int lastCMP = 0;
1193     static CString str, strStoreB, strStoreC, strNum;
1194     static CString strOp, strParam;
1195
1196
1197     CString s1, strNumTemp;
1198     int para = 0;
1199     int HParam, LParam;
1200 //    s1.Format(_T("is this window %d"), IsWindow(m_hWnd));
1201 //    SysLog(s1);
1202     //    ChangeState(inputInfo>>16, lastTaskState, curTaskState);
1203     if (inputInfo == 0x00010008)
1204     {
1205         clickCounterDF++;
1206         if (clickCounterDF == 1)                     //DF  redefine key value
1207         {
1208
1209             inputInfo = 0x00010008;
1210         }
1211         else if (clickCounterDF == 2)
1212         {
1213             inputInfo = 0x00010009;
1214             clickCounterDF = 0;
1215         }
1216     }
1217     if (inputInfo == 0x00010010)
1218     {
1219         clickCounter++;
1220
1221         if (clickCounter == 1)  //updown  redefine key value
1222         {
1223             inputInfo = 0x00010010;
1224         }
1225         else if (clickCounter == 2)
1226         {
1227             inputInfo = 0x00010011;
1228         }
1229         else if (clickCounter == 3)
1230         {
1231             inputInfo = 0x00010012;
1232             clickCounter = 0;
1233         }
1234     }
1235     if (inputInfo == 0x00010013)
1236     {
1237         clickCounterNot++;
1238         if (clickCounterNot == 1)                     //NOT  redefine key value
1239         {
1240
1241             inputInfo = 0x00010013;
1242         }
1243         else if (clickCounterNot == 2)
1244         {
1245             inputInfo = 0x00010014;
1246             clickCounterNot = 0;
1247         }
1248     }
1249
1250     if (inputInfo == 0x00010015)
1251     {
1252         clickCounterD++;
1253         if (clickCounterD == 1)                     //D  redefine key value
1254         {
1255
1256             inputInfo = 0x00010015;
1257         }
1258         else if (clickCounterD == 2)
1259         {
1260             inputInfo = 0x00010017;
1261             clickCounterD = 0;
1262         }
1263     }
1264
1265     if (inputInfo == 0x00010016)
1266     {
1267         clickCounterF++;
1268         if (clickCounterF == 1)                     //D  redefine key value
1269         {
1270
1271             inputInfo = 0x00010016;
1272         }
1273         else if (clickCounterF == 2)
1274         {
1275             inputInfo = 0x00010018;
1276             clickCounterF = 0;
1277         }
1278     }
1279
1280     HParam = inputInfo >> 16;
1281     LParam = inputInfo & 0xffff;
1282
1283
1284     switch (curTaskState)
1285     {
1286     case 'A':
1287         if (HParam == 0x1)                      //operator 1
1288         {
1289             m_InputCell.bnot = false;
1290             m_InputCell.bpp = false;
1291             m_InputCell.bpn = false;
1292             m_InputCell.bcmpEq = false;
1293             m_InputCell.bcmpLt = false;
1294             m_InputCell.bcmpGt = false;
1295             m_InputCell.bDouble = false;
1296             m_InputCell.bDouble1 = false;
1297             m_InputCell.bFloat = false;
1298             m_InputCell.bFloat1 = false;
1299             m_InputCell.bLeftLineUp = false;
1300             m_InputCell.brightLineUp = false;
1301
1302             if ((LParam >= 0x1) && (LParam <= 0x0f))
1303             {
1304
1305                 if ((LParam == 0x8) || (LParam == 0x9))         //IF DF  not clear df
1306                 {
1307                     clickCounter = 0;
1308                     clickCounterNot = 0;
1309                     clickCounterCMP = 0;
1310                     clickCounterD = 0;
1311                     clickCounterF = 0;
1312                 }
1313                 else
1314                 {
1315                     if (lastLParam != LParam)
1316                     {
1317                         clickCounter = 0;
1318                         clickCounterNot = 0;
1319                         clickCounterDF = 0;
1320                         clickCounterCMP = 0;
1321                         clickCounterD = 0;
1322                         clickCounterF = 0;
1323                     }
1324                 }
1325             }
1326             if ((lastLParam == 0x14) && ((LParam == 0x10) || (LParam == 0x11) || (LParam == 0x12)))  //from not to updown
1327             {
1328                 clickCounter = 1;
1329                 clickCounterNot = 0;
1330                 clickCounterDF = 0;
1331                 clickCounterCMP = 0;
1332                 clickCounterD = 0;
1333                 clickCounterF = 0;
1334
1335             }
1336             if ((lastLParam == 0x10) && ((LParam == 0x13) || (LParam == 0x14)))    //from up to not
1337             {
1338                 clickCounter = 0;
1339                 clickCounterNot = 1;
1340                 clickCounterDF = 0;
1341                 clickCounterCMP = 0;
1342                 clickCounterD = 0;
1343                 clickCounterF = 0;
1344
1345             }
1346             if ((lastLParam == 0x11) && ((LParam == 0x13) || (LParam == 0x14)))    //from down to not
1347             {
1348                 clickCounter = 0;
1349                 clickCounterNot = 1;
1350                 clickCounterDF = 0;
1351                 clickCounterCMP = 0;
1352                 clickCounterD = 0;
1353                 clickCounterF = 0;
1354             }
1355
1356             if ((lastLParam == 0x13) && ((LParam == 0x10) || (LParam == 0x11) || (LParam == 0x12)))  //not
1357             {
1358                 clickCounter = 0;
1359                 clickCounterNot = 0;
1360                 clickCounterDF = 0;
1361                 clickCounterCMP = 0;
1362                 clickCounterD = 0;
1363                 clickCounterF = 0;
1364
1365             }
1366             if ((lastLParam == 0x10) && ((LParam == 0x13) || (LParam == 0x14)))    //updown
1367             {
1368                 clickCounter = 0;
1369                 clickCounterNot = 0;
1370                 clickCounterDF = 0;
1371                 clickCounterCMP = 0;
1372                 clickCounterD = 0;
1373                 clickCounterF = 0;
1374
1375             }
1376             if ((lastLParam == 0x11) && ((LParam == 0x13) || (LParam == 0x14)))    //updown
1377             {
1378                 clickCounter = 0;
1379                 clickCounterNot = 0;
1380                 clickCounterDF = 0;
1381                 clickCounterCMP = 0;
1382                 clickCounterD = 0;
1383                 clickCounterF = 0;
1384             }
1385
1386             if ((lastLParam == 0x15) && ((LParam == 0x16) || (LParam == 0x18)))  //D ,"", F,""
1387             {
1388                 clickCounter = 0;
1389                 clickCounterNot = 0;
1390                 clickCounterDF = 0;
1391                 clickCounterCMP = 0;
1392                 clickCounterD = 0;
1393                 clickCounterF = 1;
1394             }
1395
1396             if ((lastLParam == 0x15) && ((LParam == 0x16) || (LParam == 0x18)))
1397             {
1398                 clickCounter = 0;
1399                 clickCounterNot = 0;
1400                 clickCounterDF = 0;
1401                 clickCounterCMP = 0;
1402                 clickCounterD = 0;
1403                 clickCounterF = 1;
1404             }
1405             if ((lastLParam == 0x17) && ((LParam == 0x16) || (LParam == 0x18)))
1406             {
1407                 clickCounter = 0;
1408                 clickCounterNot = 0;
1409                 clickCounterDF = 0;
1410                 clickCounterCMP = 0;
1411                 clickCounterD = 0;
1412                 clickCounterF = 1;
1413             }
1414             if ((lastLParam == 0x16) && ((LParam == 0x15) || (LParam == 0x17)))
1415             {
1416                 clickCounter = 0;
1417                 clickCounterNot = 0;
1418                 clickCounterDF = 0;
1419                 clickCounterCMP = 0;
1420                 clickCounterD = 1;
1421                 clickCounterF = 0;
1422             }
1423             if ((lastLParam == 0x18) && ((LParam == 0x15) || (LParam == 0x17)))
1424             {
1425                 clickCounter = 0;
1426                 clickCounterNot = 0;
1427                 clickCounterDF = 0;
1428                 clickCounterCMP = 0;
1429                 clickCounterD = 1;
1430                 clickCounterF = 0;
1431             }
1432             switch (LParam)
1433             {
1434             case 0x01:
1435                 m_InputCell.OP = CMTerm1View::typeNO; m_InputCell.param = 0x10;      //0x10 define para null 
1436
1437                 lastLParam = LParam;
1438                 curTaskState = 'B';
1439                 break;
1440             case 0x02:
1441                 m_InputCell.OP = CMTerm1View::typeNO; m_InputCell.param = 0x10;
1442                 m_InputCell.bLeftLineUp = true;
1443                 m_InputCell.brightLineUp = true;
1444                 lastLParam = LParam;
1445                 curTaskState = 'B';
1446                 break;
1447             case 0x03:
1448                 m_InputCell.OP = CMTerm1View::typeOUT; m_InputCell.param = 0x10;
1449
1450                 lastLParam = LParam;
1451                 curTaskState = 'B';
1452                 break;
1453                 /*case 4:
1454                     strOp = _T("(MC)");strParam = "";lastLParam = LParam;curTaskState = 'C'; break;
1455                 case 5:
1456                     strOp = _T("(MCE)");strParam = "";lastLParam = LParam;curTaskState = 'C'; break;*/
1457             case 0x06:
1458                 m_InputCell.OP = CMTerm1View::typeSET; m_InputCell.param = 0x10;
1459
1460                 lastLParam = LParam; curTaskState = 'B'; break;
1461             case 0x07:
1462                 m_InputCell.OP = CMTerm1View::typeRESET; m_InputCell.param = 0x10;
1463
1464                 lastLParam = LParam; curTaskState = 'B'; break;
1465             case 0x08:
1466                 m_InputCell.OP = CMTerm1View::typeDF; m_InputCell.param = 0x10;
1467
1468                 lastLParam = LParam;
1469                 curTaskState = 'A';
1470                 break;
1471             case 0x09:
1472                 m_InputCell.OP = CMTerm1View::typeDF_; m_InputCell.param = 0x10;
1473
1474                 lastLParam = LParam;
1475                 curTaskState = 'A';
1476                 break;
1477             case 0x0a:
1478                 strOp = _T("(ED)"); strParam = ""; lastLParam = LParam; curTaskState = 'A'; break;
1479             case 0x0b:
1480                 m_InputCell.OP = CMTerm1View::typeTM; m_InputCell.param = 0x10;
1481
1482                 lastLParam = LParam;
1483                 curTaskState = 'B';
1484                 break;
1485             case 0x10:
1486                 m_InputCell.bpp = true;
1487                 m_InputCell.bpn = false;
1488                 lastLParam = LParam;
1489                 break;
1490             case 0x11:
1491                 m_InputCell.bpp = false;
1492                 m_InputCell.bpn = true;
1493                 lastLParam = LParam;
1494                 break;
1495             case 0x12:
1496                 m_InputCell.bpp = false;
1497                 m_InputCell.bpn = false;
1498                 lastLParam = LParam;
1499                 break;
1500             case 0x13:
1501                 switch (lastLParam)
1502                 {
1503                 case 0x03:
1504                 case 0x06:
1505                 case 0x07:
1506                 case 0x15:
1507                 case 0x17:
1508                 case 0x16:
1509                 case 0x18:
1510                 case 0x20:
1511                 case 0x21:
1512                 case 0x22:
1513                     m_InputCell.OP = CMTerm1View::typeNOT;
1514                     clickCounterNot = 0;
1515                     curTaskState = 'A';
1516                 default:
1517                     break;
1518                 }
1519                 switch (lastLParam)
1520                 {
1521                 case 0x01:
1522                     m_InputCell.OP = CMTerm1View::typeNC; break;
1523                 case 0x02:
1524                     m_InputCell.OP = CMTerm1View::typeNC;
1525                     m_InputCell.bLeftLineUp = true;
1526                     m_InputCell.brightLineUp = true;
1527                     break;
1528                 default:
1529                     break;
1530                 }
1531                 lastLParam = LParam;
1532                 m_InputCell.bnot = true;
1533                 break;
1534             case 0x14:
1535                 m_InputCell.bnot = false;
1536                 break;
1537             case 0x15:
1538                 m_InputCell.bDouble = true;
1539                 m_InputCell.bDouble1 = false;
1540                 m_InputCell.bFloat = false;
1541                 m_InputCell.bFloat1 = false;
1542                 lastLParam = LParam; m_InputCell.param = 0x10; curTaskState = 'B';
1543                 break;
1544             case 0x17:
1545                 m_InputCell.bDouble = false;
1546                 m_InputCell.bDouble1 = true;
1547                 m_InputCell.bFloat = false;
1548                 m_InputCell.bFloat1 = false;
1549                 lastLParam = LParam; m_InputCell.param = 0x10; curTaskState = 'B';
1550                 break;
1551             case 0x16:
1552                 m_InputCell.bDouble = false;
1553                 m_InputCell.bDouble1 = false;
1554                 m_InputCell.bFloat = true;
1555                 m_InputCell.bFloat1 = false;
1556                 lastLParam = LParam; m_InputCell.param = 0x10; curTaskState = 'B';
1557                 break;
1558             case 0x18:
1559                 m_InputCell.bDouble = false;
1560                 m_InputCell.bDouble1 = false;
1561                 m_InputCell.bFloat = false;
1562                 m_InputCell.bFloat1 = true;
1563                 lastLParam = LParam; m_InputCell.param = 0x10; curTaskState = 'B';
1564                 break;
1565             default:
1566                 break;
1567             }
1568         }
1569
1570         str = strOp;
1571         break;
1572     case 'B':
1573         str = strOp;
1574         if (HParam == 0x1)                      //operator 1
1575         {
1576             m_InputCell.bnot = false;
1577             m_InputCell.bpp = false;
1578             m_InputCell.bpn = false;
1579             m_InputCell.bcmpEq = false;
1580             m_InputCell.bcmpLt = false;
1581             m_InputCell.bcmpGt = false;
1582             m_InputCell.bDouble = false;
1583             m_InputCell.bDouble1 = false;
1584             m_InputCell.bFloat = false;
1585             m_InputCell.bFloat1 = false;
1586             m_InputCell.bLeftLineUp = false;
1587             m_InputCell.brightLineUp = false;
1588             if ((LParam >= 0x0) && (LParam <= 0x0f))
1589             {
1590
1591                 if ((LParam == 0x08) || (LParam == 0x09))
1592                 {
1593                     clickCounter = 0;
1594                     clickCounterNot = 0;
1595                     clickCounterCMP = 0;
1596                     clickCounterD = 0;
1597                     clickCounterF = 0;
1598                 }
1599                 else
1600                 {
1601                     if (lastLParam != LParam)
1602                     {
1603                         clickCounter = 0;
1604                         clickCounterNot = 0;
1605                         clickCounterDF = 0;
1606                         clickCounterCMP = 0;
1607                         clickCounterD = 0;
1608                         clickCounterF = 0;
1609                     }
1610                 }
1611
1612             }
1613             if ((lastLParam == 0x13) && ((LParam == 0x10) || (LParam == 0x11) || (LParam == 0x12)))  //from not to updown
1614             {
1615                 clickCounter = 1;
1616                 clickCounterNot = 0;
1617                 clickCounterDF = 0;
1618                 clickCounterCMP = 0;
1619                 clickCounterD = 0;
1620                 clickCounterF = 0;
1621
1622             }
1623             if ((lastLParam == 0x14) && ((LParam == 0x10) || (LParam == 0x11) || (LParam == 0x12)))  //from not to updown
1624             {
1625                 clickCounter = 1;
1626                 clickCounterNot = 0;
1627                 clickCounterDF = 0;
1628                 clickCounterCMP = 0;
1629                 clickCounterD = 0;
1630                 clickCounterF = 0;
1631
1632             }
1633             if ((lastLParam == 0x10) && ((LParam == 0x13) || (LParam == 0x14)))    //from up to not
1634             {
1635                 clickCounter = 0;
1636                 clickCounterNot = 1;
1637                 clickCounterDF = 0;
1638                 clickCounterCMP = 0;
1639                 clickCounterD = 0;
1640                 clickCounterF = 0;
1641
1642             }
1643             if ((lastLParam == 0x11) && ((LParam == 0x13) || (LParam == 0x14)))    //from down to not
1644             {
1645                 clickCounter = 0;
1646                 clickCounterNot = 1;
1647                 clickCounterDF = 0;
1648                 clickCounterCMP = 0;
1649                 clickCounterD = 0;
1650                 clickCounterF = 0;
1651             }
1652             if ((lastLParam == 0x15) && ((LParam == 0x16) || (LParam == 0x18)))
1653             {
1654                 clickCounter = 0;
1655                 clickCounterNot = 0;
1656                 clickCounterDF = 0;
1657                 clickCounterCMP = 0;
1658                 clickCounterD = 0;
1659                 clickCounterF = 1;
1660             }
1661             if ((lastLParam == 0x17) && ((LParam == 0x16) || (LParam == 0x18)))
1662             {
1663                 clickCounter = 0;
1664                 clickCounterNot = 0;
1665                 clickCounterDF = 0;
1666                 clickCounterCMP = 0;
1667                 clickCounterD = 0;
1668                 clickCounterF = 1;
1669             }
1670             if ((lastLParam == 0x16) && ((LParam == 0x15) || (LParam == 0x17)))
1671             {
1672                 clickCounter = 0;
1673                 clickCounterNot = 0;
1674                 clickCounterDF = 0;
1675                 clickCounterCMP = 0;
1676                 clickCounterD = 1;
1677                 clickCounterF = 0;
1678             }
1679             if ((lastLParam == 0x18) && ((LParam == 0x15) || (LParam == 0x17)))
1680             {
1681                 clickCounter = 0;
1682                 clickCounterNot = 0;
1683                 clickCounterDF = 0;
1684                 clickCounterCMP = 0;
1685                 clickCounterD = 1;
1686                 clickCounterF = 0;
1687             }
1688             switch (LParam)
1689             {
1690             case 0x01:
1691                 m_InputCell.OP = CMTerm1View::typeNO; m_InputCell.param = 0x10;      //0x10 define para null 
1692
1693                 lastLParam = LParam;
1694                 curTaskState = 'B';
1695                 break;
1696             case 0x02:
1697                 m_InputCell.OP = CMTerm1View::typeNO; m_InputCell.param = 0x10;
1698                 m_InputCell.bLeftLineUp = true;
1699                 m_InputCell.brightLineUp = true;
1700                 lastLParam = LParam;
1701                 curTaskState = 'B';
1702                 break;
1703             case 0x03:
1704                 m_InputCell.OP = CMTerm1View::typeOUT; m_InputCell.param = 0x10;
1705
1706                 lastLParam = LParam;
1707                 curTaskState = 'B';
1708                 break;
1709                 /*case 4:
1710                     strOp = _T("(MC)");strParam = "";lastLParam = LParam;curTaskState = 'C'; break;
1711                 case 5:
1712                     strOp = _T("(MCE)");strParam = "";lastLParam = LParam;curTaskState = 'C'; break;*/
1713             case 0x06:
1714                 m_InputCell.OP = CMTerm1View::typeSET; m_InputCell.param = 0x10; ; lastLParam = LParam; curTaskState = 'B'; break;
1715             case 0x07:
1716                 m_InputCell.OP = CMTerm1View::typeRESET; m_InputCell.param = 0x10; ; lastLParam = LParam; curTaskState = 'B'; break;
1717             case 0x08:
1718                 m_InputCell.OP = CMTerm1View::typeDF;; m_InputCell.param = 0x10;
1719
1720                 lastLParam = LParam;
1721                 curTaskState = 'A';
1722                 break;
1723             case 0x9:
1724                 m_InputCell.OP = CMTerm1View::typeDF_; m_InputCell.param = 0x10;
1725
1726                 lastLParam = LParam;
1727                 curTaskState = 'A';
1728                 break;
1729             case 0x0a:
1730                 strOp = _T("(ED)"); strParam = ""; lastLParam = LParam; curTaskState = 'A'; break;
1731             case 0x0b:
1732                 m_InputCell.OP = CMTerm1View::typeTM; m_InputCell.param = 0x10;
1733
1734                 lastLParam = LParam;
1735                 curTaskState = 'B';
1736                 break;
1737             case 0x10:
1738                 m_InputCell.bpp = true;
1739                 m_InputCell.bpn = false;
1740                 lastLParam = LParam;
1741                 break;
1742             case 0x11:
1743                 m_InputCell.bpp = false;
1744                 m_InputCell.bpn = true;
1745                 lastLParam = LParam;
1746                 break;
1747             case 0x12:
1748                 m_InputCell.bpp = false;
1749                 m_InputCell.bpn = false;
1750                 lastLParam = LParam;
1751                 break;
1752             case 0x13:
1753                 switch (lastLParam)
1754                 {
1755                 case 0x03:
1756                 case 0x06:
1757                 case 0x07:
1758                 case 0x15:
1759                 case 0x17:
1760                 case 0x16:
1761                 case 0x18:
1762                 case 0x20:
1763                 case 0x21:
1764                 case 0x22:
1765                     m_InputCell.OP = CMTerm1View::typeNOT;
1766                     clickCounterNot = 0;
1767                     curTaskState = 'A';
1768                 default:
1769                     break;
1770                 }
1771
1772                 switch (lastLParam)
1773                 {
1774                 case 0x01:
1775                     m_InputCell.OP = CMTerm1View::typeNC; break;
1776                 case 0x02:
1777                     m_InputCell.OP = CMTerm1View::typeNC;
1778                     m_InputCell.bLeftLineUp = true;
1779                     m_InputCell.brightLineUp = true;
1780                     break;
1781                 default:
1782                     break;
1783                 }
1784
1785                 lastLParam = LParam;
1786                 m_InputCell.bnot = true;
1787                 break;
1788             case 0x14:
1789                 m_InputCell.bnot = false;
1790                 break;
1791             case 0x15:
1792                 m_InputCell.bDouble = true;
1793                 m_InputCell.bDouble1 = false;
1794                 m_InputCell.bFloat = false;
1795                 m_InputCell.bFloat1 = false;
1796                 m_InputCell.param = 0x10; lastLParam = LParam; curTaskState = 'B';
1797                 break;
1798             case 0x17:
1799                 m_InputCell.bDouble = false;
1800                 m_InputCell.bDouble1 = true;
1801                 m_InputCell.bFloat = false;
1802                 m_InputCell.bFloat1 = false;
1803                 m_InputCell.param = 0x10; lastLParam = LParam; curTaskState = 'B';
1804                 break;
1805             case 0x16:
1806                 m_InputCell.bDouble = false;
1807                 m_InputCell.bDouble1 = false;
1808                 m_InputCell.bFloat = true;
1809                 m_InputCell.bFloat1 = false;
1810                 lastLParam = LParam; m_InputCell.param = 0x10; curTaskState = 'B';
1811                 break;
1812             case 0x18:
1813                 m_InputCell.bDouble = false;
1814                 m_InputCell.bDouble1 = false;
1815                 m_InputCell.bFloat = false;
1816                 m_InputCell.bFloat1 = true;
1817                 lastLParam = LParam; m_InputCell.param = 0x10; curTaskState = 'B';
1818                 break;
1819             default:
1820                 break;
1821             }
1822         }
1823         else if (HParam == 0x2)
1824         {
1825             switch (LParam)
1826             {
1827             case 1:
4ed7fc 1828                 m_InputCell.param = KLCoilTypeX;
Z 1829                 curTaskState = 'C';
1830                 m_InputCell.sParamName = _T("X");
1831                 break;
df0321 1832             case 2:
4ed7fc 1833                 m_InputCell.param = KLCoilTypeY; m_InputCell.sParamName = _T("Y"); curTaskState = 'C'; break;
df0321 1834             case 3:
4ed7fc 1835                 m_InputCell.param = KLCoilTypeR; m_InputCell.sParamName = _T("R"); curTaskState = 'C'; break;
df0321 1836             case 4:
4ed7fc 1837                 m_InputCell.param = KLCoilTypeLR; m_InputCell.sParamName = _T("L"); curTaskState = 'C'; break;
df0321 1838             case 5:
4ed7fc 1839                 m_InputCell.param = KLCoilTypeP; m_InputCell.sParamName = _T("P"); curTaskState = 'C'; break;
df0321 1840             case 6:
4ed7fc 1841                 m_InputCell.param = KLCoilTypeT; m_InputCell.sParamName = _T("T"); curTaskState = 'C'; break;
df0321 1842             case 7:
4ed7fc 1843                 m_InputCell.param = KLCoilTypeC; m_InputCell.sParamName = _T("C"); curTaskState = 'C'; break;
df0321 1844             case 8:
4ed7fc 1845                 m_InputCell.param = KLCoilTypeE; m_InputCell.sParamName = _T("E"); curTaskState = 'C'; break;
df0321 1846             case 9:
Q 1847                 m_InputCell.param = OP_TMX; curTaskState = 'C'; break;
1848             case 0x0a:
1849                 m_InputCell.param = OP_TMY; curTaskState = 'C'; break;
1850             case 0x0b:
1851                 m_InputCell.param = OP_TMR; curTaskState = 'C'; break;
1852             case 0x0c:
1853                 m_InputCell.param = OP_TML; curTaskState = 'C'; break;
1854             case 0x0d:
1855                 if ((lastLParam == 0x03) || (lastLParam == 0x06) || (lastLParam == 0x07) || (lastLParam == 0x08) || (lastLParam == 0x09))
1856                 {
1857                     m_InputCell.OP = CMTerm1View::typeNO;
1858                     m_InputCell.bnot = false;
1859                     m_InputCell.bpp = false;
1860                     m_InputCell.bpn = false;
1861                     clickCounter = 0;
1862                     clickCounterNot = 0;
1863                     clickCounterDF = 0;
1864                     clickCounterD = 0;
1865                     clickCounterF = 0;
1866                 }
1867                 lastLParam = 0x20;
1868                 m_InputCell.bcmpEq = true;
1869                 if (lastCMP != LParam)
1870                 {
1871                     clickCounterCMP++;
1872                 }
1873                 else
1874                 {
1875                     clickCounterCMP = 1;
1876                     m_InputCell.bcmpGt = false;
1877                     m_InputCell.bcmpLt = false;
1878                 }
1879
1880                 if (clickCounterCMP > 2)
1881                 {
1882                     clickCounterCMP = 1;
1883                     m_InputCell.bcmpGt = false;
1884                     m_InputCell.bcmpLt = false;
1885                 }
1886                 lastCMP = LParam;
1887                 curTaskState = 'B'; break;
1888             case 0x0e:
1889                 if ((lastLParam == 0x03) || (lastLParam == 0x06) || (lastLParam == 0x07) || (lastLParam == 0x08) || (lastLParam == 0x09))
1890                 {
1891                     m_InputCell.OP = CMTerm1View::typeNO;
1892                     m_InputCell.bnot = false;
1893                     m_InputCell.bpp = false;
1894                     m_InputCell.bpn = false;
1895                     clickCounter = 0;
1896                     clickCounterNot = 0;
1897                     clickCounterDF = 0;
1898                     clickCounterD = 0;
1899                     clickCounterF = 0;
1900                 }
1901                 lastLParam = 0x21;
1902                 m_InputCell.bcmpGt = true;
1903                 if (lastCMP != LParam)
1904                 {
1905                     clickCounterCMP++;
1906                 }
1907                 else
1908                 {
1909                     clickCounterCMP = 1;
1910                     m_InputCell.bcmpEq = false;
1911                     m_InputCell.bcmpLt = false;
1912                 }
1913
1914                 if (clickCounterCMP > 2)
1915                 {
1916                     clickCounterCMP = 1;
1917                     m_InputCell.bcmpEq = false;
1918                     m_InputCell.bcmpLt = false;
1919                 }
1920                 lastCMP = LParam;
1921                 curTaskState = 'B'; break;
1922             case 0x0f:
1923                 if ((lastLParam == 0x03) || (lastLParam == 0x06) || (lastLParam == 0x07) || (lastLParam == 0x08) || (lastLParam == 0x09))
1924                 {
1925                     m_InputCell.OP = CMTerm1View::typeNO;
1926                     m_InputCell.bnot = false;
1927                     m_InputCell.bpp = false;
1928                     m_InputCell.bpn = false;
1929                     clickCounter = 0;
1930                     clickCounterNot = 0;
1931                     clickCounterDF = 0;
1932                     clickCounterD = 0;
1933                     clickCounterF = 0;
1934                 }
1935                 lastLParam = 0x22;                //  define op para; for translate to -/-
1936                 m_InputCell.bcmpLt = true;
1937                 if (lastCMP != LParam)
1938                 {
1939                     clickCounterCMP++;
1940                 }
1941                 else
1942                 {
1943                     clickCounterCMP = 1;
1944                     m_InputCell.bcmpEq = false;
1945                     m_InputCell.bcmpGt = false;
1946                 }
1947
1948                 if (clickCounterCMP > 2)
1949                 {
1950                     clickCounterCMP = 1;
1951                     m_InputCell.bcmpEq = false;
1952                     m_InputCell.bcmpGt = false;
1953                 }
1954                 lastCMP = LParam;             //record key num = > <
1955                 curTaskState = 'B'; break;
1956             default:
1957                 break;
1958             }
1959         }
1960
1961         break;
1962     case 'C':
1963         //    str = strOp + _T(" ") + strParam;
1964         if (HParam == 0x01)                      //operator 1
1965         {
1966             m_InputCell.bnot = false;
1967             m_InputCell.bpp = false;
1968             m_InputCell.bpn = false;
1969             m_InputCell.bcmpEq = false;
1970             m_InputCell.bcmpLt = false;
1971             m_InputCell.bcmpGt = false;
1972             m_InputCell.bDouble = false;
1973             m_InputCell.bFloat1 = false;
1974             m_InputCell.bFloat = false;
1975             m_InputCell.bFloat1 = false;
1976             m_InputCell.bLeftLineUp = false;
1977             m_InputCell.brightLineUp = false;
1978
1979             if ((LParam >= 0x01) && (LParam <= 0x0f))
1980             {
1981
1982                 if ((LParam == 0x08) || (LParam == 0x09))
1983                 {
1984                     clickCounter = 0;
1985                     clickCounterNot = 0;
1986                     clickCounterCMP = 0;
1987                     clickCounterD = 0;
1988                     clickCounterF = 0;
1989                 }
1990                 else
1991                 {
1992                     if (lastLParam != LParam)
1993                     {
1994                         clickCounter = 0;
1995                         clickCounterNot = 0;
1996                         clickCounterDF = 0;
1997                         clickCounterCMP = 0;
1998                         clickCounterD = 0;
1999                         clickCounterF = 0;
2000                     }
2001                 }
2002
2003             }
2004             if ((lastLParam == 0x14) && ((LParam == 0x10) || (LParam == 0x11) || (LParam == 0x12)))  //from not to updown
2005             {
2006                 clickCounter = 1;
2007                 clickCounterNot = 0;
2008                 clickCounterDF = 0;
2009                 clickCounterCMP = 0;
2010                 clickCounterD = 0;
2011                 clickCounterF = 0;
2012
2013             }
2014             if ((lastLParam == 0x10) && ((LParam == 0x13) || (LParam == 0x14)))    //from up to not
2015             {
2016                 clickCounter = 0;
2017                 clickCounterNot = 1;
2018                 clickCounterDF = 0;
2019                 clickCounterCMP = 0;
2020                 clickCounterD = 0;
2021                 clickCounterF = 0;
2022
2023             }
2024             if ((lastLParam == 0x11) && ((LParam == 0x13) || (LParam == 0x14)))    //from down to not
2025             {
2026                 clickCounter = 0;
2027                 clickCounterNot = 1;
2028                 clickCounterDF = 0;
2029                 clickCounterCMP = 0;
2030                 clickCounterD = 0;
2031                 clickCounterF = 0;
2032             }
2033             if ((lastLParam == 0x13) && ((LParam == 0x10) || (LParam == 0x11) || (LParam == 0x12)))  //not
2034             {
2035                 clickCounter = 0;
2036                 clickCounterNot = 0;
2037                 clickCounterDF = 0;
2038                 clickCounterCMP = 0;
2039                 clickCounterD = 0;
2040                 clickCounterF = 0;
2041
2042             }
2043             if ((lastLParam == 0x10) && ((LParam == 0x13) || (LParam == 0x14)))    //updown
2044             {
2045                 clickCounter = 0;
2046                 clickCounterNot = 0;
2047                 clickCounterDF = 0;
2048                 clickCounterCMP = 0;
2049                 clickCounterD = 0;
2050                 clickCounterF = 0;
2051
2052             }
2053             if ((lastLParam == 0x11) && ((LParam == 0x13) || (LParam == 0x14)))    //updown
2054             {
2055                 clickCounter = 0;
2056                 clickCounterNot = 0;
2057                 clickCounterDF = 0;
2058                 clickCounterCMP = 0;
2059                 clickCounterD = 0;
2060                 clickCounterF = 0;
2061             }
2062             if ((lastLParam == 0x15) && ((LParam == 0x16) || (LParam == 0x18)))
2063             {
2064                 clickCounter = 0;
2065                 clickCounterNot = 0;
2066                 clickCounterDF = 0;
2067                 clickCounterCMP = 0;
2068                 clickCounterD = 0;
2069                 clickCounterF = 1;
2070             }
2071             if ((lastLParam == 0x17) && ((LParam == 0x16) || (LParam == 0x18)))
2072             {
2073                 clickCounter = 0;
2074                 clickCounterNot = 0;
2075                 clickCounterDF = 0;
2076                 clickCounterCMP = 0;
2077                 clickCounterD = 0;
2078                 clickCounterF = 1;
2079             }
2080             if ((lastLParam == 0x16) && ((LParam == 0x15) || (LParam == 0x17)))
2081             {
2082                 clickCounter = 0;
2083                 clickCounterNot = 0;
2084                 clickCounterDF = 0;
2085                 clickCounterCMP = 0;
2086                 clickCounterD = 1;
2087                 clickCounterF = 0;
2088             }
2089             if ((lastLParam == 0x18) && ((LParam == 0x15) || (LParam == 0x17)))
2090             {
2091                 clickCounter = 0;
2092                 clickCounterNot = 0;
2093                 clickCounterDF = 0;
2094                 clickCounterCMP = 0;
2095                 clickCounterD = 1;
2096                 clickCounterF = 0;
2097             }
2098             switch (LParam)
2099             {
2100             case 0x01:
2101                 m_InputCell.OP = CMTerm1View::typeNO; m_InputCell.param = 0x10;      //0x10 define para null 
2102
2103                 lastLParam = LParam;
2104                 curTaskState = 'B';
2105                 break;
2106             case 0x02:
2107                 m_InputCell.OP = CMTerm1View::typeNO; m_InputCell.param = 0x10;
2108                 m_InputCell.bLeftLineUp = true;
2109                 m_InputCell.brightLineUp = true;
2110                 lastLParam = LParam;
2111                 curTaskState = 'B';
2112                 break;
2113             case 0x03:
2114                 m_InputCell.OP = CMTerm1View::typeOUT; m_InputCell.param = 0x10;
2115                 lastLParam = LParam;
2116                 curTaskState = 'B';
2117                 break;
2118                 /*case 4:
2119                     strOp = _T("(MC)");strParam = "";lastLParam = LParam;curTaskState = 'C'; break;
2120                 case 5:
2121                     strOp = _T("(MCE)");strParam = "";lastLParam = LParam;curTaskState = 'C'; break;*/
2122             case 0x06:
2123                 m_InputCell.OP = CMTerm1View::typeSET; m_InputCell.param = 0x10; ; lastLParam = LParam; curTaskState = 'B'; break;
2124             case 0x07:
2125                 m_InputCell.OP = CMTerm1View::typeRESET; m_InputCell.param = 0x10; ; lastLParam = LParam; curTaskState = 'B'; break;
2126             case 0x08:
2127                 m_InputCell.OP = CMTerm1View::typeDF;; m_InputCell.param = 0x10;
2128                 lastLParam = LParam;
2129                 curTaskState = 'A';
2130                 break;
2131             case 0x09:
2132                 m_InputCell.OP = CMTerm1View::typeDF_; m_InputCell.param = 0x10;
2133
2134                 lastLParam = LParam;
2135                 curTaskState = 'A';
2136                 break;
2137             case 0x0a:
2138                 strOp = _T("(ED)"); strParam = ""; lastLParam = LParam; curTaskState = 'A'; break;
2139             case 0x0b:
2140                 m_InputCell.OP = CMTerm1View::typeTM; m_InputCell.param = 0x10;
2141
2142                 lastLParam = LParam;
2143                 curTaskState = 'B';
2144                 break;
2145             case 0x10:
2146                 m_InputCell.bpp = true;
2147                 m_InputCell.bpn = false;
2148                 break;
2149             case 0x11:
2150                 m_InputCell.bpp = false;
2151                 m_InputCell.bpn = true;
2152                 break;
2153             case 0x12:
2154                 m_InputCell.bpp = false;
2155                 m_InputCell.bpn = false;
2156                 break;
2157             case 0x13:
2158                 switch (lastLParam)
2159                 {
2160                 case 0x03:
2161                 case 0x06:
2162                 case 0x07:
2163                 case 0x15:
2164                 case 0x17:
2165                 case 0x16:
2166                 case 0x18:
2167                 case 0x20:
2168                 case 0x21:
2169                 case 0x22:
2170                     m_InputCell.OP = CMTerm1View::typeNOT;
2171                     clickCounterNot = 0;
2172
2173                     curTaskState = 'A';
2174                 default:
2175                     break;
2176                 }
2177                 switch (lastLParam)
2178                 {
2179                 case 0x01:
2180                     m_InputCell.OP = CMTerm1View::typeNC; break;
2181                 case 0x02:
2182                     m_InputCell.OP = CMTerm1View::typeNC;
2183                     m_InputCell.bLeftLineUp = true;
2184                     m_InputCell.brightLineUp = true;
2185                     break;
2186                 default:
2187                     break;
2188                 }
2189                 lastLParam = LParam;
2190                 m_InputCell.bnot = true;
2191
2192                 break;
2193             case 0x14:
2194                 m_InputCell.bnot = false;
2195                 break;
2196             case 0x15:
2197                 m_InputCell.bDouble = true;
2198                 m_InputCell.bDouble1 = false;
2199                 m_InputCell.bFloat = false;
2200                 m_InputCell.bFloat1 = false;
2201                 m_InputCell.param = 0x10; lastLParam = LParam; curTaskState = 'B';
2202                 break;
2203             case 0x17:
2204                 m_InputCell.bDouble = false;
2205                 m_InputCell.bDouble1 = true;
2206                 m_InputCell.bFloat = false;
2207                 m_InputCell.bFloat1 = false;
2208                 m_InputCell.param = 0x10; lastLParam = LParam; curTaskState = 'B';
2209                 break;
2210             case 0x16:
2211                 m_InputCell.bDouble = false;
2212                 m_InputCell.bDouble1 = false;
2213                 m_InputCell.bFloat = true;
2214                 m_InputCell.bFloat1 = false;
2215                 lastLParam = LParam; m_InputCell.param = 0x10; curTaskState = 'B';
2216                 break;
2217             case 0x18:
2218                 m_InputCell.bDouble = false;
2219                 m_InputCell.bDouble1 = false;
2220                 m_InputCell.bFloat = false;
2221                 m_InputCell.bFloat1 = true;
2222                 lastLParam = LParam; m_InputCell.param = 0x10; curTaskState = 'B';
2223                 break;
2224             default:
2225                 break;
2226             }
2227         }
2228         else if (HParam == 0x2)
2229         {
2230             switch (LParam)
2231             {
2232             case 1:
2233                 m_InputCell.param = KLCoilTypeX; curTaskState = 'C'; break;
2234             case 2:
2235                 m_InputCell.param = KLCoilTypeY; curTaskState = 'C'; break;
2236             case 3:
2237                 m_InputCell.param = KLCoilTypeR; curTaskState = 'C'; break;
2238             case 4:
2239                 m_InputCell.param = KLCoilTypeLR; curTaskState = 'C'; break;
2240             case 5:
4ed7fc 2241                 m_InputCell.param = KLCoilTypeP; 
Z 2242                 curTaskState = 'C'; break;
df0321 2243             case 6:
Q 2244                 m_InputCell.param = KLCoilTypeT; curTaskState = 'C'; break;
2245             case 7:
2246                 m_InputCell.param = KLCoilTypeC; curTaskState = 'C'; break;
2247             case 8:
4ed7fc 2248                 m_InputCell.param = KLCoilTypeE; curTaskState = 'C'; break;
df0321 2249             case 9:
Q 2250                 m_InputCell.param = OP_TMX; curTaskState = 'C'; break;
2251             case 0x0a:
2252                 m_InputCell.param = OP_TMY; curTaskState = 'C'; break;
2253             case 0x0b:
2254                 m_InputCell.param = OP_TMR; curTaskState = 'C'; break;
2255             case 0x0c:
2256                 m_InputCell.param = OP_TML; curTaskState = 'C'; break;
2257             case 0x0d:
2258                 if ((lastLParam == 0x03) || (lastLParam == 0x06) || (lastLParam == 0x07) || (lastLParam == 0x08) || (lastLParam == 0x09))
2259                 {
2260                     m_InputCell.OP = CMTerm1View::typeNO;
2261                     m_InputCell.bnot = false;
2262                     m_InputCell.bpp = false;
2263                     m_InputCell.bpn = false;
2264                     clickCounter = 0;
2265                     clickCounterNot = 0;
2266                     clickCounterDF = 0;
2267                     clickCounterD = 0;
2268                     clickCounterF = 0;
2269                 }
2270                 lastLParam = 0x20;
2271                 m_InputCell.bcmpEq = true;
2272                 if (lastCMP != LParam)
2273                 {
2274                     clickCounterCMP++;
2275                 }
2276                 else
2277                 {
2278                     clickCounterCMP = 1;
2279                     m_InputCell.bcmpGt = false;
2280                     m_InputCell.bcmpLt = false;
2281                 }
2282                 if (clickCounterCMP > 2)
2283                 {
2284                     clickCounterCMP = 1;
2285                     m_InputCell.bcmpGt = false;
2286                     m_InputCell.bcmpLt = false;
2287                 }
2288                 lastCMP = LParam;
2289                 curTaskState = 'B'; break;
2290             case 0x0e:
2291                 if ((lastLParam == 0x03) || (lastLParam == 0x06) || (lastLParam == 0x07) || (lastLParam == 0x08) || (lastLParam == 0x09))
2292                 {
2293                     m_InputCell.OP = CMTerm1View::typeNO;
2294                     m_InputCell.bnot = false;
2295                     m_InputCell.bpp = false;
2296                     m_InputCell.bpn = false;
2297                     clickCounter = 0;
2298                     clickCounterNot = 0;
2299                     clickCounterDF = 0;
2300                     clickCounterD = 0;
2301                     clickCounterF = 0;
2302                 }
2303                 lastLParam = 0x21;
2304                 m_InputCell.bcmpGt = true;
2305                 if (lastCMP != LParam)
2306                 {
2307                     clickCounterCMP = 1;
2308                     clickCounterCMP++;
2309                 }
2310                 else
2311                 {
2312                     m_InputCell.bcmpEq = false;
2313                     m_InputCell.bcmpLt = false;
2314                 }
2315                 if (clickCounterCMP > 2)
2316                 {
2317                     clickCounterCMP = 1;
2318                     m_InputCell.bcmpEq = false;
2319                     m_InputCell.bcmpLt = false;
2320                 }
2321                 lastCMP = LParam;
2322                 curTaskState = 'B'; break;
2323             case 0x0f:
2324                 if ((lastLParam == 0x03) || (lastLParam == 0x06) || (lastLParam == 0x07) || (lastLParam == 0x08) || (lastLParam == 0x09))
2325                 {
2326                     m_InputCell.OP = CMTerm1View::typeNO;
2327                     m_InputCell.bnot = false;
2328                     m_InputCell.bpp = false;
2329                     m_InputCell.bpn = false;
2330                     clickCounter = 0;
2331                     clickCounterNot = 0;
2332                     clickCounterDF = 0;
2333                     clickCounterD = 0;
2334                     clickCounterF = 0;
2335                 }
2336                 lastLParam = 0x22;
2337                 m_InputCell.bcmpLt = true;
2338                 if (lastCMP != LParam)
2339                 {
2340                     clickCounterCMP++;
2341                 }
2342                 else
2343                 {
2344                     clickCounterCMP = 1;
2345                     m_InputCell.bcmpEq = false;
2346                     m_InputCell.bcmpGt = false;
2347                 }
2348                 if (clickCounterCMP > 2)
2349                 {
2350                     clickCounterCMP = 1;
2351                     m_InputCell.bcmpEq = false;
2352                     m_InputCell.bcmpGt = false;
2353                 }
2354                 lastCMP = LParam;
2355                 curTaskState = 'B'; break;
2356             default:
2357                 break;
2358             }
2359         }
2360         else if (HParam == 0x3)
2361         {
2362             switch (LParam)
2363             {
2364             case 0:
2365                 strNumTemp = _T("0"); curTaskState = 'D'; break;
2366             case 1:
2367                 strNumTemp = _T("1"); curTaskState = 'D'; break;
2368             case 2:
2369                 strNumTemp = _T("2"); curTaskState = 'D'; break;
2370             case 3:
2371                 strNumTemp = _T("3"); curTaskState = 'D'; break;
2372             case 4:
2373                 strNumTemp = _T("4"); curTaskState = 'D'; break;
2374             case 5:
2375                 strNumTemp = _T("5"); curTaskState = 'D'; break;
2376             case 6:
2377                 strNumTemp = _T("6"); curTaskState = 'D'; break;
2378             case 7:
2379                 strNumTemp = _T("7"); curTaskState = 'D'; break;
2380             case 8:
2381                 strNumTemp = _T("8"); curTaskState = 'D'; break;
2382             case 9:
2383                 strNumTemp = _T("9"); curTaskState = 'D'; break;
2384             case 0x0A:
2385                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2386                     ;                        //state not change
2387                 else
2388                 {
2389                     strNumTemp = _T("A"); curTaskState = 'D';
2390                 }
2391                 break;
2392             case 0x0B:
2393                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2394                     ;
2395                 else
2396                 {
2397                     strNumTemp = _T("B"); curTaskState = 'D';
2398                 }
2399                 break;
2400             case 0x0C:
2401                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2402                     ;
2403                 else
2404                 {
2405                     strNumTemp = _T("C"); curTaskState = 'D';
2406                 }
2407                 break;
2408             case 0x0D:
2409                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2410                     ;
2411                 else
2412                 {
2413                     strNumTemp = _T("D"); curTaskState = 'D';
2414                 }
2415                 break;
2416
2417             case 0x0E:
2418                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2419                     ;
2420                 else
2421                 {
2422                     strNumTemp = _T("E"); curTaskState = 'D';
2423                 }
2424                 break;
2425             case 0x0F:
2426                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2427                     ;
2428                 else
2429                 {
2430                     strNumTemp = _T("F"); curTaskState = 'D';
2431                 }
2432                 break;
2433             default:
2434                 break;
2435             }
2436
2437             if (m_InputCell.num.GetLength() < 4)
2438             {
2439                 m_InputCell.num.Append(strNumTemp);
2440             }
2441             else
2442             {
2443                 m_InputCell.num = m_InputCell.num.Right(m_InputCell.num.GetLength() - 1);
2444                 m_InputCell.num.Append(strNumTemp);
2445             }
2446         }
2447
2448         break;
2449     case 'D':
2450         if (HParam == 0x1)                      //operator 1
2451         {
2452             m_InputCell.bnot = false;
2453             m_InputCell.bpp = false;
2454             m_InputCell.bpn = false;
2455             m_InputCell.bcmpEq = false;
2456             m_InputCell.bcmpLt = false;
2457             m_InputCell.bcmpGt = false;
2458             m_InputCell.bDouble = false;
2459             m_InputCell.bDouble1 = false;
2460             m_InputCell.bFloat = false;
2461             m_InputCell.bFloat1 = false;
2462             m_InputCell.bLeftLineUp = false;
2463             m_InputCell.brightLineUp = false;
2464
2465
2466             if ((LParam >= 0x01) && (LParam <= 0x0f))
2467             {
2468
2469                 m_InputCell.num.Empty();
2470                 if ((LParam == 0x08) || (LParam == 0x09))
2471                 {
2472                     clickCounter = 0;
2473                     clickCounterNot = 0;
2474                     clickCounterCMP = 0;
2475                     clickCounterD = 0;
2476                     clickCounterF = 0;
2477                 }
2478                 else
2479                 {
2480                     if (lastLParam != LParam)
2481                     {
2482                         clickCounter = 0;
2483                         clickCounterNot = 0;
2484                         clickCounterDF = 0;
2485                         clickCounterCMP = 0;
2486                         clickCounterD = 0;
2487                         clickCounterF = 0;
2488                     }
2489                 }
2490             }
2491             if ((lastLParam == 0x14) && ((LParam == 0x10) || (LParam == 0x11) || (LParam == 0x12)))  //from not to updown
2492             {
2493                 clickCounter = 1;
2494                 clickCounterNot = 0;
2495                 clickCounterDF = 0;
2496                 clickCounterCMP = 0;
2497                 clickCounterD = 0;
2498                 clickCounterF = 0;
2499
2500             }
2501             if ((lastLParam == 0x10) && ((LParam == 0x13) || (LParam == 0x14)))    //from up to not
2502             {
2503                 clickCounter = 0;
2504                 clickCounterNot = 1;
2505                 clickCounterDF = 0;
2506                 clickCounterCMP = 0;
2507                 clickCounterD = 0;
2508                 clickCounterF = 0;
2509
2510             }
2511             if ((lastLParam == 0x11) && ((LParam == 0x13) || (LParam == 0x14)))    //from down to not
2512             {
2513                 clickCounter = 0;
2514                 clickCounterNot = 1;
2515                 clickCounterDF = 0;
2516                 clickCounterCMP = 0;
2517                 clickCounterD = 0;
2518                 clickCounterF = 0;
2519             }
2520
2521             if ((lastLParam == 0x13) && ((LParam == 0x10) || (LParam == 0x11) || (LParam == 0x12)))  //not
2522             {
2523                 clickCounter = 0;
2524                 clickCounterNot = 0;
2525                 clickCounterDF = 0;
2526                 clickCounterCMP = 0;
2527                 clickCounterD = 0;
2528                 clickCounterF = 0;
2529
2530             }
2531             if ((lastLParam == 0x10) && ((LParam == 0x13) || (LParam == 0x14)))    //updown
2532             {
2533                 clickCounter = 0;
2534                 clickCounterNot = 0;
2535                 clickCounterDF = 0;
2536                 clickCounterCMP = 0;
2537                 clickCounterD = 0;
2538                 clickCounterF = 0;
2539
2540             }
2541             if ((lastLParam == 0x11) && ((LParam == 0x13) || (LParam == 0x14)))    //updown
2542             {
2543                 clickCounter = 0;
2544                 clickCounterNot = 0;
2545                 clickCounterDF = 0;
2546                 clickCounterCMP = 0;
2547                 clickCounterD = 0;
2548                 clickCounterF = 0;
2549             }
2550             if ((lastLParam == 0x15) && ((LParam == 0x16) || (LParam == 0x18)))
2551             {
2552                 clickCounter = 0;
2553                 clickCounterNot = 0;
2554                 clickCounterDF = 0;
2555                 clickCounterCMP = 0;
2556                 clickCounterD = 0;
2557                 clickCounterF = 1;
2558             }
2559             if ((lastLParam == 0x17) && ((LParam == 0x16) || (LParam == 0x18)))
2560             {
2561                 clickCounter = 0;
2562                 clickCounterNot = 0;
2563                 clickCounterDF = 0;
2564                 clickCounterCMP = 0;
2565                 clickCounterD = 0;
2566                 clickCounterF = 1;
2567             }
2568             if ((lastLParam == 0x16) && ((LParam == 0x15) || (LParam == 0x17)))
2569             {
2570                 clickCounter = 0;
2571                 clickCounterNot = 0;
2572                 clickCounterDF = 0;
2573                 clickCounterCMP = 0;
2574                 clickCounterD = 1;
2575                 clickCounterF = 0;
2576             }
2577             if ((lastLParam == 0x18) && ((LParam == 0x15) || (LParam == 0x17)))
2578             {
2579                 clickCounter = 0;
2580                 clickCounterNot = 0;
2581                 clickCounterDF = 0;
2582                 clickCounterCMP = 0;
2583                 clickCounterD = 1;
2584                 clickCounterF = 0;
2585             }
2586             switch (LParam)
2587             {
2588             case 0x01:
2589                 m_InputCell.OP = CMTerm1View::typeNO; m_InputCell.param = 0x10;      //0x10 define para null 
2590
2591                 lastLParam = LParam;
2592                 curTaskState = 'B';
2593                 break;
2594             case 0x02:
2595                 m_InputCell.OP = CMTerm1View::typeNO; m_InputCell.param = 0x10;
2596                 m_InputCell.bLeftLineUp = true;
2597                 m_InputCell.brightLineUp = true;
2598                 lastLParam = LParam;
2599                 curTaskState = 'B';
2600                 break;
2601             case 0x03:
2602                 m_InputCell.OP = CMTerm1View::typeOUT; m_InputCell.param = 0x10;
2603
2604                 lastLParam = LParam;
2605                 curTaskState = 'B';
2606                 break;
2607                 /*case 4:
2608                     strOp = _T("(MC)");strParam = "";lastLParam = LParam;curTaskState = 'C'; break;
2609                 case 5:
2610                     strOp = _T("(MCE)");strParam = "";lastLParam = LParam;curTaskState = 'C'; break;*/
2611             case 0x06:
2612                 m_InputCell.OP = CMTerm1View::typeSET; m_InputCell.param = 0x10; ; lastLParam = LParam; curTaskState = 'B'; break;
2613             case 0x07:
2614                 m_InputCell.OP = CMTerm1View::typeRESET; m_InputCell.param = 0x10; ; lastLParam = LParam; curTaskState = 'B'; break;
2615             case 0x08:
2616                 m_InputCell.OP = CMTerm1View::typeDF; m_InputCell.param = 0x10;
2617
2618                 lastLParam = LParam;
2619                 curTaskState = 'A';
2620                 break;
2621             case 0x09:
2622                 m_InputCell.OP = CMTerm1View::typeDF_; m_InputCell.param = 0x10;
2623
2624                 lastLParam = LParam;
2625                 curTaskState = 'A';
2626                 break;
2627             case 0x0a:
2628                 strOp = _T("(ED)"); strParam = ""; lastLParam = LParam; curTaskState = 'A'; break;
2629             case 0x0b:
2630                 m_InputCell.OP = CMTerm1View::typeTM; m_InputCell.param = 0x10;
2631
2632                 lastLParam = LParam;
2633                 curTaskState = 'B';
2634                 break;
2635             case 0x10:
2636                 m_InputCell.bpp = true;
2637                 m_InputCell.bpn = false;
2638                 break;
2639             case 0x11:
2640                 m_InputCell.bpp = false;
2641                 m_InputCell.bpn = true;
2642                 break;
2643             case 0x12:
2644                 m_InputCell.bpp = false;
2645                 m_InputCell.bpn = false;
2646                 break;
2647             case 0x13:
2648                 switch (lastLParam)
2649                 {
2650                 case 3:
2651                 case 6:
2652                 case 7:
2653                 case 0x15:
2654                 case 0x17:
2655                 case 0x16:
2656                 case 0x18:
2657                 case 0x20:
2658                 case 0x21:
2659                 case 0x22:
2660                     m_InputCell.OP = CMTerm1View::typeNOT;
2661                     clickCounterNot = 0;
2662                     curTaskState = 'A';
2663                 default:
2664                     break;
2665                 }
2666                 switch (lastLParam)
2667                 {
2668                 case 0x01:
2669                     m_InputCell.OP = CMTerm1View::typeNC; break;
2670                 case 0x02:
2671                     m_InputCell.OP = CMTerm1View::typeNC;
2672                     m_InputCell.bLeftLineUp = true;
2673                     m_InputCell.brightLineUp = true;
2674                     break;
2675                 default:
2676                     break;
2677                 }
2678                 lastLParam = LParam;
2679                 m_InputCell.bnot = true;
2680
2681                 break;
2682             case 0x14:
2683                 m_InputCell.bnot = false;
2684                 break;
2685             case 0x15:
2686                 m_InputCell.bDouble = true;
2687                 m_InputCell.bDouble1 = false;
2688                 m_InputCell.bFloat = false;
2689                 m_InputCell.bFloat1 = false;
2690                 m_InputCell.param = 0x10; lastLParam = LParam; curTaskState = 'B';
2691                 break;
2692             case 0x17:
2693                 m_InputCell.bDouble = false;
2694                 m_InputCell.bDouble1 = true;
2695                 m_InputCell.bFloat = false;
2696                 m_InputCell.bFloat1 = false;
2697                 m_InputCell.param = 0x10; lastLParam = LParam; curTaskState = 'B';
2698                 break;
2699             case 0x16:
2700                 m_InputCell.bDouble = false;
2701                 m_InputCell.bDouble1 = false;
2702                 m_InputCell.bFloat = true;
2703                 m_InputCell.bFloat1 = false;
2704                 lastLParam = LParam; m_InputCell.param = 0x10; curTaskState = 'B';
2705                 break;
2706             case 0x18:
2707                 m_InputCell.bDouble = false;
2708                 m_InputCell.bDouble1 = false;
2709                 m_InputCell.bFloat = false;
2710                 m_InputCell.bFloat1 = true;
2711                 lastLParam = LParam; m_InputCell.param = 0x10; curTaskState = 'B';
2712                 break;
2713             default:
2714                 break;
2715             }
2716             if (curTaskState != 'D')
2717             {
2718                 m_InputCell.num.Empty();
2719             }
2720         }
2721         else if (HParam == 0x2)
2722         {
2723             switch (LParam)
2724             {
2725             case 1:
2726                 m_InputCell.param = KLCoilTypeX; curTaskState = 'C'; break;
2727             case 2:
2728                 m_InputCell.param = KLCoilTypeY; curTaskState = 'C'; break;
2729             case 3:
2730                 m_InputCell.param = KLCoilTypeR; curTaskState = 'C'; break;
2731             case 4:
2732                 m_InputCell.param = KLCoilTypeLR; curTaskState = 'C'; break;
2733             case 5:
2734                 strParam = _T(" P"); curTaskState = 'C'; break;
2735             case 6:
2736                 m_InputCell.param = KLCoilTypeT; curTaskState = 'C'; break;
2737             case 7:
2738                 m_InputCell.param = KLCoilTypeC; curTaskState = 'C'; break;
2739             case 8:
2740                 strParam = _T(" E"); curTaskState = 'C'; break;
2741             case 9:
2742                 m_InputCell.param = OP_TMX; curTaskState = 'C'; break;
2743             case 0x0a:
2744                 m_InputCell.param = OP_TMY; curTaskState = 'C'; break;
2745             case 0x0b:
2746                 m_InputCell.param = OP_TMR; curTaskState = 'C'; break;
2747             case 0x0c:
2748                 m_InputCell.param = OP_TML; curTaskState = 'C'; break;
2749             case 0x0d:
2750                 if ((lastLParam == 0x03) || (lastLParam == 0x06) || (lastLParam == 0x07) || (lastLParam == 0x08) || (lastLParam == 0x09))
2751                 {
2752                     m_InputCell.OP = CMTerm1View::typeNO;
2753                     m_InputCell.bnot = false;
2754                     m_InputCell.bpp = false;
2755                     m_InputCell.bpn = false;
2756                     clickCounter = 0;
2757                     clickCounterNot = 0;
2758                     clickCounterDF = 0;
2759                     clickCounterD = 0;
2760                     clickCounterF = 0;
2761                 }
2762                 lastLParam = 0x20;
2763                 m_InputCell.bcmpEq = true;
2764                 if (lastCMP != LParam)
2765                 {
2766                     clickCounterCMP++;
2767                 }
2768                 else
2769                 {
2770                     clickCounterCMP = 1;
2771                     m_InputCell.bcmpGt = false;
2772                     m_InputCell.bcmpLt = false;
2773                 }
2774
2775                 if (clickCounterCMP > 2)
2776                 {
2777                     clickCounterCMP = 1;
2778                     m_InputCell.bcmpGt = false;
2779                     m_InputCell.bcmpLt = false;
2780                 }
2781                 lastCMP = LParam;
2782                 curTaskState = 'B'; break;
2783             case 0x0e:
2784                 if ((lastLParam == 0x03) || (lastLParam == 0x06) || (lastLParam == 0x07) || (lastLParam == 0x08) || (lastLParam == 0x09))
2785                 {
2786                     m_InputCell.OP = CMTerm1View::typeNO;
2787                     m_InputCell.bnot = false;
2788                     m_InputCell.bpp = false;
2789                     m_InputCell.bpn = false;
2790                     clickCounter = 0;
2791                     clickCounterNot = 0;
2792                     clickCounterDF = 0;
2793                     clickCounterD = 0;
2794                     clickCounterF = 0;
2795                 }
2796                 lastLParam = 0x21;
2797                 m_InputCell.bcmpGt = true;
2798                 if (lastCMP != LParam)
2799                 {
2800                     clickCounterCMP++;
2801                 }
2802                 else
2803                 {
2804                     clickCounterCMP = 1;
2805                     m_InputCell.bcmpEq = false;
2806                     m_InputCell.bcmpLt = false;
2807                 }
2808                 if (clickCounterCMP > 2)
2809                 {
2810                     clickCounterCMP = 1;
2811                     m_InputCell.bcmpEq = false;
2812                     m_InputCell.bcmpLt = false;
2813                 }
2814                 lastCMP = LParam;
2815                 curTaskState = 'B'; break;
2816             case 0x0f:
2817                 if ((lastLParam == 0x03) || (lastLParam == 0x06) || (lastLParam == 0x07) || (lastLParam == 0x08) || (lastLParam == 0x09))
2818                 {
2819                     m_InputCell.OP = CMTerm1View::typeNO;
2820                     m_InputCell.bnot = false;
2821                     m_InputCell.bpp = false;
2822                     m_InputCell.bpn = false;
2823                     clickCounter = 0;
2824                     clickCounterNot = 0;
2825                     clickCounterDF = 0;
2826                     clickCounterD = 0;
2827                     clickCounterF = 0;
2828                 }
2829                 lastLParam = 0x22;
2830                 m_InputCell.bcmpLt = true;
2831                 if (lastCMP != LParam)
2832                 {
2833                     clickCounterCMP++;
2834                 }
2835                 else
2836                 {
2837                     clickCounterCMP = 1;
2838                     m_InputCell.bcmpEq = false;
2839                     m_InputCell.bcmpGt = false;
2840                 }
2841                 if (clickCounterCMP > 2)
2842                 {
2843                     clickCounterCMP = 1;
2844                     m_InputCell.bcmpEq = false;
2845                     m_InputCell.bcmpGt = false;
2846                 }
2847                 lastCMP = LParam;
2848                 curTaskState = 'B'; break;
2849             default:
2850                 break;
2851             }
2852             if (curTaskState != 'D')
2853             {
2854                 m_InputCell.num.Empty();
2855             }
2856         }
2857         else if (HParam == 0x3)
2858         {
2859             switch (LParam)
2860             {
2861             case 0:
2862                 strNumTemp = _T("0"); curTaskState = 'D'; break;
2863             case 1:
2864                 strNumTemp = _T("1"); curTaskState = 'D'; break;
2865             case 2:
2866                 strNumTemp = _T("2"); curTaskState = 'D'; break;
2867             case 3:
2868                 strNumTemp = _T("3"); curTaskState = 'D'; break;
2869             case 4:
2870                 strNumTemp = _T("4"); curTaskState = 'D'; break;
2871             case 5:
2872                 strNumTemp = _T("5"); curTaskState = 'D'; break;
2873             case 6:
2874                 strNumTemp = _T("6"); curTaskState = 'D'; break;
2875             case 7:
2876                 strNumTemp = _T("7"); curTaskState = 'D'; break;
2877             case 8:
2878                 strNumTemp = _T("8"); curTaskState = 'D'; break;
2879             case 9:
2880                 strNumTemp = _T("9"); curTaskState = 'D'; break;
2881             case 0x0A:
2882                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2883                     ;                        //state not change
2884                 else
2885                 {
2886                     strNumTemp = _T("A"); curTaskState = 'D';
2887                 }
2888                 break;
2889             case 0x0B:
2890                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2891                     ;
2892                 else
2893                 {
2894                     strNumTemp = _T("B"); curTaskState = 'D';
2895                 }
2896                 break;
2897             case 0x0C:
2898                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2899                     ;
2900                 else
2901                 {
2902                     strNumTemp = _T("C"); curTaskState = 'D';
2903                 }
2904                 break;
2905             case 0x0D:
2906                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2907                     ;
2908                 else
2909                 {
2910                     strNumTemp = _T("D"); curTaskState = 'D';
2911                 }
2912                 break;
2913
2914             case 0x0E:
2915                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2916                     ;
2917                 else
2918                 {
2919                     strNumTemp = _T("E"); curTaskState = 'D';
2920                 }
2921                 break;
2922             case 0x0F:
2923                 if ((m_InputCell.param == KLCoilTypeT) || (m_InputCell.param == KLCoilTypeC))
2924                     ;
2925                 else
2926                 {
2927                     strNumTemp = _T("F"); curTaskState = 'D';
2928                 }
2929                 break;
2930             default:
2931                 break;
2932             }
2933
2934             if (m_InputCell.num.GetLength() < 4)
2935             {
2936                 m_InputCell.num.Append(strNumTemp);
2937             }
2938             else
2939             {
2940                 m_InputCell.num = m_InputCell.num.Right(m_InputCell.num.GetLength() - 1);
2941                 m_InputCell.num.Append(strNumTemp);
2942
2943                 for (int i = 0; i < m_InputCell.num.GetLength(); i++)
2944                 {
2945                     if (m_InputCell.num[i] == _T('0'))
2946                     {
2947                         ;
2948                     }
2949                     else
2950                     {
2951                         flag = 1; break;
2952                     }
2953
2954                 }
2955                 if (flag == 0)
2956                 {
2957                     m_InputCell.num.Empty();
2958                     m_InputCell.num.Append(_T("0"));
2959                 }
2960             }
2961             int num = m_InputCell.num.GetLength();
2962             for (int i = 0; i < num; i++)
2963             {
2964                 int len1 = m_InputCell.num.GetLength();
2965                 if (len1 > 1 && m_InputCell.num[0] == _T('0')) m_InputCell.num = m_InputCell.num.Right(m_InputCell.num.GetLength() - 1);
2966             }
2967
2968         }
2969
2970
2971         break;
2972     }    //end switch
2973     if (HParam == 0x14)
2974     {
2975         bool editEndFlag = false;                                              //********************************************************************************************************
2976
2977         switch (m_InputCell.OP)
2978         {
2979         case CMTerm1View::typeNO:
2980         case CMTerm1View::typeNC:
2981         case CMTerm1View::typeOUT:
2982         case CMTerm1View::typeSET:
2983         case CMTerm1View::typeRESET:
2984         case CMTerm1View::typeTM:
2985             if (curTaskState == 'D')
2986             {
2987                 editEndFlag = true;
2988             }
2989         case CMTerm1View::typeDF:
2990         case CMTerm1View::typeDF_:
2991             if (curTaskState == 'A')
2992             {
2993                 editEndFlag = true;
2994             }
2995         default:
2996             break;
2997         }
2998
2999         if ((m_InputCell.bcmpEq) || (m_InputCell.bcmpGt) || (m_InputCell.bcmpLt))
3000         {
3001             editEndFlag = true;
3002         }
3003
3004         if (editEndFlag)
3005         {
3006             CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3007             p1->GetInputCell(m_InputCell);
3008         }
3009         else
3010         {
3011             CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3012             CString str = _T("无法确定指令输入");
3013             //p1->m_wndStatusBar.GetStatusBarCtrl().SetBkColor(RGB(255, 0, 0)); 
3014             p1->m_wndStatusBar.SetPaneText(0, str);
3015         }
3016
3017     }
3018
3019     display(m_InputCell);
3020     return 0;
3021 }
3022
3023 int CMyFormInputShow::SetDisplay1(int inputInfo)
3024 {
3025     return 0;
3026 }
3027
3028
3029 void CMyFormInputShow::OnBnClickedBtnAnd()
3030 {
4ed7fc 3031     //判断按钮在第几页,触发不同的操作
Z 3032     switch (showPage)
3033     {
3034     case 0:
3035         //0页的F1,是线圈
3036         SetDisplay(0x00010001);
3037         showPage = 1;
3038         SetBtnDisplay(showPage);
3039         break;
3040     case 1:
3041         //1页的F1,是X
3042         OnBnClickedBtnX();
3043         break;
3044     default:
3045         break;
3046     }
df0321 3047 }
Q 3048
3049 void CMyFormInputShow::OnBnClickedBtnOr()
3050 {
4ed7fc 3051     //判断按钮在第几页,触发不同的操作
Z 3052     switch (showPage)
3053     {
3054     case 0:
3055         //0页的F1,是线圈
3056         SetDisplay(0x00010002);
3057         showPage = 1;
3058         SetBtnDisplay(showPage);
3059         break;
3060     case 1:
3061         //1页的F1,是Y
3062         OnBnClickedBtnY();
3063         break;
3064     default:
3065         break;
3066     }
df0321 3067 }
Q 3068
ad1b4b 3069 /// <summary>
Z 3070 /// 画竖线
3071 /// </summary>
3072 /// <remark>
3073 /// 1.原本无纵线,在焦点格加入左上线,同列上行加入左下线
3074 /// 2.原本有纵线,在两个位置取消线绘制
3075 /// 3.第0行禁止插入纵线
3076 /// 4.焦点在单元格参数位置禁止添加
3077 /// </remark>
df0321 3078 void CMyFormInputShow::OnBnClickedBtnVline()
Q 3079 {
4ed7fc 3080     //判断按钮在第几页,触发不同的操作
Z 3081     switch (showPage)
3082     {
3083     case 0:
3084         //0页的F3,是竖线
3085     {
3086         CString s1;
df0321 3087
4ed7fc 3088         //先判断情况3
Z 3089         if (m_InputCell.row == 0)
ad1b4b 3090         {
4ed7fc 3091             //发送错误信息
Z 3092             DbgLog(_T("插入纵线失败:光标位置错误!第一行禁止插入竖线"));
3093             return;
ad1b4b 3094         }
4ed7fc 3095         //情况4
Z 3096         if (focusCell.nType == CMTerm1View::typeExt1)
3097         {
3098             //发送错误信息
3099             DbgLog(_T("插入纵线失败:光标位置错误!参数位置不允许添加纵线"));
3100             return;
3101         }
3102         //原本是纵线格
3103         if (focusCell.nType == CMTerm1View::typeLine2)
3104         {
3105             flag = 2;//同步删除
3106             focusCell.bLeftLineUp = 0;//设置左上线为0
3107             focusCell.nType = CMTerm1View::typeNone;//设置为空单元格
3108         }
3109         //原本不是纵线格
ad1b4b 3110         else
Z 3111         {
4ed7fc 3112             //不是空格,判断有无左上纵线
Z 3113             if (focusCell.bLeftLineUp == 1)
3114             {
3115                 focusCell.bLeftLineUp = 0;//设置左上线为0
3116                 flag = 2;
3117             }
3118             else
3119             {
3120                 focusCell.bLeftLineUp = 1;//设置左上线为0
3121                 flag = 1;
3122             }
ad1b4b 3123         }
4ed7fc 3124
Z 3125         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3126         CMDIChildWnd* pChild = (CMDIChildWnd*)p1->GetActiveFrame();
3127         CView* p2 = (CView*)pChild->GetActiveView();
3128         if (p2 == NULL)
3129         {
3130             return;
3131         }
3132         CMTerm1View* p3 = (CMTerm1View*)p2;
3133
3134         //设置回显
3135         p3->SetCellToView(focusCell, flag);
3136
3137         //插入完成后,设置按钮返回第一页
3138         showPage = 0;
3139         SetBtnDisplay(showPage);
3140         DbgLog(focusCell.sCoilName);
3141     }break;
3142     case 1:
3143         //1页的F3,是R
3144         OnBnClickedBtnR();
3145         break;
3146     default:
3147         break;
ad1b4b 3148     }
df0321 3149 }
Q 3150
3151 void CMyFormInputShow::OnBnClickedBtnOut()
3152 {
4ed7fc 3153     //判断按钮在第几页,触发不同的操作
Z 3154     switch (showPage)
3155     {
3156     case 0:
3157         //0页的F4,是out
3158     {
3159         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3160         p1->GetInputInfo(0x00010003);
3161         SetDisplay(0x00010003);
3162         showPage = 1;
3163         SetBtnDisplay(showPage);
3164     }break;
3165     case 1:
3166         //1页的F4,是L
3167         OnBnClickedBtnL();
3168         break;
3169     default:
3170         break;
3171     }
df0321 3172 }
4ed7fc 3173
df0321 3174 void CMyFormInputShow::OnBnClickedBtnTmCt()
Q 3175 {
4ed7fc 3176     //判断按钮在第几页,触发不同的操作
Z 3177     switch (showPage)
3178     {
3179     case 0:
3180         //0页的F5,是tm/ct
3181     {
3182         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3183         p1->GetInputInfo(0x0001000b);
3184         SetDisplay(0x0001000b);
3185         showPage = 5;
3186         SetBtnDisplay(showPage);
3187     }break;
3188     case 1:
3189         //1页的F5,是P
3190         OnBnClickedBtnP();
3191         break;
3192     default:
3193         break;
3194     }
df0321 3195 }
4ed7fc 3196
df0321 3197 void CMyFormInputShow::OnBnClickedBtnFun()
Q 3198 {
4ed7fc 3199     //判断按钮在第几页,触发不同的操作
Z 3200     switch (showPage)
3201     {
3202     case 0:
3203         //0页的F6,是Func
3204     {
3205         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3206         //p1->GetInputInfo(_T("Fun "));
3207     }break;
3208     case 1:
3209         //1页的F6,是比较
3210         OnBnClickedBtnCompare();
3211         break;
3212     default:
3213         break;
3214     }
df0321 3215 }
ad1b4b 3216
Z 3217 /// <summary>
3218 /// 画横线
3219 /// </summary>
df0321 3220 void CMyFormInputShow::OnBnClickedBtnHLine()
Q 3221 {
4ed7fc 3222     //判断按钮在第几页,触发不同的操作
Z 3223     switch (showPage)
3224     {
3225     case 0:
3226         //0页的F1,是横线
3227     {
3228         CString s1;
3229         CString strName;
df0321 3230
4ed7fc 3231         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
Z 3232         CMDIChildWnd* pChild = (CMDIChildWnd*)p1->GetActiveFrame();
3233         CView* p2 = (CView*)pChild->GetActiveView();
3234         if (p2 == NULL) return;
3235         CMTerm1View* p3 = (CMTerm1View*)p2;
ad1b4b 3236
4ed7fc 3237         focusCell.nType = 1;
Z 3238         //
3239         p3->SetCellToView(focusCell);
3240         //插入完成后,设置按钮返回第一页
3241         showPage = 0;
3242         SetBtnDisplay(showPage);
3243         DbgLog(focusCell.sCoilName);
3244     }break;
3245     case 1:
3246         //1页的F7,无操作
3247         break;
3248     default:
3249         break;
3250     }
df0321 3251 }
ad1b4b 3252
4ed7fc 3253 void CMyFormInputShow::OnBnClickedBtnNot()
df0321 3254 {
4ed7fc 3255     //判断按钮在第几页,触发不同的操作
Z 3256     switch (showPage)
3257     {
3258     case 0:
3259         //0页的F8,是not
3260     {
3261         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3262         p1->GetInputInfo(0x00010013);
df0321 3263
4ed7fc 3264         SetDisplay(0x00010013);
Z 3265         showPage = 1;
3266         SetBtnDisplay(showPage);
3267     }break;
3268     case 1:
3269         //1页的F8,是not
3270     {
3271         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3272         p1->GetInputInfo(0x00010013);
df0321 3273
4ed7fc 3274         SetDisplay(0x00010013);
Z 3275         showPage = 1;
3276         SetBtnDisplay(showPage);
3277     }break;
3278     default:
3279         break;
3280     }
df0321 3281 }
4ed7fc 3282
df0321 3283 void CMyFormInputShow::OnBnClickedBtnIndex()
Q 3284 {
4ed7fc 3285     //判断按钮在第几页,触发不同的操作
Z 3286     switch (showPage)
3287     {
3288     case 0:
3289         //0页的F9,是Index
3290     {
3291         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3292         //p1->GetInputInfo(_T("Index "));
3293         showPage = 4;
3294         SetBtnDisplay(showPage);
df0321 3295
4ed7fc 3296     }break;
Z 3297     case 1:
3298         //1页的F9,是Index
3299     {
3300         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3301         //p1->GetInputInfo(_T("Index "));
3302         showPage = 4;
3303         SetBtnDisplay(showPage);
3304
3305     }break;
3306     default:
3307         break;
3308     }
df0321 3309 }
Q 3310 void CMyFormInputShow::OnBnClickedBtnMc()
3311 {
4ed7fc 3312     //判断按钮在第几页,触发不同的操作
Z 3313     switch (showPage)
3314     {
3315     case 0:
3316         //0页的F11,是MC
3317     {
3318         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3319         p1->GetInputInfo(0x00010004);
df0321 3320
4ed7fc 3321         SetDisplay(0x00010004);
Z 3322     }break;
3323     case 1:
3324         //1页的F11,是No.清除(33409,还没定义!
df0321 3325
4ed7fc 3326         break;
Z 3327     default:
3328         break;
3329     }
df0321 3330 }
Q 3331 void CMyFormInputShow::OnBnClickedBtnMce()
3332 {
4ed7fc 3333     //判断按钮在第几页,触发不同的操作
Z 3334     switch (showPage)
3335     {
3336     case 0:
3337         //0页的F12,是MCE
3338     {
3339         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3340         p1->GetInputInfo(0x00010005);
df0321 3341
4ed7fc 3342         SetDisplay(0x00010005);
Z 3343     }break;
3344     case 1:
3345         //1页的F12,无操作
3346         break;
3347     default:
3348         break;
3349     }
df0321 3350 }
4ed7fc 3351
df0321 3352 void CMyFormInputShow::OnBnClickedBtnSet()
Q 3353 {
4ed7fc 3354     switch (showPage)
Z 3355     {
3356         case 0:
3357         {
3358             CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3359             p1->GetInputInfo(0x00010006);
df0321 3360
4ed7fc 3361             SetDisplay(0x00010006);
Z 3362             showPage = 1;
3363             SetBtnDisplay(showPage);
3364         }
3365         break;
3366         case 1:
3367         {
3368             OnBnClickedBtnT();
3369         }
3370         break;
3371         default:
3372         break;
3373     }
df0321 3374 }
Q 3375 void CMyFormInputShow::OnBnClickedBtnReset()
3376 {
4ed7fc 3377     switch (showPage)
Z 3378     {
3379     case 0:
3380     {
3381         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3382         p1->GetInputInfo(0x00010007);
df0321 3383
4ed7fc 3384         SetDisplay(0x00010007);
Z 3385         showPage = 1;
3386         SetBtnDisplay(showPage);
3387     }
3388     break;
3389     case 1:
3390     {
3391         OnBnClickedBtnC();
3392     }
3393     break;
3394     default:
3395         break;
3396     }
df0321 3397 }
Q 3398 void CMyFormInputShow::OnBnClickedBtnDf()
3399 {
4ed7fc 3400     switch (showPage)
Z 3401     {
3402     case 0:
3403     {
3404         CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3405         p1->GetInputInfo(0x00010008);
df0321 3406
4ed7fc 3407         SetDisplay(0x00010008);
Z 3408         //p1->GetInputInfo(_T("(DF)"));
3409     }
3410     break;
3411     case 1:
3412     {
3413         OnBnClickedBtnE();
3414     }
3415     break;
3416     default:
3417         break;
3418     }
df0321 3419
Q 3420 }
3421 void CMyFormInputShow::OnBnClickedBtnEnd()
3422 {
3423     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3424     p1->GetInputInfo(0x0001000A);
3425
3426     SetDisplay(0x0001000A);
3427 }
3428 void CMyFormInputShow::OnBnClickedBtnCompare()
3429 {
3430     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3431     //p1->GetInputInfo(_T("Compare"));
4ed7fc 3432     showPage = 2;
Z 3433     SetBtnDisplay(showPage);
df0321 3434 }
Q 3435 void CMyFormInputShow::OnBnClickedBtnPFun()
3436 {
3437     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3438     //p1->GetInputInfo(_T("PFun"));
3439 }
3440 void CMyFormInputShow::OnBnClickedBtnUpDown()
3441 {
3442     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3443     p1->GetInputInfo(0x00010010);
3444
3445     SetDisplay(0x00010010);
4ed7fc 3446     showPage = 1;
Z 3447     SetBtnDisplay(showPage);
df0321 3448 }
Q 3449 void CMyFormInputShow::OnBnClickedBtnBit()
3450 {
3451     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3452     //p1->GetInputInfo(_T("Bit"));
4ed7fc 3453     showPage = 1;
Z 3454     SetBtnDisplay(showPage);
df0321 3455 }
Q 3456 void CMyFormInputShow::OnBnClickedBtnWord()
3457 {
3458     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3459     //p1->GetInputInfo(_T("Word"));
4ed7fc 3460     showPage = 3;
Z 3461     SetBtnDisplay(showPage);
df0321 3462 }
Q 3463 void CMyFormInputShow::OnBnClickedBtnInc1()
3464 {
3465     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3466     //p1->GetInputInfo(_T("Inc1"));
3467 }
3468 void CMyFormInputShow::OnBnClickedBtnInc2()
3469 {
3470     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3471     //p1->GetInputInfo(_T("Inc2"));
3472 }
3473
3474
3475 void CMyFormInputShow::OnBnClickedBtnPgConvert()
3476 {
3477     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3478     //p1->GetInputInfo(_T("PgConvert"));
3479 }
3480 void CMyFormInputShow::OnBnClickedBtnOnline()
3481 {
3482     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3483     //p1->GetInputInfo(_T("Online"));
3484 }
3485 void CMyFormInputShow::OnBnClickedBtnOffline()
3486 {
3487     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3488     //p1->GetInputInfo(_T("Offline"));
3489 }
3490 void CMyFormInputShow::OnBnClickedBtnClose()
3491 {
3492     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3493     //p1->GetInputInfo(_T("Close"));
3494 }
3495 void CMyFormInputShow::OnBnClickedBtnFind()
3496 {
3497     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3498     //p1->GetInputInfo(_T("Find"));
3499 }
3500 void CMyFormInputShow::OnBnClickedBtnNextWin()
3501 {
3502     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3503     //p1->GetInputInfo(_T("NextWin"));
3504 }
3505 void CMyFormInputShow::OnBnClickedBtnMonitor()
3506 {
3507     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3508     //p1->GetInputInfo(_T("Monitor"));
3509 }
3510 void CMyFormInputShow::OnBnClickedBtnStatus()
3511 {
3512     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3513     //p1->GetInputInfo(_T("Status"));
3514 }
3515 void CMyFormInputShow::OnBnClickedBtnRunProg()
3516 {
3517     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3518     //p1->GetInputInfo(_T("RunProg"));
3519 }
3520 void CMyFormInputShow::OnBnClickedBtnPlcRead()
3521 {
3522     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3523     //p1->GetInputInfo(_T("PlcRead"));
3524 }
3525 void CMyFormInputShow::OnBnClickedBtnPlcWrite()
3526 {
3527     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3528     //p1->GetInputInfo(_T("PlcWrite"));
3529 }
3530
3531
3532 void CMyFormInputShow::OnBnClickedBtnX()
3533 {
3534     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3535     p1->GetInputInfo(0x00020001);
3536     SetDisplay(0x00020001);
3537 }
3538 void CMyFormInputShow::OnBnClickedBtnY()
3539 {
3540     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3541     p1->GetInputInfo(0x00020002);
3542
3543     SetDisplay(0x00020002);
3544 }
3545 void CMyFormInputShow::OnBnClickedBtnR()
3546 {
3547     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3548     p1->GetInputInfo(0x00020003);
3549
3550     SetDisplay(0x00020003);
3551 }
3552 void CMyFormInputShow::OnBnClickedBtnL()
3553 {
3554     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3555     p1->GetInputInfo(0x00020004);
3556
3557     SetDisplay(0x00020004);
3558 }
3559 void CMyFormInputShow::OnBnClickedBtnP()
3560 {
3561     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3562     p1->GetInputInfo(0x00020005);
3563
3564     SetDisplay(0x00020005);
3565 }
3566
3567 void CMyFormInputShow::OnBnClickedBtnCompare1()
3568 {
4ed7fc 3569     showPage = 2;
Z 3570     SetBtnDisplay(showPage);
df0321 3571 }
Q 3572 void CMyFormInputShow::OnBnClickedBtnT()
3573 {
3574
3575     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3576     p1->GetInputInfo(0x00020006);
3577
3578     SetDisplay(0x00020006);
3579 }
3580 void CMyFormInputShow::OnBnClickedBtnC()
3581 {
3582
3583     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3584     p1->GetInputInfo(0x00020007);
3585
3586     SetDisplay(0x00020007);
3587 }
3588 void CMyFormInputShow::OnBnClickedBtnE()
3589 {
3590
3591     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3592     p1->GetInputInfo(0x00020008);
3593
3594     SetDisplay(0x00020008);
3595 }
3596
3597
3598 void CMyFormInputShow::OnBnClickedBtnTmx()
3599 {
3600     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3601     p1->GetInputInfo(0x00020009);
3602
3603     SetDisplay(0x00020009);
4ed7fc 3604     showPage = 0;
Z 3605     SetBtnDisplay(showPage);
df0321 3606 }
Q 3607 void CMyFormInputShow::OnBnClickedBtnTmy()
3608 {
3609     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3610     p1->GetInputInfo(0x0002000A);
3611
3612     SetDisplay(0x0002000A);
4ed7fc 3613     showPage = 1;
Z 3614     SetBtnDisplay(showPage);
df0321 3615 }
Q 3616 void CMyFormInputShow::OnBnClickedBtnTmr()
3617 {
3618     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3619     p1->GetInputInfo(0x0002000B);
3620
3621     SetDisplay(0x0002000B);
4ed7fc 3622     showPage = 0;
Z 3623     SetBtnDisplay(showPage);
df0321 3624 }
Q 3625 void CMyFormInputShow::OnBnClickedBtnTml()
3626 {
3627     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3628     p1->GetInputInfo(0x0002000C);
3629
3630     SetDisplay(0x0002000C);
4ed7fc 3631     showPage = 0;
Z 3632     SetBtnDisplay(showPage);
df0321 3633 }
Q 3634 void CMyFormInputShow::OnBnClickedBtnCt()
3635 {
3636     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3637     p1->GetInputInfo(0x0002000D);
3638
3639     SetDisplay(0x0002000D);
4ed7fc 3640     showPage = 0;
Z 3641     SetBtnDisplay(showPage);
df0321 3642 }
Q 3643
3644
3645 void CMyFormInputShow::OnBnClickedBtnD()
3646 {
3647     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3648     p1->GetInputInfo(0x00010015);
3649
3650     SetDisplay(0x00010015);
3651
3652 }
3653 void CMyFormInputShow::OnBnClickedBtnF()
3654 {
3655     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3656     p1->GetInputInfo(0x00010016);
3657
3658     SetDisplay(0x00010016);
3659
3660 }
3661 void CMyFormInputShow::OnBnClickedBtnNEQ()
3662 {
3663     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3664     p1->GetInputInfo(0x0002000D);
3665
3666     SetDisplay(0x0002000D);
3667 }
3668
3669 void CMyFormInputShow::OnBnClickedBtnGT()
3670 {
3671     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3672     p1->GetInputInfo(0x0002000E);
3673
3674     SetDisplay(0x0002000E);
3675 }
3676 void CMyFormInputShow::OnBnClickedBtnLT()
3677 {
3678     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3679     p1->GetInputInfo(0x0002000F);
3680
3681     SetDisplay(0x0002000F);
3682 }
3683
3684
3685 void CMyFormInputShow::OnBtn0()
3686 {
3687     // TODO: 在此添加命令处理程序代码
3688     SetDisplay(0x00030000);
3689 }
3690 void CMyFormInputShow::OnBtn1()
3691 {
3692     // TODO: 在此添加命令处理程序代码
3693     SetDisplay(0x00030001);
3694 }
3695 void CMyFormInputShow::OnBtn2()
3696 {
3697     // TODO: 在此添加命令处理程序代码
3698     SetDisplay(0x00030002);
3699 }
3700 void CMyFormInputShow::OnBtn3()
3701 {
3702     // TODO: 在此添加命令处理程序代码
3703     SetDisplay(0x00030003);
3704 }
3705 void CMyFormInputShow::OnBtn4()
3706 {
3707     // TODO: 在此添加命令处理程序代码
3708     SetDisplay(0x00030004);
3709 }
3710 void CMyFormInputShow::OnBtn5()
3711 {
3712     // TODO: 在此添加命令处理程序代码
3713     SetDisplay(0x00030005);
3714 }
3715 void CMyFormInputShow::OnBtn6()
3716 {
3717     // TODO: 在此添加命令处理程序代码
3718     SetDisplay(0x00030006);
3719 }
3720 void CMyFormInputShow::OnBtn7()
3721 {
3722     // TODO: 在此添加命令处理程序代码
3723     SetDisplay(0x00030007);
3724 }
3725 void CMyFormInputShow::OnBtn8()
3726 {
3727     // TODO: 在此添加命令处理程序代码
3728     SetDisplay(0x00030008);
3729 }
3730 void CMyFormInputShow::OnBtn9()
3731 {
3732     // TODO: 在此添加命令处理程序代码
3733     SetDisplay(0x00030009);
3734 }
3735 void CMyFormInputShow::OnBtnA()
3736 {
3737     // TODO: 在此添加命令处理程序代码
3738     SetDisplay(0x0003000A);
3739 }
3740 void CMyFormInputShow::OnBtnB()
3741 {
3742     // TODO: 在此添加命令处理程序代码
3743     SetDisplay(0x0003000B);
3744 }
3745 void CMyFormInputShow::OnBtnC()
3746 {
3747     // TODO: 在此添加命令处理程序代码
3748     SetDisplay(0x0003000C);
3749 }
3750
3751 void CMyFormInputShow::OnBtnD()
3752 {
3753     // TODO: 在此添加命令处理程序代码
3754     SetDisplay(0x0003000D);
3755 }
3756 void CMyFormInputShow::OnBtnE()
3757 {
3758     // TODO: 在此添加命令处理程序代码
3759     SetDisplay(0x0003000E);
3760 }
3761 void CMyFormInputShow::OnBtnF()
3762 {
3763     // TODO: 在此添加命令处理程序代码
3764
3765     SetDisplay(0x0003000F);
3766 }
3767 void CMyFormInputShow::OnBtnMinus()
3768 {
3769     // TODO: 在此添加命令处理程序代码
3770     //m_wndDlgBar_InputShow.SetDisplay(_T("-"));
3771 }
3772 void CMyFormInputShow::OnBtnDot()
3773 {
3774     // TODO: 在此添加命令处理程序代码
3775     //m_wndDlgBar_InputShow.SetDisplay(_T("."));
3776 }
3777
3778
3779 void CMyFormInputShow::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
3780 {
3781     // TODO: 在此添加消息处理程序代码和/或调用默认值
3782     if (nChar == 13) { OnBtnRet(); }
3783     CFormView::OnChar(nChar, nRepCnt, nFlags);
3784 }
0200a3 3785
Q 3786
3787 void CMyFormInputShow::OnKeyX()
3788 {
3789     // TODO: 在此添加命令处理程序代码
3790     CMainFrame* p1 = (CMainFrame*)AfxGetMainWnd();
3791     p1->GetInputInfo(0x00020001);
3792
3793     SetDisplay(0x00020001);
3794 }