2个文件已删除
21个文件已修改
24 文件已重命名
29个文件已添加
| | |
| | | <FunctionLevelLinking>true</FunctionLevelLinking>
|
| | | <IntrinsicFunctions>true</IntrinsicFunctions>
|
| | | <SDLCheck>true</SDLCheck>
|
| | | <PreprocessorDefinitions>_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
| | | <PreprocessorDefinitions>KLINK_EXPORTS;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
| | | <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
| | | </ClCompile>
|
| | | <Link>
|
| | |
| | | ST R18
|
| | | ST SR13
|
| | | PSHS
|
| | | MV K20 DT1
|
| | | MV K51 DT11
|
| | | MV K20 DT12
|
| | | MV K10 DT0
|
| | | MV K20 DT1
|
| | | RDS
|
| | | MV K5 DT11
|
| | | MV K50 DT12
|
| | | MV K20 DT13
|
| | | POPS
|
| | | MV K50 DT13
|
| | | MV K20 DT14
|
| | | MV K5 DT14
|
| | | MV K50 DT15
|
| | | MV K20 DT16
|
| | | SET R0
|
| | | ST R0
|
| | | TMX 1 DT1
|
| | | DF
|
| | | SET R10
|
| | | ST R0
|
| | | AN R1
|
| | | AN R2
|
| | | AN R3
|
| | | AN R4
|
| | | AN R5
|
| | | AN R9
|
| | | AN R10
|
| | | AN R11
|
| | | AN R15
|
| | | AN R16
|
| | | ST X0
|
| | | DF
|
| | | SET R10
|
| | |
| | | AN R51
|
| | | AN R52
|
| | | AN R53
|
| | | ADD3 DT21 DT31 DT32
|
| | | ADD3 DT22 DT32 DT33
|
| | | ST R10
|
| | | AN R54
|
| | | AN R55
|
| | | AN R56
|
| | | ADD3 DT25 DT35 DT36
|
| | | ADD3 DT23 DT33 DT34
|
| | | ST R10
|
| | | DF
|
| | |
| | | AN/ R12
|
| | | AN/ R13
|
| | | AN/ R14
|
| | | AN/ R15
|
| | | AN/ R16
|
| | | SET R14
|
| | | ST R10
|
| | | PSHS
|
| | | AN R11
|
| | | TMX 11 DT11
|
| | | RESET R11
|
| | | SET R12
|
| | | RDS
|
| | | AN R12
|
| | | DF
|
| | | SET R51
|
| | | RESET R52
|
| | | RESET R53
|
| | | RESET R54
|
| | | RESET R55
|
| | | SET R56
|
| | | RDS
|
| | | AN R11
|
| | | PSHS
|
| | | TMX 11 DT11
|
| | | RESET R11
|
| | | SET R12
|
| | | POPS
|
| | | SUB3 SV11 EV11 DT21
|
| | | AN<= DT21 K30
|
| | | PSHS
|
| | | DIV DT21 K10 DT31
|
| | | RDS
|
| | | AN>= DT32 K5
|
| | | SET R51
|
| | | POPS
|
| | | AN< DT32 K5
|
| | | RESET R51
|
| | | RDS
|
| | | AN R12
|
| | | DF
|
| | | RESET R51
|
| | | SET R52
|
| | | RDS
|
| | | AN R12
|
| | | PSHS
|
| | | TMX 12 DT12
|
| | | RESET R12
|
| | | SET R13
|
| | | POPS
|
| | | AN R12
|
| | | SUB3 SV12 EV12 DT22
|
| | | AN<= DT22 K30
|
| | | PSHS
|
| | | DIV DT22 K10 DT32
|
| | | RDS
|
| | | AN>= DT33 K5
|
| | | RESET R51
|
| | | POPS
|
| | | AN< DT33 K5
|
| | | SET R51
|
| | | RDS
|
| | | AN R13
|
| | | DF
|
| | | RESET R51
|
| | | SET R52
|
| | | RDS
|
| | | AN R13
|
| | | TMX 13 DT13
|
| | | RESET R52
|
| | | SET R53
|
| | | RESET R13
|
| | | SET R14
|
| | | POPS
|
| | | AN R13
|
| | | OUT R52
|
| | | ST R10
|
| | | PSHS
|
| | | AN R13
|
| | | AN R14
|
| | | TMX 14 DT14
|
| | | RESET R14
|
| | | SET R15
|
| | | RDS
|
| | | AN R15
|
| | | DF
|
| | | RESET R52
|
| | | SET R53
|
| | | SET R54
|
| | | RESET R56
|
| | | RDS
|
| | | AN R13
|
| | | TMX 13 DT13
|
| | | RESET R13
|
| | | SET R14
|
| | | AN R15
|
| | | TMX 15 DT15
|
| | | RESET R15
|
| | | SET R16
|
| | | RDS
|
| | | AN R13
|
| | | SUB3 SV13 EV13 DT23
|
| | | AN<= DT23 K30
|
| | | AN R15
|
| | | SUB3 SV15 EV15 DT25
|
| | | AN<= DT25 K30
|
| | | PSHS
|
| | | DIV DT23 K10 DT33
|
| | | DIV DT25 K10 DT35
|
| | | RDS
|
| | | AN>= DT34 K5
|
| | | AN>= DT36 K5
|
| | | SET R54
|
| | | POPS
|
| | | AN< DT34 K5
|
| | | AN< DT36 K5
|
| | | RESET R54
|
| | | RDS
|
| | | AN R14
|
| | | AN R16
|
| | | DF
|
| | | RESET R54
|
| | | SET R55
|
| | | POPS
|
| | | AN R14
|
| | | TMX 14 DT14
|
| | | RESET R14
|
| | | AN R16
|
| | | TMX 16 DT16
|
| | | RESET R55
|
| | | SET R56
|
| | | RESET R16
|
| | | SET R11
|
| | | ST SR1
|
| | | PSHS
|
| | |
| | | R54 绿灯2
|
| | | R55 黄灯2
|
| | | R56 红灯2
|
| | | DT11 绿灯1时间
|
| | | DT12 黄灯1时间
|
| | | DT13 绿灯2时间
|
| | | DT14 黄灯2时间
|
| | | DT21 绿灯1剩余时间
|
| | | DT23 绿灯2剩余时间
|
| | | DT31 剩余秒数
|
| | | DT32 余数
|
| | | DT33 绿灯2剩余秒数
|
| | | DT34 绿灯2 秒余数
|
| | | DT11 绿灯1延迟时间
|
| | | DT12 绿灯1时间
|
| | | DT13 黄灯1时间
|
| | | DT14 绿灯2延迟时间
|
| | | DT32 剩余秒数
|
| | | DT33 余数
|
| | | DT15 绿灯2时间
|
| | | DT16 黄灯2时间
|
| | | DT25 绿灯2剩余时间
|
| | | DT35 绿灯2剩余秒数
|
| | | DT36 绿灯2 秒余数
|
| | | DT22 绿灯1剩余时间
|
| | | [MONCOILLIST]
|
| | | [MONDATALIST]
|
| | | ST]
|
| | | ]
|
| | | T14 黄灯2时间
|
| | | DT21 绿灯1剩余时间
|
| | | DT23 绿灯2剩余时间
|
| | | DT31 剩余秒数
|
| | | DT32 余数
|
| | | DT33 绿灯2剩余秒数
|
| | | DT34 绿灯2 秒余数
|
| | | [MONCOILLIST]
|
| | | [MONDATALIST]
|
| | | TALIST]
|
New file |
| | |
| | | [SYSCFG]
|
| | | [PROG]
|
| | | ST R0
|
| | | AN R1
|
| | | ST R2
|
| | | AN R3
|
| | | ORS
|
| | | ST R4
|
| | | AN R5
|
| | | ST R6
|
| | | AN R7
|
| | | ORS
|
| | | ANS
|
| | | ST R8
|
| | | AN R9
|
| | | AN R10
|
| | | AN R11
|
| | | ORS
|
| | | PSHS
|
| | | AN R70
|
| | | SET R71
|
| | | POPS
|
| | | SET R72
|
| | | SET R73
|
| | | [COMMENT]
|
| | | SR0 OFF
|
| | | SR1 ON
|
| | | SR13 初始脉冲
|
| | | R0 R0的注释
|
| | | R1 R1的注释
|
| | | R2 R2的注释
|
| | | R4 R4的注释
|
| | | R6 R6的注释
|
| | | R8 R8的注释
|
| | | R9 R9的注释
|
| | | R10 R10的注释
|
| | | R11 R11的注释
|
| | | R12 R12的注释
|
| | | R13 R13的注释
|
| | | R14 R14的注释
|
| | | R15 R15的注释
|
| | | R16 R16的注释
|
| | | R17 R17的注释
|
| | | X00 开始
|
| | | X01 ֹͣ
|
| | | X02 X02的注释
|
| | | X03 X03的注释
|
| | | X04 X04的注释
|
| | | X05 X05的注释
|
| | | X06 X06的注释
|
| | | X07 X07的注释
|
| | | X08 X08的注释
|
| | | X09 X09的注释
|
| | | Y00 Y00的注释
|
| | | Y01 Y01的注释
|
| | | Y02 绿灯1
|
| | | Y03 黄灯1
|
| | | Y04 红灯1
|
| | | Y05 绿灯2
|
| | | Y06 黄灯2
|
| | | Y07 红灯2
|
| | | Y08 Y08的注释
|
| | | Y09 Y09的注释
|
| | | DT0 DT0的注释
|
| | | DT1 DT1的注释
|
| | | DT2 DT2的注释
|
| | | DT3 DT3的注释
|
| | | DT4 DT4的注释
|
| | | DT5 DT5的注释
|
| | | DT6 DT6的注释
|
| | | DT7 DT7的注释
|
| | | DT8 DT8的注释
|
| | | DT9 DT9的注释
|
| | | R5 R5的注释
|
| | | SR2 SR2
|
| | | SR3 SR3
|
| | | SR4 SR4
|
| | | R51 绿灯1
|
| | | R52 黄灯1
|
| | | R53 红灯1
|
| | | R54 绿灯2
|
| | | R55 黄灯2
|
| | | R56 红灯2
|
| | | DT11 绿灯1延迟时间
|
| | | DT12 绿灯1时间
|
| | | DT13 黄灯1时间
|
| | | DT14 绿灯2延迟时间
|
| | | DT32 剩余秒数
|
| | | DT33 余数
|
| | | DT15 绿灯2时间
|
| | | DT16 黄灯2时间
|
| | | DT25 绿灯2剩余时间
|
| | | DT35 绿灯2剩余秒数
|
| | | DT36 绿灯2 秒余数
|
| | | DT22 绿灯1剩余时间
|
| | | [MONCOILLIST]
|
| | | [MONDATALIST]
|
File was renamed from MTerm2/CAnsiParser.cpp |
| | |
| | | #include "pch.h"
|
| | | #include "CAnsiParser.h"
|
| | | #include "AnsiParser.h"
|
| | |
|
| | | static inline int AnsiToT(CStringA & Src, CString & Dest)
|
| | | {
|
File was renamed from MTerm2/CDataParser1.cpp |
| | |
| | | #include "pch.h"
|
| | | #include "CDataParser1.h"
|
| | | #include "DataParser1.h"
|
| | |
|
| | | CDataParser1::CDataParser1()
|
| | | {
|
File was renamed from MTerm2/CDialogCoilMon.cpp |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "CDialogCoilMon.h"
|
| | | #include "DialogCoilMon.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
File was renamed from MTerm2/CDialogCommSet1.cpp |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "CDialogCommSet1.h"
|
| | | #include "DialogCommSet1.h"
|
| | | #include "afxdialogex.h"
|
| | | #include <devguid.h>
|
| | | #include <SetupAPI.h>
|
File was renamed from MTerm2/CDialogDataMon.cpp |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "CDialogDataMon.h"
|
| | | #include "DialogDataMon.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
File was renamed from MTerm2/CDialogDateTime.cpp |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "CDialogDateTime.h"
|
| | | #include "DialogDateTime.h"
|
| | | #include "afxdialogex.h"
|
| | | #include "KLink.h"
|
| | | #include "MTerm2Doc.h"
|
File was renamed from MTerm2/CDialogEventLog.cpp |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "CDialogEventLog.h"
|
| | | #include "DialogEventLog.h"
|
| | | #include "afxdialogex.h"
|
| | | #include "KLinkDefine.h"
|
| | | #include "KLink.h"
|
New file |
| | |
| | | // DialogFactCfg.cpp: 实现文件
|
| | | //
|
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "DialogFactCfg.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | | #include "MTerm2Doc.h"
|
| | |
|
| | | // CDialogFactCfg 对话框
|
| | |
|
| | | IMPLEMENT_DYNAMIC(CDialogFactCfg, CDialogEx)
|
| | |
|
| | | CDialogFactCfg::CDialogFactCfg(CWnd* pParent /*=nullptr*/)
|
| | | : CDialogEx(IDD_DIALOG_FACT_CFG, pParent)
|
| | | {
|
| | | InitDataItems();
|
| | | }
|
| | |
|
| | | CDialogFactCfg::~CDialogFactCfg()
|
| | | {
|
| | | }
|
| | |
|
| | | void CDialogFactCfg::DoDataExchange(CDataExchange* pDX)
|
| | | {
|
| | | CDialogEx::DoDataExchange(pDX);
|
| | | }
|
| | |
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CDialogFactCfg, CDialogEx)
|
| | | ON_BN_CLICKED(IDC_BUTTON_CONN, &CDialogFactCfg::OnBnClickedButtonConn)
|
| | | ON_BN_CLICKED(IDC_BUTTON_DISCONN, &CDialogFactCfg::OnBnClickedButtonDisconn)
|
| | | ON_BN_CLICKED(IDC_BUTTON_READDATA, &CDialogFactCfg::OnBnClickedButtonReaddata)
|
| | | ON_BN_CLICKED(IDC_BUTTON_WRITEDATA, &CDialogFactCfg::OnBnClickedButtonWritedata)
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | | // CDialogFactCfg 消息处理程序
|
| | | int CDialogFactCfg::AddDataItem(int nOffset, int nSize, int nType, CString sName)
|
| | | {
|
| | | FactoryDataItems[nFactoryDataItemsCount] = { nOffset,nSize,nType,sName };
|
| | | nFactoryDataItemsCount++;
|
| | | return 0;
|
| | | }
|
| | |
|
| | | int CDialogFactCfg::InitDataItems()
|
| | | {
|
| | | AddDataItem(0, 2, typeBIN, _T("开始标志"));
|
| | | AddDataItem(2, 2, typeINT, _T("序号"));
|
| | | AddDataItem(4, 2, typeHEX, _T("ModelNo"));
|
| | | AddDataItem(6, 2, typeHEX, _T("ModelVer"));
|
| | | AddDataItem(8, 4, typeUINT, _T("nLotNo"));
|
| | | AddDataItem(12, 4, typeDATETIME, _T("nProductDate"));
|
| | | AddDataItem(16, 4, typeHEX, _T("nSN1"));
|
| | | AddDataItem(20, 4, typeHEX, _T("nProtocalVer"));
|
| | | AddDataItem(24, 4, typeHEX, _T("nDefaultFuncr"));
|
| | | AddDataItem(28, 16, typeString, _T("sModelStr"));
|
| | | AddDataItem(44, 16, typeString, _T("sLot_No"));
|
| | | AddDataItem(60, 16, typeString, _T("sSNStr"));
|
| | | AddDataItem(76, 2, typeHEX, _T("CRC1"));
|
| | | AddDataItem(78, 2, typeHEX, _T("EndSign"));
|
| | | return 0;
|
| | | }
|
| | |
|
| | | int CDialogFactCfg::FindIdByName(CString sName)
|
| | | {
|
| | | for (int i = 0; i < nFactoryDataItemsCount; i++) {
|
| | | if (FactoryDataItems[i].sName == sName) {
|
| | | return i;
|
| | | }
|
| | | }
|
| | | return -1;
|
| | | }
|
| | |
|
| | | int CDialogFactCfg::GetDataByOffset(void * pDataBlock, int nOffset)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | int CDialogFactCfg::GetDataByName(void * pDataBlock, CString sName)
|
| | | {
|
| | | return 0;
|
| | | }
|
| | | CString CDialogFactCfg::GetDataStrByName(void * pDataBlock, CString sName)
|
| | | {
|
| | | UCHAR * pBuf2 = (UCHAR *)pDataBlock;
|
| | | CString s1;
|
| | | UCHAR buf3[256];
|
| | | CString s3;
|
| | | int nIdx = FindIdByName(sName);
|
| | | if (nIdx >= 0)
|
| | | {
|
| | | CTime ctime1;
|
| | | int nType = FactoryDataItems[nIdx].nType;
|
| | | int nSize = FactoryDataItems[nIdx].nSize;
|
| | | int nOffset = FactoryDataItems[nIdx].nOffset;
|
| | | int nValue;
|
| | | UINT uValue;
|
| | | switch (nType)
|
| | | {
|
| | | case typeINT:
|
| | | if (nSize == 1) {
|
| | | nValue = *((char *)(pBuf2 + nOffset));
|
| | | }
|
| | | else if (nSize == 2) {
|
| | | nValue = *(short *)(pBuf2 + nOffset);
|
| | | }
|
| | | else if (nSize == 3) {
|
| | |
|
| | | }
|
| | | else if (nSize == 4) {
|
| | | nValue = *(int *)(pBuf2 + nOffset);
|
| | | }
|
| | | s1.Format(_T("%d"), nValue);
|
| | | break;
|
| | | case typeUINT:
|
| | | if (nSize == 1) {
|
| | | uValue = *((UCHAR *)(pBuf2 + nOffset));
|
| | | }
|
| | | else if (nSize == 2) {
|
| | | uValue = *(USHORT *)(pBuf2 + nOffset);
|
| | | }
|
| | | else if (nSize == 3) {
|
| | |
|
| | | }
|
| | | else if (nSize == 4) {
|
| | | uValue = *(UINT *)(pBuf2 + nOffset);
|
| | | }
|
| | | s1.Format(_T("%u"), uValue);
|
| | | break;
|
| | | case typeHEX:
|
| | | if (nSize == 1) {
|
| | | uValue = *((UCHAR *)(pBuf2 + nOffset));
|
| | | s1.Format(_T("%02X"), uValue);
|
| | | }
|
| | | else if (nSize == 2) {
|
| | | uValue = *(USHORT *)(pBuf2 + nOffset);
|
| | | s1.Format(_T("%04X"), uValue);
|
| | | }
|
| | | else if (nSize == 3) {
|
| | |
|
| | | }
|
| | | else if (nSize == 4) {
|
| | | uValue = *(UINT *)(pBuf2 + nOffset);
|
| | | s1.Format(_T("%08X"), uValue);
|
| | | }
|
| | |
|
| | | break;
|
| | | case typeBIN:
|
| | | if (nSize == 1) {
|
| | | uValue = *((UCHAR *)(pBuf2 + nOffset));
|
| | | s1.Format(_T("%02X"), uValue);
|
| | | }
|
| | | else if (nSize == 2) {
|
| | | uValue = *(USHORT *)(pBuf2 + nOffset);
|
| | | s1.Format(_T("%04X"), uValue);
|
| | | }
|
| | | else if (nSize == 3) {
|
| | |
|
| | | }
|
| | | else if (nSize == 4) {
|
| | | uValue = *(UINT *)(pBuf2 + nOffset);
|
| | | s1.Format(_T("%08X"), uValue);
|
| | | }
|
| | |
|
| | | break;
|
| | | case typeFLOAT:
|
| | | break;
|
| | | case typeFIX:
|
| | | break;
|
| | | case typeBIT:
|
| | | break;
|
| | | case typeString:
|
| | | for (int j = 0; j < nSize; j++)
|
| | | {
|
| | | buf3[j] = pBuf2[nOffset + j];
|
| | | }
|
| | | buf3[nSize] = 0;
|
| | | s3 = buf3;
|
| | | s1.Format(_T("%s"), s3);
|
| | | break;
|
| | | case typeDATETIME:
|
| | | nValue = *(UINT *)(pBuf2 + nOffset);
|
| | | ctime1 = nValue;
|
| | | ctime1 = CStringToCTime(_T("2000-01-01 08:00:00"));
|
| | | ctime1 += nValue;
|
| | | s3 = ctime1.Format(_T("%Y-%m-%d %H:%M:%S"));
|
| | | s1.Format(_T("%s"), s3);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | | return s1;
|
| | | }
|
| | | int CDialogFactCfg::SetDataByName(void * pDataBlock, CString sName, UINT uValue)
|
| | | {
|
| | | UCHAR * pBuf2 = (UCHAR *)pDataBlock;
|
| | | // UCHAR buf3[256];
|
| | | int nIdx = FindIdByName(sName);
|
| | | if (nIdx >= 0)
|
| | | {
|
| | | CTime ctime1;
|
| | | CTime ctime2;
|
| | | CTimeSpan ctime3;
|
| | | int nType = FactoryDataItems[nIdx].nType;
|
| | | int nSize = FactoryDataItems[nIdx].nSize;
|
| | | int nOffset = FactoryDataItems[nIdx].nOffset;
|
| | | int nValue;
|
| | | switch (nType)
|
| | | {
|
| | | case typeINT:
|
| | | if (nSize == 1) {
|
| | | *((char *)(pBuf2 + nOffset)) = uValue;
|
| | | }
|
| | | else if (nSize == 2) {
|
| | | *(short *)(pBuf2 + nOffset) = uValue;
|
| | | }
|
| | | else if (nSize == 3) {
|
| | |
|
| | | }
|
| | | else if (nSize == 4) {
|
| | | *(int *)(pBuf2 + nOffset) = uValue;
|
| | | }
|
| | | break;
|
| | | case typeUINT:
|
| | | if (nSize == 1) {
|
| | | *((UCHAR *)(pBuf2 + nOffset)) = uValue;
|
| | | }
|
| | | else if (nSize == 2) {
|
| | | *(USHORT *)(pBuf2 + nOffset) = uValue;
|
| | | }
|
| | | else if (nSize == 3) {
|
| | |
|
| | | }
|
| | | else if (nSize == 4) {
|
| | | *(UINT *)(pBuf2 + nOffset) = uValue;
|
| | | }
|
| | | break;
|
| | | case typeBIN:
|
| | | if (nSize == 1) {
|
| | | *((UCHAR *)(pBuf2 + nOffset)) = uValue;
|
| | | }
|
| | | else if (nSize == 2) {
|
| | | *(USHORT *)(pBuf2 + nOffset) = uValue;
|
| | | }
|
| | | else if (nSize == 3) {
|
| | |
|
| | | }
|
| | | else if (nSize == 4) {
|
| | | *(UINT *)(pBuf2 + nOffset) = uValue;
|
| | | }
|
| | |
|
| | | break;
|
| | | case typeFLOAT:
|
| | | break;
|
| | | case typeFIX:
|
| | | break;
|
| | | case typeBIT:
|
| | | break;
|
| | | case typeString:
|
| | | break;
|
| | | case typeDATETIME:
|
| | | ctime1 = CStringToCTime(_T("2000-01-01 08:00:00"));
|
| | | ctime2 = uValue;
|
| | | ctime3 = ctime2 - ctime1;
|
| | | nValue = ctime3.GetTotalSeconds();
|
| | | *(UINT *)(pBuf2 + nOffset) = uValue;
|
| | |
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | | int CDialogFactCfg::SetDataByName(void * pDataBlock, CString sName, CString sValue)
|
| | | {
|
| | | UCHAR * pBuf2 = (UCHAR *)pDataBlock;
|
| | | // UCHAR buf3[256];
|
| | | CStringA s3;
|
| | | int nIdx = FindIdByName(sName);
|
| | | if (nIdx >= 0)
|
| | | {
|
| | | CTime ctime1;
|
| | | CTime ctime2;
|
| | | CTimeSpan ctime3;
|
| | | int nType = FactoryDataItems[nIdx].nType;
|
| | | int nSize = FactoryDataItems[nIdx].nSize;
|
| | | int nOffset = FactoryDataItems[nIdx].nOffset;
|
| | | int nValue;
|
| | | int len;
|
| | | switch (nType)
|
| | | {
|
| | | case typeINT:
|
| | | if (nSize == 1) {
|
| | | *((char *)(pBuf2 + nOffset)) = _tstoi(sValue);
|
| | | }
|
| | | else if (nSize == 2) {
|
| | | *(short *)(pBuf2 + nOffset) = _tstoi(sValue);
|
| | | }
|
| | | else if (nSize == 3) {
|
| | |
|
| | | }
|
| | | else if (nSize == 4) {
|
| | | *(int *)(pBuf2 + nOffset) = _tstoi(sValue);
|
| | | }
|
| | | break;
|
| | | case typeUINT:
|
| | | if (nSize == 1) {
|
| | | *((UCHAR *)(pBuf2 + nOffset)) = _tstoi(sValue);
|
| | | }
|
| | | else if (nSize == 2) {
|
| | | *(USHORT *)(pBuf2 + nOffset) = _tstoi(sValue);
|
| | | }
|
| | | else if (nSize == 3) {
|
| | |
|
| | | }
|
| | | else if (nSize == 4) {
|
| | | *(UINT *)(pBuf2 + nOffset) = _tstoi(sValue);
|
| | | }
|
| | | break;
|
| | | case typeBIN:
|
| | | if (nSize == 1) {
|
| | | *((UCHAR *)(pBuf2 + nOffset)) = _tstoi(sValue);
|
| | | }
|
| | | else if (nSize == 2) {
|
| | | *(USHORT *)(pBuf2 + nOffset) = _tstoi(sValue);
|
| | | }
|
| | | else if (nSize == 3) {
|
| | |
|
| | | }
|
| | | else if (nSize == 4) {
|
| | | *(UINT *)(pBuf2 + nOffset) = _tstoi(sValue);
|
| | | }
|
| | |
|
| | | break;
|
| | | case typeFLOAT:
|
| | | break;
|
| | | case typeFIX:
|
| | | break;
|
| | | case typeBIT:
|
| | | break;
|
| | | case typeString:
|
| | | s3 = sValue;
|
| | | len = s3.GetLength();
|
| | | for (int j = 0; j < nSize; j++) {
|
| | | if (j < len) {
|
| | | pBuf2[nOffset + j] = s3[j];
|
| | | }else {
|
| | | pBuf2[nOffset + j] = ' ';
|
| | | }
|
| | | }
|
| | | break;
|
| | | case typeDATETIME:
|
| | | ctime1 = CStringToCTime(_T("2000-01-01 08:00:00"));
|
| | | ctime2 = CStringToCTime(sValue);;
|
| | | ctime3 = ctime2 - ctime1;
|
| | | nValue = ctime3.GetTotalSeconds();
|
| | | *(UINT *)(pBuf2 + nOffset) = nValue;
|
| | |
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | CMTerm2Doc * CDialogFactCfg::GetDocument()
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | | CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
|
| | | CMDIChildWnd *pChild = (CMDIChildWnd *)pFrame->GetActiveFrame();
|
| | | CView *pV = (CView*)pChild->GetActiveView();
|
| | | CMTerm2Doc* pDoc = (CMTerm2Doc *)(pV->GetDocument());
|
| | | return pDoc;
|
| | | }
|
| | |
|
| | | int CDialogFactCfg::Connect()
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | | CString s1;
|
| | | CMTerm2Doc* pDoc = (CMTerm2Doc *)GetDocument();
|
| | |
|
| | |
|
| | | int r = pDoc->Connect();
|
| | | s1.Format(_T("Open %s = %d"), pDoc->myHvSerialPort1.m_strResult, r);
|
| | | SysLog(s1);
|
| | | if (r == pDoc->myHvSerialPort1.R_OK)
|
| | | {
|
| | | pDoc->MyKLink1.Open();
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | return 0;
|
| | | }
|
| | |
|
| | |
|
| | | int CDialogFactCfg::Disconnect()
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | | CMTerm2Doc* pDoc = (CMTerm2Doc *)GetDocument();
|
| | | |
| | | pDoc->DisConnect();
|
| | | pDoc->MyKLink1.Close();
|
| | | return 0;
|
| | | }
|
| | |
|
| | | int CDialogFactCfg::ReadData()
|
| | | {
|
| | | CMTerm2Doc* pDoc = (CMTerm2Doc *)GetDocument();
|
| | |
|
| | | unsigned short buf1[1024];
|
| | | int res = pDoc->MyKLink1.GetInfo(1, 0, 0, 16, buf1);
|
| | | SysLog(pDoc->MyKLink1.m_resultStr);
|
| | | CString s1;
|
| | | s1.Format(_T("GetInfo = %d "), res);
|
| | | if (res == KLink::KL_OK)
|
| | | {
|
| | | s1.Append(_T("\r\n"));
|
| | | for (int i = 0; i < 16 / 2; i++)
|
| | | {
|
| | | s1.AppendFormat(_T("%04X "), buf1[i]);
|
| | | }
|
| | | }
|
| | | SysLog(s1);
|
| | | |
| | | s1.Format(_T("%04X"), buf1[0]);
|
| | | SetDlgItemText(IDC_EDIT_DEVICE_TYPE, s1);
|
| | | s1.Format(_T("%04X"), buf1[1]);
|
| | | SetDlgItemText(IDC_EDIT_FIRM_VER, s1);
|
| | | s1.Format(_T("%04X"), buf1[2]);
|
| | | SetDlgItemText(IDC_EDIT_KLINK_VER, s1);
|
| | | s1.Format(_T("%04X"), buf1[3]);
|
| | | SetDlgItemText(IDC_EDIT_CAP, s1);
|
| | |
|
| | | CString s2;
|
| | | CString s3;
|
| | | unsigned char buf2[1024];
|
| | | res = pDoc->MyKLink1.GetUID(1, 0, 0, 12, (unsigned short *)buf2);
|
| | | SysLog(pDoc->MyKLink1.m_resultStr);
|
| | | s1.Format(_T("GetUID = %d "), res);
|
| | | |
| | | if (res == KLink::KL_OK)
|
| | | {
|
| | | s1.Append(_T("\r\n"));
|
| | | for (int i = 0; i < 12; i++)
|
| | | {
|
| | | s1.AppendFormat(_T("%02X "), buf2[i]);
|
| | | s2.AppendFormat(_T("%02X"), buf2[12-i-1]);
|
| | | // s3.AppendFormat(_T("%c"), buf2[12 - i - 1]);
|
| | | }
|
| | | }
|
| | | SysLog(s1);
|
| | | SetDlgItemText(IDC_EDIT_DEVICE_UID, s2);
|
| | |
|
| | | |
| | | res = pDoc->MyKLink1.GetSN(1, 0, 0, 4, (unsigned short *)buf2);
|
| | | SysLog(pDoc->MyKLink1.m_resultStr);
|
| | | s1.Format(_T("GetSN = %d "), res);
|
| | | s2.Empty();
|
| | | if (res == KLink::KL_OK)
|
| | | {
|
| | | s1.Append(_T("\r\n"));
|
| | | for (int i = 0; i < 4; i++)
|
| | | {
|
| | | s1.AppendFormat(_T("%02X "), buf2[i]);
|
| | | s2.AppendFormat(_T("%02X"), buf2[4-i-1]);
|
| | | // s3.AppendFormat(_T("%c"), buf2[12 - i - 1]);
|
| | | }
|
| | | }
|
| | | SysLog(s1);
|
| | | SetDlgItemText(IDC_EDIT_ORG_FACT_SN, s2);
|
| | |
|
| | | res = pDoc->MyKLink1.GetFactoryData(1, 0, 0, 80, (unsigned short *)buf2);
|
| | | SysLog(pDoc->MyKLink1.m_resultStr);
|
| | | s1.Format(_T("GetFactoryData = %d "), res);
|
| | | s2.Empty();
|
| | | if (res == KLink::KL_OK)
|
| | | {
|
| | | s1.Append(_T("\r\n"));
|
| | | for (int i = 0; i < 80; i++)
|
| | | {
|
| | | s1.AppendFormat(_T("%02X "), buf2[i]);
|
| | | s2.AppendFormat(_T("%02X"), buf2[4 - i - 1]);
|
| | | // s3.AppendFormat(_T("%c"), buf2[12 - i - 1]);
|
| | | }
|
| | | }
|
| | | SysLog(s1);
|
| | | // SetDlgItemText(IDC_EDIT_ORG_FACT_SN, s2);
|
| | |
|
| | | // unsigned char buf3[1024];
|
| | | CTime ctime1;
|
| | | for (int i = 0; i < nFactoryDataItemsCount; i++)
|
| | | {
|
| | | // int nType = FactoryDataItems[i].nType;
|
| | | // int nSize = FactoryDataItems[i].nSize;
|
| | | // int nOffset = FactoryDataItems[i].nOffset;
|
| | | CString sName = FactoryDataItems[i].sName;
|
| | | s3 = GetDataStrByName(buf2,sName);
|
| | | s1.Format(_T("%d %s %s"), i, sName, s3);
|
| | | SysLog(s1);
|
| | | }
|
| | |
|
| | | s3=GetDataStrByName(buf2, _T("nLotNo"));
|
| | | SetDlgItemText(IDC_EDIT_ORG_LOT_NO, s3);
|
| | |
|
| | | s3 = GetDataStrByName(buf2, _T("nProductDate"));
|
| | | SetDlgItemText(IDC_EDIT_ORG_FAC_DATE, s3);
|
| | |
|
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | int CDialogFactCfg::WriteData()
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | |
|
| | | CString s1;
|
| | | CMTerm2Doc* pDoc = (CMTerm2Doc *)GetDocument();
|
| | | unsigned short buf1[1024];
|
| | | // unsigned char buf2[1024];
|
| | | // unsigned char buf3[1024];
|
| | | /*
|
| | | AddDataItem(0, 2, typeBIN, _T("开始标志"));
|
| | | AddDataItem(2, 2, typeINT, _T("序号"));
|
| | | AddDataItem(4, 2, typeBIN, _T("ModelNo"));
|
| | | AddDataItem(6, 2, typeBIN, _T("ModelVer"));
|
| | | AddDataItem(8, 4, typeUINT, _T("nLotNo"));
|
| | | AddDataItem(12, 4, typeDATETIME, _T("nProductDate"));
|
| | | AddDataItem(16, 4, typeBIN, _T("nSN1"));
|
| | | AddDataItem(20, 4, typeBIN, _T("nProtocalVer"));
|
| | | AddDataItem(24, 4, typeBIN, _T("nDefaultFuncr"));
|
| | | AddDataItem(28, 16, typeString, _T("sModelStr"));
|
| | | AddDataItem(44, 16, typeString, _T("sLot_No"));
|
| | | AddDataItem(60, 16, typeString, _T("sSNStr"));
|
| | | AddDataItem(76, 2, typeBIN, _T("CRC1"));
|
| | | AddDataItem(78, 2, typeBIN, _T("EndSign"));
|
| | | */
|
| | | UINT uValue;
|
| | |
|
| | | SetDataByName(buf1, _T("开始标志"), 0x55AA);
|
| | | SetDataByName(buf1, _T("序号"), 0x0002);
|
| | | SetDataByName(buf1, _T("ModelNo"), 0x0008);
|
| | | SetDataByName(buf1, _T("ModelVer"), 0x0100);
|
| | | GetDlgItemText(IDC_EDIT_LOT_NO, s1); uValue = _tstoi(s1);
|
| | | SetDataByName(buf1, _T("nLotNo"), uValue);
|
| | | SetDataByName(buf1, _T("nProductDate"), 0x2996c000);
|
| | |
|
| | | GetDlgItemText(IDC_EDIT_FACT_SN, s1); uValue = _tstoi(s1);
|
| | | SetDataByName(buf1, _T("nSN1"), uValue);
|
| | | SetDataByName(buf1, _T("nProtocalVer"), 0x01000100);
|
| | | SetDataByName(buf1, _T("nDefaultFuncr"), 0x00000001);
|
| | | SetDataByName(buf1, _T("sModelStr"), _T("12122121"));
|
| | | SetDataByName(buf1, _T("sLot_No"), _T("34344343"));
|
| | | SetDataByName(buf1, _T("sSNStr"), _T("56566565"));
|
| | | SetDataByName(buf1, _T("CRC1"), 0xEFEF);
|
| | | SetDataByName(buf1, _T("EndSign"), 0x55AA);
|
| | |
|
| | |
|
| | | int res = pDoc->MyKLink1.WriteFactoryData(1, 0, 0, 80, buf1);
|
| | | SysLog(pDoc->MyKLink1.m_resultStr);
|
| | | s1.Format(_T("WriteFactoryData = %d "), res);
|
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | | void CDialogFactCfg::OnBnClickedButtonReaddata()
|
| | | {
|
| | | // TODO: 在此添加控件通知处理程序代码
|
| | | ReadData();
|
| | | }
|
| | |
|
| | | void CDialogFactCfg::OnBnClickedButtonConn()
|
| | | {
|
| | | // TODO: 在此添加控件通知处理程序代码
|
| | | Connect();
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | void CDialogFactCfg::OnBnClickedButtonDisconn()
|
| | | {
|
| | | // TODO: 在此添加控件通知处理程序代码
|
| | | Disconnect();
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | void CDialogFactCfg::OnBnClickedButtonWritedata()
|
| | | {
|
| | | // TODO: 在此添加控件通知处理程序代码
|
| | | WriteData();
|
| | |
|
| | | }
|
| | |
|
New file |
| | |
| | | #pragma once
|
| | |
|
| | |
|
| | | // CDialogFactCfg 对话框
|
| | | class CMTerm2Doc;
|
| | |
|
| | | class CDialogFactCfg : public CDialogEx
|
| | | {
|
| | | DECLARE_DYNAMIC(CDialogFactCfg)
|
| | |
|
| | | public:
|
| | | CDialogFactCfg(CWnd* pParent = nullptr); // 标准构造函数
|
| | | virtual ~CDialogFactCfg();
|
| | |
|
| | | // 对话框数据
|
| | | #ifdef AFX_DESIGN_TIME
|
| | | enum { IDD = IDD_DIALOG_FACT_CFG };
|
| | | #endif
|
| | |
|
| | | protected:
|
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
| | |
|
| | | DECLARE_MESSAGE_MAP()
|
| | | public:
|
| | | enum DataItemType
|
| | | {
|
| | | typeINT,
|
| | | typeUINT,
|
| | | typeHEX,
|
| | | typeBIN,
|
| | | typeFLOAT,
|
| | | typeFIX,
|
| | | typeBIT,
|
| | | typeString,
|
| | | typeDATE,
|
| | | typeTIME,
|
| | | typeDATETIME,
|
| | |
|
| | | };
|
| | | typedef struct tagDataItemDef
|
| | | {
|
| | | int nOffset;
|
| | | int nSize;
|
| | | int nType;
|
| | | CString sName;
|
| | | }stDataItemDef;
|
| | |
|
| | | typedef struct tagFactoryData //工厂量产参数数据。
|
| | | {
|
| | | USHORT Sign1;
|
| | | USHORT Seq1;
|
| | | USHORT nModelNo;
|
| | | USHORT nModelVer;
|
| | | UCHAR LOT_NO[16]; //
|
| | | UINT nProductDateTime;
|
| | | UINT SN1;
|
| | | unsigned int nProtocalVer;
|
| | | unsigned int nLotNo;
|
| | | unsigned int nDefaultFunc;
|
| | | char ModelStr[16];
|
| | | char SNStr[16];
|
| | | unsigned short CRC1;
|
| | | unsigned short EndSign1;
|
| | |
|
| | | }stFactoryData, *pFactoryData;
|
| | |
|
| | | stDataItemDef FactoryDataItems[50];
|
| | | int nFactoryDataItemsCount = 0;
|
| | |
|
| | | int AddDataItem(int nOffset, int nSize, int nType, CString sName);
|
| | |
|
| | | int InitDataItems();
|
| | |
|
| | | int Connect();
|
| | | int Disconnect();
|
| | | int ReadData();
|
| | | afx_msg void OnBnClickedButtonConn();
|
| | | afx_msg void OnBnClickedButtonDisconn();
|
| | | afx_msg void OnBnClickedButtonWritedata();
|
| | | afx_msg void OnBnClickedButtonReaddata();
|
| | | int WriteData();
|
| | | CMTerm2Doc * GetDocument();
|
| | |
|
| | | int FindIdByName(CString sName);
|
| | |
|
| | | int GetDataByOffset(void * pDataBlock, int nOffset);
|
| | | int GetDataByName(void * pDataBlock, CString sName);
|
| | |
|
| | | CString GetDataStrByName(void * pDataBlock, CString sName);
|
| | |
|
| | | int SetDataByName(void * pDataBlock, CString sName, UINT uValue);
|
| | | int SetDataByName(void * pDataBlock, CString sName, CString sValue);
|
| | |
|
| | | };
|
File was renamed from MTerm2/CDialogForceIO.cpp |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "CDialogForceIO.h"
|
| | | #include "DialogForceIO.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
File was renamed from MTerm2/CDialogInfoDisplay.cpp |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "CDialogInfoDisplay.h"
|
| | | #include "DialogInfoDisplay.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
File was renamed from MTerm2/CDialogProgress.cpp |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "CDialogProgress.h"
|
| | | #include "DialogProgress.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
File was renamed from MTerm2/CDialogStatusShow.cpp |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "CDialogStatusShow.h"
|
| | | #include "DialogStatusShow.h"
|
| | | #include "afxdialogex.h"
|
| | | #include "KLink.h"
|
| | | //#include "KLink.h"
|
| | | #include "MTerm2Doc.h"
|
| | | // CDialogStatusShow 对话框
|
| | |
|
New file |
| | |
| | | // CDialogSysRegSet.cpp: 实现文件
|
| | | //
|
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "DialogSysRegSet.h"
|
| | | #include "afxdialogex.h"
|
| | | #include "PropSysReg1.h"
|
| | |
|
| | | // CDialogSysRegSet 对话框
|
| | |
|
| | | IMPLEMENT_DYNAMIC(CDialogSysRegSet, CDialogEx)
|
| | |
|
| | | CDialogSysRegSet::CDialogSysRegSet(CWnd* pParent /*=nullptr*/)
|
| | | : CDialogEx(IDD_DIALOG_SYSREG_SET, pParent)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | CDialogSysRegSet::~CDialogSysRegSet()
|
| | | {
|
| | | }
|
| | |
|
| | | void CDialogSysRegSet::DoDataExchange(CDataExchange* pDX)
|
| | | {
|
| | | CDialogEx::DoDataExchange(pDX);
|
| | | DDX_Control(pDX, IDC_SCROLLBAR1, m_prop_scrollbar1);
|
| | | DDX_Control(pDX, IDC_LIST_SEL1, m_listSel1);
|
| | | }
|
| | |
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CDialogSysRegSet, CDialogEx)
|
| | | ON_WM_VSCROLL()
|
| | | ON_WM_MOUSEWHEEL()
|
| | | ON_LBN_SELCHANGE(IDC_LIST_SEL1, &CDialogSysRegSet::OnLbnSelchangeListSel1)
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | |
|
| | | // CDialogSysRegSet 消息处理程序
|
| | |
|
| | | int CDialogSysRegSet::AddPropPage(CString sName, CDialogEx & rDlg)
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | | m_listSel1.AddString(sName);
|
| | | if (rDlg.GetSafeHwnd() == NULL ) { }
|
| | |
|
| | | m_PropPages[m_nTotalProp] = &rDlg;
|
| | | m_nTotalProp++;
|
| | | return 0;
|
| | | }
|
| | |
|
| | | BOOL CDialogSysRegSet::OnInitDialog()
|
| | | {
|
| | | CDialogEx::OnInitDialog();
|
| | |
|
| | | // TODO: 在此添加额外的初始化
|
| | |
|
| | | m_listSel1.GetCount();
|
| | | AddPropPage(_T("工作模式设置1"), m_propmodecfg1);
|
| | | AddPropPage(_T("内存分配1"), m_propmemcfg1);
|
| | | AddPropPage(_T("保持/非保持11"), m_propmodecfg1);
|
| | | AddPropPage(_T("保持/非保持21"), m_propmodecfg1);
|
| | | AddPropPage(_T("232通信端口设置1"), m_propcommcfg1);
|
| | | AddPropPage(_T("485通信端口设置1"), m_propcommcfg2);
|
| | | AddPropPage(_T("输入时间常数设置1"), m_propinputcfg1);
|
| | | AddPropPage(_T("输入时间常数设置2"), m_propinputcfg2);
|
| | | AddPropPage(_T("输入时间常数设置3"), m_propinputcfg3);
|
| | | AddPropPage(_T("输入时间常数设置4"), m_propinputcfg4);
|
| | | AddPropPage(_T("输出保持时间设置1"), m_propoutputcfg1);
|
| | | AddPropPage(_T("输出保持时间设置2"), m_propoutputcfg2);
|
| | | AddPropPage(_T("输入时间常数设置3"), m_propoutputcfg3);
|
| | | AddPropPage(_T("输出保持时间设置4"), m_propoutputcfg4);
|
| | | AddPropPage(_T("485通信端口设置2"), m_propcommcfg3);
|
| | | AddPropPage(_T("内置SPI端口设置1"), m_propmodecfg1);
|
| | | AddPropPage(_T("外置扩展SPI端口设置1"), m_propmodecfg1);
|
| | |
|
| | | //GetDlgItem(IDC_STATIC_PROP)->
|
| | |
|
| | | GetDlgItem(IDC_STATIC_PROP)->GetClientRect(&rect1);
|
| | | m_nFrameheight = rect1.bottom - rect1.top;
|
| | | GetDlgItem(IDC_STATIC_PROP)->ClientToScreen(&rect1);
|
| | | this->ScreenToClient(&rect1);
|
| | |
|
| | | m_propsysreg1.Create(IDD_PROP_SYSREG1, this);
|
| | | m_propsysreg1.EnableWindow(true);
|
| | | m_propsysreg1.GetClientRect(&rect0);
|
| | | m_nPropHeight = rect0.bottom - rect0.top;
|
| | | // m_propsysreg1.ShowWindow(SW_SHOW);
|
| | |
|
| | | m_propmodecfg1.Create(IDD_PROP_MODE_CFG1, this);
|
| | | m_propmodecfg1.EnableWindow(true);
|
| | | m_propmodecfg1.MoveWindow(&rect1, true);
|
| | | m_propmodecfg1.ShowWindow(SW_SHOW);
|
| | |
|
| | | m_propmemcfg1.Create(IDD_PROP_MEM_CFG, this);
|
| | | m_propmemcfg1.MoveWindow(&rect1, true);
|
| | | m_propmemcfg1.EnableWindow(true);
|
| | |
|
| | |
|
| | | m_propcommcfg1.Create(IDD_PROP_COMM_CFG, this);
|
| | | m_propcommcfg1.MoveWindow(&rect1, true);
|
| | | m_propcommcfg1.EnableWindow(true);
|
| | |
|
| | | m_propcommcfg2.Create(IDD_PROP_COMM_CFG, this);
|
| | | m_propcommcfg2.MoveWindow(&rect1, true);
|
| | | m_propcommcfg2.EnableWindow(true);
|
| | |
|
| | | m_propcommcfg3.Create(IDD_PROP_COMM_CFG, this);
|
| | | m_propcommcfg3.MoveWindow(&rect1, true);
|
| | | m_propcommcfg3.EnableWindow(true);
|
| | |
|
| | | m_propinputcfg1.Create(IDD_PROP_INPUT_CFG, this);
|
| | | m_propinputcfg1.MoveWindow(&rect1, true);
|
| | | m_propinputcfg1.EnableWindow(true);
|
| | |
|
| | | m_propinputcfg2.Create(IDD_PROP_INPUT_CFG, this);
|
| | | m_propinputcfg2.MoveWindow(&rect1, true);
|
| | | m_propinputcfg2.EnableWindow(true);
|
| | |
|
| | | m_propinputcfg3.Create(IDD_PROP_INPUT_CFG, this);
|
| | | m_propinputcfg3.MoveWindow(&rect1, true);
|
| | | m_propinputcfg3.EnableWindow(true);
|
| | |
|
| | | m_propinputcfg4.Create(IDD_PROP_INPUT_CFG, this);
|
| | | m_propinputcfg4.MoveWindow(&rect1, true);
|
| | | m_propinputcfg4.EnableWindow(true);
|
| | |
|
| | | m_propoutputcfg1.Create(IDD_PROP_OUTPUT_SET, this);
|
| | | m_propoutputcfg1.MoveWindow(&rect1, true);
|
| | | m_propoutputcfg1.EnableWindow(true);
|
| | |
|
| | | m_propoutputcfg2.Create(IDD_PROP_OUTPUT_SET, this);
|
| | | m_propoutputcfg2.MoveWindow(&rect1, true);
|
| | | m_propoutputcfg2.EnableWindow(true);
|
| | |
|
| | | m_propoutputcfg3.Create(IDD_PROP_OUTPUT_SET, this);
|
| | | m_propoutputcfg3.MoveWindow(&rect1, true);
|
| | | m_propoutputcfg3.EnableWindow(true);
|
| | |
|
| | | m_propoutputcfg4.Create(IDD_PROP_OUTPUT_SET, this);
|
| | | m_propoutputcfg4.MoveWindow(&rect1, true);
|
| | | m_propoutputcfg4.EnableWindow(true);
|
| | |
|
| | | m_propsysreg1.MoveWindow(&rect1, true);
|
| | |
|
| | | int nNewPos = m_nScrollPos;
|
| | | int Scrolldel = nNewPos - m_nScrollPos;
|
| | | m_propsysreg1.ScrollWindow(0, Scrolldel);
|
| | | m_nScrollPos += Scrolldel;
|
| | |
|
| | | SCROLLINFO si;
|
| | | si.cbSize = sizeof(SCROLLINFO);
|
| | | si.fMask = SIF_ALL;
|
| | | si.nMin = 0;
|
| | | si.nMax = m_nPropHeight;//你滑动画面的高度
|
| | | si.nPage = m_nFrameheight; //这个是你显示画面的高度
|
| | | si.nPos = 0;//这个是滑块的位置 初始化的时候是0 以后会根据你的操作变动
|
| | | // GetDlgItem(IDC_STATIC_PROP)->SetScrollInfo(SB_VERT, &si);
|
| | | // m_propsysreg1.SetScrollInfo(SB_VERT, &si);
|
| | |
|
| | | m_prop_scrollbar1.SetScrollInfo(&si, true);
|
| | |
|
| | | // m_prop_scrollbar1.SetScrollRange(1, 100);
|
| | | // m_prop_scrollbar1.SetScrollPos(20);
|
| | | return TRUE; // return TRUE unless you set the focus to a control
|
| | | // 异常: OCX 属性页应返回 FALSE
|
| | | }
|
| | |
|
| | | void CDialogSysRegSet::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
|
| | | {
|
| | | // TODO: 在此添加消息处理程序代码和/或调用默认值
|
| | | int nMin, nMax;
|
| | | pScrollBar->GetScrollRange(&nMin, &nMax); //取得滚动条范围
|
| | | int TempPos = pScrollBar->GetScrollPos();
|
| | | CString s1;
|
| | | // s1.Format(_T("DialogSysReg OnVScroll %d %d %d"), nSBCode, nPos,TempPos);
|
| | | // SysLog(s1);
|
| | | switch (nSBCode)
|
| | | {
|
| | | case SB_THUMBPOSITION://拖动滑块
|
| | | case SB_THUMBTRACK:
|
| | | pScrollBar->SetScrollPos(nPos);
|
| | | TempPos = nPos;
|
| | | break;
|
| | | case SB_LINEUP://点击上边/左边的箭头
|
| | | if (TempPos > 1)
|
| | | {
|
| | | TempPos--;
|
| | | }
|
| | | pScrollBar->SetScrollPos(TempPos);
|
| | | break;
|
| | | case SB_LINEDOWN://点击下边/右边的箭头
|
| | | if (TempPos < nMax)
|
| | | {
|
| | | TempPos++;
|
| | | }
|
| | | pScrollBar->SetScrollPos(TempPos);
|
| | |
|
| | | break;
|
| | | |
| | | case SB_PAGEUP: // 如果向上/左滚动一页
|
| | | if (TempPos >10) TempPos -= 10;
|
| | | pScrollBar->SetScrollPos(TempPos);
|
| | | break;
|
| | | |
| | | case SB_PAGEDOWN: // 如果向下/右滚动一页
|
| | | if (TempPos < nMax - 10) TempPos += 10;
|
| | | pScrollBar->SetScrollPos(TempPos);
|
| | | break;
|
| | | }
|
| | | int nNewPos = -TempPos;
|
| | | int Scrolldel = nNewPos - m_nScrollPos;
|
| | | // s1.Format(_T("DialogSysReg Scroll %d %d %d"), m_nScrollPos, nNewPos, Scrolldel);
|
| | | // SysLog(s1);
|
| | |
|
| | | m_propsysreg1.ScrollWindow(0, Scrolldel);
|
| | | m_nScrollPos += Scrolldel;
|
| | |
|
| | | // m_propsysreg1.ScrollWindow(0, -TempPos);
|
| | |
|
| | | CDialogEx::OnVScroll(nSBCode, nPos, pScrollBar);
|
| | | }
|
| | |
|
| | |
|
| | | BOOL CDialogSysRegSet::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
|
| | | {
|
| | | // TODO: 在此添加消息处理程序代码和/或调用默认值
|
| | | /*
|
| | | int nNewPos=m_nScrollPos;
|
| | | if (zDelta < 0) |
| | | {
|
| | | if (-m_nScrollPos < m_nPropHeight -m_nFrameheight - 30)
|
| | | nNewPos = m_nScrollPos - 30;
|
| | | else
|
| | | nNewPos = - (m_nPropHeight - m_nFrameheight);
|
| | | }
|
| | | else if (zDelta > 0)
|
| | | {
|
| | | if (-m_nScrollPos > 30)
|
| | | nNewPos = m_nScrollPos + 30;
|
| | | else
|
| | | nNewPos = 0;
|
| | | }
|
| | | else
|
| | | {
|
| | | }
|
| | | int Scrolldel = nNewPos - m_nScrollPos;
|
| | | m_propsysreg1.ScrollWindow(0, Scrolldel);
|
| | | m_nScrollPos += Scrolldel;
|
| | | m_prop_scrollbar1.SetScrollPos(-m_nScrollPos);
|
| | | */
|
| | | return CDialogEx::OnMouseWheel(nFlags, zDelta, pt);
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | void CDialogSysRegSet::OnLbnSelchangeListSel1()
|
| | | {
|
| | | // TODO: 在此添加控件通知处理程序代码
|
| | | CString s1;
|
| | | int j = m_listSel1.GetCurSel();
|
| | | s1.Format(_T("LbnSelChange %d"),j);
|
| | | SysLog(s1);
|
| | | m_PropPages[m_nCurProp]->ShowWindow(SW_HIDE);
|
| | |
|
| | | m_PropPages[j]->ShowWindow(SW_SHOW);
|
| | | m_PropPages[j]->MoveWindow(&rect1, true);
|
| | | m_PropPages[j]->EnableWindow(true);
|
| | | /*
|
| | | switch (j)
|
| | | {
|
| | | case 0:
|
| | | m_propmodecfg1.ShowWindow(SW_SHOW);
|
| | | m_propmodecfg1.MoveWindow(&rect1, true);
|
| | | break;
|
| | | case 1:
|
| | | m_propmemcfg1.ShowWindow(SW_SHOW);
|
| | | m_propmodecfg1.MoveWindow(&rect1, true);
|
| | | break;
|
| | | case 2:
|
| | | //m_propmodecfg1.ShowWindow(SW_SHOW);
|
| | | break;
|
| | | case 3:
|
| | | //m_propmodecfg1.ShowWindow(SW_SHOW);
|
| | | break;
|
| | | case 4:
|
| | | m_propcommcfg1.ShowWindow(SW_SHOW);
|
| | | m_propmodecfg1.MoveWindow(&rect1, true);
|
| | | break;
|
| | | case 5:
|
| | | m_propcommcfg2.ShowWindow(SW_SHOW);
|
| | | m_propmodecfg1.MoveWindow(&rect1, true);
|
| | | break;
|
| | | case 6:
|
| | | m_propinputcfg1.ShowWindow(SW_SHOW);
|
| | | break;
|
| | | case 7:
|
| | | m_propinputcfg2.ShowWindow(SW_SHOW);
|
| | | break;
|
| | | case 8:
|
| | | m_propinputcfg3.ShowWindow(SW_SHOW);
|
| | | break;
|
| | | case 9:
|
| | | m_propinputcfg4.ShowWindow(SW_SHOW);
|
| | | break;
|
| | | case 10:
|
| | | m_propoutputcfg1.ShowWindow(SW_SHOW);
|
| | | break;
|
| | | case 11:
|
| | | m_propoutputcfg2.ShowWindow(SW_SHOW);
|
| | | break;
|
| | | case 12:
|
| | | m_propoutputcfg3.ShowWindow(SW_SHOW);
|
| | | break;
|
| | | case 13:
|
| | | m_propoutputcfg4.ShowWindow(SW_SHOW);
|
| | | break;
|
| | |
|
| | | case 14:
|
| | | m_propcommcfg3.ShowWindow(SW_SHOW);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | */
|
| | | m_nCurProp = j;
|
| | | }
|
| | |
|
New file |
| | |
| | | #pragma once
|
| | | #include "PropSysReg1.h"
|
| | | #include "PropModeCfg.h"
|
| | | #include "PropMemCfg.h"
|
| | | #include "PropCommCfg.h"
|
| | | #include "PropInputCfg.h"
|
| | | #include "PropOutputCfg.h"
|
| | | #include "PropSysReg1.h"
|
| | |
|
| | |
|
| | | // CDialogSysRegSet 对话框
|
| | | //class CPropSysReg1;
|
| | |
|
| | | class CDialogSysRegSet : public CDialogEx
|
| | | {
|
| | | DECLARE_DYNAMIC(CDialogSysRegSet)
|
| | |
|
| | | public:
|
| | | CDialogSysRegSet(CWnd* pParent = nullptr); // 标准构造函数
|
| | | virtual ~CDialogSysRegSet();
|
| | | RECT rect0;
|
| | | RECT rect1;
|
| | | int m_nPropHeight;
|
| | | int m_nFrameheight;
|
| | | int m_nScrollPos = 0;
|
| | |
|
| | | // 对话框数据
|
| | | #ifdef AFX_DESIGN_TIME
|
| | | enum { IDD = IDD_DIALOG_SYSREG_SET };
|
| | | #endif
|
| | |
|
| | | protected:
|
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
| | | CPropSysReg1 m_propsysreg1;
|
| | | CPropModeCfg m_propmodecfg1;
|
| | | CPropMemCfg m_propmemcfg1;
|
| | |
|
| | | CPropCommCfg m_propcommcfg1;
|
| | | CPropCommCfg m_propcommcfg2;
|
| | | CPropInputCfg m_propinputcfg1;
|
| | | CPropInputCfg m_propinputcfg2;
|
| | | CPropInputCfg m_propinputcfg3;
|
| | | CPropInputCfg m_propinputcfg4;
|
| | | CPropOutputCfg m_propoutputcfg1;
|
| | | CPropOutputCfg m_propoutputcfg2;
|
| | | CPropOutputCfg m_propoutputcfg3;
|
| | | CPropOutputCfg m_propoutputcfg4;
|
| | | CPropCommCfg m_propcommcfg3;
|
| | |
|
| | | DECLARE_MESSAGE_MAP()
|
| | | public:
|
| | | virtual BOOL OnInitDialog();
|
| | | CScrollBar m_prop_scrollbar1;
|
| | | afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
|
| | | afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
|
| | | afx_msg void OnLbnSelchangeListSel1();
|
| | | CListBox m_listSel1;
|
| | |
|
| | | int m_nTotalProp = 0;
|
| | | int m_nCurProp = 0;
|
| | | CDialogEx * m_PropPages[30];
|
| | |
|
| | |
|
| | | int AddPropPage(CString sName, CDialogEx & rDlg);
|
| | | };
|
| | |
| | | int LastSpeedTime = (int)GetTimemS();
|
| | | int nThisRecv = 0;
|
| | |
|
| | | COMSTAT cs;
|
| | | OVERLAPPED os;
|
| | | DWORD dwTrans;
|
| | | DWORD dwReaded;
|
| | | // COMSTAT cs;
|
| | | // OVERLAPPED os;
|
| | | // DWORD dwTrans;
|
| | | // DWORD dwReaded;
|
| | | for (; MyThreadProc1ToRun == 1;)
|
| | | {
|
| | |
|
| | |
| | | /*
|
| | | /*
|
| | |
|
| | |
|
| | |
|
| | |
| | |
|
| | | };
|
| | |
|
| | | enum enInputFilter
|
| | | {
|
| | | InputFilter_None = 0,
|
| | | InputFilter_1mS = 1,
|
| | | InputFilter_2mS = 2,
|
| | | InputFilter_4mS = 3,
|
| | | InputFilter_8mS = 4,
|
| | | InputFilter_16mS = 5,
|
| | | InputFilter_32mS = 6,
|
| | | InputFilter_64mS = 7,
|
| | | InputFilter_128mS = 8,
|
| | | InputFilter_256mS = 9,
|
| | | };
|
| | |
|
| | | enum enOutputHold
|
| | | {
|
| | | Output_Hold = 0,
|
| | | Output_Set_0 = 1,
|
| | | Output_Set_1 = 2,
|
| | | };
|
| | |
|
| | | enum enPortType
|
| | | {
|
| | | PortType_Com = 0, //¼ÆËã»úͨѶ
|
| | | PortType_Gen = 1, //ͨÓÃͨѶ£¬×ÔÓÉ¿Ú
|
| | | PortType_KLink = 2, //KlinkͨѶ
|
| | | PortType_KBus = 3, //KBusͨѶ
|
| | | PortType_KNet = 4, // KNetͨѶ
|
| | | PortType_ModbusRTU = 5, //Modbus RTU ͨѶ
|
| | | };
|
| | |
|
| | | enum enKeventType
|
| | | {
|
| | | EventTypeNone = 0,
|
| | | EventTypePowerUp = 1,
|
| | | EventTypePowerDown = 2,
|
| | | EventTypePowerRecover = 3,
|
| | | EventTypeConnected = 4,
|
| | | EventTypeLostCon = 5,
|
| | | EventTypeSetTime = 6,
|
| | | EventTypeSysCfg = 7,
|
| | | EventTypeProg = 8,
|
| | | EventTypeForce = 9,
|
| | | EventTypeClearEvent = 10,
|
| | |
|
| | |
|
| | | EventType
|
| | | };
|
| | | typedef struct tagInfoBlock
|
| | | {
|
| | | USHORT nDeviceType;
|
| | | USHORT ProgVer;
|
| | | USHORT KlinkVer;
|
| | | USHORT nCapacity;
|
| | | UCHAR nDInput;
|
| | | UCHAR nDOutput;
|
| | | UCHAR nAInput;
|
| | | UCHAR nAOutput;
|
| | | UCHAR nHInput;
|
| | | UCHAR nHOutput;
|
| | | UCHAR nExt1;
|
| | | UCHAR nEXT2;
|
| | |
|
| | | }stKMInfoBlock;
|
| | |
|
| | | typedef struct tagKMFuncParam
|
| | | {
|
| | | USHORT EnablePLC : 1; //使能内部PLC功能
|
| | | USHORT RunMode; //工作模式
|
| | | }stKMFuncParam;
|
| | |
|
| | | //输入输出地址映射
|
| | | typedef struct tagAddrMapping
|
| | | {
|
| | | USHORT InputAddr;
|
| | | USHORT OutputAddr;
|
| | | USHORT WRAddr;
|
| | | USHORT DTAddr;
|
| | | }stAddrMapping;
|
| | | typedef struct tagComPortParam
|
| | | {
|
| | | USHORT PortType : 4; /* 0-5=Com,Gen,KLink,KBus,KNet,RTU */
|
| | | USHORT ByteSize : 2; /* 0-1=Number of bits/byte, 7-8 */
|
| | | USHORT Parity : 4; /* 0-4=None,Odd,Even,Mark,Space */
|
| | | USHORT StopBits : 2; /* 0,1,2 = 1, 1.5, 2 */
|
| | | USHORT EofChar : 2; /* 0,1,2 = None, CR, CR+LF, ETX; End of character */
|
| | | USHORT SofChar : 2; /* 0,1,2 = None, STX */
|
| | | USHORT BaudRate; /* =*100 Baudrate at which running */
|
| | | }stComPortParam;
|
| | |
|
| | | typedef struct tagInputFilterParam
|
| | | {
|
| | | BYTE Filter0 : 4;
|
| | | BYTE Filter1 : 4;
|
| | |
|
| | | }stInputFilterParam;
|
| | |
|
| | | typedef struct tagOutputHoldParam
|
| | | {
|
| | | BYTE Hold1 : 4;
|
| | | BYTE Hold2 : 4;
|
| | | }stOutputHoldParam;
|
| | | // 硬件描述文件
|
| | |
|
| | | typedef struct tagMSysCfg
|
| | | {
|
| | | unsigned short Sign1; //2
|
| | | unsigned short Seq1; //2
|
| | | UINT cfgvar2; //4
|
| | | stComPortParam Ports[2]; //2*4B
|
| | | stOutputHoldParam OutputParams[16]; //16B
|
| | | stInputFilterParam InputParams[16]; //16B
|
| | |
|
| | | UINT cfgvar3;
|
| | | UINT cfgvar4;
|
| | | UINT cfgvar5;
|
| | | UINT cfgvar6;
|
| | | UINT cfgvar7;
|
| | | UINT cfgvar8;
|
| | | UINT cfgvar9;
|
| | | UINT cfgvar10;
|
| | | UINT cfgvar11;
|
| | | UINT cfgvar12;
|
| | | UINT cfgvar13;
|
| | | UINT cfgvar14;
|
| | | UINT cfgvar15;
|
| | | UINT cfgvar16; //14*4 56B
|
| | | UINT Space1[5]; // 20B
|
| | |
|
| | | unsigned short CRC1; //2B
|
| | | unsigned short EndSign1; //2B
|
| | | }stKMSysCfg, *pKMSysCfg; //128B
|
| | |
|
| | |
|
| | | typedef struct tagTimer
|
| | |
| | | unsigned short nParamAddr;
|
| | | }stBinProg1;
|
| | | typedef struct stBinProg15
|
| | | { //定时器
|
| | | //单参数高级指令
|
| | | { //定时器
|
| | | //单参数高级指令
|
| | | unsigned char nOp;
|
| | | unsigned char nOpNum;
|
| | | unsigned short nParamAddr1;
|
| | |
| | | unsigned short resvr2;
|
| | | }stBinProg15;
|
| | | typedef struct stBinProg2
|
| | | { //比较指令
|
| | | //双参数高级指令
|
| | | { //比较指令
|
| | | //双参数高级指令
|
| | | unsigned char nOp;
|
| | | unsigned char nOpNum;
|
| | | unsigned short nParamAddr1;
|
| | |
| | | unsigned short nParamAddr2;
|
| | | }stBinProg2;
|
| | | typedef struct stBinProg3
|
| | | { //三参数高级指令
|
| | | { //三参数高级指令
|
| | | unsigned char nOp;
|
| | | unsigned char nOpNum;
|
| | | unsigned short nParamAddr1;
|
| | |
| | | PkgLen1 = sizeof(stKLReqPacket) + Datalen;
|
| | | break;
|
| | | case KLCmdGetInfo:
|
| | | case KLCmdGetSN:
|
| | | Datalen = 0;
|
| | | PkgLen1 = sizeof(stKLReqPacket) + 4 + Datalen;
|
| | | break;
|
| | | case KLCmdGetFactoryData:
|
| | | Datalen = 0;
|
| | | PkgLen1 = sizeof(stKLReqPacket) + 4 + Datalen;
|
| | | break;
|
| | | case KLCmdWriteFactoryData:
|
| | | Datalen = nCount;
|
| | | memcpy(pPacket->Params + 4, pData, Datalen);
|
| | | PkgLen1 = sizeof(stKLReqPacket) + 4 + Datalen;
|
| | | break;
|
| | | case KLCmdRead:
|
| | | Datalen = 0;
|
| | |
| | | case KLCmdPing:
|
| | | case KLCmdPingReply:
|
| | | *nCount = Datalen;
|
| | | memcpy(pPacket->Datas, pData, Datalen);
|
| | | memcpy(pData, pPacket->Datas, Datalen);
|
| | | break;
|
| | | case KLCmdGetInfo:
|
| | | case KLCmdVerInfo:
|
| | | *nCount = Datalen;
|
| | | memcpy(pPacket->Datas, pData, Datalen);
|
| | | memcpy(pData, pPacket->Datas, Datalen);
|
| | | break;
|
| | | case KLCmdGetUid:
|
| | | case KLCmdGetSN:
|
| | | case KLCmdGetFactoryData:
|
| | | *nCount = Datalen;
|
| | | memcpy(pData, pPacket->Datas, Datalen);
|
| | | break;
|
| | | case KLCmdWriteFactoryData:
|
| | | *nCount = Datalen;
|
| | | break;
|
| | | case KLCmdRead:
|
| | | case KLCmdReadReply:
|
| | |
| | |
|
| | | int len2=RecvPacket(m_RecvBuf, numToRead);
|
| | | unsigned char nCmd;
|
| | | unsigned short nCount;
|
| | | unsigned short nCount=0;
|
| | | ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nCount, m_DataBuf);
|
| | | Value[0] = m_DataBuf[0];
|
| | | return KL_OK;
|
| | |
| | | SendPacket(m_Packetbuf, len1);
|
| | | int len2 = RecvPacket(m_RecvBuf, 64);
|
| | | unsigned char nCmd;
|
| | | unsigned short nCount;
|
| | | unsigned short nCount=0;
|
| | | ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nCount, m_DataBuf);
|
| | | return KL_OK;
|
| | | }
|
| | | int KLink::ReadBits(UCHAR nDst, UCHAR nBitCount, UCHAR nType, USHORT nBitAddr, UCHAR * Values)
|
| | | int KLink::ReadBits(UCHAR nDst, UCHAR nType, USHORT nBitAddr, UCHAR nBitCount, UCHAR * Values)
|
| | | {
|
| | | return KL_OK;
|
| | | }
|
| | | int KLink::WriteBits(UCHAR nDst, UCHAR nBitCount, UCHAR nType, USHORT nBitAddr, UCHAR * Values)
|
| | | int KLink::WriteBits(UCHAR nDst, UCHAR nType, USHORT nBitAddr, UCHAR nBitCount, UCHAR * Values)
|
| | | {
|
| | | return KL_OK;
|
| | | }
|
| | | int KLink::ReadBitsByWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT *Values)
|
| | | int KLink::ReadBitsByWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT *Values)
|
| | | {
|
| | | return KL_OK;
|
| | | }
|
| | | int KLink::WriteBitsByWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT *Values)
|
| | | int KLink::WriteBitsByWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT *Values)
|
| | | {
|
| | | return KL_OK;
|
| | | }
|
| | |
| | | return m_nSeq;
|
| | | }
|
| | |
|
| | | int KLink::ReadDataByte(UCHAR nDst, UCHAR nByteCount, UCHAR nType, USHORT nByteAddr, UCHAR * Values)
|
| | | int KLink::ReadDataByte(UCHAR nDst, UCHAR nType, USHORT nByteAddr, UCHAR nByteCount, UCHAR * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | m_resultStr.Empty();
|
| | |
| | | m_resultStr += s1;
|
| | | }
|
| | | unsigned char nCmd ;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | if (res == KL_OK)
|
| | | {
|
| | |
| | |
|
| | | return KL_OK;
|
| | | }
|
| | | int KLink::WriteDataByte(UCHAR nDst, UCHAR nByteCount, UCHAR nType, USHORT nByteAddr, UCHAR * Values)
|
| | | int KLink::WriteDataByte(UCHAR nDst, UCHAR nType, USHORT nByteAddr, UCHAR nByteCount, UCHAR * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | UCHAR nExpSeq = GetNextSeq();
|
| | | int len1 = MakeReqPacketEx(m_Packetbuf, nDst, m_Stat1.StatByte, KLCmdWriteDataByte, nType, nByteAddr/2, nByteCount, Values);
|
| | | SendPacket(m_Packetbuf, len1);
|
| | | int len2 = RecvPacket(m_RecvBuf, 64);
|
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, 64); }
|
| | | nByteCount = 0;
|
| | | int numToRead = sizeof(stKLRplyPktHdr) + nByteCount;
|
| | | int len2 = RecvPacket(m_RecvBuf, numToRead);
|
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, numToRead); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | return res;
|
| | | }
|
| | |
|
| | | int KLink::ReadDataWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values)
|
| | | int KLink::ReadDataWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | UCHAR nExpSeq = GetNextSeq();
|
| | |
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, numToRead); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | for (int i = 0; i < nnCount/2; i++)
|
| | | {
|
| | |
| | | }
|
| | | return res;
|
| | | }
|
| | | int KLink::WriteDataWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values)
|
| | | int KLink::WriteDataWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | UCHAR nExpSeq = GetNextSeq();
|
| | | int len1 = MakeReqPacketEx(m_Packetbuf, nDst, m_Stat1.StatByte, KLCmdWriteDataWord, nType, nWordAddr, nWordCount, Values);
|
| | | SendPacket(m_Packetbuf, len1);
|
| | | int len2 = RecvPacket(m_RecvBuf, 64);
|
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, 64); }
|
| | | nWordCount = 0;
|
| | | int numToRead = sizeof(stKLRplyPktHdr) + nWordCount;
|
| | | int len2 = RecvPacket(m_RecvBuf, nWordCount);
|
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, nWordCount); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | Values[0] = m_DataBuf[0];
|
| | | return res;
|
| | | }
|
| | |
|
| | | int KLink::ReadData(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values)
|
| | | int KLink::ReadData(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | UCHAR nExpSeq = GetNextSeq();
|
| | |
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, 64); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | for (int i=0;i<nnCount;i++) Values[i] = m_DataBuf[i];
|
| | | return res;
|
| | |
|
| | | return KL_OK;
|
| | | }
|
| | | int KLink::WriteData(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values)
|
| | | int KLink::WriteData(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | UCHAR nExpSeq = GetNextSeq();
|
| | |
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, 64); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | // Values[0] = m_DataBuf[0];
|
| | | return res;
|
| | |
|
| | | return KL_OK;
|
| | | }
|
| | | int KLink::GetInfo(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values)
|
| | | int KLink::GetInfo(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | UCHAR nExpSeq = GetNextSeq();
|
| | | int len1 = MakeReqPacketEx(m_Packetbuf, nDst, m_Stat1.StatByte, KLCmdGetInfo, nType, nWordAddr, nWordCount, Values);
|
| | | CString s1;
|
| | | for (int i = 0; i < len1; i++) {
|
| | | s1.AppendFormat(_T("%02X "), m_Packetbuf[i]);
|
| | | }
|
| | | m_resultStr = s1;
|
| | | SendPacket(m_Packetbuf, len1);
|
| | | int len2 = RecvPacket(m_RecvBuf, 64);
|
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, 64); }
|
| | | int numToRead = sizeof(stKLRplyPktHdr) + nWordCount;
|
| | | int len2 = RecvPacket(m_RecvBuf, numToRead);
|
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, numToRead); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, Values);
|
| | | // Values[0] = m_DataBuf[0];
|
| | | return res;
|
| | |
|
| | | return KL_OK;
|
| | | }
|
| | | int KLink::GetSN(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | UCHAR nExpSeq = GetNextSeq();
|
| | | int len1 = MakeReqPacketEx(m_Packetbuf, nDst, m_Stat1.StatByte, KLCmdGetSN, nType, nWordAddr, nWordCount, Values);
|
| | | CString s1;
|
| | | for (int i = 0; i < len1; i++) {
|
| | | s1.AppendFormat(_T("%02X "), m_Packetbuf[i]);
|
| | | }
|
| | | m_resultStr = s1;
|
| | | SendPacket(m_Packetbuf, len1);
|
| | | nWordCount = 4;
|
| | | int numToRead = sizeof(stKLRplyPktHdr) + nWordCount;
|
| | | int len2 = RecvPacket(m_RecvBuf, numToRead);
|
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, numToRead); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount = 0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, Values);
|
| | | // Values[0] = m_DataBuf[0];
|
| | | return res;
|
| | |
|
| | | return KL_OK;
|
| | | return 0;
|
| | | }
|
| | | int KLink::GetUID(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | UCHAR nExpSeq = GetNextSeq();
|
| | | int len1 = MakeReqPacketEx(m_Packetbuf, nDst, m_Stat1.StatByte, KLCmdGetUid, nType, nWordAddr, nWordCount, Values);
|
| | | CString s1;
|
| | | for (int i = 0; i < len1; i++) {
|
| | | s1.AppendFormat(_T("%02X "), m_Packetbuf[i]);
|
| | | }
|
| | | m_resultStr = s1;
|
| | | SendPacket(m_Packetbuf, len1);
|
| | | int numToRead = sizeof(stKLRplyPktHdr) + nWordCount;
|
| | | int len2 = RecvPacket(m_RecvBuf, numToRead);
|
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, numToRead); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount = 0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, Values);
|
| | | // Values[0] = m_DataBuf[0];
|
| | | return res;
|
| | |
|
| | | return KL_OK;
|
| | | return 0;
|
| | | }
|
| | |
|
| | | int KLink::GetFactoryData(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | UCHAR nExpSeq = GetNextSeq();
|
| | | int len1 = MakeReqPacketEx(m_Packetbuf, nDst, m_Stat1.StatByte, KLCmdGetFactoryData, nType, nWordAddr, nWordCount, Values);
|
| | | CString s1;
|
| | | for (int i = 0; i < len1; i++) {
|
| | | s1.AppendFormat(_T("%02X "), m_Packetbuf[i]);
|
| | | }
|
| | | m_resultStr = s1;
|
| | | SendPacket(m_Packetbuf, len1);
|
| | | int numToRead = sizeof(stKLRplyPktHdr) + nWordCount;
|
| | | int len2 = RecvPacket(m_RecvBuf, numToRead);
|
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, numToRead); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount = 0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, Values);
|
| | | // Values[0] = m_DataBuf[0];
|
| | | return res;
|
| | | return KL_OK;
|
| | | }
|
| | | int KLink::WriteFactoryData(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values)
|
| | | {
|
| | | m_Dst = nDst;
|
| | | UCHAR nExpSeq = GetNextSeq();
|
| | | int len1 = MakeReqPacketEx(m_Packetbuf, nDst, m_Stat1.StatByte, KLCmdWriteFactoryData, nType, nWordAddr, nWordCount, Values);
|
| | | SendPacket(m_Packetbuf, len1);
|
| | | nWordCount = 0;
|
| | | int numToRead = sizeof(stKLRplyPktHdr) + nWordCount;
|
| | | int len2 = RecvPacket(m_RecvBuf, numToRead);
|
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, numToRead); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount = 0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | // Values[0] = m_DataBuf[0];
|
| | | return res;
|
| | |
|
| | | return KL_OK;
|
| | | }
|
| | |
|
| | | int KLink::GetEventLogCount(UCHAR nDst, int * nCount)
|
| | | {
|
| | | m_Dst = nDst;
|
| | |
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, 64); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | nCount[0] = *(int *)m_DataBuf;
|
| | | return res;
|
| | |
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, 64); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | int res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | |
|
| | | memcpy(theEventLogs, m_DataBuf, nCount * sizeof(stEventLog));
|
| | |
| | | int KLink::GetDateTime32(UCHAR nDst, UINT * pValue)
|
| | | {
|
| | | int res = KL_OK;
|
| | | res = ReadDataByte(nDst, 4, KLDataTypeSDT, 36, (UCHAR *)pValue);
|
| | | res = ReadDataByte(nDst, KLDataTypeSDT, 36, 4, (UCHAR *)pValue);
|
| | | return res;
|
| | |
|
| | | }
|
| | |
| | | int KLink::SetDateTime32(UCHAR nDst, UINT Value)
|
| | | {
|
| | | int res = KL_OK;
|
| | | res = WriteDataByte(nDst, 4, KLDataTypeSDT, 36, (UCHAR *)&Value);
|
| | | res = WriteDataByte(nDst, KLDataTypeSDT, 36, 4, (UCHAR *)&Value);
|
| | | return res;
|
| | | }
|
| | |
|
| | |
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, 64); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | return res;
|
| | |
|
| | |
| | | if (len2 == 0) { len2 = RecvPacket(m_RecvBuf, 64); }
|
| | | if (len2 == 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | return res;
|
| | |
|
| | |
| | | if (len2 <= 0) { len2 = RecvPacket(m_RecvBuf, numToRead); }
|
| | | if (len2 <= 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | unsigned char * values2 = (unsigned char *)Values;
|
| | | for (int i = 0; i < nnCount; i++) values2[i] = m_DataBuf[i];
|
| | |
| | | if (len2 <= 0) { len2 = RecvPacket(m_RecvBuf, 6); }
|
| | | if (len2 <= 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | return res;
|
| | |
|
| | |
| | | if (len2 <= 0) { len2 = RecvPacket(m_RecvBuf, 6, 30); }
|
| | | if (len2 <= 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | // Values[0] = m_DataBuf[0];
|
| | | return res;
|
| | |
| | | if (len2 <= 0) { len2 = RecvPacket(m_RecvBuf, 6, 30); }
|
| | | if (len2 <= 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | return res;
|
| | | }
|
| | |
| | | if (len2 <= 0) { len2 = RecvPacket(m_RecvBuf, numToRead); }
|
| | | if (len2 <= 0) return KL_ERR;
|
| | | unsigned char nCmd;
|
| | | unsigned short nnCount;
|
| | | unsigned short nnCount=0;
|
| | | res = ParseRplyPacket(m_RecvBuf, len2, &nCmd, &m_DstStat.StatByte, &nnCount, m_DataBuf);
|
| | | unsigned char * values2 = (unsigned char *)Values;
|
| | | for (int i = 0; i < nnCount; i++) values2[i] = m_DataBuf[i];
|
| | |
| | | KLCmdResetMachine,
|
| | | KLCmdGetUid,
|
| | | KLCmdSetTime,
|
| | | KLCmdGetSN,
|
| | |
|
| | | KLCmdMC,
|
| | |
|
| | | KLCmdMC = 0x70, |
| | | KLCmdMD,
|
| | | KLCmdMG,
|
| | |
|
| | |
| | | for (int i = 0; i < ReTryCount; i++)
|
| | | {
|
| | | int len1= RecvPkgFunc(pBufByte + len2, LenToRead - len2);
|
| | | if (len1 <= 0 || len1 > 256) {
|
| | | continue;
|
| | | }
|
| | | len2 += len1;
|
| | | if (len2 >= LenToRead) break;
|
| | | }
|
| | |
| | | int ProcessPacket(void *pBuf, int nLen);
|
| | | int ParseRplyPacket(void *pBuf, int nPkgLen, UCHAR * nCmd, UCHAR * Status, USHORT* nCount, void * pData);
|
| | |
|
| | | int GetInfo(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values);
|
| | | int GetSN(UCHAR nDst, int * nCount);
|
| | | int GetUID(UCHAR nDst, int * nCount);
|
| | | int GetInfo(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
|
| | | int GetSN(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
|
| | | int GetUID(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
|
| | | int GetFactoryData(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
|
| | | int WriteFactoryData(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
|
| | |
|
| | | //int GetTime32(UCHAR nDst, int * nCount);
|
| | | //int SetTime32(UCHAR nDst, int * nCount);
|
| | | int GetDateTime32(UCHAR nDst, UINT * pValue);
|
| | |
| | |
|
| | | int ReadBit(UCHAR nDst, UCHAR nType,USHORT nBitAddr, UCHAR * Value);//Read 1 Single bit
|
| | | int WriteBit(UCHAR nDst, UCHAR nType,USHORT nBitAddr, UCHAR Value);//Write 1 Single bit
|
| | | int ReadBits(UCHAR nDst, UCHAR nBitCount, UCHAR nType, USHORT nBitAddr, UCHAR * Values);
|
| | | int WriteBits(UCHAR nDst, UCHAR nBitCount, UCHAR nType, USHORT nBitAddr, UCHAR * Values);
|
| | | int ReadBitsByWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT *Values);
|
| | | int WriteBitsByWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT *Values);
|
| | | int ReadBits(UCHAR nDst, UCHAR nType, USHORT nBitAddr, UCHAR nBitCount, UCHAR * Values);
|
| | | int WriteBits(UCHAR nDst, UCHAR nType, USHORT nBitAddr, UCHAR nBitCount, UCHAR * Values);
|
| | | int ReadBitsByWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT *Values);
|
| | | int WriteBitsByWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT *Values);
|
| | |
|
| | | int ReadDataByte(UCHAR nDst, UCHAR nByteCount, UCHAR nType, USHORT nByteAddr, UCHAR * Values);
|
| | | int WriteDataByte(UCHAR nDst, UCHAR nByteCount, UCHAR nType, USHORT nByteAddr, UCHAR * Values);
|
| | | int ReadDataByte(UCHAR nDst, UCHAR nType, USHORT nByteAddr, UCHAR nByteCount, UCHAR * Values);
|
| | | int WriteDataByte(UCHAR nDst, UCHAR nType, USHORT nByteAddr, UCHAR nByteCount, UCHAR * Values);
|
| | |
|
| | | int ReadDataWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values);
|
| | | int WriteDataWord(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values);
|
| | | int ReadDataWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
|
| | | int WriteDataWord(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
|
| | |
|
| | | int ReadData(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values);
|
| | | int WriteData(UCHAR nDst, UCHAR nWordCount, UCHAR nType, USHORT nWordAddr, USHORT * Values);
|
| | | int ReadData(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
|
| | | int WriteData(UCHAR nDst, UCHAR nType, USHORT nWordAddr, UCHAR nWordCount, USHORT * Values);
|
| | |
|
| | | int GetMode(UCHAR nDst, UCHAR nType);
|
| | | int ChangeMode(UCHAR nDst, UCHAR nType);
|
| | |
| | |
|
| | | CMTerm2App::CMTerm2App() noexcept
|
| | | {
|
| | | m_bHiColorIcons = TRUE;
|
| | | // 支持重新启动管理器
|
| | | m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS;
|
| | | #ifdef _MANAGED
|
| | |
| | | virtual int ExitInstance();
|
| | |
|
| | | // 实现
|
| | | bool m_bHiColorIcons;
|
| | |
|
| | | afx_msg void OnAppAbout();
|
| | | DECLARE_MESSAGE_MAP()
|
| | | afx_msg void OnFileNew();
|
| | |
| | | </PropertyGroup>
|
| | | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
| | | <LinkIncremental>false</LinkIncremental>
|
| | | <LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;x64\Release</LibraryPath>
|
| | | </PropertyGroup>
|
| | | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
| | | <ClCompile>
|
| | |
| | | </ResourceCompile>
|
| | | </ItemDefinitionGroup>
|
| | | <ItemGroup>
|
| | | <ClInclude Include="CAnsiParser.h" />
|
| | | <ClInclude Include="CDataParser1.h" />
|
| | | <ClInclude Include="CDialogCoilMon.h" />
|
| | | <ClInclude Include="CDialogCommSet1.h" />
|
| | | <ClInclude Include="AnsiParser.h" />
|
| | | <ClInclude Include="DataParser1.h" />
|
| | | <ClInclude Include="DialogCoilMon.h" />
|
| | | <ClInclude Include="DialogCommSet1.h" />
|
| | | <ClInclude Include="DialogFactCfg.h" />
|
| | | <ClInclude Include="DialogIoComment.h" />
|
| | | <ClInclude Include="DialogSetCoil.h" />
|
| | | <ClInclude Include="DialogSetData.h" />
|
| | |
| | | <ClInclude Include="KMachine.h" />
|
| | | <ClInclude Include="MTerm2CommDevView.h" />
|
| | | <ClInclude Include="MTerm2CommTestView.h" />
|
| | | <ClInclude Include="CDialogDataMon.h" />
|
| | | <ClInclude Include="CDialogDateTime.h" />
|
| | | <ClInclude Include="CDialogEventLog.h" />
|
| | | <ClInclude Include="CDialogForceIO.h" />
|
| | | <ClInclude Include="CDialogInfoDisplay.h" />
|
| | | <ClInclude Include="CDialogProgress.h" />
|
| | | <ClInclude Include="CDialogStatusShow.h" />
|
| | | <ClInclude Include="CDialogSysRegSet.h" />
|
| | | <ClInclude Include="DialogDataMon.h" />
|
| | | <ClInclude Include="DialogDateTime.h" />
|
| | | <ClInclude Include="DialogEventLog.h" />
|
| | | <ClInclude Include="DialogForceIO.h" />
|
| | | <ClInclude Include="DialogInfoDisplay.h" />
|
| | | <ClInclude Include="DialogProgress.h" />
|
| | | <ClInclude Include="DialogStatusShow.h" />
|
| | | <ClInclude Include="DialogSysRegSet.h" />
|
| | | <ClInclude Include="ChildFrm.h" />
|
| | | <ClInclude Include="CPropSysReg1.h" />
|
| | | <ClInclude Include="PropCommCfg.h" />
|
| | | <ClInclude Include="PropInputCfg.h" />
|
| | | <ClInclude Include="PropMemCfg.h" />
|
| | | <ClInclude Include="PropModeCfg.h" />
|
| | | <ClInclude Include="PropOutputCfg.h" />
|
| | | <ClInclude Include="PropSysReg1.h" />
|
| | | <ClInclude Include="HvSerialPort.h" />
|
| | | <ClInclude Include="KLinkDefine.h" />
|
| | | <ClInclude Include="KLink.h" />
|
| | |
| | | <ClInclude Include="MyDialogLog.h" />
|
| | | <ClInclude Include="MyFormLog.h" />
|
| | | <ClInclude Include="MyPaneLog.h" />
|
| | | <ClInclude Include="NavView.h" />
|
| | | <ClInclude Include="pch.h" />
|
| | | <ClInclude Include="Resource.h" />
|
| | | <ClInclude Include="targetver.h" />
|
| | | <ClInclude Include="ViewTree.h" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <ClCompile Include="..\MyLib\StaticEx.cpp" />
|
| | | <ClCompile Include="CAnsiParser.cpp" />
|
| | | <ClCompile Include="CDataParser1.cpp" />
|
| | | <ClCompile Include="CDialogCoilMon.cpp" />
|
| | | <ClCompile Include="CDialogCommSet1.cpp" />
|
| | | <ClCompile Include="AnsiParser.cpp" />
|
| | | <ClCompile Include="DataParser1.cpp" />
|
| | | <ClCompile Include="DialogCoilMon.cpp" />
|
| | | <ClCompile Include="DialogCommSet1.cpp" />
|
| | | <ClCompile Include="DialogFactCfg.cpp" />
|
| | | <ClCompile Include="DialogIoComment.cpp" />
|
| | | <ClCompile Include="DialogSetCoil.cpp" />
|
| | | <ClCompile Include="DialogSetData.cpp" />
|
| | | <ClCompile Include="KMachine.cpp" />
|
| | | <ClCompile Include="MTerm2CommDevView.cpp" />
|
| | | <ClCompile Include="MTerm2CommTestView.cpp" />
|
| | | <ClCompile Include="CDialogDataMon.cpp" />
|
| | | <ClCompile Include="CDialogDateTime.cpp" />
|
| | | <ClCompile Include="CDialogEventLog.cpp" />
|
| | | <ClCompile Include="CDialogForceIO.cpp" />
|
| | | <ClCompile Include="CDialogInfoDisplay.cpp" />
|
| | | <ClCompile Include="CDialogProgress.cpp" />
|
| | | <ClCompile Include="CDialogStatusShow.cpp" />
|
| | | <ClCompile Include="CDialogSysRegSet.cpp" />
|
| | | <ClCompile Include="DialogDataMon.cpp" />
|
| | | <ClCompile Include="DialogDateTime.cpp" />
|
| | | <ClCompile Include="DialogEventLog.cpp" />
|
| | | <ClCompile Include="DialogForceIO.cpp" />
|
| | | <ClCompile Include="DialogInfoDisplay.cpp" />
|
| | | <ClCompile Include="DialogProgress.cpp" />
|
| | | <ClCompile Include="DialogStatusShow.cpp" />
|
| | | <ClCompile Include="DialogSysRegSet.cpp" />
|
| | | <ClCompile Include="ChildFrm.cpp" />
|
| | | <ClCompile Include="CPropSysReg1.cpp" />
|
| | | <ClCompile Include="PropCommCfg.cpp" />
|
| | | <ClCompile Include="PropInputCfg.cpp" />
|
| | | <ClCompile Include="PropMemCfg.cpp" />
|
| | | <ClCompile Include="PropModeCfg.cpp" />
|
| | | <ClCompile Include="PropOutputCfg.cpp" />
|
| | | <ClCompile Include="PropSysReg1.cpp" />
|
| | | <ClCompile Include="HvSerialPort.cpp" />
|
| | | <ClCompile Include="KLink.cpp" />
|
| | | <ClCompile Include="MTerm2ProgTxt.cpp" />
|
| | |
| | | <ClCompile Include="MyDialogLog.cpp" />
|
| | | <ClCompile Include="MyFormLog.cpp" />
|
| | | <ClCompile Include="MyPaneLog.cpp" />
|
| | | <ClCompile Include="NavView.cpp" />
|
| | | <ClCompile Include="pch.cpp">
|
| | | <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
| | | <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
| | | <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
| | | <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
| | | </ClCompile>
|
| | | <ClCompile Include="ViewTree.cpp" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <ResourceCompile Include="MTerm2.rc" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <None Include="devices.cfg" />
|
| | | <None Include="res\MTerm2.rc2" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Image Include="res\bitmap1.bmp" />
|
| | | <Image Include="res\bmp00001.bmp" />
|
| | | <Image Include="res\bmp00002.bmp" />
|
| | | <Image Include="res\bmp00003.bmp" />
|
| | | <Image Include="res\classview.bmp" />
|
| | | <Image Include="res\classview_hc.bmp" />
|
| | | <Image Include="res\class_view.ico" />
|
| | | <Image Include="res\class_view_hc.ico" />
|
| | | <Image Include="res\ico00001.ico" />
|
| | | <Image Include="res\ico00002.ico" />
|
| | | <Image Include="res\idr_mult.ico" />
|
| | | <Image Include="res\mainfram.bmp" />
|
| | | <Image Include="res\MTerm2.ico" />
|
| | | <Image Include="res\MTerm2Doc.ico" />
|
| | | <Image Include="res\sort.bmp" />
|
| | | <Image Include="res\sort_hc.bmp" />
|
| | | <Image Include="res\Toolbar.bmp" />
|
| | | <Image Include="res\toolbar1.bmp" />
|
| | | <Image Include="res\toolbar2.bmp" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Text Include="..\MTerm1\Prog.txt" />
|
| | | <Text Include="design1.txt" />
|
| | | </ItemGroup>
|
| | | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
| | | <ImportGroup Label="ExtensionTargets">
|
| | |
| | | <ClInclude Include="MTerm2ProgTxt.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CAnsiParser.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDataParser1.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDialogCoilMon.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDialogCommSet1.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDialogDataMon.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDialogDateTime.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDialogEventLog.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDialogForceIO.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDialogInfoDisplay.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDialogProgress.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDialogStatusShow.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CDialogSysRegSet.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="CPropSysReg1.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="HvSerialPort.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | |
| | | <ClInclude Include="KMachine.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="NavView.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="ViewTree.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="AnsiParser.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DataParser1.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogCoilMon.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogCommSet1.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogDataMon.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogDateTime.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogEventLog.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogForceIO.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogInfoDisplay.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogProgress.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogStatusShow.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogSysRegSet.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="PropSysReg1.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="PropMemCfg.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="PropModeCfg.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="PropCommCfg.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="PropInputCfg.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="PropOutputCfg.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | <ClInclude Include="DialogFactCfg.h">
|
| | | <Filter>头文件</Filter>
|
| | | </ClInclude>
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <ClCompile Include="MainFrm.cpp">
|
| | |
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="MTerm2ProgTxt.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CAnsiParser.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDataParser1.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDialogCoilMon.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDialogCommSet1.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDialogDataMon.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDialogDateTime.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDialogEventLog.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDialogForceIO.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDialogInfoDisplay.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDialogProgress.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDialogStatusShow.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CDialogSysRegSet.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="CPropSysReg1.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="HvSerialPort.cpp">
|
| | |
| | | <ClCompile Include="KMachine.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="NavView.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="ViewTree.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogSysRegSet.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogStatusShow.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogProgress.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogInfoDisplay.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogForceIO.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogEventLog.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogDateTime.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogDataMon.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogCommSet1.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogCoilMon.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DataParser1.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="AnsiParser.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="PropSysReg1.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="PropMemCfg.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="PropModeCfg.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="PropCommCfg.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="PropInputCfg.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="PropOutputCfg.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | <ClCompile Include="DialogFactCfg.cpp">
|
| | | <Filter>源文件</Filter>
|
| | | </ClCompile>
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <ResourceCompile Include="MTerm2.rc">
|
| | |
| | | <None Include="res\MTerm2.rc2">
|
| | | <Filter>资源文件</Filter>
|
| | | </None>
|
| | | <None Include="devices.cfg" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Image Include="res\Toolbar.bmp">
|
| | |
| | | <Image Include="res\toolbar2.bmp">
|
| | | <Filter>资源文件</Filter>
|
| | | </Image>
|
| | | <Image Include="res\class_view.ico">
|
| | | <Filter>资源文件</Filter>
|
| | | </Image>
|
| | | <Image Include="res\class_view_hc.ico">
|
| | | <Filter>资源文件</Filter>
|
| | | </Image>
|
| | | <Image Include="res\sort.bmp">
|
| | | <Filter>资源文件</Filter>
|
| | | </Image>
|
| | | <Image Include="res\classview.bmp">
|
| | | <Filter>资源文件</Filter>
|
| | | </Image>
|
| | | <Image Include="res\classview_hc.bmp">
|
| | | <Filter>资源文件</Filter>
|
| | | </Image>
|
| | | <Image Include="res\sort_hc.bmp">
|
| | | <Filter>资源文件</Filter>
|
| | | </Image>
|
| | | <Image Include="res\bitmap1.bmp">
|
| | | <Filter>资源文件</Filter>
|
| | | </Image>
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Text Include="..\MTerm1\Prog.txt">
|
| | | <Filter>源文件</Filter>
|
| | | </Text>
|
| | | <Text Include="design1.txt" />
|
| | | </ItemGroup>
|
| | | </Project> |
| | |
| | | #include <SetupAPI.h>
|
| | | #include "../MyLib/Functions.hpp"
|
| | | #include "../MyLib/UI_Func/UI_Func.hpp"
|
| | | #include "CAnsiParser.h"
|
| | | #include "CDataParser1.h"
|
| | | #include "AnsiParser.h"
|
| | | #include "DataParser1.h"
|
| | | #include "KLink.h"
|
| | | //#include "../MyLib/SerialCom/SerialCom.hpp"
|
| | | #include <Dbt.h>
|
| | | #include "CDialogCommSet1.h"
|
| | | #include "CDialogSysRegSet.h"
|
| | | #include "CDialogStatusShow.h"
|
| | | #include "CDialogInfoDisplay.h"
|
| | | #include "DialogCommSet1.h"
|
| | | #include "DialogSysRegSet.h"
|
| | | #include "DialogStatusShow.h"
|
| | | #include "DialogInfoDisplay.h"
|
| | |
|
| | | #include "CDialogCoilMon.h"
|
| | | #include "CDialogDataMon.h"
|
| | | #include "DialogCoilMon.h"
|
| | | #include "DialogDataMon.h"
|
| | |
|
| | | #include "CDialogProgress.h"
|
| | | #include "CDialogEventLog.h"
|
| | | #include "CDialogDateTime.h"
|
| | | #include "CDialogForceIO.h"
|
| | | #include "DialogProgress.h"
|
| | | #include "DialogEventLog.h"
|
| | | #include "DialogDateTime.h"
|
| | | #include "DialogForceIO.h"
|
| | | #include "HvSerialPort.h"
|
| | |
|
| | | #ifdef _DEBUG
|
| | |
| | | // ON_BN_CLICKED(IDC_BUTTON11, &CMTerm2CommDevView::OnBnClickedButton11)
|
| | | ON_BN_CLICKED(IDC_BUTTON12, &CMTerm2CommDevView::OnBnClickedButton12)
|
| | | ON_BN_CLICKED(IDC_BUTTON13, &CMTerm2CommDevView::OnBnClickedButton13)
|
| | | ON_BN_CLICKED(IDC_BUTTON31, &CMTerm2CommDevView::OnBnClickedButton31)
|
| | | ON_BN_CLICKED(IDC_BUTTON2, &CMTerm2CommDevView::OnBnClickedButton2)
|
| | | ON_BN_CLICKED(IDC_BUTTON3, &CMTerm2CommDevView::OnBnClickedButton3)
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | |
|
| | |
| | | //DrawPic1();
|
| | | // MyLogger1.UpdateLogDisplay(0);
|
| | | UpdateDataDisplay();
|
| | | UpdateLEDDisplay();
|
| | | }
|
| | | else if (nIDEvent == 3)
|
| | | {
|
| | |
| | | {
|
| | | DataType = pDoc->MyKLink1.KLDataTypeWX;
|
| | | DCount = 16;
|
| | | res = pDoc->MyKLink1.ReadDataByte(DstAddr, DCount, DataType, DAddr, &pDoc->MyKLink1.MEM.WXB[DAddr]);
|
| | | res = pDoc->MyKLink1.ReadDataByte(DstAddr, DataType, DAddr, DCount, &pDoc->MyKLink1.MEM.WXB[DAddr]);
|
| | | nCount = DCount;
|
| | | if (res == pDoc->MyKLink1.KL_OK)
|
| | | {
|
| | |
| | | {
|
| | | DataType = pDoc->MyKLink1.KLDataTypeWY;
|
| | | DCount = 16;
|
| | | res = pDoc->MyKLink1.ReadDataByte(DstAddr, DCount, DataType, DAddr, &pDoc->MyKLink1.MEM.WYB[DAddr]);
|
| | | res = pDoc->MyKLink1.ReadDataByte(DstAddr, DataType, DAddr, DCount, &pDoc->MyKLink1.MEM.WYB[DAddr]);
|
| | | nCount = DCount;
|
| | | if (res == pDoc->MyKLink1.KL_OK)
|
| | | {
|
| | |
| | | {
|
| | | DataType = pDoc->MyKLink1.KLDataTypeWR;
|
| | | DCount = 32;
|
| | | res = pDoc->MyKLink1.ReadDataByte(DstAddr, DCount, DataType, DAddr, &pDoc->MyKLink1.MEM.WRB[DAddr]);
|
| | | res = pDoc->MyKLink1.ReadDataByte(DstAddr, DataType, DAddr, DCount, &pDoc->MyKLink1.MEM.WRB[DAddr]);
|
| | | nCount = DCount;
|
| | | if (res == pDoc->MyKLink1.KL_OK)
|
| | | {
|
| | |
| | | {
|
| | | DataType = pDoc->MyKLink1.KLDataTypeDT;
|
| | | DCount = 96;
|
| | | res = pDoc->MyKLink1.ReadDataByte(DstAddr, DCount, DataType, DAddr, &pDoc->MyKLink1.MEM.DTB[DAddr]);
|
| | | res = pDoc->MyKLink1.ReadDataByte(DstAddr, DataType, DAddr, DCount, &pDoc->MyKLink1.MEM.DTB[DAddr]);
|
| | | nCount = DCount;
|
| | | if (res == pDoc->MyKLink1.KL_OK)
|
| | | {
|
| | |
| | | DataType = pDoc->MyKLink1.KLDataTypeSDT;
|
| | | ByteAddr = nBlock * 128;
|
| | | DCount = 128;
|
| | | res = pDoc->MyKLink1.ReadDataByte(DstAddr, DCount, DataType, ByteAddr, &pDoc->MyKLink1.MEM.SDB[ByteAddr]);
|
| | | res = pDoc->MyKLink1.ReadDataByte(DstAddr, DataType, ByteAddr, DCount, &pDoc->MyKLink1.MEM.SDB[ByteAddr]);
|
| | | nCount = DCount;
|
| | | if (res == pDoc->MyKLink1.KL_OK)
|
| | | {
|
| | |
| | | // s3.Format("%d %d ",recv2length,wCount2);AppendText(s3);
|
| | |
|
| | | s1.Format(_T("R %d(Try %d %d)=%d->"), dNumtoRead, nTryCount, nTryCount2, wCount2);
|
| | | for (DWORD i = 0; i < 8 && i < wCount2; i++)
|
| | | for (DWORD i = 0; i < 16 && i < wCount2; i++)
|
| | | {
|
| | | s1.AppendFormat(_T("%02X "), recv1[i]);
|
| | | }
|
| | |
| | |
|
| | |
|
| | | }
|
| | | enum enStat
|
| | | {
|
| | | normal=0,
|
| | | setchn=1,
|
| | | setvalue=2,
|
| | | setonoff=3,
|
| | |
|
| | | };
|
| | | int nStat = 0;
|
| | | int ntimecount = 0;
|
| | | #define MaxTimeOut 50
|
| | |
|
| | | int nCurChn = 0;
|
| | | int nValue[4] = { 100,200,300,400 };
|
| | | int LedOn[4] = { 0 };
|
| | | int flickTimer = 0;
|
| | | int CMTerm2CommDevView::UpdateLEDDisplay()
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | | flickTimer++;
|
| | | int bHide = 0;
|
| | | if ((flickTimer & 0x7) > 3) { bHide = 1; }
|
| | |
|
| | | CString s1;
|
| | | s1 = _T("0000");
|
| | |
|
| | | s1.Format(_T("%d%03d"), nCurChn, nValue[nCurChn]);
|
| | | if (nStat == setchn && bHide)
|
| | | {
|
| | | s1.Format(_T(" %03d"), nValue[nCurChn]);
|
| | | }
|
| | | if (nStat == setvalue && bHide)
|
| | | {
|
| | | s1.Format(_T("%d "),nCurChn);
|
| | | }
|
| | | if (nStat == setonoff && bHide)
|
| | | {
|
| | | s1.Format(_T(" "), nCurChn);
|
| | | }
|
| | |
|
| | | SetDlgItemText(IDC_EDIT31, s1);
|
| | |
|
| | | s1.Format(_T("%d %d %d %d"), LedOn[0], LedOn[1], LedOn[2], LedOn[3]);
|
| | | SetDlgItemText(IDC_EDIT32, s1);
|
| | |
|
| | | ntimecount++;
|
| | | if (ntimecount >= MaxTimeOut) { nStat = normal; }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | void CMTerm2CommDevView::OnBnClickedButton31()
|
| | | {
|
| | | // TODO: 在此添加控件通知处理程序代码
|
| | | ntimecount = 0;
|
| | | if (nStat == setchn)
|
| | | {
|
| | | nCurChn++;
|
| | | if (nCurChn >= 4) { nCurChn = 0; }
|
| | | }
|
| | | if (nStat == setvalue)
|
| | | {
|
| | | nValue[nCurChn] ++;
|
| | | if (nValue[nCurChn] > 999) { nValue[nCurChn] = 999; }
|
| | | }
|
| | | if (nStat == setonoff)
|
| | | {
|
| | | LedOn[nCurChn] =1;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | void CMTerm2CommDevView::OnBnClickedButton2()
|
| | | {
|
| | | // TODO: 在此添加控件通知处理程序代码
|
| | | ntimecount = 0;
|
| | | if (nStat == setchn)
|
| | | {
|
| | | nCurChn--;
|
| | | if (nCurChn <0) { nCurChn = 3; }
|
| | | }
|
| | | if (nStat == setvalue)
|
| | | {
|
| | | nValue[nCurChn] --;
|
| | | if (nValue[nCurChn] <= 0) { nValue[nCurChn] = 0; }
|
| | | }
|
| | | if (nStat == setonoff)
|
| | | {
|
| | | LedOn[nCurChn] = 0;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | void CMTerm2CommDevView::OnBnClickedButton3()
|
| | | {
|
| | | // TODO: 在此添加控件通知处理程序代码
|
| | | ntimecount = 0;
|
| | | if (nStat == normal)
|
| | | {
|
| | | nStat = setchn;
|
| | | } else if (nStat == setchn)
|
| | | {
|
| | | nStat = setvalue;
|
| | | } else if (nStat == setvalue)
|
| | | {
|
| | | nStat = setonoff;
|
| | | }
|
| | | else if (nStat == setonoff)
|
| | | {
|
| | | nStat = setchn;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
| | | afx_msg void OnBnClickedButton12();
|
| | | afx_msg void OnBnClickedButton13();
|
| | |
|
| | | afx_msg void OnBnClickedButton31();
|
| | | afx_msg void OnBnClickedButton2();
|
| | | afx_msg void OnBnClickedButton3();
|
| | | int UpdateLEDDisplay();
|
| | | };
|
| | |
| | | #include "MTerm2CommDevView.h"
|
| | | #include <propkey.h>
|
| | |
|
| | | #include "CDialogCommSet1.h"
|
| | | #include "CDialogStatusShow.h"
|
| | | #include "DialogCommSet1.h"
|
| | | #include "DialogStatusShow.h"
|
| | | #include "DialogSysRegSet.h"
|
| | | #include "DialogFactCfg.h"
|
| | |
|
| | | #include "HvSerialPort.h"
|
| | | #include <functional>
|
| | |
| | | #endif
|
| | |
|
| | | // CMTerm2Doc
|
| | | CMTerm2Doc::stTypeDef CMTerm2Doc::CoilTypeDef[] =
|
| | | CMTerm2Doc::stTypeNameDef CMTerm2Doc::CoilTypeNameDef[] =
|
| | | {
|
| | | {KLCoilTypeX,"X"},
|
| | | {KLCoilTypeY,"Y"},
|
| | |
| | | {KLCoilTypeC,"C"},
|
| | | {KLCoilTypeT,"T"},
|
| | | };
|
| | | int CMTerm2Doc::nCoilTypeDefCount = sizeof(CMTerm2Doc::CoilTypeDef) / sizeof(stTypeDef);
|
| | | int CMTerm2Doc::nCoilTypeDefCount = sizeof(CMTerm2Doc::CoilTypeNameDef) / sizeof(stTypeNameDef);
|
| | |
|
| | | CMTerm2Doc::stTypeDef CMTerm2Doc::DataTypeDef[] =
|
| | | CMTerm2Doc::stTypeNameDef CMTerm2Doc::DataTypeNameDef[] =
|
| | | {
|
| | | {KLDataTypeDEC,"K"},
|
| | | {KLDataTypeHEX,"H"},
|
| | |
| | | {KLDataTypeSV,"SV"},
|
| | | {KLDataTypeLD,"LD"},
|
| | | };
|
| | | int CMTerm2Doc::nDataTypeDefCount = sizeof(CMTerm2Doc::DataTypeDef) / sizeof(stTypeDef);
|
| | | int CMTerm2Doc::nDataTypeDefCount = sizeof(CMTerm2Doc::DataTypeNameDef) / sizeof(stTypeNameDef);
|
| | |
|
| | | CMTerm2Doc::stOpDef CMTerm2Doc::OpDef[] =
|
| | | {
|
| | |
| | | ON_COMMAND(ID_SIMULATE, &CMTerm2Doc::OnSimulate)
|
| | | ON_UPDATE_COMMAND_UI(ID_SIMULATE, &CMTerm2Doc::OnUpdateSimulate)
|
| | | ON_COMMAND(ID_MENU_STATUS_SHOW, &CMTerm2Doc::OnMenuStatusShow)
|
| | | ON_COMMAND(ID_MENU_FACT_CFG, &CMTerm2Doc::OnMenuFactCfg)
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | |
|
| | |
| | | }
|
| | | int CMTerm2Doc::RecvPacket(void * pBuf, int Len)
|
| | | {
|
| | | int j = myHvSerialPort1.Recv((char *)pBuf, Len);
|
| | | int j = 0;
|
| | | j = myHvSerialPort1.Recv((char *)pBuf, Len);
|
| | | if (j <= 0)
|
| | | {
|
| | | CString s1;
|
| | |
| | | Typetxt.MakeUpper();
|
| | | for (int i = 0; i < nCoilTypeDefCount; i++)
|
| | | {
|
| | | if (Typetxt.Find( CoilTypeDef[i].TypeTxt)==0) {
|
| | | *nCoilType = CoilTypeDef[i].nType;
|
| | | *nCoilAddr = atoi(Typetxt.Mid(CoilTypeDef[i].TypeTxt.GetLength()));
|
| | | return CoilTypeDef[i].nType;
|
| | | if (Typetxt.Find( CoilTypeNameDef[i].TypeTxt)==0) {
|
| | | *nCoilType = CoilTypeNameDef[i].nType;
|
| | | *nCoilAddr = atoi(Typetxt.Mid(CoilTypeNameDef[i].TypeTxt.GetLength()));
|
| | | return CoilTypeNameDef[i].nType;
|
| | | }
|
| | | }
|
| | | return false;;
|
| | |
| | | {
|
| | | for (int i = 0; i < nCoilTypeDefCount; i++)
|
| | | {
|
| | | if (CoilTypeDef[i].nType == nType){
|
| | | typeTxt = CoilTypeDef[i].TypeTxt;
|
| | | if (CoilTypeNameDef[i].nType == nType){
|
| | | typeTxt = CoilTypeNameDef[i].TypeTxt;
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
| | | Typetxt.MakeUpper();
|
| | | for (int i = 0; i < nDataTypeDefCount; i++)
|
| | | {
|
| | | if (Typetxt.Find(DataTypeDef[i].TypeTxt) == 0) {
|
| | | *nDataType = DataTypeDef[i].nType;
|
| | | *nDataAddr = atoi(Typetxt.Mid(DataTypeDef[i].TypeTxt.GetLength()));
|
| | | if (Typetxt.Find(DataTypeNameDef[i].TypeTxt) == 0) {
|
| | | *nDataType = DataTypeNameDef[i].nType;
|
| | | *nDataAddr = atoi(Typetxt.Mid(DataTypeNameDef[i].TypeTxt.GetLength()));
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | for (int i = 0; i < nDataTypeDefCount; i++)
|
| | | {
|
| | | if (DataTypeDef[i].nType == nType) {
|
| | | typeTxt = DataTypeDef[i].TypeTxt;
|
| | | if (DataTypeNameDef[i].nType == nType) {
|
| | | typeTxt = DataTypeNameDef[i].TypeTxt;
|
| | | return true;
|
| | | }
|
| | | }
|
| | |
| | | int CMTerm2Doc::SetAnno(unsigned short nType, unsigned short nAddr, CString sCoilName, CString sAnno)
|
| | | {
|
| | | // TODO: 在此处添加实现代码.
|
| | | // 二分法 查找。
|
| | | // 二分法? 查找。
|
| | | // map.
|
| | | for (int i = 0; i < nCoilAnnoCount; i++) {
|
| | | if (mCoilAnnos[i].nType == nType && mCoilAnnos[i].nAddr == nAddr) {
|
| | |
| | | void CMTerm2Doc::OnPlcSysregSet()
|
| | | {
|
| | | // TODO: 在此添加命令处理程序代码
|
| | | CDialogSysRegSet dialog1;
|
| | | INT_PTR r = dialog1.DoModal();
|
| | | if (r == IDOK)
|
| | | {
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | void CMTerm2Doc::OnMenuFactCfg()
|
| | | {
|
| | | // TODO: 在此添加命令处理程序代码
|
| | | CDialogFactCfg dialog1;
|
| | | INT_PTR r = dialog1.DoModal();
|
| | | if (r == IDOK)
|
| | | {
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | | return nDataAddr;
|
| | | }
|
| | |
|
| | | MyKLink1.ReadDataWord(1, 2, nDataType, nDataAddr, value);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | | MyKLink1.ReadDataWord(1, nDataType, nDataAddr, 2, value);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | | svalue = value[0];
|
| | | return svalue;
|
| | | }
|
| | |
| | | unsigned short svalue[10];
|
| | | svalue[0]=nDataValue;
|
| | | int res = 0;
|
| | | res = MyKLink1.WriteDataWord(1, 2, nDataType, nDataAddr, svalue);
|
| | | res = MyKLink1.WriteDataWord(1, nDataType, nDataAddr, 2, svalue);
|
| | | return res;
|
| | | }
|
| | |
|
| | |
| | | int nDataType = MyKLink1.KLDataTypeWX;
|
| | | int nDataAddr = 0;
|
| | | int nDataCount = 4;
|
| | | int res;
|
| | | // int res;
|
| | | for (int i = 0; i < nDataCount; i++) {
|
| | | KMem.WX[i] = myKMachine1.KMem.WX[i];
|
| | | }
|
| | |
| | | int nDataAddr = 0;
|
| | | int nDataCount = 4;
|
| | | int res;
|
| | | res = MyKLink1.ReadDataWord(1, nDataCount, nDataType, nDataAddr, KMem.WX);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | | res = MyKLink1.ReadDataWord(1, nDataType, nDataAddr, nDataCount, KMem.WX);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | |
|
| | | nDataType = MyKLink1.KLDataTypeWY;
|
| | | nDataAddr = 0;
|
| | | nDataCount = 4;
|
| | | res = MyKLink1.ReadDataWord(1, nDataCount, nDataType, nDataAddr, KMem.WY);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | | res = MyKLink1.ReadDataWord(1, nDataType, nDataAddr, nDataCount, KMem.WY);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | |
|
| | | nDataType = MyKLink1.KLDataTypeWR;
|
| | | nDataAddr = 0;
|
| | | nDataCount = 10;
|
| | | res = MyKLink1.ReadDataWord(1, nDataCount, nDataType, nDataAddr, KMem.WR);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | | res = MyKLink1.ReadDataWord(1, nDataType, nDataAddr, nDataCount, KMem.WR);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | |
|
| | | nDataType = MyKLink1.KLDataTypeDT;
|
| | | nDataAddr = 0;
|
| | | nDataCount = 80;
|
| | | res = MyKLink1.ReadDataWord(1, nDataCount, nDataType, nDataAddr, KMem.DT);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | | res = MyKLink1.ReadDataWord(1, nDataType, nDataAddr, nDataCount, KMem.DT);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | |
|
| | | nDataType = MyKLink1.KLDataTypeSV;
|
| | | nDataAddr = 0;
|
| | | nDataCount = 40;
|
| | | res = MyKLink1.ReadDataWord(1, nDataCount, nDataType, nDataAddr, KMem.SV);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | | res = MyKLink1.ReadDataWord(1, nDataType, nDataAddr, nDataCount, KMem.SV);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | |
|
| | | nDataType = MyKLink1.KLDataTypeEV;
|
| | | nDataAddr = 0;
|
| | | nDataCount = 40;
|
| | | res = MyKLink1.ReadDataWord(1, nDataCount, nDataType, nDataAddr, KMem.EV);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | | res = MyKLink1.ReadDataWord(1, nDataType, nDataAddr, nDataCount, KMem.EV);// (unsigned char *)&KMem.DT[nDataAddr]);
|
| | |
|
| | | }
|
| | |
|
| | |
| | |
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
| | |
|
| | | #pragma once
|
| | | #include "HvSerialPort.h"
|
| | | #include "CAnsiParser.h"
|
| | | #include "CDataParser1.h"
|
| | | #include "AnsiParser.h"
|
| | | #include "DataParser1.h"
|
| | | #include "KDefine.h"
|
| | | #include "KLink.h"
|
| | | #include "KMachine.h"
|
| | |
| | | CString ProgTxt;
|
| | |
|
| | |
|
| | | struct stTypeDef
|
| | | struct stTypeNameDef
|
| | | {
|
| | | int nType;
|
| | | CStringA TypeTxt;
|
| | | };
|
| | | static stTypeDef CoilTypeDef[];
|
| | | static stTypeNameDef CoilTypeNameDef[];
|
| | | static int nCoilTypeDefCount;
|
| | |
|
| | | static stTypeDef DataTypeDef[];
|
| | | static stTypeNameDef DataTypeNameDef[];
|
| | | static int nDataTypeDefCount;
|
| | |
|
| | | stKMem KMem;
|
| | |
| | | int ClearMonitor();
|
| | | int DoPLCMonitor();
|
| | | afx_msg void OnMenuStatusShow();
|
| | | afx_msg void OnMenuFactCfg();
|
| | | };
|
| | |
| | | xform1.eM12 = 0;
|
| | | xform1.eM21 = 0;
|
| | | xform1.eM22 = 1;
|
| | | xform1.eDx = -scroll1.x;
|
| | | xform1.eDy = -scroll1.y;
|
| | | xform1.eDx = float(-scroll1.x);
|
| | | xform1.eDy = float(-scroll1.y);
|
| | |
|
| | | XFORM xform2 = { 1, 0, 0, 1, 0, 0 };
|
| | |
|
| | |
| | | Progsec += thisprogsec;
|
| | | }
|
| | | DbgLog(_T("\r\n")+ sProg);
|
| | | int n = Progsec.Progs.size();
|
| | | int n = int(Progsec.Progs.size());
|
| | | s1.Format(_T("progSec steps %d "), n);
|
| | | DbgLog(s1);
|
| | | for (int i = 0; i < n; i++) {
|
| | |
| | | allprogs += Progsec;
|
| | | }
|
| | | //输出程序
|
| | | int n=allprogs.Progs.size();
|
| | | int n=(int)allprogs.Progs.size();
|
| | | s1.Format(_T("all prog steps %d "), n);
|
| | | DbgLog(s1);
|
| | | for (int i = 0; i < n; i++) {
|
| | |
| | | OpTxt = OpTxtA;
|
| | | OpShowTxt = OpShowTxtA;
|
| | | s1.Format(_T("%d %s %s"), optype, OpTxt, OpShowTxt);
|
| | | DbgLog(s1);
|
| | | // DbgLog(s1);
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
| | | return 0;
|
| | | };
|
| | | int Append(struct stProgSection progsec){
|
| | | int n=progsec.Progs.size();
|
| | | int n=(int)progsec.Progs.size();
|
| | | for (int i = 0; i < n; i++) {
|
| | | Progs.push_back(progsec.Progs[i]);
|
| | | }
|
| | |
| | | // m_dlgMyLog.Create(m_dlgMyLog.IDD, GetParent());
|
| | | // m_dlgMyLog.ShowWindow(SW_SHOW);
|
| | |
|
| | | // BOOL bNameValid;
|
| | |
|
| | | // 创建类视图
|
| | | CString strNavView;
|
| | | // bNameValid = strNavView.LoadString(IDS_CLASS_VIEW);
|
| | | // ASSERT(bNameValid);
|
| | | strNavView = _T("导航视图");
|
| | | if (!m_wndNavView.Create(strNavView, this, CRect(0, 0, 200, 200), TRUE, ID_VIEW_NAVVIEW, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CBRS_LEFT | CBRS_FLOAT_MULTI))
|
| | | {
|
| | | TRACE0("未能创建“导航视图”窗口\n");
|
| | | return FALSE; // 未能创建
|
| | | }
|
| | |
|
| | | if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
|
| | | !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
|
| | | {
|
| | |
| | | m_wndMyPaneLog.EnableDocking(CBRS_ALIGN_ANY);
|
| | | // EnableDocking(CBRS_ALIGN_ANY);
|
| | |
|
| | | m_wndNavView.EnableDocking(CBRS_ALIGN_ANY);
|
| | | DockPane(&m_wndNavView);
|
| | | // CDockablePane* pTabbedBar = nullptr;
|
| | | // m_wndNavView.AttachToTabWnd(&m_wndFileView, DM_SHOW, TRUE, &pTabbedBar);
|
| | |
|
| | |
|
| | | ///*
|
| | | m_wndToolBar_InputShow.EnableDocking(CBRS_ALIGN_ANY);
|
| | |
| | | //
|
| | |
|
| | | #pragma once
|
| | | #include "NavView.h"
|
| | | #include "MyPaneLog.h"
|
| | |
|
| | | //class CMyPaneLog;
|
| | |
| | | CMFCToolBar m_wndToolBar_InputShow;
|
| | | CMFCToolBar m_wndToolBar_Comments;
|
| | |
|
| | | CNavView m_wndNavView;
|
| | |
|
| | | CEdit m_InputShowEdit;
|
| | |
|
| | | CStaticEx m_InputShowStatic;
|
| | |
|
| | | CMFCStatusBar m_wndStatusBar;
|
| | |
|
| | | CMyPaneLog m_wndMyPaneLog;
|
New file |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "framework.h"
|
| | | #include "Resource.h"
|
| | | #include "MainFrm.h"
|
| | | #include "NavView.h"
|
| | |
|
| | | #include "MTerm2.h"
|
| | |
|
| | | class CClassViewMenuButton : public CMFCToolBarMenuButton
|
| | | {
|
| | | friend class CNavView;
|
| | |
|
| | | DECLARE_SERIAL(CClassViewMenuButton)
|
| | |
|
| | | public:
|
| | | CClassViewMenuButton(HMENU hMenu = nullptr) noexcept : CMFCToolBarMenuButton((UINT)-1, hMenu, -1)
|
| | | {
|
| | | }
|
| | |
|
| | | virtual void OnDraw(CDC* pDC, const CRect& rect, CMFCToolBarImages* pImages, BOOL bHorz = TRUE,
|
| | | BOOL bCustomizeMode = FALSE, BOOL bHighlight = FALSE, BOOL bDrawBorder = TRUE, BOOL bGrayDisabledButtons = TRUE)
|
| | | {
|
| | | pImages = CMFCToolBar::GetImages();
|
| | |
|
| | | CAfxDrawState ds;
|
| | | pImages->PrepareDrawImage(ds);
|
| | |
|
| | | CMFCToolBarMenuButton::OnDraw(pDC, rect, pImages, bHorz, bCustomizeMode, bHighlight, bDrawBorder, bGrayDisabledButtons);
|
| | |
|
| | | pImages->EndDrawImage(ds);
|
| | | }
|
| | | };
|
| | |
|
| | | IMPLEMENT_SERIAL(CClassViewMenuButton, CMFCToolBarMenuButton, 1)
|
| | |
|
| | | //////////////////////////////////////////////////////////////////////
|
| | | // 构造/析构
|
| | | //////////////////////////////////////////////////////////////////////
|
| | |
|
| | | CNavView::CNavView() noexcept
|
| | | {
|
| | | m_nCurrSort = ID_SORTING_GROUPBYTYPE;
|
| | | }
|
| | |
|
| | | CNavView::~CNavView()
|
| | | {
|
| | | }
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CNavView, CDockablePane)
|
| | | ON_WM_CREATE()
|
| | | ON_WM_SIZE()
|
| | | ON_WM_CONTEXTMENU()
|
| | | // ON_COMMAND(ID_CLASS_ADD_MEMBER_FUNCTION, OnClassAddMemberFunction)
|
| | | // ON_COMMAND(ID_CLASS_ADD_MEMBER_VARIABLE, OnClassAddMemberVariable)
|
| | | // ON_COMMAND(ID_CLASS_DEFINITION, OnClassDefinition)
|
| | | // ON_COMMAND(ID_CLASS_PROPERTIES, OnClassProperties)
|
| | | ON_COMMAND(ID_NEW_FOLDER, OnNewFolder)
|
| | | ON_WM_PAINT()
|
| | | ON_WM_SETFOCUS()
|
| | | ON_COMMAND_RANGE(ID_SORTING_GROUPBYTYPE, ID_SORTING_SORTBYACCESS, OnSort)
|
| | | ON_UPDATE_COMMAND_UI_RANGE(ID_SORTING_GROUPBYTYPE, ID_SORTING_SORTBYACCESS, OnUpdateSort)
|
| | |
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | | /////////////////////////////////////////////////////////////////////////////
|
| | | // CNavView 消息处理程序
|
| | |
|
| | | int CNavView::OnCreate(LPCREATESTRUCT lpCreateStruct)
|
| | | {
|
| | | if (CDockablePane::OnCreate(lpCreateStruct) == -1)
|
| | | return -1;
|
| | |
|
| | | CRect rectDummy;
|
| | | rectDummy.SetRectEmpty();
|
| | |
|
| | | // 创建视图: |
| | | const DWORD dwViewStyle = WS_CHILD | WS_VISIBLE | TVS_LINESATROOT | TVS_HASLINES | TVS_HASBUTTONS | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; //
|
| | |
|
| | | if (!m_wndNavView.Create(dwViewStyle, rectDummy, this, 2))
|
| | | {
|
| | | TRACE0("未能创建导航栏视图\n");
|
| | | return -1; // 未能创建
|
| | | }
|
| | |
|
| | | // 加载图像: |
| | | m_wndToolBar.Create(this, AFX_DEFAULT_TOOLBAR_STYLE, IDR_SORT);
|
| | | m_wndToolBar.LoadToolBar(IDR_SORT, 0, 0, TRUE /* 已锁定*/);
|
| | |
|
| | | OnChangeVisualStyle();
|
| | |
|
| | | m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() | CBRS_TOOLTIPS | CBRS_FLYBY);
|
| | | m_wndToolBar.SetPaneStyle(m_wndToolBar.GetPaneStyle() & ~(CBRS_GRIPPER | CBRS_SIZE_DYNAMIC | CBRS_BORDER_TOP | CBRS_BORDER_BOTTOM | CBRS_BORDER_LEFT | CBRS_BORDER_RIGHT));
|
| | |
|
| | | m_wndToolBar.SetOwner(this);
|
| | |
|
| | | // 所有命令将通过此控件路由,而不是通过主框架路由: |
| | | m_wndToolBar.SetRouteCommandsViaFrame(FALSE);
|
| | |
|
| | | CMenu menuSort;
|
| | | menuSort.LoadMenu(IDR_POPUP_SORT);
|
| | |
|
| | | m_wndToolBar.ReplaceButton(ID_SORT_MENU, CClassViewMenuButton(menuSort.GetSubMenu(0)->GetSafeHmenu()));
|
| | |
|
| | | CClassViewMenuButton* pButton = DYNAMIC_DOWNCAST(CClassViewMenuButton, m_wndToolBar.GetButton(0));
|
| | |
|
| | | if (pButton != nullptr)
|
| | | {
|
| | | pButton->m_bText = FALSE;
|
| | | pButton->m_bImage = TRUE;
|
| | | pButton->SetImage(GetCmdMgr()->GetCmdImage(m_nCurrSort));
|
| | | pButton->SetMessageWnd(this);
|
| | | }
|
| | |
|
| | | // 填入一些静态树视图数据(此处只需填入虚拟代码,而不是复杂的数据)
|
| | | FillClassView();
|
| | |
|
| | | return 0;
|
| | | }
|
| | |
|
| | | void CNavView::OnSize(UINT nType, int cx, int cy)
|
| | | {
|
| | | CDockablePane::OnSize(nType, cx, cy);
|
| | | AdjustLayout();
|
| | | }
|
| | |
|
| | | void CNavView::FillClassView()
|
| | | {
|
| | | HTREEITEM hRoot1 = m_wndNavView.InsertItem(_T("连接状态"), 0, 0);
|
| | | m_wndNavView.SetItemState(hRoot1, TVIS_BOLD, TVIS_BOLD);
|
| | |
|
| | | HTREEITEM hClass1 = m_wndNavView.InsertItem(_T("KL10-E16D-N1"), 1, 1, hRoot1);
|
| | | m_wndNavView.InsertItem(_T("工作模式"), 3, 3, hClass1);
|
| | | m_wndNavView.InsertItem(_T("状态"), 3, 3, hClass1);
|
| | | m_wndNavView.InsertItem(_T("系统参数"), 3, 3, hClass1);
|
| | | m_wndNavView.Expand(hRoot1, TVE_EXPAND);
|
| | |
|
| | | HTREEITEM hClass2 = m_wndNavView.InsertItem(_T("CFakeAboutDlg"), 1, 1, hRoot1);
|
| | | m_wndNavView.InsertItem(_T("CFakeAboutDlg()"), 3, 3, hClass2);
|
| | |
|
| | | HTREEITEM hClass3 = m_wndNavView.InsertItem(_T("CFakeAppDoc"), 1, 1, hRoot1);
|
| | | m_wndNavView.InsertItem(_T("CFakeAppDoc()"), 4, 4, hClass3);
|
| | | m_wndNavView.InsertItem(_T("~CFakeAppDoc()"), 3, 3, hClass3);
|
| | | m_wndNavView.InsertItem(_T("OnNewDocument()"), 3, 3, hClass3);
|
| | |
|
| | | HTREEITEM hClass4 = m_wndNavView.InsertItem(_T("CFakeAppView"), 1, 1, hRoot1);
|
| | | m_wndNavView.InsertItem(_T("CFakeAppView()"), 4, 4, hClass4);
|
| | | m_wndNavView.InsertItem(_T("~CFakeAppView()"), 3, 3, hClass4);
|
| | | m_wndNavView.InsertItem(_T("GetDocument()"), 3, 3, hClass4);
|
| | | m_wndNavView.Expand(hClass4, TVE_EXPAND);
|
| | |
|
| | | HTREEITEM hClass5 = m_wndNavView.InsertItem(_T("Globals"), 2, 2, hRoot1);
|
| | | m_wndNavView.InsertItem(_T("theFakeApp"), 5, 5, hClass5);
|
| | | m_wndNavView.Expand(hClass5, TVE_EXPAND);
|
| | |
|
| | | HTREEITEM hRoot2 = m_wndNavView.InsertItem(_T("连接状态2"), 0, 0);
|
| | | m_wndNavView.SetItemState(hRoot2, TVIS_BOLD, TVIS_BOLD);
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | void CNavView::OnContextMenu(CWnd* pWnd, CPoint point)
|
| | | {
|
| | | CTreeCtrl* pWndTree = (CTreeCtrl*)&m_wndNavView;
|
| | | ASSERT_VALID(pWndTree);
|
| | |
|
| | | if (pWnd != pWndTree)
|
| | | {
|
| | | CDockablePane::OnContextMenu(pWnd, point);
|
| | | return;
|
| | | }
|
| | |
|
| | | if (point != CPoint(-1, -1))
|
| | | {
|
| | | // 选择已单击的项: |
| | | CPoint ptTree = point;
|
| | | pWndTree->ScreenToClient(&ptTree);
|
| | |
|
| | | UINT flags = 0;
|
| | | HTREEITEM hTreeItem = pWndTree->HitTest(ptTree, &flags);
|
| | | if (hTreeItem != nullptr)
|
| | | {
|
| | | pWndTree->SelectItem(hTreeItem);
|
| | | }
|
| | | }
|
| | |
|
| | | pWndTree->SetFocus();
|
| | | CMenu menu;
|
| | | menu.LoadMenu(IDR_POPUP_SORT);
|
| | |
|
| | | CMenu* pSumMenu = menu.GetSubMenu(0);
|
| | |
|
| | | if (AfxGetMainWnd()->IsKindOf(RUNTIME_CLASS(CMDIFrameWndEx)))
|
| | | {
|
| | | CMFCPopupMenu* pPopupMenu = new CMFCPopupMenu;
|
| | |
|
| | | if (!pPopupMenu->Create(this, point.x, point.y, (HMENU)pSumMenu->m_hMenu, FALSE, TRUE))
|
| | | return;
|
| | |
|
| | | ((CMDIFrameWndEx*)AfxGetMainWnd())->OnShowPopupMenu(pPopupMenu);
|
| | | UpdateDialogControls(this, FALSE);
|
| | | }
|
| | | }
|
| | |
|
| | | void CNavView::AdjustLayout()
|
| | | {
|
| | | if (GetSafeHwnd() == nullptr)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | CRect rectClient;
|
| | | GetClientRect(rectClient);
|
| | |
|
| | | int cyTlb = m_wndToolBar.CalcFixedLayout(FALSE, TRUE).cy;
|
| | |
|
| | | m_wndToolBar.SetWindowPos(nullptr, rectClient.left, rectClient.top, rectClient.Width(), cyTlb, SWP_NOACTIVATE | SWP_NOZORDER);
|
| | | m_wndNavView.SetWindowPos(nullptr, rectClient.left + 1, rectClient.top + cyTlb + 1, rectClient.Width() - 2, rectClient.Height() - cyTlb - 2, SWP_NOACTIVATE | SWP_NOZORDER);
|
| | | }
|
| | |
|
| | | BOOL CNavView::PreTranslateMessage(MSG* pMsg)
|
| | | {
|
| | | return CDockablePane::PreTranslateMessage(pMsg);
|
| | | }
|
| | |
|
| | | void CNavView::OnSort(UINT id)
|
| | | {
|
| | | if (m_nCurrSort == id)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | m_nCurrSort = id;
|
| | |
|
| | | CClassViewMenuButton* pButton = DYNAMIC_DOWNCAST(CClassViewMenuButton, m_wndToolBar.GetButton(0));
|
| | |
|
| | | if (pButton != nullptr)
|
| | | {
|
| | | pButton->SetImage(GetCmdMgr()->GetCmdImage(id));
|
| | | m_wndToolBar.Invalidate();
|
| | | m_wndToolBar.UpdateWindow();
|
| | | }
|
| | | }
|
| | |
|
| | | void CNavView::OnUpdateSort(CCmdUI* pCmdUI)
|
| | | {
|
| | | pCmdUI->SetCheck(pCmdUI->m_nID == m_nCurrSort);
|
| | | }
|
| | |
|
| | | void CNavView::OnClassAddMemberFunction()
|
| | | {
|
| | | AfxMessageBox(_T("添加成员函数..."));
|
| | | }
|
| | |
|
| | | void CNavView::OnClassAddMemberVariable()
|
| | | {
|
| | | // TODO: 在此处添加命令处理程序代码
|
| | | }
|
| | |
|
| | | void CNavView::OnClassDefinition()
|
| | | {
|
| | | // TODO: 在此处添加命令处理程序代码
|
| | | }
|
| | |
|
| | | void CNavView::OnClassProperties()
|
| | | {
|
| | | // TODO: 在此处添加命令处理程序代码
|
| | | }
|
| | |
|
| | | void CNavView::OnNewFolder()
|
| | | {
|
| | | AfxMessageBox(_T("新建文件夹..."));
|
| | | }
|
| | |
|
| | | void CNavView::OnPaint()
|
| | | {
|
| | | CPaintDC dc(this); // 用于绘制的设备上下文
|
| | |
|
| | | CRect rectTree;
|
| | | m_wndNavView.GetWindowRect(rectTree);
|
| | | ScreenToClient(rectTree);
|
| | |
|
| | | rectTree.InflateRect(1, 1);
|
| | | dc.Draw3dRect(rectTree, ::GetSysColor(COLOR_3DSHADOW), ::GetSysColor(COLOR_3DSHADOW));
|
| | | }
|
| | |
|
| | | void CNavView::OnSetFocus(CWnd* pOldWnd)
|
| | | {
|
| | | CDockablePane::OnSetFocus(pOldWnd);
|
| | |
|
| | | m_wndNavView.SetFocus();
|
| | | }
|
| | |
|
| | | void CNavView::OnChangeVisualStyle()
|
| | | {
|
| | | m_NavViewImages.DeleteImageList();
|
| | |
|
| | | UINT uiBmpId = theApp.m_bHiColorIcons ? IDB_CLASS_VIEW_24 : IDB_CLASS_VIEW;
|
| | | // uiBmpId = IDB_NAV_VIEW1;
|
| | | CBitmap bmp;
|
| | | if (!bmp.LoadBitmap(uiBmpId))
|
| | | {
|
| | | TRACE(_T("无法加载位图: %x\n"), uiBmpId);
|
| | | ASSERT(FALSE);
|
| | | return;
|
| | | }
|
| | |
|
| | | BITMAP bmpObj;
|
| | | bmp.GetBitmap(&bmpObj);
|
| | |
|
| | | UINT nFlags = ILC_MASK;
|
| | |
|
| | | nFlags |= (theApp.m_bHiColorIcons) ? ILC_COLOR24 : ILC_COLOR4;
|
| | |
|
| | | m_NavViewImages.Create(16, bmpObj.bmHeight, nFlags, 0, 0);
|
| | | m_NavViewImages.Add(&bmp, RGB(255, 0, 0));
|
| | |
|
| | | m_wndNavView.SetImageList(&m_NavViewImages, TVSIL_NORMAL);
|
| | |
|
| | | m_wndToolBar.CleanUpLockedImages();
|
| | | m_wndToolBar.LoadBitmap(theApp.m_bHiColorIcons ? IDB_SORT_24 : IDR_SORT, 0, 0, TRUE /* 锁定*/);
|
| | | }
|
New file |
| | |
| | |
|
| | | #pragma once
|
| | |
|
| | | #include "ViewTree.h"
|
| | |
|
| | | class CNavToolBar : public CMFCToolBar
|
| | | {
|
| | | virtual void OnUpdateCmdUI(CFrameWnd* /*pTarget*/, BOOL bDisableIfNoHndler)
|
| | | {
|
| | | CMFCToolBar::OnUpdateCmdUI((CFrameWnd*) GetOwner(), bDisableIfNoHndler);
|
| | | }
|
| | |
|
| | | virtual BOOL AllowShowOnList() const { return FALSE; }
|
| | | };
|
| | |
|
| | | class CNavView : public CDockablePane
|
| | | {
|
| | | public:
|
| | | CNavView() noexcept;
|
| | | virtual ~CNavView();
|
| | |
|
| | | void AdjustLayout();
|
| | | void OnChangeVisualStyle();
|
| | |
|
| | | protected:
|
| | | CNavToolBar m_wndToolBar;
|
| | | CViewTree m_wndNavView;
|
| | | CImageList m_NavViewImages;
|
| | | UINT m_nCurrSort;
|
| | |
|
| | | void FillClassView();
|
| | |
|
| | | // 重写
|
| | | public:
|
| | | virtual BOOL PreTranslateMessage(MSG* pMsg);
|
| | |
|
| | | protected:
|
| | | afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
| | | afx_msg void OnSize(UINT nType, int cx, int cy);
|
| | | afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
|
| | | afx_msg void OnClassAddMemberFunction();
|
| | | afx_msg void OnClassAddMemberVariable();
|
| | | afx_msg void OnClassDefinition();
|
| | | afx_msg void OnClassProperties();
|
| | | afx_msg void OnNewFolder();
|
| | | afx_msg void OnPaint();
|
| | | afx_msg void OnSetFocus(CWnd* pOldWnd);
|
| | | afx_msg LRESULT OnChangeActiveTab(WPARAM, LPARAM);
|
| | | afx_msg void OnSort(UINT id);
|
| | | afx_msg void OnUpdateSort(CCmdUI* pCmdUI);
|
| | |
|
| | | DECLARE_MESSAGE_MAP()
|
| | | };
|
| | |
|
New file |
| | |
| | | // PropCommCfg.cpp: 实现文件
|
| | | //
|
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "PropCommCfg.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
| | | // CPropCommCfg 对话框
|
| | |
|
| | | IMPLEMENT_DYNAMIC(CPropCommCfg, CDialogEx)
|
| | |
|
| | | CPropCommCfg::CPropCommCfg(CWnd* pParent /*=nullptr*/)
|
| | | : CDialogEx(IDD_PROP_COMM_CFG, pParent)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | CPropCommCfg::~CPropCommCfg()
|
| | | {
|
| | | }
|
| | |
|
| | | void CPropCommCfg::DoDataExchange(CDataExchange* pDX)
|
| | | {
|
| | | CDialogEx::DoDataExchange(pDX);
|
| | | }
|
| | |
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CPropCommCfg, CDialogEx)
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | |
|
| | | // CPropCommCfg 消息处理程序
|
New file |
| | |
| | | #pragma once
|
| | |
|
| | |
|
| | | // CPropCommCfg 对话框
|
| | |
|
| | | class CPropCommCfg : public CDialogEx
|
| | | {
|
| | | DECLARE_DYNAMIC(CPropCommCfg)
|
| | |
|
| | | public:
|
| | | CPropCommCfg(CWnd* pParent = nullptr); // 标准构造函数
|
| | | virtual ~CPropCommCfg();
|
| | |
|
| | | // 对话框数据
|
| | | #ifdef AFX_DESIGN_TIME
|
| | | enum { IDD = IDD_PROP_COMM_CFG };
|
| | | #endif
|
| | |
|
| | | protected:
|
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
| | |
|
| | | DECLARE_MESSAGE_MAP()
|
| | | };
|
New file |
| | |
| | | // PropInputCfg.cpp: 实现文件
|
| | | //
|
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "PropInputCfg.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
| | | // CPropInputCfg 对话框
|
| | |
|
| | | IMPLEMENT_DYNAMIC(CPropInputCfg, CDialogEx)
|
| | |
|
| | | CPropInputCfg::CPropInputCfg(CWnd* pParent /*=nullptr*/)
|
| | | : CDialogEx(IDD_PROP_INPUT_CFG, pParent)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | CPropInputCfg::~CPropInputCfg()
|
| | | {
|
| | | }
|
| | |
|
| | | void CPropInputCfg::DoDataExchange(CDataExchange* pDX)
|
| | | {
|
| | | CDialogEx::DoDataExchange(pDX);
|
| | | }
|
| | |
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CPropInputCfg, CDialogEx)
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | |
|
| | | // CPropInputCfg 消息处理程序
|
New file |
| | |
| | | #pragma once
|
| | |
|
| | |
|
| | | // CPropInputCfg 对话框
|
| | |
|
| | | class CPropInputCfg : public CDialogEx
|
| | | {
|
| | | DECLARE_DYNAMIC(CPropInputCfg)
|
| | |
|
| | | public:
|
| | | CPropInputCfg(CWnd* pParent = nullptr); // 标准构造函数
|
| | | virtual ~CPropInputCfg();
|
| | |
|
| | | // 对话框数据
|
| | | #ifdef AFX_DESIGN_TIME
|
| | | enum { IDD = IDD_PROP_INPUT_CFG };
|
| | | #endif
|
| | |
|
| | | protected:
|
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
| | |
|
| | | DECLARE_MESSAGE_MAP()
|
| | | };
|
New file |
| | |
| | | // PropMemCfg.cpp: 实现文件
|
| | | //
|
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "PropMemCfg.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
| | | // CPropMemCfg 对话框
|
| | |
|
| | | IMPLEMENT_DYNAMIC(CPropMemCfg, CDialogEx)
|
| | |
|
| | | CPropMemCfg::CPropMemCfg(CWnd* pParent /*=nullptr*/)
|
| | | : CDialogEx(IDD_PROP_MEM_CFG, pParent)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | CPropMemCfg::~CPropMemCfg()
|
| | | {
|
| | | }
|
| | |
|
| | | void CPropMemCfg::DoDataExchange(CDataExchange* pDX)
|
| | | {
|
| | | CDialogEx::DoDataExchange(pDX);
|
| | | }
|
| | |
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CPropMemCfg, CDialogEx)
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | |
|
| | | // CPropMemCfg 消息处理程序
|
New file |
| | |
| | | #pragma once
|
| | |
|
| | |
|
| | | // CPropMemCfg 对话框
|
| | |
|
| | | class CPropMemCfg : public CDialogEx
|
| | | {
|
| | | DECLARE_DYNAMIC(CPropMemCfg)
|
| | |
|
| | | public:
|
| | | CPropMemCfg(CWnd* pParent = nullptr); // 标准构造函数
|
| | | virtual ~CPropMemCfg();
|
| | |
|
| | | // 对话框数据
|
| | | #ifdef AFX_DESIGN_TIME
|
| | | enum { IDD = IDD_PROP_MEM_CFG };
|
| | | #endif
|
| | |
|
| | | protected:
|
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
| | |
|
| | | DECLARE_MESSAGE_MAP()
|
| | | };
|
New file |
| | |
| | | // PropModeCfg.cpp: 实现文件
|
| | | //
|
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "PropModeCfg.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
| | | // CPropModeCfg 对话框
|
| | |
|
| | | IMPLEMENT_DYNAMIC(CPropModeCfg, CDialogEx)
|
| | |
|
| | | CPropModeCfg::CPropModeCfg(CWnd* pParent /*=nullptr*/)
|
| | | : CDialogEx(IDD_PROP_MODE_CFG1, pParent)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | CPropModeCfg::~CPropModeCfg()
|
| | | {
|
| | | }
|
| | |
|
| | | void CPropModeCfg::DoDataExchange(CDataExchange* pDX)
|
| | | {
|
| | | CDialogEx::DoDataExchange(pDX);
|
| | | }
|
| | |
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CPropModeCfg, CDialogEx)
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | |
|
| | | // CPropModeCfg 消息处理程序
|
New file |
| | |
| | | #pragma once
|
| | |
|
| | |
|
| | | // CPropModeCfg 对话框
|
| | |
|
| | | class CPropModeCfg : public CDialogEx
|
| | | {
|
| | | DECLARE_DYNAMIC(CPropModeCfg)
|
| | |
|
| | | public:
|
| | | CPropModeCfg(CWnd* pParent = nullptr); // 标准构造函数
|
| | | virtual ~CPropModeCfg();
|
| | |
|
| | | // 对话框数据
|
| | | #ifdef AFX_DESIGN_TIME
|
| | | enum { IDD = IDD_PROP_MODE_CFG1 };
|
| | | #endif
|
| | |
|
| | | protected:
|
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
| | |
|
| | | DECLARE_MESSAGE_MAP()
|
| | | };
|
New file |
| | |
| | | // PropOutputCfg.cpp: 实现文件
|
| | | //
|
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "PropOutputCfg.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
| | | // CPropOutputCfg 对话框
|
| | |
|
| | | IMPLEMENT_DYNAMIC(CPropOutputCfg, CDialogEx)
|
| | |
|
| | | CPropOutputCfg::CPropOutputCfg(CWnd* pParent /*=nullptr*/)
|
| | | : CDialogEx(IDD_PROP_OUTPUT_SET, pParent)
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | CPropOutputCfg::~CPropOutputCfg()
|
| | | {
|
| | | }
|
| | |
|
| | | void CPropOutputCfg::DoDataExchange(CDataExchange* pDX)
|
| | | {
|
| | | CDialogEx::DoDataExchange(pDX);
|
| | | }
|
| | |
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CPropOutputCfg, CDialogEx)
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | |
|
| | | // CPropOutputCfg 消息处理程序
|
New file |
| | |
| | | #pragma once
|
| | |
|
| | |
|
| | | // CPropOutputCfg 对话框
|
| | |
|
| | | class CPropOutputCfg : public CDialogEx
|
| | | {
|
| | | DECLARE_DYNAMIC(CPropOutputCfg)
|
| | |
|
| | | public:
|
| | | CPropOutputCfg(CWnd* pParent = nullptr); // 标准构造函数
|
| | | virtual ~CPropOutputCfg();
|
| | |
|
| | | // 对话框数据
|
| | | #ifdef AFX_DESIGN_TIME
|
| | | enum { IDD = IDD_PROP_OUTPUT_SET };
|
| | | #endif
|
| | |
|
| | | protected:
|
| | | virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
| | |
|
| | | DECLARE_MESSAGE_MAP()
|
| | | };
|
File was renamed from MTerm2/CPropSysReg1.cpp |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "MTerm2.h"
|
| | | #include "CPropSysReg1.h"
|
| | | #include "PropSysReg1.h"
|
| | | #include "afxdialogex.h"
|
| | |
|
| | |
|
| | |
| | | GetClientRect(&rect0);
|
| | | CString s1;
|
| | | s1.Format(_T("OnInit H %d "), rect0.bottom - rect0.top);
|
| | | GetDlgItem(IDC_EDIT1)->SetWindowText(s1);
|
| | | ShowParams();
|
| | | // GetDlgItem(IDC_EDIT1)->SetWindowText(s1);
|
| | | // ShowParams();
|
| | |
|
| | | return TRUE; // return TRUE unless you set the focus to a control
|
| | | // 异常: OCX 属性页应返回 FALSE
|
File was renamed from MTerm2/CPropSysReg1.h |
| | |
| | |
|
| | | // 对话框数据
|
| | | #ifdef AFX_DESIGN_TIME
|
| | | enum { IDD = IDD_PROPPAGE_SYSREG1 };
|
| | | enum { IDD = IDD_PROP_SYSREG1 };
|
| | | #endif
|
| | |
|
| | | protected:
|
New file |
| | |
| | |
|
| | | #include "pch.h"
|
| | | #include "framework.h"
|
| | | #include "ViewTree.h"
|
| | | #include "MTerm2.h"
|
| | |
|
| | | #ifdef _DEBUG
|
| | | #define new DEBUG_NEW
|
| | | #undef THIS_FILE
|
| | | static char THIS_FILE[] = __FILE__;
|
| | | #endif
|
| | |
|
| | | /////////////////////////////////////////////////////////////////////////////
|
| | | // CViewTree
|
| | |
|
| | | CViewTree::CViewTree() noexcept
|
| | | {
|
| | | }
|
| | |
|
| | | CViewTree::~CViewTree()
|
| | | {
|
| | | }
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CViewTree, CTreeCtrl)
|
| | | ON_NOTIFY_REFLECT(NM_DBLCLK, &CViewTree::OnDblClkTree)
|
| | | ON_NOTIFY_REFLECT(NM_CLICK, &CViewTree::OnClkTree)
|
| | |
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | | /////////////////////////////////////////////////////////////////////////////
|
| | | // CViewTree 消息处理程序
|
| | |
|
| | | BOOL CViewTree::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
|
| | | {
|
| | | BOOL bRes = CTreeCtrl::OnNotify(wParam, lParam, pResult);
|
| | |
|
| | | NMHDR* pNMHDR = (NMHDR*)lParam;
|
| | | ASSERT(pNMHDR != nullptr);
|
| | |
|
| | | if (pNMHDR && pNMHDR->code == TTN_SHOW && GetToolTips() != nullptr)
|
| | | {
|
| | | GetToolTips()->SetWindowPos(&wndTop, -1, -1, -1, -1, SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSIZE);
|
| | | }
|
| | |
|
| | | return bRes;
|
| | | }
|
| | | |
| | | void CViewTree::OnClkTree(NMHDR* pNMHDR, LRESULT* pResult) |
| | | { |
| | | |
| | | HTREEITEM hTreeItem = GetSelectedItem(); |
| | | //以GetItemText()函数为例: |
| | | CString S1 = GetItemText(hTreeItem); |
| | | // AfxMessageBox(_T("You have selected ") + S1); |
| | | |
| | | *pResult = 0; |
| | | |
| | | } |
| | | |
| | | void CViewTree::OnDblClkTree(NMHDR* pNMHDR, LRESULT* pResult) |
| | | { |
| | | LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
|
| | | |
| | | HTREEITEM hTreeItem = GetSelectedItem(); |
| | | //以GetItemText()函数为例: |
| | | CString s2 = GetItemText(hTreeItem); |
| | | //AfxMessageBox(_T("You have selected ") + s1); |
| | | CString s1; |
| | | s1.Format(_T("dbclk Code %d, id %d %d %d %s "), pNMTreeView->action,pNMTreeView->itemOld.hItem, pNMTreeView->ptDrag.x, pNMTreeView->ptDrag.y,s2); |
| | | |
| | | SysLog(s1); |
| | | |
| | | *pResult = 0; |
| | | } |
New file |
| | |
| | |
|
| | | #pragma once
|
| | |
|
| | | /////////////////////////////////////////////////////////////////////////////
|
| | | // CViewTree 窗口
|
| | |
|
| | | class CViewTree : public CTreeCtrl
|
| | | {
|
| | | // 构造
|
| | | public:
|
| | | CViewTree() noexcept;
|
| | |
|
| | | // 重写
|
| | | protected:
|
| | | virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
|
| | |
|
| | | // 实现
|
| | | public:
|
| | | virtual ~CViewTree();
|
| | | afx_msg void OnDblClkTree(NMHDR* pNMHDR, LRESULT* pResult);
|
| | | afx_msg void OnClkTree(NMHDR* pNMHDR, LRESULT* pResult);
|
| | | protected:
|
| | | DECLARE_MESSAGE_MAP()
|
| | | };
|
New file |
| | |
| | |
|
| | | 设备描述文件
|
| | |
|
| | | 可以有多个设备描述文件
|
| | |
|
| | | 一个设备描述文件里面可以有多个设备。
|
| | |
|
| | | 设备信息块 尺寸 解析
|
| | |
|
| | | 数据说明文件。
|
| | |
|
| | | INT8,UINT8,INT16,UINT16,INT32,UINT32.FLOAT32,BIT. 地址偏移. 100.5.长度 bit.
|
| | |
|
| | | INT,(INT8,INT16,INT32)有符号整型
|
| | | UINT,(UINT8,UINT16,UINT32),无符号整数
|
| | | BIN.(HEX)二进制数,按位显示。
|
| | | FLOAT(FLOAT16,FLOAT32),浮点数,按小数显示。
|
| | |
|
| | | 定点数,定点数有两种,1种是按二进制分,几位整数,几位小数。
|
| | | 另外一直是倍率关系,都是整数,最后除以10或100或1000,即显示的时候,小数点左移几位。
|
| | |
|
| | | FIX,(FIX8,FIX16,FIX24,FIX32),定点小数,按小数显示。
|
| | | FIX.1, 1位二进制小数。
|
| | |
|
| | | BIT,
|
| | | 地址偏移, 纯数字表示字节/字地址,带.后数字表示位地址。
|
| | |
|
| | | 地址有两种表示方法。
|
| | | 1,纯10进制, 100.15
|
| | | 2,16进制 10CH.F
|
| | |
|
| | |
|
| | | 注册登录监视内容。
|
| | |
|
| | | 一次性读取。
|
| | |
|
| | |
|
| | | #地址
|
| | | #地址,长度(字节/位),类型,显示名称,转换算式,注释
|
| | |
|
| | | #地址,长度, 类型, 名称, 算式, 注释。
|
| | | 0000, 2, BIN, 工作模式,
|
| | |
|
| | | VCC5,U16,20,2B,5V电压
|
| | |
|
| | |
|
| | | DIB
|
| | |
|
| | | 自检
|
| | |
|
| | | 说明书 |
| | |
|
| | |
|
| | | 数据图表功能
|
| | |
|
| | |
|
| | |
|
| | | 组态显示功能
|
| | |
|
| | | 元素
|
| | | 1,文本,
|
| | | 字体,颜色,位置,内容。
|
| | |
|
| | |
|
| | |
|
| | | chart display
|
| | |
|
| | |
|
| | | 一个图表中,数据序列数量。
|
| | |
|
| | |
|
| | | 数据类型/格式
|
| | |
|
| | | 内存中连续数据组/单个地址,连续采集的数据。
|
| | |
|
| | | 数据类型 Bit/Byte/short/dword/int/UINT/float/string
|
| | | 数据长度 ?b/?B
|
| | | 数据地址
|
| | |
|
| | |
|
| | | 当前状态 状态机
|
| | |
|
| | | 几个独立的定时器。
|
| | | 1秒才计算。写入日志 。
|
| | |
|
| | |
|
| | |
|
| | | 出厂参数设置
|
| | |
|
| | | 读取唯一UID。
|
| | | 读取硬件型号。
|
| | |
|
| | | 读取原来的出厂参数 显示/未设置状态。
|
| | | 遇到UID重复 ->
|
| | | 遇到已经配置过出厂参数 -> ? 覆盖原来的参数? 使用原来的SN?
|
| | |
|
| | |
|
| | |
|
| | | 自动写入
|
| | | 写入完成后, 显示提示,播放声音,触发硬件动作/打印条码, 存储倒数据库, 提交到服务器。
|
| | |
|
| | |
|
| | |
|
New file |
| | |
| | | [设备描述文件]
|
| | |
|
| | | [DEVICETYPES]
|
| | | 0=UNKNOWN
|
| | | 1=KL10-E04D-N1
|
| | | 2=KL10-E08D-N1
|
| | | 3=KL10-E16D-N2
|
| | | 4=KL10-E08D-N2
|
| | | 5=KL10-E16D-N3
|
| | | 6=KL10-E08D-N3
|
| | | 7=KL10-E16D-N4
|
| | | 8=KL10-E08D-N4
|
| | | 9=KL10-E16D-N42
|
| | | 10=KL10-E08D-N42
|
| | | 11=KL10-E08DMINI-N1
|
| | |
|
| | | [KL10-E04D-N1]
|
| | |
|
| | | [KL10-E08D-N1]
|
| | |
|
| | | [KL10-E16D-N2]
|
| | |
|
| | | [KL10-E08D-N2]
|
| | |
|
| | | [KL10-E16D-N3]
|
| | |
|
| | | [KL10-E08D-N3]
|
| | |
|
| | | [KL10-E16D-N4]
|
| | |
|
| | | [KL10-E08D-N4]
|
| | |
|
| | | [KL10-E16D-N42]
|
| | | Sign=9
|
| | | DigitalInput=16,NPN ;数字输入=16
|
| | | Interrupt=0 ;中断输入=0
|
| | | AnalogInput=0 ;模拟输入=0
|
| | | HighSpeedCnt=0 ;高速计数器输入=0
|
| | | DigitalOutPut=16,NPN ;数字输出=16;
|
| | | AnalogOutput=0 ;模拟输出
|
| | | PulseOutput=0 ;脉冲输出
|
| | | DIP=6 ;拨码开关位数
|
| | | COMM232=1
|
| | | COMM485=1
|
| | |
|
| | | 功能; |
| | | 硬件
|
| | |
|
| | | 24V输入端子
|
| | | 电源防反接保护
|
| | | 电源过流保险
|
| | |
|
| | | 24V输出端子
|
| | | 24V输出限流电阻
|
| | |
|
| | | 数字量输入端子
|
| | | 数字量输入公共端
|
| | | 数字量输入极性转换SS
|
| | |
|
| | | 中断输入端口
|
| | | 高速计数器输入端口
|
| | | 模拟量输入端口
|
| | | 集成的模拟电位器
|
| | | 热电阻采样接口
|
| | | 热电偶采样接口
|
| | |
|
| | |
|
| | | 数字量输出端子
|
| | | 数字量输出限流保险
|
| | | 输入断线检测电路。
|
| | | 输出断线检测电路
|
| | | 输出短路检测电路
|
| | | 输出故障检测电路
|
| | |
|
| | | 模拟量输出端口
|
| | | 高速脉冲输出端口
|
| | | 直流电机驱动
|
| | | 步进电机驱动
|
| | | 直流无刷电机驱动
|
| | | 刹车控制信号
|
| | | 原点输入信号。
|
| | | 限位输入信号
|
| | |
|
| | |
|
| | | 双线(只有电源线)通讯端子
|
| | | 自动电源极性转换
|
| | |
|
| | |
|
| | | RS485通讯
|
| | | RS485端子
|
| | | RS485端口电气隔离
|
| | | RS485端口公共端端子
|
| | | RS485断线检测电路
|
| | | 双路RS485接线端口
|
| | |
|
| | | RS232端口
|
| | | USB接口
|
| | | 内部扩展接口
|
| | | 外部扩展接口
|
| | | 指示灯们,24V电源,5V,3.3V,RUN,ERR,GOOD
|
| | | 指示灯们,隔离5V,RXD,TXD,DE,RS232-RXD1,-TXD1。
|
| | |
|
| | | 网络接口
|
| | | 光纤接口
|
| | | 无线接口
|
| | | WIFI
|
| | | 蓝牙
|
| | | RS485可变波特率
|
| | |
|
| | |
|
| | | 电源电压检测电路
|
| | | 开关式5V电源
|
| | | 5V电压检测电路
|
| | | 3.3V电压检测功能
|
| | | 芯片温度检测功能
|
| | | 后备电池
|
| | | 实时时钟
|
| | | SPIFlash扩展
|
| | | TF卡接口
|
| | | 显示用LED数码管
|
| | | GOOD指示灯
|
| | | GOOD输出端子
|
| | | ERR指示灯
|
| | | RUN指示灯
|
| | | 外部SPI扩展
|
| | |
|
| | | 行列按键矩阵扫描电路
|
| | | 段码LED输出驱动电路
|
| | | LCD屏驱动
|
| | |
|
| | | 蜂鸣器
|
| | | 扬声器
|
| | | 拾音器
|
| | |
|
| | | 软件
|
| | | MODBUS RTU SERVER
|
| | | MODBUS RTU CLIENT
|
| | | 运行日志记录
|
| | | 电源闪断记录
|
| | |
|
| | |
|
| | | Factory1=硬件型号,String,16,FFFF0000@ROM
|
| | | factory2=硬件唯一ID,HEX,12,FFFF0000@ROM
|
| | | Prop1=
|
| | | [KL10-E08D-N42]
|
| | |
|
| | | [KL10-E08DMINI-N1]
|
| | |
| | | #include <afxcontrolbars.h>
|
| | | #include <afxcontrolbars.h>
|
| | | #include <afxcontrolbars.h>
|
| | | #include <afxcontrolbars.h>
|
| | | #include <afxcontrolbars.h>
|
| | | #include <afxcontrolbars.h>
|
| | | #include <afxcontrolbars.h>
|
| | | #include <afxcontrolbars.h>
|
| | | #include <afxcontrolbars.h>
|
| | |
|
| | | #endif //PCH_H
|
| | |
| | | #define IDD_DIALOGBAR_MDI_INFO 103
|
| | | #define IDP_SOCKETS_INIT_FAILED 104
|
| | | #define IDD_PROPPAGE_SYSREG1 106
|
| | | #define IDD_PROP_SYSREG1 106
|
| | | #define IDR_MAINFRAME 128
|
| | | #define IDR_MultiTerminal2TYPE 130
|
| | | #define IDR_MTerm2TYPE 130
|
| | |
| | | #define IDD_DIALOG_COMMSET1 137
|
| | | #define IDD_DIALOG_INFO_DISPLAY 139
|
| | | #define IDD_DIALOG_DATA_MON 142
|
| | | #define ID_NEW_FOLDER 143
|
| | | #define IDD_DIALOG_COMMTEST 144
|
| | | #define IDD_MTerm2CommTestView 144
|
| | | #define ID_SORT_MENU 144
|
| | | #define ID_SORTING_GROUPBYTYPE 145
|
| | | #define ID_SORTING_SORTALPHABETIC 146
|
| | | #define IDD_DIALOG_STATUS_SHOW 147
|
| | | #define ID_SORTING_SORTBYTYPE 147
|
| | | #define ID_SORTING_SORTBYACCESS 148
|
| | | #define IDD_DIALOG_SYSREG_SET 149
|
| | | #define IDD_DIALOG_COIL_MON 151
|
| | | #define IDD_DIALOG_PROGRESS 155
|
| | | #define IDD_DIALOG_EVENTLOG 157
|
| | | #define IDD_DIALOG_FORCE_IO 159
|
| | | #define IDD_DIALOG_DATETIME 161
|
| | | #define IDI_CLASS_VIEW 163
|
| | | #define IDI_CLASS_VIEW_HC 164
|
| | | #define IDR_SORT 171
|
| | | #define IDB_SORT_24 172
|
| | | #define IDR_POPUP_SORT 173
|
| | | #define IDB_CLASS_VIEW 177
|
| | | #define IDB_CLASS_VIEW_24 178
|
| | | #define IDR_TOOLBAR_NUM 310
|
| | | #define IDD_MTerm2TestView 311
|
| | | #define IDD_MTerm2CtrlView 312
|
| | |
| | | #define IDW_TOOL_BAR2 315
|
| | | #define IDD_DIALOG1 316
|
| | | #define IDW_TOOL_BAR_EDIT 316
|
| | | #define ID_VIEW_NAVVIEW 317
|
| | | #define IDD_DIALOG_SET_COIL 320
|
| | | #define IDD_DIALOG_SET_DATA 321
|
| | | #define IDR_MENU1 324
|
| | |
| | | #define IDR_TOOLBAR_INPUT_SHOW 329
|
| | | #define IDR_TOOLBAR_COMMENT 332
|
| | | #define IDR_TOOLBAR_INFO_SHOW 334
|
| | | #define IDB_NAV_VIEW1 336
|
| | | #define IDD_FORM_LOG 337
|
| | | #define IDD_DIALOG_LOG 339
|
| | | #define IDD_PROP_INPUT_CFG 340
|
| | | #define IDD_PROP_OUTPUT_SET 341
|
| | | #define IDD_PROP_COMM_CFG 342
|
| | | #define IDD_PROP_MEM_CFG 343
|
| | | #define IDD_PROP_COMM_CFG1 344
|
| | | #define IDD_PROP_MODE_CFG1 344
|
| | | #define IDD_DIALOG_FACT_CFG 345
|
| | | #define IDC_EDIT1 1000
|
| | | #define IDC_BUTTON1 1001
|
| | | #define IDC_BUTTON_LOAD 1001
|
| | |
| | | #define IDC_STATIC_STAT_XY 1015
|
| | | #define IDC_EDIT_IO_COMMENT 1015
|
| | | #define IDC_STATIC_DRAW_XY 1016
|
| | | #define IDC_COMBO_INPUT_FILTER_1 1016
|
| | | #define IDC_COMBO_MADDR 1017
|
| | | #define IDC_COMBO_OUTPUT_SET_1 1017
|
| | | #define IDC_COMBO_CMD 1018
|
| | | #define IDC_STATIC_INPUT_NAME_1 1018
|
| | | #define IDC_COMBO_CMD_TYPE 1019
|
| | | #define IDC_STATIC_INPUT_NAME_2 1019
|
| | | #define IDC_CHECK1 1019
|
| | | #define IDC_COMBO_DADDR 1020
|
| | | #define IDC_COMBO_INPUT_FILTER_2 1020
|
| | | #define IDC_EDIT3 1020
|
| | | #define IDC_COMBO_DCOUNT 1021
|
| | | #define IDC_STATIC_INPUT_NAME_3 1021
|
| | | #define IDC_EDIT4 1021
|
| | | #define IDC_BUTTON_DO 1022
|
| | | #define IDC_COMBO_INPUT_FILTER_3 1022
|
| | | #define IDC_EDIT5 1022
|
| | | #define IDC_EDIT_DATA1 1023
|
| | | #define IDC_STATIC_INPUT_NAME_4 1023
|
| | | #define IDC_EDIT6 1023
|
| | | #define IDC_EDIT_DATA2 1024
|
| | | #define IDC_COMBO_INPUT_FILTER_4 1024
|
| | | #define IDC_EDIT7 1024
|
| | | #define IDC_BUTTON_START_BULK_TEST 1025
|
| | | #define IDC_STATIC_INPUT_NAME_5 1025
|
| | | #define IDC_CHECK_AUTO_INC 1025
|
| | | #define IDC_BUTTON_STOP_BULK_TEST 1026
|
| | | #define IDC_COMBO_INPUT_FILTER_5 1026
|
| | | #define IDC_STATIC_SPEED 1027
|
| | | #define IDC_STATIC_INPUT_NAME_6 1027
|
| | | #define IDC_CHECK_EXT_DATA 1028
|
| | | #define IDC_COMBO_INPUT_FILTER_6 1028
|
| | | #define IDC_DATETIMEPICKER1 1028
|
| | | #define IDC_COMBO_EXT_TYPE 1029
|
| | | #define IDC_STATIC_INPUT_NAME_7 1029
|
| | | #define IDC_BUTTON_DISCONN 1029
|
| | | #define IDC_COMBO_EXT_DST 1030
|
| | | #define IDC_COMBO_INPUT_FILTER_7 1030
|
| | | #define IDC_EDIT_KLINK_VER 1030
|
| | | #define IDC_COMBO_EXT_DATA_LEN 1031
|
| | | #define IDC_STATIC_INPUT_NAME_8 1031
|
| | | #define IDC_CHECK_AUTO_WRITE 1031
|
| | | #define IDC_EDIT_EXT_DATA1 1032
|
| | | #define IDC_COMBO_INPUT_FILTER_8 1032
|
| | | #define IDC_EDIT11 1032
|
| | | #define IDC_EDIT_EXT_DATA2 1033
|
| | | #define IDC_STATIC_OUTPUT_NAME_1 1033
|
| | | #define IDC_EDIT12 1033
|
| | | #define IDC_STATIC_MON 1034
|
| | | #define IDC_COMBO_OUTPUT_SET_2 1034
|
| | | #define IDC_BUTTON6 1034
|
| | | #define IDC_STATIC_MON2 1035
|
| | | #define IDC_STATIC_OUTPUT_NAME_2 1035
|
| | | #define IDC_EDIT13 1035
|
| | | #define IDC_TREE1 1036
|
| | | #define IDC_COMBO_OUTPUT_SET_3 1036
|
| | | #define IDC_EDIT1_FUNCTIONS 1036
|
| | | #define IDC_EDIT_MON 1037
|
| | | #define IDC_STATIC_OUTPUT_NAME_3 1037
|
| | | #define IDC_BUTTON7 1037
|
| | | #define IDC_EDIT_MON2 1038
|
| | | #define IDC_COMBO_OUTPUT_SET_4 1038
|
| | | #define IDC_BUTTON8 1038
|
| | | #define IDC_STATIC_OUTPUT_NAME_4 1039
|
| | | #define IDC_BUTTON_WRITEDATA 1039
|
| | | #define IDC_BUTTON2 1040
|
| | | #define IDC_COMBO_OUTPUT_SET_5 1040
|
| | | #define IDC_CHECK_AUTO_CONN 1040
|
| | | #define IDC_COMBO_NETWORK_TYPE 1041
|
| | | #define IDC_STATIC_OUTPUT_NAME_5 1041
|
| | | #define IDC_BUTTON_CONN 1041
|
| | | #define IDC_COMBO_PORT 1042
|
| | | #define IDC_COMBO_OUTPUT_SET_6 1042
|
| | | #define IDC_EDIT_DEVICE_TYPE 1042
|
| | | #define IDC_COMBO_BAUD 1043
|
| | | #define IDC_STATIC_OUTPUT_NAME_6 1043
|
| | | #define IDC_EDIT_DEVICE_UID 1043
|
| | | #define IDC_COMBO_COMM_TIMEOUT 1044
|
| | | #define IDC_COMBO_OUTPUT_SET_7 1044
|
| | | #define IDC_EDIT_FIRM_VER 1044
|
| | | #define IDC_RADIO_DATA_LENGTH_7B 1045
|
| | | #define IDC_STATIC_OUTPUT_NAME_7 1045
|
| | | #define IDC_EDIT_LOT_NO 1045
|
| | | #define IDC_RADIO_DATA_LENGTH_8B 1046
|
| | | #define IDC_COMBO_OUTPUT_SET_8 1046
|
| | | #define IDC_EDIT_FACT_SN 1046
|
| | | #define IDC_RADIO_STOP_1B 1047
|
| | | #define IDC_STATIC_OUTPUT_NAME_8 1047
|
| | | #define IDC_STATIC_CONN_STAT 1047
|
| | | #define IDC_RADIO_STOP_2B 1048
|
| | | #define IDC_EDIT15 1048
|
| | | #define IDC_RADIO_PARITY_NONE 1049
|
| | | #define IDC_CHECK2 1049
|
| | | #define IDC_RADIO_PARITY_ODD 1050
|
| | | #define IDC_CHECK3 1050
|
| | | #define IDC_RADIO_PARITY_EVEN 1051
|
| | | #define IDC_BUTTON9 1051
|
| | | #define IDC_RADIO_PARITY_0 1052
|
| | | #define IDC_BUTTON_READDATA 1052
|
| | | #define IDC_CHECK_AUTO_BAUD 1053
|
| | | #define IDC_STATIC_PROC_STAT 1053
|
| | | #define IDC_CHECK_AUTO_DATA_LENGTH 1054
|
| | | #define IDC_EDIT_ORG_LOT_NO 1054
|
| | | #define IDC_CHECK_AUTO_PARITY 1055
|
| | | #define IDC_EDIT_ORG_FACT_SN 1055
|
| | | #define IDC_EDIT_CAP 1056
|
| | | #define IDC_LIST1 1057
|
| | | #define IDC_LIST_SEL1 1057
|
| | | #define IDC_EDIT_ORG_FAC_DATE 1057
|
| | | #define IDC_BUTTON31 1057
|
| | | #define IDC_BUTTON3 1058
|
| | | #define IDC_LIST_STATUS1 1059
|
| | | #define IDC_EDIT31 1059
|
| | | #define IDC_COMBO1 1060
|
| | | #define IDC_EDIT8 1060
|
| | | #define IDC_EDIT32 1060
|
| | | #define IDC_COMBO2 1061
|
| | | #define IDC_COMBO3 1062
|
| | | #define IDC_RADIO1 1063
|
| | |
| | | #define ID_MENU_DATA_MON 33076
|
| | | #define ID_MENU_COIL_MON 33077
|
| | | #define ID_MENU_PLC_INFO_SHOW 33078
|
| | | #define ID_33079 33079
|
| | | #define ID_MENU_FACT_CFG 33080
|
| | | #define ID_INDICATOR_SEL_TYPE 59135
|
| | | #define ID_INDICATOR_MACHINE_TYPE 59142
|
| | | #define ID_INDICATOR_PROGRAM_POS 59143
|
| | |
| | | //
|
| | | #ifdef APSTUDIO_INVOKED
|
| | | #ifndef APSTUDIO_READONLY_SYMBOLS
|
| | | #define _APS_NEXT_RESOURCE_VALUE 336
|
| | | #define _APS_NEXT_COMMAND_VALUE 33079
|
| | | #define _APS_NEXT_CONTROL_VALUE 1016
|
| | | #define _APS_NEXT_SYMED_VALUE 317
|
| | | #define _APS_NEXT_RESOURCE_VALUE 349
|
| | | #define _APS_NEXT_COMMAND_VALUE 33081
|
| | | #define _APS_NEXT_CONTROL_VALUE 1061
|
| | | #define _APS_NEXT_SYMED_VALUE 318
|
| | | #endif
|
| | | #endif
|