GpsSignObject.cpp
上传用户:yffx2008
上传日期:2014-10-12
资源大小:12414k
文件大小:4k
源码类别:

交通/航空行业

开发平台:

Visual C++

  1. // GpsSignObject.cpp: implementation of the CGpsSignObject class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #include "stdafx.h"
  5. //#include "GpsSC.h"
  6. #include "GpsSignObject.h"
  7. #ifdef _DEBUG
  8. #undef THIS_FILE
  9. static char THIS_FILE[]=__FILE__;
  10. #define new DEBUG_NEW
  11. #endif
  12. //////////////////////////////////////////////////////////////////////
  13. // Construction/Destruction
  14. //////////////////////////////////////////////////////////////////////
  15. CGpsSignObject::CGpsSignObject()
  16. {
  17. BYTE i;
  18. m_bySignName_Bytes = SignObjectOfOthers_Bytes; //标志物名称的字节数
  19. m_pSignObjectName = new char[m_bySignName_Bytes + 1];
  20. for(i = 0; i < m_bySignName_Bytes + 1; i++) {
  21. m_pSignObjectName[i] = 0;
  22. }
  23. m_arrSignObject_Serial1 = 0;
  24. m_bySignObject_Serial1_Bytes= 1;
  25. m_arrSignObject_Number1 = 0;
  26. m_bySignObject_Number1_Bytes= 2;
  27. m_arrSignObject_Serial2 = 0;
  28. m_bySignObject_Serial2_Bytes= 1;
  29. m_arrSignObject_Number2 = 0;
  30. m_bySignObject_Number2_Bytes= 2;
  31. m_bySignAdvertise_Bytes = 4;
  32. for(i = 0; i < m_bySignAdvertise_Bytes; i++) {
  33. m_arrSignAdvertise[i] = 0;
  34. }
  35. m_bySignType = 0;
  36. m_sIconName.Empty();
  37. m_bDraw = false;
  38. }
  39. CGpsSignObject::CGpsSignObject(BYTE SignObjectName_Bytes)
  40. {
  41. BYTE i;
  42. if(SignObjectName_Bytes > SignObjectOfCompany_Bytes) {
  43. SignObjectName_Bytes = SignObjectOfCompany_Bytes;
  44. }
  45. m_bySignName_Bytes = SignObjectName_Bytes; //标志物名称的字节数
  46. m_pSignObjectName = new char[m_bySignName_Bytes + 1];
  47. for(i = 0; i < m_bySignName_Bytes + 1; i++) {
  48. m_pSignObjectName[i] = 0;
  49. }
  50. m_arrSignObject_Serial1 = 0;
  51. m_arrSignObject_Number1 = 0;
  52. m_bySignObject_Serial1_Bytes = 1;
  53. m_bySignObject_Number1_Bytes = 2;
  54. m_arrSignObject_Serial2 = 0;
  55. m_arrSignObject_Number2 = 0;
  56. m_bySignObject_Serial2_Bytes = 1;
  57. m_bySignObject_Number2_Bytes = 2;
  58. m_arrSignObjectDispLevel[0] = 0;
  59. m_arrSignObjectDispLevel[1] = 0;
  60. m_bySignDispLevel_Bytes = 2;
  61. m_bySignAdvertise_Bytes = 4; //做广告用,保留
  62. for(i = 0; i < m_bySignAdvertise_Bytes; i++) {
  63. m_arrSignAdvertise[i] = 0;
  64. }
  65. m_bySignType = 0;
  66. m_sIconName.Empty();
  67. m_bDraw = false;
  68. }
  69. CGpsSignObject::~CGpsSignObject()
  70. {
  71. delete m_pSignObjectName;
  72. }
  73. CGpsSignObject& CGpsSignObject::operator = (const CGpsSignObject& ds)
  74. {
  75. BYTE i;
  76. m_bySignName_Bytes = ds.m_bySignName_Bytes;
  77. m_pSignObjectName = new char[m_bySignName_Bytes + 1];
  78. for(i = 0; i < m_bySignName_Bytes + 1; i++) {
  79. m_pSignObjectName[i] = ds.m_pSignObjectName[i];
  80. }
  81. m_bySignObject_Serial1_Bytes = ds.m_bySignObject_Serial1_Bytes;
  82. m_bySignObject_Number1_Bytes = ds.m_bySignObject_Number1_Bytes;
  83. m_arrSignObject_Serial1 = ds.m_arrSignObject_Serial1;
  84. m_arrSignObject_Number1 = ds.m_arrSignObject_Number1;
  85. m_bySignObject_Serial2_Bytes = ds.m_bySignObject_Serial2_Bytes;
  86. m_bySignObject_Number2_Bytes = ds.m_bySignObject_Number2_Bytes;
  87. m_arrSignObject_Serial2 = ds.m_arrSignObject_Serial2;
  88. m_arrSignObject_Number2 = ds.m_arrSignObject_Number2;
  89. m_bySignDispLevel_Bytes = ds.m_bySignDispLevel_Bytes;
  90. m_arrSignObjectDispLevel[0] = ds.m_arrSignObjectDispLevel[0];
  91. m_arrSignObjectDispLevel[1] = ds.m_arrSignObjectDispLevel[1];
  92. m_arrSignObjectDispLevel[2] = ds.m_arrSignObjectDispLevel[2];
  93. m_arrSignObjectDispLevel[3] = ds.m_arrSignObjectDispLevel[3];
  94. m_bySignAdvertise_Bytes = ds.m_bySignAdvertise_Bytes; //做广告用,保留
  95. for(i = 0; i < m_bySignAdvertise_Bytes; i++) {
  96. m_arrSignAdvertise[i] = ds.m_arrSignAdvertise[i];
  97. }
  98. m_bySignType = ds.m_bySignType;
  99. m_sIconName = ds.m_sIconName;
  100. m_bDraw = ds.m_bDraw;
  101. return *this;
  102. }