📄 airguard_c.h
字号:
#if !defined(AFX_AIRGUARD_C_H__5AC44889_C30A_11D5_BA01_52544CC01EF9__INCLUDED_)
#define AFX_AIRGUARD_C_H__5AC44889_C30A_11D5_BA01_52544CC01EF9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "resource.h"
#include "Bitmap.h"
#include "Camera.h"
#include "SysState.h"
#include "WndMsgPara.h"
#include "Dib.h"
#include "FileName.h"
// constants define.
#define MAX_LOADSTRING 100
// define the location of unusual buttons.
#define BASELINE 580
#define ARROWS_X 680//430
#define ARROWS_Y BASELINE - 17//425
#define PIE_WIDTH 33 + 2
#define PIE_HEIGHT 33 + 2
#define LEFT_X ARROWS_X - 37 + 2
#define LEFT_Y ARROWS_Y + 4
#define LEFT_WIDTH 29 + 1
#define LEFT_HEIGHT 26 - 1
#define RIGHT_X ARROWS_X + 41 - 2
#define RIGHT_Y ARROWS_Y + 4
#define RIGHT_WIDTH LEFT_WIDTH
#define RIGHT_HEIGHT LEFT_HEIGHT
#define UP_X ARROWS_X + 5
#define UP_Y ARROWS_Y - 37 + 2
#define UP_WIDTH LEFT_HEIGHT
#define UP_HEIGHT LEFT_WIDTH
#define DOWN_X ARROWS_X + 5
#define DOWN_Y ARROWS_Y + 37
#define DOWN_WIDTH UP_WIDTH
#define DOWN_HEIGHT UP_HEIGHT
#define PLUS_X 480
#define PLUS_Y BASELINE - 1
#define PLUS_WIDTH 45 + 1
#define PLUS_HEIGHT 15 + 1
#define MINUS_X PLUS_X - 60
#define MINUS_Y PLUS_Y
#define MINUS_WIDTH PLUS_WIDTH
#define MINUS_HEIGHT PLUS_HEIGHT
// Define Message Types
#define WM_ACK (WM_USER+10)
#define WM_PARENTMOVED (WM_USER+11)
#define ACK_BN_DOWN 1
#define ACK_BN_UP 2
// Define Windows IDs
#define ID_UPBUTTON 1
#define ID_LEFTBUTTON 2
#define ID_DOWNBUTTON 3
#define ID_RIGHTBUTTON 4
#define ID_PIEBUTTON 5
#define ID_RADIOAUTO 6
#define ID_RADIOMANUAL 7
#define ID_RADIOZOOM 8
#define ID_RADIOFOCUS 9
#define ID_RADIOAPERTURE 10
#define ID_RADIOBROWSE 11
#define ID_BTNNEXT 12
#define ID_BTNPREV 13
#define ID_BTNPRINT 14
#define ID_BTNVIEWDETAILED 15
#define ID_BTNPLAY 16
#define ID_EDITBLACKNESS 17
#define ID_BTNVIEWDETAILEDCHIMNEY 18
#define ID_EDITBRIGHTNESS 19
#define ID_BTNGOTO 20
#define ID_BTNSETBRIGHTNESS 21
#define ID_BTNSETPRESET 22
#define ID_PLUSBUTTON 23
#define ID_MINUSBUTTON 24
#define ID_BTNCAMNUM_0 30
#define ID_BTNCAMNUM_1 31
#define ID_BTNCAMNUM_2 32
#define ID_BTNCAMNUM_3 33
#define ID_BTNCAMNUM_4 34
#define ID_BTNCAMNUM_5 35
#define ID_BTNCAMNUM_6 36
#define ID_BTNCAMNUM_7 37
#define ID_BTNCAMNUM_8 38
#define ID_BTNCAMNUM_9 39
#define ID_BTNCAMNUM_10 40
#define ID_BTNCAMNUM_11 41
#define ID_BTNCAMNUM_12 42
#define ID_BTNCAMNUM_13 43
#define ID_BTNCAMNUM_14 44
#define ID_BTNCAMNUM_15 45
#define ID_TRACKBAR_CAMNUM 46
#define ID_BTNNEXTCHIMNEY 47
#define ID_BTNPREVCHIMNEY 48
#define ID_STATIC 51
#define ID_CB_TYPE 52
#define ID_ED_ADDRESS 68
#define ID_CB_PROTOCOL 74
#define ID_CB_AVPORT 90
#define ID_ED_CMNQUEUE 106
#define ID_CHECKBOXSOUND 107
#define VIDEOWINDOW_WIDTH 640
#define VIDEOWINDOW_HEIGHT 480
#define MAXFILENAME 200
#define AUTOMODE 0
#define MANUALMODE 1
#define DETECT_ON_TIMER_2 0
#define VDO_ONCONTEXTMENU_2 1
#define CREATE_CHIMNEY_TEMPLATE2 2
#define TIMER_AUTODETECT_CLICK 5
#define TIMER_AUTODETECT_CAMERAPOSITION 6
// Global Variables:
HINSTANCE g_hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text
// Global Objects:
CCamera g_myCamera;
CSysState g_mySysState;
CDib g_myDIB, g_myDIB2;
CFileName g_myFileName;
// Global window handles
HWND g_hwndVideo;
HWND g_hwndMainWindow;
HWND g_hwndToolTip;
HWND g_hwndUpButton;
HWND g_hwndLeftButton;
HWND g_hwndDownButton;
HWND g_hwndRightButton;
HWND g_hwndPieButton;
HWND g_hwndPlusButton;
HWND g_hwndMinusButton;
HWND g_hwndRadioManual;
HWND g_hwndRadioAuto;
HWND g_hwndRadioBrowse;
HWND g_hwndRadioZoom;
HWND g_hwndRadioFocus;
HWND g_hwndRadioAperture;
HWND g_hwndCheckBoxBeep;
HWND g_hwndEditBlackness;
HWND g_hwndEditChimneyInfo;
HWND g_hwndEditSysState;
HWND g_hwndLogoWindow;
HWND g_BtnNext;
HWND g_BtnSetPreset;
HWND g_BtnGotoPreset;
HWND g_BtnNextChimney;
HWND g_BtnCamNum[16];
HWND g_TrackbarIllumination;
HWND g_hwndVideo_MPEG = NULL;
HWND g_hwndVideo_JIMU = NULL;
HWND g_hwndSiteSettings;
HWND g_hwndStaticColumn[6];
HWND g_hwndStaticCamNum[16];
HWND g_hwndCBType[16];
HWND g_hwndEditAddress[16];
HWND g_hwndCBProtocol[16];
HWND g_hwndCBAVPort[16];
HWND g_hwndEditCmnQueue[16];
HWND g_hwndGroupBox_SiteSettings;
HWND g_hwnd_SiteSettings_OK;
HWND g_hwnd_SiteSettings_CANCEL;
// Foward declarations of windows callback functions.
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK VideoWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK Video_MPEGWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK Video_JIMUWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK StartupWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK UpButtonWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK LeftButtonWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK RightButtonWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK DownButtonWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK PieButtonWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK PlusButtonWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK MinusButtonWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK LogoWndProc(HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK SiteSettingsWndProc(HWND hWnd, UINT wMessage, WPARAM wParam, LPARAM lParam);
BOOL CALLBACK DlgGotoPreset(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK DlgSetPreset(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK DlgCreateTemplate(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
BOOL CALLBACK DlgDatebaseConfiguration(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam );
// Foward declarations of functions implemented in AriGuard.cpp.
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
BOOL MainWindow_OnCreate(HWND hWnd);
void MainWindow_OnPaint(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
bool MainWindow_OnHScroll(HWND hWnd, WPARAM wParam, LPARAM lParam);
bool MainWindow_OnACK(HWND hWnd, WPARAM wParam, LPARAM lParam);
bool MainWindow_OnCommand(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
bool MainWindow_OnTimer(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
HWND WINAPI CreateTrackbar(
HWND hwndDlg, // handle of dialog box (parent window)
UINT iMin, // minimum value in trackbar range
UINT iMax, // maximum value in trackbar range
UINT iSelMin, // minimum value in trackbar selection
UINT iSelMax, // maximum value in trackbar selection
UINT xPos,
UINT yPos,
UINT iWidth,
UINT iHeight,
int iCtlID);
bool EnterAutoMode();
bool EnterManualMode();
bool DetectChimney();
// Foward declarations of thread functions
DWORD WINAPI ThreadStartupFunc(LPVOID lpvThreadParam);
bool MPEG_VideoWindow_OnContextMenu1(HWND hWnd, WPARAM wParam, LPARAM lParam);
bool MPEG_VideoWindow_OnContextMenu2();
bool MPEG_CvtBmpTo320(LPSTR lpszSocFileName, LPSTR lpszDstFileName);
bool MPEG_SaveDIBFileIntoDatebase(LPSTR lpszFileName, float fBlackness, int nObjectID, int nCameraID);
bool MPEG_CreateChimneyTemplate1();
bool MPEG_CreateChimneyTemplate2();
bool MPEG_DetectChimneyOnTimer1();
bool MPEG_DetectChimneyOnTimer2();
bool JIMU_CreateChimneyTemplate();
bool JIMU_DetectChimneyOnTimer();
#endif // !defined(AFX_AIRGUARD_C_H__5AC44889_C30A_11D5_BA01_52544CC01EF9__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -