VmsFormF.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. //---------------------------------------------------------------------------
  2. #ifndef VmsFormFH
  3. #define VmsFormFH
  4. //---------------------------------------------------------------------------
  5. #include <Classes.hpp>
  6. #include <stdio.h>
  7. #include <ADODB.hpp>
  8. #include <DB.hpp>
  9. #include <SyncObjs.hpp>
  10. #include <ExtCtrls.hpp>
  11. #include <jpeg.hpp>
  12. #include <GIFimg.hpp>
  13. //---------------------------------------------------------------------------
  14. #include "ITSLibF.h"
  15. #include "CDSItsObjectF.h"
  16. //---------------------------------------------------------------------------
  17. #define MAX_FORM_OBJ_LIST 64 /* 최대 VMS 오브젝트 리스트 갯수 */
  18. class TVmsFormObj
  19. {
  20. public:
  21. TVmsFormObj();
  22. ~TVmsFormObj();
  23. public:
  24. int ObjectKind; /* 객체종류 */
  25. int ObjectType; /* 객체타입 */
  26. int ObjectSize; /* 객체크기 */
  27. int IsBlinking; /* 점멸 여부 */
  28. int PosX; /* 위치 X */
  29. int PosY; /* 위치 Y */
  30. int Width; /* 객체넓이 */
  31. int TextWidth; /* 객체넓이 */
  32. int Height; /* 객체높이 */
  33. int BkColor; /* 객체배경색상 */
  34. int TextFontName; /* 폰트이름 */
  35. //TODO
  36. AnsiString StrTextFontName;
  37. int TextFontColor; /* 폰트색상 */
  38. int TextFontSize; /* 폰트크기 */
  39. int TextFontBold; /* 폰트굵기 */
  40. int TextAlign; /* 문자열정열방식 */
  41. AnsiString TextData; /* 문자열데이터 */
  42. AnsiString ImageId; /* 이미지아이디 */
  43. AnsiString ImageType; /* 이미지 타입 */
  44. AnsiString IFSC_ID;
  45. AnsiString TRFC_FILL_CD;
  46. TImage *pImageData; /* 이미지데이터 */
  47. TMemoryStream *pImageStream; /* 이미지데이터 버퍼 */
  48. public:
  49. void Clear();
  50. TImage *NewImage();
  51. };
  52. //---------------------------------------------------------------------------
  53. class TVmsForm
  54. {
  55. public:
  56. TVmsForm();
  57. ~TVmsForm();
  58. public:
  59. int ScenarioSeq; /* 폼 표출순서 */
  60. AnsiString VMS_FORM_ID; /* TB_VMS_FORM - VMS FORM ID */
  61. int DSPL_HH; /* TB_VMS_FORM - 표출시간(초) */
  62. AnsiString VMS_FORM_DSPL_DRCT_CD; /* TB_VMS_FORM - VMS 메시지 표출 방향 코드 */
  63. AnsiString VMS_FORM_DSPL_MTHD_CD; /* TB_VMS_FORM - VMS 메시지 표출 방법 코드 */
  64. int VMS_FORM_TYPE_CD; /* TB_VMS_FORM - 폼 종류 */
  65. int VMS_FORM_COLR_CD; /* TB_VMS_FORM - 배경색상 */
  66. int Width; /* 폼넓이 */
  67. int Height; /* 폼높이 */
  68. AnsiString TrfBakImgId;
  69. AnsiString VMS_SCH_TYPE;
  70. int VMS_SCH_FORM_TYPE;
  71. AnsiString SYMB_LIB_NMBR;
  72. AnsiString STRM_ADDR;
  73. bool Success;
  74. bool SvcRes; /* 제공결과 */
  75. bool FtpRes; /* 제공결과 */
  76. AnsiString FtpFileName;
  77. AnsiString LocalFileName;
  78. //////////////////////////////////////////////////////////////////////
  79. //// 프로토콜 적용을 위해서
  80. BYTE fileType; // 0x01 : 이미지 (JPG)
  81. // 0x02 : 동영상 (AVI)
  82. // 0x03 : URL(스트리밍)
  83. // 0x04 : 소통 이미지
  84. // 0x05 : 표출문구 이미지
  85. //////////////////////////////////////////////////////////////////////
  86. TCriticalSection *pCriticalSection;
  87. public:
  88. int FTotal;
  89. int FObjects;
  90. TItsMap<int, TVmsFormObj*> FLists;
  91. void Lock() { pCriticalSection->Enter(); }
  92. void UnLock() { pCriticalSection->Leave(); };
  93. int Count() { return FObjects; }
  94. int Total() { return FTotal; }
  95. void Clear();
  96. TVmsFormObj *GetItem(int AIdx);
  97. int AddFormObject(TVmsFormObj *AFormObj);
  98. TVmsFormObj *AddFormObject();
  99. void Init(int AWidth, int AHeight);
  100. void FormClear(TColor ABkColor);
  101. Graphics::TBitmap *pBitmap; /* 이미지데이터 */
  102. TMemoryStream *pStream; /* 이미지데이터 버퍼 */
  103. };
  104. //---------------------------------------------------------------------------
  105. //---------------------------------------------------------------------------
  106. class TVmsFormManager
  107. {
  108. public:
  109. TVmsFormManager();
  110. ~TVmsFormManager();
  111. private:
  112. public:
  113. void Lock() { FLists.Lock(); }
  114. void UnLock() { FLists.UnLock(); }
  115. public:
  116. int FormWidth;
  117. int FormHeight;
  118. int FTotal;
  119. int FObjects;
  120. TItsMap<int, TVmsForm*> FLists;
  121. int Count() { return FObjects; }
  122. int Total() { return FTotal; }
  123. void Clear();
  124. TVmsForm *GetItem(int AIdx);
  125. int AddForm(TVmsForm *AForm);
  126. TVmsForm *AddForm();
  127. };
  128. //---------------------------------------------------------------------------
  129. //extern TVmsFormManager *VmsFormManager;
  130. //---------------------------------------------------------------------------
  131. #endif