You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
819 lines
20 KiB
819 lines
20 KiB
//----------------------------------------------------------------------------
|
|
// Laser Guard Ltd.
|
|
// Copyright © 2000-2002. All Rights Reserved.
|
|
// Version 1.0 01/01/2000
|
|
// Last modification: 08/10/2003
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: ObjectFactory.h
|
|
// AUTHOR: Sergey Chizhevskiy
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of ObjectFactory.h
|
|
//----------------------------------------------------------------------------
|
|
#ifndef __OBJECT__FACTORY__H__INCLUDED__
|
|
#define __OBJECT__FACTORY__H__INCLUDED__
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#include "Background.h"
|
|
#include "..\..\LgLib\MFC\FileGroup.h"
|
|
#include "..\..\LgLib\LgAux.h"
|
|
#include "..\..\LgLib\UIMap\LgUIMapBackground.h"
|
|
#include "..\..\LgLib\LgString.h"
|
|
#include "HiddenZoneList.h"
|
|
#include "BorderLGS.h"
|
|
|
|
#define NORMAL_SIZE 16
|
|
|
|
#ifndef SETUP_LGS_PROJECT
|
|
class CDevice;
|
|
class CSensor;
|
|
class CVideoDevice;
|
|
class CSocket;
|
|
class CDirectInput;
|
|
class CDirectOutput;
|
|
#endif
|
|
|
|
namespace OFNS
|
|
{
|
|
|
|
enum E_DEVICE_TYPE
|
|
{
|
|
DT_NONE = -1,
|
|
DT_FIRST = 0,
|
|
DT_CAMERA = 0, // Fixed camera
|
|
DT_MIGVAN_CAMERA = 1,
|
|
DT_MIGVAN_VM8X4 = 4,
|
|
DT_RABBIT = 2,
|
|
DT_RABBIT_CAMERA = 3,
|
|
DT_SOCKET = 5,
|
|
DT_VIDEO_IN = 6,
|
|
DT_LGS = 7,
|
|
DT_DRY_CONTACTS = 8,
|
|
DT_CLD = 9,
|
|
DT_CAMERA_PTZ = 10,
|
|
DT_CAMERA_LGS = 11,
|
|
DT_PCI_1762 = 12,
|
|
DT_COUNT = 13
|
|
};
|
|
|
|
enum E_PIN_TYPE
|
|
{
|
|
PT_NONE = 0,
|
|
|
|
PT_VIDEO_IN = 1, // video input
|
|
PT_VIDEO_OUT = 2, // video output
|
|
|
|
PT_RABBIT_CAMERA = 3,// logical connection rabbit with rabbit camera
|
|
PT_CAMERA_RABBIT = 4,// logical connection rabbit camera with rabbit
|
|
|
|
PT_SOCKET_MD = 5, // connection with communication line multi-drop
|
|
PT_SOCKET_PTZ = 6, // connection with communication line Migvan PTZ
|
|
PT_SOCKET_VM = 7, // connection with communication line Migvan Video Multiplexor
|
|
PT_SOCKET_LGS = 8, // connection with communication line single LGS
|
|
PT_SOCKET_MIC1300 = 9,// connection with communication line camera MIC1300
|
|
PT_SOCKET_TKS576 = 10,// connection with communication line camera TKS576
|
|
PT_SOCKET_PG3AD = 11, // connection with communication line camera Philips G3 AutoDome
|
|
PT_SOCKET_VICON = 12, // connection with communication line camera Vicon
|
|
PT_SOCKET_AMERICAN_DYNAMIS = 13,
|
|
|
|
PT_LGS_CAMERA = 14,// logical connection LGS with LGS's camera
|
|
PT_CAMERA_LGS = 15,// logical connection LGS's camera with LGS
|
|
|
|
PT_CAMERA_SENSOR = 16,// logical connection camera with sensor
|
|
PT_SENSOR_CAMERA = 17,// logical connection sensor with camera
|
|
|
|
PT_INPUT_SENSOR = 18, // logical connection dry-contact with sensor
|
|
PT_SENSOR_INPUT = 19, // logical connection sensor with dry-contact
|
|
|
|
PT_OUTPUT_EVENT = 20, // logical connection for output to event
|
|
PT_EVENT_OUTPUT = 21, // logical connection for event to output
|
|
};
|
|
|
|
enum E_PIN_SUB_TYPE
|
|
{
|
|
PST_NONE = 0,
|
|
PST_SENSOR = 1,
|
|
PST_COMMAND = 2,
|
|
};
|
|
|
|
struct PIN_DESC
|
|
{
|
|
E_PIN_TYPE nPinType;
|
|
E_PIN_SUB_TYPE nPinSubType;
|
|
E_PIN_TYPE nTruePinType;
|
|
int nDeviceMax;
|
|
POINT pos;
|
|
int nSubIndex;
|
|
LPCTSTR pName;
|
|
};
|
|
|
|
class CObjectFactory;
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFPin
|
|
{
|
|
public:
|
|
COFPin();
|
|
virtual ~COFPin();
|
|
|
|
// WARNING: Partial initialization, it needs to initiate m_Owner.nIndex!
|
|
void Initialize( int nOwnerType, int nOwnerPin, PIN_DESC *pPinDesk );
|
|
|
|
void Serialize(CArchive& ar);
|
|
|
|
BOOL IsFree() { return m_nDeviceCount < m_nDeviceMax; }
|
|
int GetType() { return m_nPinType; }
|
|
int GetSubType() { return m_nPinSubType; }
|
|
int GetTrueType() { return m_nTruePinType; }
|
|
|
|
CString GetName() { return m_Name; }
|
|
COLORREF GetColor();
|
|
|
|
CObjectFactory *GetOF() { return m_pOF; };
|
|
|
|
int GetParam() { return m_nParam; }
|
|
void SetParam( int nParam ) { m_nParam = nParam; }
|
|
|
|
public:
|
|
// WARNING: connect both pins: this and pPin!
|
|
BOOL Connect( COFPin *pPin );
|
|
|
|
// WARNING: disconnect only this pin!
|
|
BOOL Disconnect( COFPin *pPin );
|
|
|
|
|
|
public:
|
|
|
|
struct DID
|
|
{
|
|
int nType;
|
|
int nIndex;
|
|
int nPin;
|
|
};
|
|
|
|
DID m_Owner;
|
|
int m_nPinType;
|
|
int m_nPinSubType;
|
|
int m_nTruePinType;
|
|
|
|
int m_nSubIndex;
|
|
|
|
DID *m_pDevice;
|
|
int m_nDeviceCount;
|
|
int m_nDeviceMax;
|
|
|
|
CPoint m_Pos;
|
|
|
|
CString m_Name;
|
|
|
|
int m_nParam;
|
|
|
|
CObjectFactory *m_pOF;
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDevice
|
|
{
|
|
public:
|
|
COFDevice();
|
|
virtual ~COFDevice();
|
|
|
|
virtual int GetType() { return DT_NONE; };
|
|
int GetIndex() { return m_nIndex; };
|
|
void SetIndex( int nIndex );
|
|
|
|
CString GetName() { return m_Name; };
|
|
void SetName( const CString& name ) { m_Name = name; };
|
|
|
|
CObjectFactory *GetOF() { return m_pOF; }
|
|
|
|
virtual void Draw( CDC *pDC, BOOL bActive, CPoint shift, double scale );
|
|
// CSize GetSize() { return CSize( 32,32 ); }
|
|
|
|
public:
|
|
void CreatePins( PIN_DESC* pPinDesc, int nCount );
|
|
|
|
COFPin *GetPin( int nIndex ) { return nIndex < m_nPin ? &m_pPin[ nIndex ] : NULL; }
|
|
int GetPinCount() { return m_nPin; }
|
|
|
|
COFPin *GetFreePin( int nType, int nIndex = 0 );
|
|
BOOL IsPossibleToConnect( COFDevice *pDevice );
|
|
|
|
COFPin *m_pPin;
|
|
int m_nPin;
|
|
|
|
CString m_Name;
|
|
CString m_DeviceName;
|
|
public:
|
|
virtual void Serialize(CArchive& ar);
|
|
|
|
public:
|
|
CLgDPoint m_Pos;
|
|
|
|
// CPoint m_Pos;
|
|
|
|
HICON m_hIcon[2];
|
|
int m_nIndex;
|
|
|
|
CObjectFactory *m_pOF;
|
|
|
|
#ifndef SETUP_LGS_PROJECT
|
|
CDevice *m_pDevice;
|
|
CDevice *m_pDeviceDO;
|
|
CVideoDevice *m_pVideoDevice[2];
|
|
CSocket *m_pSocket;
|
|
CDirectInput *m_pDI[100];
|
|
CDirectOutput *m_pDO[100];
|
|
CSensor *m_pSensor;
|
|
#endif
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceCamera : public COFDevice
|
|
{
|
|
public:
|
|
COFDeviceCamera();
|
|
virtual ~COFDeviceCamera();
|
|
|
|
virtual int GetType(){ return DT_CAMERA; }
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceSensor : public COFDevice
|
|
{
|
|
public:
|
|
COFDeviceSensor();
|
|
|
|
public:
|
|
virtual void Serialize(CArchive& ar);
|
|
|
|
public:
|
|
int m_nAddressCCC;
|
|
|
|
public:
|
|
typedef struct TRANSFORM
|
|
{
|
|
double m_dX;
|
|
double m_dY;
|
|
double m_dZ;
|
|
double m_dPsi;
|
|
double m_dTheta;
|
|
double m_dPhi;
|
|
}TRANSFORM, *PTRANSFORM;
|
|
|
|
public:
|
|
BOOL m_bRemoteCamera;
|
|
TRANSFORM m_Transform[2];
|
|
enum { LGS_TILT_TABLE_SIZE = 10 };
|
|
double m_dTiltTable[LGS_TILT_TABLE_SIZE];
|
|
double m_dPanShift;
|
|
|
|
public:
|
|
int m_nImageCount;
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceLGS : public COFDeviceSensor
|
|
{
|
|
public:
|
|
enum
|
|
{
|
|
LGS_CMD_CLEAR = 0,
|
|
LGS_CMD_RESET = 1,
|
|
LGS_CMD_HZ_1 = 2,
|
|
LGS_CMD_HZ_2 = 3,
|
|
LGS_CMD_HZ_3 = 4,
|
|
LGS_CMD_HZ_4 = 5,
|
|
LGS_CMD_HZ_5 = 6,
|
|
|
|
LGS_EVT_ALARM = 0,
|
|
LGS_EVT_POSTALARM = 1,
|
|
LGS_EVT_NORMAL = 2,
|
|
LGS_EVT_TIMEOUT = 3,
|
|
LGS_EVT_HZ_1 = 4,
|
|
LGS_EVT_HZ_2 = 5,
|
|
LGS_EVT_HZ_3 = 6,
|
|
LGS_EVT_HZ_4 = 7,
|
|
LGS_EVT_HZ_5 = 8,
|
|
};
|
|
|
|
public:
|
|
COFDeviceLGS();
|
|
virtual ~COFDeviceLGS();
|
|
|
|
virtual int GetType(){ return DT_LGS; }
|
|
|
|
enum{ ST_MULTI, ST_SINGLE };
|
|
|
|
void ChangeSubType( int nSubType );
|
|
|
|
virtual void Serialize( CArchive& ar );
|
|
|
|
public:
|
|
virtual CHiddenZoneList *GetHiddenZoneList() { return &m_HiddenZoneList; }
|
|
virtual CBorderLGS *GetBorderLGS() { return &m_BorderLGS; }
|
|
virtual double GetCommonZero() { return m_dZeroShift; }
|
|
void SetLaserData( int MasterOffset, int MasterDelta, int MasterWidth, int MasterOrder, int MasterSST, int MasterFlip,
|
|
int SlaveOffset, int SlaveDelta, int SlaveWidth, int SlaveOrder, int SlaveSST, int SlaveFlip );
|
|
void GetLaserData( int &MasterOffset, int &MasterDelta, int &MasterWidth, int &MasterOrder, int &MasterSST, int &MasterFlip,
|
|
int &SlaveOffset, int &SlaveDelta, int &SlaveWidth, int &SlaveOrder, int &SlaveSST, int &SlaveFlip );
|
|
public:
|
|
int m_nSubType;
|
|
int m_nAddress;
|
|
double m_dZeroShift;
|
|
double m_dRange;
|
|
BOOL m_bZeroClockwise;
|
|
|
|
protected:
|
|
CHiddenZoneList m_HiddenZoneList;
|
|
CBorderLGS m_BorderLGS;
|
|
|
|
protected:
|
|
int m_MasterOffset;
|
|
int m_MasterDelta;
|
|
int m_MasterWidth;
|
|
int m_MasterOrder;
|
|
int m_MasterSST;
|
|
int m_MasterFlip;
|
|
int m_SlaveOffset;
|
|
int m_SlaveDelta;
|
|
int m_SlaveWidth;
|
|
int m_SlaveOrder;
|
|
int m_SlaveSST;
|
|
int m_SlaveFlip;
|
|
|
|
public:
|
|
CLgArray<CString> m_arrCalibrationName;
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceCLD :
|
|
public COFDeviceSensor
|
|
{
|
|
public:
|
|
enum
|
|
{
|
|
CLD_CMD_CLEAR = 0,
|
|
CLD_CMD_RESET = 1,
|
|
|
|
CLD_EVT_ALARM = 0,
|
|
CLD_EVT_POSTALARM = 1,
|
|
CLD_EVT_NORMAL = 2,
|
|
CLD_EVT_TIMEOUT = 3,
|
|
};
|
|
|
|
public:
|
|
COFDeviceCLD();
|
|
virtual ~COFDeviceCLD();
|
|
|
|
virtual int GetType(){ return DT_CLD; }
|
|
|
|
virtual void Serialize( CArchive& ar );
|
|
|
|
public:
|
|
void SetParameters( int Offset, int Width, int Flip );
|
|
void GetParameters( int& Offset, int& Width, int& Flip );
|
|
|
|
public:
|
|
double GetCommonZero() { return m_dCommonZero; }
|
|
|
|
public:
|
|
int m_nAddress;
|
|
|
|
public:
|
|
int m_nOffset;
|
|
int m_nWidth;
|
|
int m_nFlip;
|
|
|
|
public:
|
|
double m_dCommonZero;
|
|
double m_dRange;
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceCameraPTZ :
|
|
public COFDevice
|
|
{
|
|
public:
|
|
COFDeviceCameraPTZ();
|
|
virtual ~COFDeviceCameraPTZ();
|
|
|
|
public:
|
|
virtual int GetType() { return DT_CAMERA_PTZ; }
|
|
virtual void Serialize( CArchive& ar );
|
|
|
|
public:
|
|
enum
|
|
{
|
|
PTZST_NONE = 0,
|
|
PTZST_MIGVAN_878 = 1,
|
|
PTZST_MIGVAN_KD6Z = 2,
|
|
PTZST_MIC_1_300 = 3,
|
|
PTZST_TK_S576 = 4,
|
|
PTZST_PG3AD_NEW = 5,
|
|
PTZST_VICON = 6,
|
|
PTZST_HEBRON = 7,
|
|
PTZST_3_TRACK = 8,
|
|
PTZST_AMERICAN_DYNAMICS = 9,
|
|
PTZST_PG3AD_OLD = 10
|
|
};
|
|
int GetSubType() { return m_nSubType; };
|
|
void ChangeSubType( int nSubType );
|
|
|
|
public:
|
|
int m_nSubType;
|
|
|
|
public:
|
|
struct CAMERA_DATA
|
|
{
|
|
struct MIGVAN
|
|
{
|
|
BYTE pHardwareID[5];
|
|
BOOL bAuto;
|
|
}migvan;
|
|
struct MIC_1_300
|
|
{
|
|
BYTE bAddress;
|
|
}mic1300;
|
|
struct TK_S_576
|
|
{
|
|
BYTE bAddress;
|
|
}tks576;
|
|
struct PG3AD
|
|
{
|
|
WORD bAddress;
|
|
}pg3ad;
|
|
struct VICON
|
|
{
|
|
BYTE bAddress;
|
|
}vicon;
|
|
struct HEBRON
|
|
{
|
|
BYTE bAddress;
|
|
}hebron;
|
|
struct TRI_TRACK
|
|
{
|
|
BYTE bAddress;
|
|
INT nAngle;
|
|
DWORD dwTimeout;
|
|
}tri_track;
|
|
struct AMERICAN_DYNAMICS
|
|
{
|
|
BYTE bAddress;
|
|
}american_dynamics;
|
|
}m_uData;
|
|
|
|
public:
|
|
enum { ZF_RANGE_TABLE_SIZE = 10 };
|
|
double m_dZoomTable[ZF_RANGE_TABLE_SIZE];
|
|
double m_dFocusTable[ZF_RANGE_TABLE_SIZE];
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceCameraLGS : public COFDeviceCameraPTZ
|
|
{
|
|
public:
|
|
COFDeviceCameraLGS();
|
|
virtual ~COFDeviceCameraLGS();
|
|
|
|
public:
|
|
virtual int GetType() { return DT_CAMERA_LGS; }
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceMigvan : public COFDevice
|
|
{
|
|
public:
|
|
COFDeviceMigvan();
|
|
virtual ~COFDeviceMigvan();
|
|
|
|
virtual void Serialize( CArchive& ar );
|
|
|
|
BYTE m_pHardwareID[5];
|
|
BOOL m_bAuto;
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
/*
|
|
class COFDeviceMigvanCameraPTZ : public COFDeviceMigvan
|
|
{
|
|
public:
|
|
COFDeviceMigvanCameraPTZ();
|
|
virtual ~COFDeviceMigvanCameraPTZ();
|
|
|
|
virtual int GetType(){ return DT_MIGVAN_CAMERA; }
|
|
};
|
|
*/
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceMigvanVM8x4 : public COFDeviceMigvan
|
|
{
|
|
public:
|
|
COFDeviceMigvanVM8x4();
|
|
virtual ~COFDeviceMigvanVM8x4();
|
|
|
|
virtual int GetType() { return DT_MIGVAN_VM8X4; }
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceRabbit : public COFDevice
|
|
{
|
|
public:
|
|
COFDeviceRabbit();
|
|
virtual ~COFDeviceRabbit();
|
|
|
|
virtual int GetType(){ return DT_RABBIT; }
|
|
|
|
virtual void Serialize( CArchive& ar );
|
|
|
|
int m_nAddress;
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDevicePCI1762 : public COFDeviceSensor
|
|
{
|
|
public:
|
|
COFDevicePCI1762();
|
|
virtual ~COFDevicePCI1762();
|
|
|
|
virtual int GetType(){ return DT_PCI_1762; }
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceRabbitCamera : public COFDevice
|
|
{
|
|
public:
|
|
COFDeviceRabbitCamera();
|
|
virtual ~COFDeviceRabbitCamera();
|
|
|
|
virtual int GetType(){ return DT_RABBIT_CAMERA; }
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceSocket : public COFDevice
|
|
{
|
|
public:
|
|
COFDeviceSocket();
|
|
virtual ~COFDeviceSocket();
|
|
|
|
virtual int GetType(){ return DT_SOCKET; }
|
|
|
|
virtual void Serialize(CArchive& ar);
|
|
|
|
enum{ ST_MD, ST_PTZ, ST_LGS, ST_VM, ST_DI, ST_MIC1300, ST_TKS576, ST_PG3AD, ST_CCC, ST_VICON, ST_AMERICAN_DYNAMICS };
|
|
|
|
void ChangeSubType( int nSubType );
|
|
|
|
public:
|
|
int m_nSubType;
|
|
CString m_Port;
|
|
CString m_BaudRate;
|
|
BOOL m_bSpyMode;
|
|
BOOL m_bSelfTest;
|
|
INT m_nSelfTest;
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFDeviceVideoIn : public COFDevice
|
|
{
|
|
public:
|
|
COFDeviceVideoIn();
|
|
virtual ~COFDeviceVideoIn();
|
|
|
|
virtual int GetType(){ return DT_VIDEO_IN; }
|
|
|
|
enum{ ST_GENERIC = 0, ST_NAMED = 1 };
|
|
|
|
virtual void Serialize(CArchive& ar);
|
|
|
|
public:
|
|
int m_nSubType;
|
|
int m_nStandard;
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class COFTemplateDCBit
|
|
{
|
|
public:
|
|
COFTemplateDCBit() { m_Name = _T("Noname"); m_Pos.x = m_Pos.y = 0.0; }
|
|
COFTemplateDCBit( COFTemplateDCBit& bit ) { m_Pos = bit.m_Pos; m_Name = bit.m_Name; }
|
|
~COFTemplateDCBit() {}
|
|
|
|
public:
|
|
void Serialize(CArchive& ar);
|
|
|
|
public:
|
|
void SetName( CString *pName ) { m_Name = *pName; }
|
|
CString& GetName() { return m_Name; }
|
|
|
|
public:
|
|
void SetPos( CLgDPoint *pPoint ) { m_Pos = *pPoint; }
|
|
CLgDPoint& GetPos() { return m_Pos; }
|
|
|
|
public:
|
|
CLgDPoint m_Pos; // contacts coordinate (relative to bitmap from 0.0 to 1.0 )
|
|
CString m_Name;
|
|
};
|
|
|
|
class COFTemplateDC
|
|
{
|
|
public:
|
|
COFTemplateDC();
|
|
~COFTemplateDC();
|
|
|
|
public:
|
|
static const double defQuality; // 5%
|
|
int BitAdd( CLgDPoint *pPoint, CString *pName );
|
|
BOOL BitDel( CLgDPoint *pPoint, double q = defQuality );
|
|
BOOL BitDel( COFTemplateDCBit *pBit );
|
|
BOOL BitDel( int nBit );
|
|
BOOL BitGet( CLgDPoint *pPoint, int *pBit, double q = defQuality );
|
|
int BitGetCount() const { return m_nCount; }
|
|
COFTemplateDCBit *BitGet( int nBit ) { return (nBit<m_nCount) ? m_ppBit[nBit] : NULL; }
|
|
|
|
CString& GetBG() { return m_NameBG; }
|
|
void SetBG( CString& name ) { m_NameBG = name; }
|
|
|
|
CString& GetName() { return m_Name; }
|
|
void SetName( CString& name ) { m_Name = name; }
|
|
|
|
public:
|
|
void Serialize(CArchive& ar);
|
|
|
|
public:
|
|
CObjectFactory *GetOF() { return m_pOF; }
|
|
|
|
public:
|
|
COFTemplateDCBit **m_ppBit;
|
|
int m_nCount;
|
|
CString m_NameBG; // background name
|
|
CString m_Name;
|
|
CObjectFactory *m_pOF;
|
|
};
|
|
|
|
class COFDeviceDryContacts : public COFDeviceSensor
|
|
{
|
|
public:
|
|
enum
|
|
{
|
|
DC_CMD_CLEAR = 0,
|
|
DC_CMD_RESET = 1,
|
|
|
|
DC_EVT_ALARM = 0,
|
|
DC_EVT_POSTALARM = 1,
|
|
DC_EVT_NORMAL = 2,
|
|
DC_EVT_TIMEOUT = 3,
|
|
};
|
|
|
|
public:
|
|
COFDeviceDryContacts();
|
|
virtual ~COFDeviceDryContacts();
|
|
|
|
virtual int GetType(){ return DT_DRY_CONTACTS; }
|
|
|
|
public:
|
|
void SetTemplate( int nTemplate );
|
|
virtual void Serialize( CArchive& ar );
|
|
|
|
int m_nTemplate; // index in template array
|
|
|
|
double m_Pan, m_Tilt, m_Zoom;
|
|
|
|
private:
|
|
static PIN_DESC s_pPD[];
|
|
};
|
|
|
|
/***************************************************************************
|
|
|
|
***************************************************************************/
|
|
class CObjectFactory
|
|
{
|
|
public:
|
|
CObjectFactory();
|
|
virtual ~CObjectFactory();
|
|
|
|
public:
|
|
struct OBJECT
|
|
{
|
|
int nType;
|
|
int nCount;
|
|
COFDevice **ppDevice;
|
|
}m_pDevice[ DT_COUNT ];
|
|
|
|
// CMetaFile m_MetaFile;
|
|
CSize m_MapSize;
|
|
CString m_FileNameBG;
|
|
CLgUIMapBackground m_Background;
|
|
|
|
public:
|
|
void SetBackground( LPCTSTR pFileName, bool bNew );
|
|
void DeviceDisconnect( COFDevice *pDevice );
|
|
CSize *GetMapSize() { return &m_MapSize; }
|
|
|
|
COFDevice *DeviceGet( CLgDRect &rect );
|
|
BOOL ConnectionGet( CPoint p, COFPin **pPin1, COFPin **pPin2, double scale );
|
|
|
|
COFDevice* DeviceAdd(double x, double y, int nType);
|
|
void DeviceDelete( int nIndex, int nType );
|
|
void DeviceDelete( COFDevice *pDevice );
|
|
COFDevice *DeviceGet(int nIndex, int nType);
|
|
|
|
void Draw( CDC *pDC, CPoint shift, double scale );
|
|
void DrawLine( CDC *pDC, COFPin *pP1, COFPin *pP2, BOOL bActive, CPoint shift, double scale );
|
|
void Serialize(CArchive& ar);
|
|
void _Serialize(CArchive& ar);
|
|
|
|
CLgFileGroup* FileGroupGet() { return &m_FileGroup; }
|
|
CString FileGroupGetTemp( LPCTSTR pFileName ) { CString name; TCHAR pTemp[MAX_PATH]; m_FileGroup.GetTemp( pFileName, pTemp, MAX_PATH ); return (name = pTemp); }
|
|
|
|
private:
|
|
COFDevice* ClassCreate(int nType);
|
|
int DeviceMove( COFDevice *pDevice, int nIndex );
|
|
void DrawDevice( CDC *pDC, COFDevice *pDevice, CPoint shift, double scale );
|
|
BOOL ConnectionGet( COFDevice *pD, CPoint p, COFPin **pPin1, COFPin **pPin2, double scale );
|
|
|
|
public:
|
|
void ConnectionDisconnect( COFPin *pPin1, COFPin *pPin2 );
|
|
BOOL TemplateAdd( COFTemplateDC *pTemplate );
|
|
BOOL TemplateDel( COFTemplateDC *pTemplate );
|
|
BOOL TemplateDel( int nIndex );
|
|
|
|
int TemplateGetCount() { return m_nTemplateCount; }
|
|
COFTemplateDC* TemplateGet( int nIndex ) { return (nIndex < m_nTemplateCount && nIndex != -1 ) ? m_ppTemplate[nIndex] : NULL; }
|
|
|
|
private:
|
|
COFTemplateDC **m_ppTemplate;
|
|
int m_nTemplateCount;
|
|
static CString s_Version;
|
|
CLgFileGroup m_FileGroup;
|
|
|
|
public:
|
|
BOOL SetProtectedString( CString& str );
|
|
BOOL GetProtectedString( CString& str );
|
|
BOOL SaveProtectedString( CArchive &ar );
|
|
BOOL LoadProtectedString( CArchive &ar );
|
|
|
|
private:
|
|
enum{ MAX_UNIQUE_STRING_LENGTH = 1024 };
|
|
INT m_nUniqueString;
|
|
BYTE m_pUniqueString[MAX_UNIQUE_STRING_LENGTH];
|
|
|
|
public:
|
|
double& GetMeterScale() { return m_dMeterScale; }
|
|
|
|
public:
|
|
typedef struct SETTINGS
|
|
{
|
|
BOOL bTroubleWindowShowFirstImage;
|
|
}SETTINGS;
|
|
|
|
public:
|
|
SETTINGS& GetSettings() { return m_Settings; }
|
|
|
|
private:
|
|
SETTINGS m_Settings;
|
|
|
|
private:
|
|
double m_dMeterScale;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|