📄 stdafx.h
字号:
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__7C384079_B7C2_41EB_A4D1_30B8B6CE2CBF__INCLUDED_)
#define AFX_STDAFX_H__7C384079_B7C2_41EB_A4D1_30B8B6CE2CBF__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
//Control.0 PID_SWITCH
//Control.1 RH1_SWITCH
//Control.2 RH2_SWITCH
//Control.3 RH3_SWITCH
//Control.4 SL_SWITCH
//Control.5 WS1_SWITCH
//Control.6 WS2_SWITCH
//Control.7
// 0--------入板光感
// 1--------急停
// 2--------编码信号
// 3--------噴头左限 原点
// 4--------噴头右限 顶点
// 5--------运输马达过载
// 6--------
// 7--------排风马达过载
// 8--------波峰马达1
// 9--------波峰马达2
//10--------调机测试
// 告警信息
// 64: 1号4018
// 65: 2号4012
// 66: 3号4021
// 67: 4号传送带
// 68: 5号风机
// 69: 6号波峰马达1
// 70: 7号波峰马达2
// 71: COM1通信异常
// 72:
#ifndef _SYS_LOCAL_
#define _SYS_LOCAL_
#define OPERATORMAX 30
typedef struct //操作员设置
{ // id=0 =>系统管理员
unsigned short OperatorName[20];
unsigned short Password[20];
unsigned char on_enable; //开机
unsigned char off_enable; //关机
unsigned char rh1_on_enable; //预热一开
unsigned char rh1_off_enable; //预热一关
unsigned char rh2_on_enable; //预热二开
unsigned char rh2_off_enable; //预热二关
unsigned char rh3_on_enable; //预热三开
unsigned char rh3_off_enable; //预热三关
unsigned char sl_on_enable; //锡炉开
unsigned char sl_off_enable; //锡炉关
unsigned char trans_on_enable; //传输开
unsigned char trans_off_enable; //传输关
unsigned char pw_on_enable; //喷雾开
unsigned char pw_off_enable; //喷雾关
unsigned char lpw_on_enable; //连喷开
unsigned char lpw_off_enable; //连喷关
unsigned char para_enable; //修改参数窗
unsigned char set_enable; //修改设置窗
unsigned char info_enable; //修改信息窗
unsigned char warn_enable; //修改报警窗
unsigned char oven_enable; //修改熔锡温度
unsigned char plc_enable; //PLC设置
unsigned char exit_enable;
unsigned char com_enable;
unsigned char xz_on_enable;
unsigned char xz_off_enable;
unsigned char auto_enable;
unsigned char manul_enable;
unsigned char ws1_on_enable;
unsigned char ws1_off_enable;
unsigned char ws2_on_enable;
unsigned char ws2_off_enable;
}OPERATORS; //"用户管理" =>仅id=0系统管理员才有权
typedef struct
{
unsigned int CurOperatorid; //当前正在操作的操作员编码
unsigned short CurOperatorName[20]; //当前正在操作的操作员名
double KeepTime; //密码维持时间(单位:分)
OPERATORS Operators[OPERATORMAX]; //30 个用户
}OPERATORSTRUCT;
#endif
//-------定时器----------------------------------------
#define MAXKRNUM 256
#define MaxMailLength 24
#define MAXEMPMAIL 200
#define MainControl_TIMER 1000
#define Set_TIMER 1001
#define Para_TIMER 1002
#define Test_TIMER 1003
#define Info_TIMER 1004
#define Warn_TIMER 1005
#define Curve_TIMER 1006
#define Plc_TIMER 1007
#define MainControl_Window 0
#define Set_Window 1
#define Para_Window 2
#define Test_Window 3
#define Info_Window 4
#define Warn_Window 5
#define Curve_Window 6
#define Plc_Window 7
#define WM_STARTSAMPLE (WM_USER + 0)
#define WM_STOPSAMPLE (WM_USER + 1)
#define WM_LEVELPLAY (WM_USER + 2)
#define WM_VERTYPLAY (WM_USER + 3)
#define WM_ESCFILE (WM_USER + 4)
#define WM_FLASHCURVE (WM_USER + 5)
#define WM_FLASHPLC (WM_USER + 7)
#define YKON 0
#define YKOFF 1
#define YK_RH1_ACON 0 /* 预热接触器1 */
#define YK_RH2_ACON 1 /* 预热接触器2 */
#define YK_RH3_ACON 2 /* 预热接触器3 */
#define YK_TRANS_ACON 3 /* 运输接触器 (排风马达接触器) */
//#define YK_FAN_ACON 3 /* 运输接触器 (排风马达接触器) */
#define YK_CFOOT_JON 4 /* 洗爪中间继电器 */
#define YK_WS1_JON 5 /* 波峰1中间继电器 */
#define YK_WS2_JON 6 /* 波峰2中间继电器 */
#define YK_RED_LED 7 /* 红灯 */
#define YK_YEW_LED 8 /* 黄灯 */
#define YK_YEW_BLUE 9 /* 绿灯 */
#define YK_TK 10 /* 调宽 */
#define YK_TZ 11 /* 调窄 */
#define POWER_24 12 /* */
#define YK_RH_POWER 13 /* 加热恒温接触器 */
#define YK_SPOOT 22
#define YK_SL_TIMER 23 /* 锡炉底部加热16+7 T8 */
#define YK_WS_SSR 24 /* 锡炉恒温 16+8 T9 */
#define YK_RH1_SSR 25 /* 预热一恒温 16+9 T10 */
#define YK_RH2_SSR 26 /* 预热二恒温 16+10 T11 */
#define YK_RH3_SSR 27 /* 预热三恒温 16+11 T12 */
#define YK_JUST_AIR 28 /* 调气 16+12 T13 */
#define YK_JUST_WATER 29 /* 调水 16+13 T14 */
#define YK_SHIFT 30 /* 移动 16+14 T15 */
#define YK_FON_RIGHT 31 /* 喷头方向 16+15 T16 */
#define YK_FON_LEFT 32 /* 喷头移动 16+16 T17 */
#include <afxdisp.h> // MFC Automation classes
#include "afx.h"
#include "afxplex_.h"
#include "afxcoll.h"
// public headers
#include "afxwin.h"
#include "afxdlgs.h"
#include "afxext.h"
#ifndef _COMMSTRUCT
#define _COMMSTRUCT
#define SOH 1
#define PI 3.14159265
#define NOUSER 0
#define PACKETLENGTH 12
#define SOH 1
#define WINDOWS95_COMMCONFIG_VERSION 0x100
#define MaxError 20
#define MaxRepeate 10
enum FILESTS
{
FileNull,
FileOpen,
FileNewCreate
};
struct ComStruct
{
unsigned char ComNo;
unsigned char Baud;
unsigned char Stop;
unsigned char Flow;
unsigned char Data;
unsigned char Parity;
UINT MaxErrNum;
UINT MaxWaitTime;
UINT RepeateCount;
};
#endif
#ifndef __POSTSTATIONSTRUCT
struct PostStationStruct
{
int MailQueueLength;
int TotMailNum;
struct Mail *MailQueueHead;
};
#define __POSTSTATIONSTRUCT
#endif
#ifndef __MESSAGESTRUCT
struct Mail
{
unsigned char Data[MaxMailLength]; /* Data array */
struct Mail *Link;
};
#define __MESSAGESTRUCT
#endif
struct SoeHeadItem
{
int MailQueueLimit;
int MailQueueLength;
struct Mail far *MailQueueHead; /* GET LETTER FROM THE FRONT */
struct Mail far *MailQueueTail; /* RECIVE LETTER FROM THE REAR */
};
#ifndef CCOMMSTRUCT
#define CCOMMSTRUCT // Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <commdlg.h>
#include <string.h>
//#include <io.h>
#include <memory.h>
// constant definitions
#define GWL_NPTTYINFO 0
#define TTYEXTRAunsigned char S sizeof( LONG )
#define ABOUTDLG_USEBITMAP 1
#define ATOM_TTYINFO 0x100
// hard coded maximum number of ports for device under Win32
#define MAXPORTS 4
// terminal size
#define MAXROWS 25
#define MAXCOLS 80
#define MAXBLOCK 80
#define MAXLEN_TEMPSTR 81
#define RXQUEUE 4096
#define TXQUEUE 4096
// cursor states
#define CS_HIDE 0x00
#define CS_SHOW 0x01
// Flow control flags
#define FC_DTRDSR 0x01
#define FC_RTSCTS 0x02
#define FC_XONXOFF 0x04
// ascii definitions
#define ASCII_BEL 0x07
#define ASCII_BS 0x08
#define ASCII_LF 0x0A
#define ASCII_CR 0x0D
#define ASCII_XON 0x11
#define ASCII_XOFF 0x13
#define TransLength 3900
// data structures
typedef struct tagTTYINFO
{
HANDLE idComDev ;
unsigned char bPort, abScreen[ MAXROWS * MAXCOLS ] ;
unsigned char RecData[256],SendData[256];
unsigned char RecDataPtr,MoveDataPtr,SendDataPtr;
BOOL fConnected, fXonXoff, fLocalEcho, fNewLine, fAutoWrap,
fUseCNReceive, fDisplayErrors;
unsigned char Size, bFlowCtrl, bParity, bStopBits ;
DWORD dwBaudRate ;
WORD wCursorState ;
HFONT hTTYFont ;
LOGFONT lfTTYFont ;
DWORD rgbFGColor ;
int xSize, ySize, xScroll, yScroll, xOffset, yOffset,
nColumn, nRow, xChar, yChar ;
HANDLE hPostEvent, hWatchThread, hWatchEvent ;
DWORD dwThreadID ;
OVERLAPPED osWrite, osRead ;
} TTYINFO, NEAR *NPTTYINFO ;
#define COMDEV( x ) (x -> idComDev)
#define PORT( x ) (x -> bPort)
#define SCREEN( x ) (x -> abScreen)
#define CONNECTED( x ) (x -> fConnected)
#define XONXOFF( x ) (x -> fXonXoff)
#define LOCALECHO( x ) (x -> fLocalEcho)
#define NEWLINE( x ) (x -> fNewLine)
#define AUTOWRAP( x ) (x -> fAutoWrap)
#define BYTESIZE( x ) (x -> bByteSize)
#define FLOWCTRL( x ) (x -> bFlowCtrl)
#define PARITY( x ) (x -> bParity)
#define STOPBITS( x ) (x -> bStopBits)
#define BAUDRATE( x ) (x -> dwBaudRate)
#define CURSORSTATE( x ) (x -> wCursorState)
#define HTTYFONT( x ) (x -> hTTYFont)
#define LFTTYFONT( x ) (x -> lfTTYFont)
#define FGCOLOR( x ) (x -> rgbFGColor)
#define XSIZE( x ) (x -> xSize)
#define YSIZE( x ) (x -> ySize)
#define XSCROLL( x ) (x -> xScroll)
#define YSCROLL( x ) (x -> yScroll)
#define XOFFSET( x ) (x -> xOffset)
#define YOFFSET( x ) (x -> yOffset)
#define COLUMN( x ) (x -> nColumn)
#define ROW( x ) (x -> nRow)
#define XCHAR( x ) (x -> xChar)
#define YCHAR( x ) (x -> yChar )
#define USECNRECEIVE( x ) (x -> fUseCNReceive)
#define DISPLAYERRORS( x ) (x -> fDisplayErrors)
#define POSTEVENT( x ) (x -> hPostEvent)
#define HTHREAD( x ) (x -> hWatchThread)
#define THREADID( x ) (x -> dwThreadID)
#define WRITE_OS( x ) (x -> osWrite)
#define READ_OS( x ) (x -> osRead)
#define SET_PROP( x, y, z ) SetProp( x, MAKEINTATOM( y ), z )
#define GET_PROP( x, y ) GetProp( x, MAKEINTATOM( y ) )
#define REMOVE_PROP( x, y ) RemoveProp( x, MAKEINTATOM( y ) )
#define WM_WarnBoard1 WM_USER+1
#define WM_WarnBoard2 WM_USER+2
#define WM_WarnBoard3 WM_USER+3
#define WM_WarnBoard4 WM_USER+4
#define WM_WarnBoard5 WM_USER+5
#define WM_WarnBoard6 WM_USER+6
#define WM_WarnBoard7 WM_USER+7
#define WM_WarnBoard8 WM_USER+8
#define WM_WarnBoard9 WM_USER+9
#define WM_WarnBoard10 WM_USER+10
#define WM_WarnBoard11 WM_USER+11
#define WM_WarnBoard12 WM_USER+12
#define WM_WarnBoard13 WM_USER+13
#define WM_WarnBoard14 WM_USER+14
#define WM_WarnBoard15 WM_USER+15
#define WM_WarnBoard16 WM_USER+16
#define WM_WarnBoard17 WM_USER+17
#define WM_WarnBoard18 WM_USER+18
#define WM_WarnBoard19 WM_USER+19
#define WM_WarnBoard20 WM_USER+20
#define WM_WarnBoard21 WM_USER+21
#define WM_WarnBoard22 WM_USER+22
#define WM_WarnBoard23 WM_USER+23
#define WM_WarnBoard24 WM_USER+24
#define WM_WarnBoard25 WM_USER+25
#define WM_WarnBoard26 WM_USER+26
#define WM_WarnBoard27 WM_USER+27
#define WM_WarnBoard28 WM_USER+28
#define WM_WarnBoard29 WM_USER+29
#define WM_WarnBoard30 WM_USER+30
#define WM_WarnBoard31 WM_USER+31
#define WM_WarnBoard32 WM_USER+32
#define WM_WarnBoard33 WM_USER+33
#define WM_WarnBoard34 WM_USER+34
DWORD BaudTable[] =
{
CBR_110, CBR_300, CBR_600, CBR_1200, CBR_2400,
CBR_4800, CBR_9600, CBR_14400, CBR_19200, CBR_38400,
CBR_56000, CBR_128000, CBR_256000
} ;
DWORD ParityTable[] =
{
NOPARITY, EVENPARITY, ODDPARITY, MARKPARITY, SPACEPARITY
} ;
DWORD StopBitsTable[] =
{
ONESTOPBIT, ONE5STOPBITS, TWOSTOPBITS
} ;
// CRT mappings to NT API
#define _fmemset memset
#define _fmemmove memmove
LRESULT NEAR CreateTTYInfo( ) ;
BOOL NEAR DestroyTTYInfo( ) ;
int NEAR ReadCommBlock( LPSTR, int ) ;
BOOL NEAR WriteCommBlock( LPSTR, DWORD);
BOOL NEAR OpenConnection( ) ;
BOOL NEAR SetupConnection( ) ;
BOOL NEAR CloseConnection( ) ;
DWORD FAR PASCAL CommWatchProc( LPSTR ) ;
#endif
#include "CJButton.h"
#include "editcmd.h"
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#if defined(_WIN32_WCE) && (_WIN32_WCE >= 211) && (_AFXDLL)
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxsock.h> // MFC socket extensions
//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__7C384079_B7C2_41EB_A4D1_30B8B6CE2CBF__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -