- // GpsSignObject.cpp: implementation of the CGpsSignObject class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- //#include "GpsSC.h"
- #include "GpsSignObject.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char THIS_FILE[]=__FILE__;
- #define new DEBUG_NEW
- #endif
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- CGpsSignObject::CGpsSignObject()
- {
- BYTE i;
- m_bySignName_Bytes = SignObjectOfOthers_Bytes; //标志物名称的字节数
- m_pSignObjectName = new char[m_bySignName_Bytes + 1];
- for(i = 0; i < m_bySignName_Bytes + 1; i++) {
- m_pSignObjectName[i] = 0;
- }
- m_arrSignObject_Serial1 = 0;
- m_bySignObject_Serial1_Bytes= 1;
- m_arrSignObject_Number1 = 0;
- m_bySignObject_Number1_Bytes= 2;
- m_arrSignObject_Serial2 = 0;
- m_bySignObject_Serial2_Bytes= 1;
- m_arrSignObject_Number2 = 0;
- m_bySignObject_Number2_Bytes= 2;
- m_bySignAdvertise_Bytes = 4;
- for(i = 0; i < m_bySignAdvertise_Bytes; i++) {
- m_arrSignAdvertise[i] = 0;
- }
- m_bySignType = 0;
- m_sIconName.Empty();
- m_bDraw = false;
- }
- CGpsSignObject::CGpsSignObject(BYTE SignObjectName_Bytes)
- {
- BYTE i;
- if(SignObjectName_Bytes > SignObjectOfCompany_Bytes) {
- SignObjectName_Bytes = SignObjectOfCompany_Bytes;
- }
- m_bySignName_Bytes = SignObjectName_Bytes; //标志物名称的字节数
- m_pSignObjectName = new char[m_bySignName_Bytes + 1];
- for(i = 0; i < m_bySignName_Bytes + 1; i++) {
- m_pSignObjectName[i] = 0;
- }
- m_arrSignObject_Serial1 = 0;
- m_arrSignObject_Number1 = 0;
- m_bySignObject_Serial1_Bytes = 1;
- m_bySignObject_Number1_Bytes = 2;
- m_arrSignObject_Serial2 = 0;
- m_arrSignObject_Number2 = 0;
- m_bySignObject_Serial2_Bytes = 1;
- m_bySignObject_Number2_Bytes = 2;
- m_arrSignObjectDispLevel[0] = 0;
- m_arrSignObjectDispLevel[1] = 0;
- m_bySignDispLevel_Bytes = 2;
- m_bySignAdvertise_Bytes = 4; //做广告用,保留
- for(i = 0; i < m_bySignAdvertise_Bytes; i++) {
- m_arrSignAdvertise[i] = 0;
- }
- m_bySignType = 0;
- m_sIconName.Empty();
- m_bDraw = false;
- }
- CGpsSignObject::~CGpsSignObject()
- {
- delete m_pSignObjectName;
- }
- CGpsSignObject& CGpsSignObject::operator = (const CGpsSignObject& ds)
- {
- BYTE i;
- m_bySignName_Bytes = ds.m_bySignName_Bytes;
- m_pSignObjectName = new char[m_bySignName_Bytes + 1];
- for(i = 0; i < m_bySignName_Bytes + 1; i++) {
- m_pSignObjectName[i] = ds.m_pSignObjectName[i];
- }
- m_bySignObject_Serial1_Bytes = ds.m_bySignObject_Serial1_Bytes;
- m_bySignObject_Number1_Bytes = ds.m_bySignObject_Number1_Bytes;
- m_arrSignObject_Serial1 = ds.m_arrSignObject_Serial1;
- m_arrSignObject_Number1 = ds.m_arrSignObject_Number1;
- m_bySignObject_Serial2_Bytes = ds.m_bySignObject_Serial2_Bytes;
- m_bySignObject_Number2_Bytes = ds.m_bySignObject_Number2_Bytes;
- m_arrSignObject_Serial2 = ds.m_arrSignObject_Serial2;
- m_arrSignObject_Number2 = ds.m_arrSignObject_Number2;
- m_bySignDispLevel_Bytes = ds.m_bySignDispLevel_Bytes;
- m_arrSignObjectDispLevel[0] = ds.m_arrSignObjectDispLevel[0];
- m_arrSignObjectDispLevel[1] = ds.m_arrSignObjectDispLevel[1];
- m_arrSignObjectDispLevel[2] = ds.m_arrSignObjectDispLevel[2];
- m_arrSignObjectDispLevel[3] = ds.m_arrSignObjectDispLevel[3];
- m_bySignAdvertise_Bytes = ds.m_bySignAdvertise_Bytes; //做广告用,保留
- for(i = 0; i < m_bySignAdvertise_Bytes; i++) {
- m_arrSignAdvertise[i] = ds.m_arrSignAdvertise[i];
- }
- m_bySignType = ds.m_bySignType;
- m_sIconName = ds.m_sIconName;
- m_bDraw = ds.m_bDraw;
- return *this;
- }