From 4ed7fc8447d202e21ef9907e2aac63ef6fcbf301 Mon Sep 17 00:00:00 2001
From: zxd <zxdvslxy@gmail.com>
Date: 星期二, 17 十月 2023 12:33:23 +0800
Subject: [PATCH] 提交图码转换部分修改: 1.基本图形转换 2.ANS\ORS\PSHS\POPS命令的处理 3.重构了转换方法,命名为CMTerm1View::ScanLDSCells2();同时将翻译单独提出为方法CMTerm1View::Translate2Prog() 4.快捷键的添加绑定 5.其他相关方法修改,Insert,Delete,FocusChg…… 6.其他关联修改

---
 MTerm2/HvSerialPort.h |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/MTerm2/HvSerialPort.h b/MTerm2/HvSerialPort.h
index 4a33ff3..c515eb5 100644
--- a/MTerm2/HvSerialPort.h
+++ b/MTerm2/HvSerialPort.h
@@ -30,12 +30,14 @@
 	volatile bool MyThreadProc1Running;
 
 	volatile int RecvBufDataLen = 0;
-	unsigned char * RecvBuf[2048];
+	unsigned char * RecvBuf[4096];
+	volatile int RecvBufPos = 0;
 
+	unsigned char * RecvBuf2[4096];
 	DWORD m_dwError;
 	CString m_strResult;
 	int m_nCountToTry = 5;
-	int m_nCountToWait = 0;
+	int m_nCountToWait = 1;
 
 	volatile	DWORD TotalSendBytes, TotalRecvBytes;
 	volatile	DWORD SendBytes, RecvBytes;
@@ -74,10 +76,6 @@
 
 public:
 	int SetParams(int nPortNum, int BaudRate, CString Settings);
-	int PurgeComBuf()
-	{
-		return	PurgeComm(hCom1, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_TXCLEAR);
-	}
 
 	int Open();
 	int ClearStatData();
@@ -86,8 +84,19 @@
 	int Close();
 	int SetRecvDoneCallBack(pRecvDone);
 
+	int ClearBuf();
+
 	int Send(void * pBuf, int len1);
 	int Recv(void * pBuf, int len1);
+	int RecvFromCom(void * pBuf, int len1);
+	int RecvFromBuf(void * pBuf, int len1);
+
+protected:
+	int PurgeComBuf()
+	{
+		return	PurgeComm(hCom1, PURGE_TXABORT | PURGE_RXABORT | PURGE_TXCLEAR | PURGE_TXCLEAR);
+	}
+
 
 	static UINT MyJumper1(LPVOID pParam);
 	DWORD WINAPI MyThreadProc1(LPVOID pParam);

--
Gitblit v1.9.1