obj-facility.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. const _textFont = [
  2. "bold 10px Verdana", // 0
  3. "bold 10px Verdana",
  4. "bold 10px Verdana",
  5. "bold 10px Verdana",
  6. "bold 10px Verdana",
  7. "bold 10px Verdana",
  8. "bold 10px Verdana",
  9. "bold 10px Verdana",
  10. "bold 10px Verdana",
  11. "bold 10px Verdana",
  12. "bold 10px Verdana", // 10
  13. "bold 10px Verdana",
  14. "bold 10px Verdana",
  15. "bold 10px Verdana",
  16. "bold 12px Verdana",
  17. "bold 12px Verdana",
  18. "bold 14px Verdana",
  19. "bold 14px Verdana",
  20. "bold 14px Verdana",
  21. "bold 16px Verdana",
  22. "bold 16px Verdana", // 20
  23. "bold 16px Verdana",
  24. "bold 16px Verdana",
  25. "bold 16px Verdana",
  26. ];
  27. export class TPoi {
  28. constructor(ALyrInfo, ANmbr, AId, AName, AXCrdn, AYCrdn, AComm, ADoor, ATemp, AUpdDt) {
  29. this.lyrInfo = ALyrInfo;
  30. this.lyrIdx = ALyrInfo.lyrIdx;
  31. this.NMBR = ANmbr;
  32. this.ID = AId;
  33. this.NAME = AName;
  34. this.COMM = AComm;
  35. this.DOOR = ADoor;
  36. this.TEMP = ATemp;
  37. this.REG_DT = AUpdDt;
  38. this.LAT = Number(AXCrdn);
  39. this.LNG = Number(AYCrdn);
  40. this.marker = null;
  41. this.infoWin = null;
  42. this.edit = false;
  43. this.deleted = false;
  44. this.marker = new ol.Feature({
  45. obj: this,
  46. geometry: new ol.geom.Point([this.LAT, this.LNG]),
  47. });
  48. } // constructor
  49. // 상태정보 업데이트
  50. updateStts(AComm, AUpdDt) {
  51. const oldComm = this.COMM;
  52. this.COMM = AComm.slice(-1);
  53. this.REG_DT = AUpdDt;
  54. if (oldComm != this.COMM) {
  55. //상태가 변경되었거나 줌이 변경되었을때 업데이트 하도록 함
  56. this.setMarkerStyle(this.lyrInfo.zoom, true);
  57. }
  58. }
  59. // 시설물객체 스타일을 설정한다
  60. setMarkerStyle(ACurrZoom, AImmediate) {
  61. this.setEditMarkerStyle();
  62. // const currZoom = ACurrZoom; //this.lyrInfo.zoom;
  63. // console.log(_textFont[currZoom]);
  64. // let featureStyle = null;
  65. // if (this.lyrInfo.showText) {
  66. // featureStyle = new ol.style.Style({
  67. // image: new ol.style.Icon({
  68. // anchor: [0.5, 0.5] /*아이콘 중앙*/,
  69. // opacity: 1,
  70. // size: [this.lyrInfo.imgW, this.lyrInfo.imgH],
  71. // scale: this.lyrInfo.scales[currZoom],
  72. // src: this.lyrInfo.image + this.COMM + ".png",
  73. // }),
  74. // text: new ol.style.Text({
  75. // textAlign: "center",
  76. // textBaseline: "top",
  77. // font: _textFont[currZoom],
  78. // //scale: 1.0,
  79. // text: this.NMBR,
  80. // //fill: new ol.style.Fill({ color: "#aa3300" }),
  81. // //stroke: new ol.style.Stroke({ color: "#ffffff", width: 6 }),
  82. // //offsetX: 0,
  83. // //offsetY: (this.lyrInfo.imgW * this.lyrInfo.scales[currZoom]) / 2 - 4,
  84. // placement: "Point",
  85. // }),
  86. // });
  87. // } else {
  88. // featureStyle = new ol.style.Style({
  89. // image: new ol.style.Icon({
  90. // anchor: [0.5, 0.5] /*아이콘 중앙*/,
  91. // opacity: 1,
  92. // size: [this.lyrInfo.imgW, this.lyrInfo.imgH],
  93. // scale: this.lyrInfo.scales[currZoom],
  94. // src: this.lyrInfo.image + this.COMM + ".png",
  95. // }),
  96. // });
  97. // }
  98. // this.marker.setStyle(featureStyle);
  99. }
  100. // 편집용시설물객체 스타일을 설정한다
  101. setEditMarkerStyle() {
  102. const currZoom = this.lyrInfo.zoom;
  103. let featureStyle = null;
  104. if (this.lyrInfo.showText) {
  105. featureStyle = new ol.style.Style({
  106. image: new ol.style.Icon({
  107. anchor: [0.5, 0.5] /*아이콘 중앙*/,
  108. opacity: 1,
  109. size: [this.lyrInfo.imgW, this.lyrInfo.imgH],
  110. scale: this.lyrInfo.scales[currZoom],
  111. src: this.lyrInfo.image + this.COMM + ".png",
  112. }),
  113. text: new ol.style.Text({
  114. textAlign: "center",
  115. textBaseline: "top",
  116. font: _textFont[currZoom],
  117. scale: 1.0,
  118. text: [this.NMBR, _textFont[currZoom]],
  119. fill: new ol.style.Fill({ color: "white" }), //#aa3300
  120. stroke: new ol.style.Stroke({ color: "black", width: 6 }), //#ffffff
  121. backgroundFill: new ol.style.Fill({ color: "black" }),
  122. offsetX: 2,
  123. offsetY: (this.lyrInfo.imgW * this.lyrInfo.scales[currZoom]) / 2 + 2,
  124. placement: "pooint",
  125. }),
  126. });
  127. } else {
  128. featureStyle = new ol.style.Style({
  129. image: new ol.style.Icon({
  130. anchor: [0.5, 0.5] /*아이콘 중앙*/,
  131. opacity: 1,
  132. size: [this.lyrInfo.imgW, this.lyrInfo.imgH],
  133. scale: this.lyrInfo.scales[currZoom],
  134. src: this.lyrInfo.image + this.COMM + ".png",
  135. }),
  136. });
  137. }
  138. this.marker.setStyle(featureStyle);
  139. }
  140. setEditObject(AIsEdit, AComm) {
  141. this.edit = AIsEdit;
  142. this.COMM = AComm;
  143. this.setMarkerStyle(this.lyrInfo.zoom, true);
  144. }
  145. }
  146. export class TNode extends TPoi {
  147. constructor(ALyrInfo, ADto) {
  148. super(ALyrInfo, ADto.node_id, ADto.node_id, ADto.node_name, ADto.x_crdn, ADto.y_crdn, "0", "0", 0, "");
  149. this.nodeType = ADto.node_type;
  150. this.turnP = ADto.turn_p;
  151. this.rmrk = ADto.rmrk;
  152. this.xCrdn = ADto.x_crdn;
  153. this.yCrdn = ADto.y_crdn;
  154. }
  155. }
  156. export class TCctv extends TPoi {
  157. constructor(ALyrInfo, ADto) {
  158. super(ALyrInfo, ADto.cctv_mngm_nmbr, ADto.cctv_ctlr_id, ADto.istl_lctn_nm, ADto.x_crdn, ADto.y_crdn, "1", "0", 0, "19700101000000");
  159. this.cctvCtlrIp = ADto.cctv_ctlr_ip;
  160. this.cctvCtlrPort = ADto.cctv_ctlr_port;
  161. this.cctvCaptIp = ADto.cctv_capt_ip;
  162. this.cctvCaptPort = ADto.cctv_capt_port;
  163. this.cctvFibrIp = ADto.cctv_fibr_ip;
  164. this.cctvEncdIp = ADto.cctv_encd_ip;
  165. this.strmSvrIp = ADto.strm_svr_ip;
  166. this.strmSvrPort = ADto.strm_svr_port;
  167. this.strmSesnNm = ADto.strm_sesn_nm;
  168. this.istlLctnAddr = ADto.istl_lctn_addr;
  169. this.cctvChnl = ADto.cctv_chnl;
  170. this.delYn = ADto.del_yn;
  171. this.linkId = ADto.link_id;
  172. this.nodeId = ADto.node_id;
  173. this.cctvId = ADto.cctv_id;
  174. this.relyPort = ADto.rely_port;
  175. this.strmRtspAddr = ADto.strm_rtsp_addr;
  176. this.strmRtmpAddr = ADto.strm_rtmp_addr;
  177. this.strmHttpAddr = ADto.strm_http_addr;
  178. this.strmStorAddr = ADto.strm_stor_addr;
  179. this.areaCd = ADto.area_cd;
  180. this.cctvType = ADto.cctv_type;
  181. this.cctvSbstImgn = ADto.cctv_sbst_imgn;
  182. this.cctvSbstDsplYn = ADto.cctv_sbst_dspl_yn;
  183. this.cctvAreaDvsn = ADto.cctv_area_dvsn;
  184. this.intrRtmpAddr = ADto.intr_rtmp_addr;
  185. this.syopCntlYn = ADto.syop_cntl_yn;
  186. }
  187. }
  188. export class TVms extends TPoi {
  189. constructor(ALyrInfo, ADto) {
  190. super(ALyrInfo, ADto.vms_ctlr_nmbr, ADto.vms_ctlr_id, ADto.vms_nm, ADto.x_crdn, ADto.y_crdn, "1", "0", 0, "19700101000000");
  191. this.vmsCtlrIp = ADto.vms_ctlr_ip;
  192. this.vmsUsagTypeCd = ADto.vms_usag_type_cd;
  193. this.vmsFrmTypeCd = ADto.vms_frm_type_cd;
  194. this.vmsTypeCd = ADto.vms_type_cd;
  195. this.vmsModlTypeCd = ADto.vms_modl_type_cd;
  196. this.vmsCmncPort = ADto.vms_cmnc_port;
  197. this.operMode = ADto.oper_mode;
  198. this.vmsCmncErrBassVal = ADto.vms_cmnc_err_bass_val;
  199. this.vmsNghtBrghStep = ADto.vms_nght_brgh_step;
  200. this.vmsWeekBrghStep = ADto.vms_week_brgh_step;
  201. this.vmsPhseChngCycl = ADto.vms_phse_chng_cycl;
  202. this.vmsModlErrRate = ADto.vms_modl_err_rate;
  203. this.cmncfailSlotNmbr = ADto.cmncfail_slot_nmbr;
  204. this.pwerFailSlotNmbr = ADto.pwer_fail_slot_nmbr;
  205. this.delYn = ADto.del_yn;
  206. this.cmtrinfrCnctYn = ADto.cmtrinfr_cnct_yn;
  207. this.wthrinfrCnctYn = ADto.wthrinfr_cnct_yn;
  208. this.envrinfrCnctYn = ADto.envrinfr_cnct_yn;
  209. this.vmsMaxPhseNum = ADto.vms_max_phse_num;
  210. this.panlOnTime = ADto.panl_on_time;
  211. this.panlOffTime = ADto.panl_off_time;
  212. this.panlPwerMode = ADto.panl_pwer_mode;
  213. this.brghMode = ADto.brgh_mode;
  214. this.webCmraIp = ADto.web_cmra_ip;
  215. this.istlLctnNm = ADto.istl_lctn_nm;
  216. this.trfcStrgUseYn = ADto.trfc_strg_use_yn;
  217. this.vmsLocIfscId = ADto.vms_loc_ifsc_id;
  218. this.fanMtnsTmpr = ADto.fan_mtns_tmpr;
  219. this.hetrMtnsTmpr = ADto.hetr_mtns_tmpr;
  220. this.webCmraPort = ADto.web_cmra_port;
  221. this.webCmraId = ADto.web_cmra_id;
  222. this.webCmraPwd = ADto.web_cmra_pwd;
  223. this.strmSesnNm = ADto.strm_sesn_nm;
  224. this.strmHttpAddr = ADto.strm_http_addr;
  225. this.strmRsptAddr = ADto.strm_rstp_addr;
  226. }
  227. }
  228. export class TVds extends TPoi {
  229. constructor(ALyrInfo, ADto) {
  230. super(ALyrInfo, ADto.ctlr_mngm_nmbr, ADto.vds_ctlr_id, ADto.lctn, ADto.x_crdn, ADto.y_crdn, "1", "0", 0, "19700101000000");
  231. this.ctlrTypeCd = ADto.ctlr_type_cd;
  232. this.valdYn = ADto.vald_yn;
  233. this.trmnIp = ADto.trmn_ip;
  234. this.trmnPort = ADto.trmn_port;
  235. this.ctlrClctCycl = ADto.ctlr_clct_cycl;
  236. this.ctlrSttsCycl = ADto.ctlr_stts_cycl;
  237. this.loopBordNum = ADto.loop_bord_num;
  238. this.delYn = ADto.del_yn;
  239. }
  240. }
  241. export class TRse extends TPoi {
  242. constructor(ALyrInfo, ADto) {
  243. super(ALyrInfo, ADto.rseid, ADto.rseid, ADto.location, ADto.coordx, ADto.coordy, "1", "0", 0, "19700101000000");
  244. this.instdt = ADto.instdt;
  245. this.citycd = ADto.citycd;
  246. this.regioncd = ADto.regioncd;
  247. this.areacd = ADto.areacd;
  248. this.rseip = ADto.rseip;
  249. this.radius1 = ADto.radius1;
  250. this.radius2 = ADto.radius2;
  251. this.compcd = ADto.compcd;
  252. this.rseconfigid = ADto.rseconfigid;
  253. this.obeparamid = ADto.obeparamid;
  254. this.port = ADto.port;
  255. this.bridge = ADto.bridge;
  256. this.comyn = ADto.comyn;
  257. this.commtype = ADto.commtype;
  258. }
  259. }
  260. export class TBit extends TPoi {
  261. constructor(ALyrInfo, ADto) {
  262. super(ALyrInfo, ADto.bitid, ADto.localno, ADto.bitname, ADto.coordx, ADto.coordy, "1", "0", 0, "19700101000000");
  263. this.instdt = ADto.regdate;
  264. this.address = ADto.address;
  265. }
  266. }
  267. export class TStation extends TPoi {
  268. constructor(ALyrInfo, ADto) {
  269. const commStts = ADto.turnseq >= ADto.stationorder ? "0" : "1";
  270. super(ALyrInfo, ADto.stationid, ADto.stationid, ADto.stationname, ADto.coordx, ADto.coordy, commStts, "0", 0, "19700101000000");
  271. this.stationtype = ADto.stationtype;
  272. }
  273. }
  274. export class TBit2 extends TPoi {
  275. constructor(ALyrInfo, ADto) {
  276. super(ALyrInfo, ADto.bitid, ADto.bitid, ADto.bitname, ADto.coordx, ADto.coordy, "1", "0", 0, "19700101000000");
  277. }
  278. }
  279. export class TBus extends TPoi {
  280. constructor(ALyrInfo, ADto, AOrder) {
  281. super(ALyrInfo, ADto.vehid, ADto.vehid, ADto.plateno, ADto.coordx, ADto.coordy, "0", "0", 0, "19700101000000");
  282. this.order = AOrder;
  283. this.instdt = ADto.collectdate;
  284. this.stationname = ADto.stationname;
  285. }
  286. }
  287. export class TPark extends TPoi {
  288. constructor(ALyrInfo, ADto) {
  289. super(ALyrInfo, ADto.parkingid, ADto.parkingid, ADto.parkingname, ADto.coordx, ADto.coordy, "0", "0", 0, "19700101000000");
  290. this.location = ADto.location;
  291. this.address = ADto.address;
  292. this.phone = ADto.phone;
  293. this.parkingCnt = ADto.parkingcnt;
  294. this.pisFlag = ADto.pisflag;
  295. this.districtId = ADto.districtid;
  296. this.parkingEName = ADto.parkingename;
  297. this.eLocation = ADto.elocation;
  298. this.eAddress = ADto.eaddress;
  299. }
  300. }
  301. export class TIncident extends TPoi {
  302. constructor(ALyrInfo, ADto) {
  303. super(ALyrInfo, ADto.incd_ocrr_id, ADto.incd_ocrr_id, ADto.incd_titl, ADto.x_crdn, ADto.y_crdn, ADto.incd_type_clsf_cd, 0, ADto.rgst_dt, ADto.rgst_dt);
  304. this.STR_DT = ADto.incd_strt_dt;
  305. this.END_DT = ADto.incd_end_prar_dt;
  306. this.TITLE = ADto.incd_titl;
  307. this.INCTYPENM = ADto.incd_type_clsf_desc;
  308. this.INCLOC = ADto.ocrr_lctn_nm;
  309. this.LINK_ID = ADto.link_id == null ? 0 : Number(ADto.link_id);
  310. }
  311. }