shjung 2 tahun lalu
induk
melakukan
b922bc5826

+ 3 - 0
src/main/java/com/its/vms/VmsCommServerApplication.java

@@ -172,6 +172,9 @@ public class VmsCommServerApplication implements CommandLineRunner, ApplicationL
             }
         }
 
+        VwStrmCtlrService vwStrmCtlrService = (VwStrmCtlrService)AppUtils.getBean(VwStrmCtlrService.class);
+        vwStrmCtlrService.loadDb();
+
         VmsSymbService vmsSymbService = (VmsSymbService)AppUtils.getBean(VmsSymbService.class);
         vmsSymbService.loadDb();
         vmsSymbService.loadVmsSymbLibDnld();

+ 15 - 29
src/main/java/com/its/vms/api/controller/EsbVmsController.java

@@ -1,38 +1,24 @@
 package com.its.vms.api.controller;
 
-import com.its.vms.esb.dto.TbEsbVmsShortMsgDto;
-import com.its.vms.esb.service.EsbVmsTcpService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.validation.Valid;
 
 @Slf4j
-@Api(tags = "1.VMS-1.ESB 연계")
-@Validated
-@RestController
-@RequiredArgsConstructor
-@RequestMapping("/api/vms/esb")
+//@Api(tags = "1.VMS-1.ESB 연계")
+//@Validated
+//@RestController
+//@RequiredArgsConstructor
+//@RequestMapping("/api/vms/esb")
 public class EsbVmsController {
 
-    private final EsbVmsTcpService esbService;
-
-    @ApiOperation(value = "ESB VMS 단문 메시지 즉시 전송", response = TbEsbVmsShortMsgDto.TbEsbVmsShortMsgReqRes.class)
-    @PostMapping(value = "/send/short-msg", produces = {"application/json; charset=utf8"})
-    public TbEsbVmsShortMsgDto.TbEsbVmsShortMsgReqRes sendVmsShortMsg(
-            @ApiParam(name = "req", value = "단문 메시지 정보", example = "", required = true)
-            @RequestBody @Valid final TbEsbVmsShortMsgDto.TbEsbVmsShortMsgReq req,
-            HttpServletRequest request) {
-        return this.esbService.sendShortMsg(req);
-    }
+//    private final EsbVmsTcpService esbService;
+//
+//    @ApiOperation(value = "ESB VMS 단문 메시지 즉시 전송", response = TbEsbVmsShortMsgDto.TbEsbVmsShortMsgReqRes.class)
+//    @PostMapping(value = "/send/short-msg", produces = {"application/json; charset=utf8"})
+//    public TbEsbVmsShortMsgDto.TbEsbVmsShortMsgReqRes sendVmsShortMsg(
+//            @ApiParam(name = "req", value = "단문 메시지 정보", example = "", required = true)
+//            @RequestBody @Valid final TbEsbVmsShortMsgDto.TbEsbVmsShortMsgReq req,
+//            HttpServletRequest request) {
+//        return this.esbService.sendShortMsg(req);
+//    }
 
 }

+ 12 - 2
src/main/java/com/its/vms/api/controller/VmsControlController.java

@@ -58,7 +58,7 @@ public class VmsControlController {
         return this.service.controlBright(ctlrNmbr, req);
     }
 
-    @ApiOperation(value = "VMS 제어기 FAN 제어", response = VmsControlDto.VmsControlRes.class)
+    @ApiOperation(value = "VMS 제어기 함체 FAN 제어", response = VmsControlDto.VmsControlRes.class)
     @PostMapping(value = "/fan/{ctlrNmbr}", produces = {"application/json; charset=utf8"})
     public VmsControlDto.VmsControlRes controlFan(
             @ApiParam(name = "ctlrNmbr", value = "제어기번호", example = "10005", required = true)
@@ -68,8 +68,18 @@ public class VmsControlController {
             HttpServletRequest request) {
         return this.service.controlFan(ctlrNmbr, req);
     }
+    @ApiOperation(value = "VMS 제어기 표출부 FAN 제어", response = VmsControlDto.VmsControlRes.class)
+    @PostMapping(value = "/fan2/{ctlrNmbr}", produces = {"application/json; charset=utf8"})
+    public VmsControlDto.VmsControlRes controlFan2(
+            @ApiParam(name = "ctlrNmbr", value = "제어기번호", example = "10005", required = true)
+            @PathVariable("ctlrNmbr") Long ctlrNmbr,
+            @ApiParam(name = "req", value = "VMS 제어기 제어 정보", example = "[ADMIN]", required = true)
+            @RequestBody @Valid final VmsControlDto.VmsControlFanReq req,
+            HttpServletRequest request) {
+        return this.service.controlFan2(ctlrNmbr, req);
+    }
 
-    @ApiOperation(value = "VMS 제어기 HEATER 제어", response = VmsControlDto.VmsControlRes.class)
+    @ApiOperation(value = "VMS 제어기 함체 HEATER 제어", response = VmsControlDto.VmsControlRes.class)
     @PostMapping(value = "/heater/{ctlrNmbr}", produces = {"application/json; charset=utf8"})
     public VmsControlDto.VmsControlRes controlHeater(
             @ApiParam(name = "ctlrNmbr", value = "제어기번호", example = "10005", required = true)

+ 17 - 0
src/main/java/com/its/vms/api/service/VmsControlService.java

@@ -239,6 +239,23 @@ public class VmsControlService {
         controlData.controlFan(controlType.getByteValue(), (byte)(req.getValue() & 0xFF));
         return statusControlReq(req.getUserId(), command, controlData);
     }
+    public VmsControlDto.VmsControlRes controlFan2(Long vmsCtlrNmbr, VmsControlDto.VmsControlFanReq req) {
+        log.warn("VmsControlService.controlFan2: VMS {}, {}.", vmsCtlrNmbr, req);
+        eVmsStatusControl command = eVmsStatusControl.CONTROL_DISPLAY_FAN;
+        TbVmsCtlrDto vmsObj = this.repoService.getCtlrMap(vmsCtlrNmbr);
+        if (vmsObj == null) {
+            return unknownControlNmbr(command, req.getUserId(), vmsCtlrNmbr);
+        }
+
+        eVmsReqFanControl controlType = eVmsReqFanControl.getValue(req.getType());
+        if (controlType == null) {
+            return unknownControlType(command, req.getType(), req.getUserId(), vmsCtlrNmbr);
+        }
+
+        VmsReqStatusControl controlData = new VmsReqStatusControl(vmsObj);
+        controlData.controlFan2(controlType.getByteValue(), (byte)(req.getValue() & 0xFF));
+        return statusControlReq(req.getUserId(), command, controlData);
+    }
 
     /**
      * VMS 제어기 HEATER 제어

+ 13 - 0
src/main/java/com/its/vms/dao/mapper/VwStrmCtlrMapper.java

@@ -0,0 +1,13 @@
+package com.its.vms.dao.mapper;
+
+import com.its.vms.entity.VwStrmCtlr;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface VwStrmCtlrMapper {
+
+    List<VwStrmCtlr> selectStrmCtlrInfo();
+
+}

+ 0 - 2
src/main/java/com/its/vms/domain/VmsForm.java

@@ -291,8 +291,6 @@ public class VmsForm implements Serializable {
                 case 167: //@우회소통정보이미지
                 case 200: //동영상
                 case 300: //스티리밍영상
-                //case 201: //동영상 스넵샷 이미지
-                //case 301: //스티리밍영상 대표 이미지
                 case 406: //@통합대기등급 이미지
                 case 407: //@미세먼지등급 이미지
                 case 408: //@초미세먼지등급 이미지

+ 1 - 0
src/main/java/com/its/vms/dto/TbVmsFormObjectDto.java

@@ -37,6 +37,7 @@ public class TbVmsFormObjectDto implements Serializable {
     private Long vmsIfscId;
     private Long strmCtlrNmbr;
     private String strmAddr;
+    private String strmCtlrNm;  // 내부에서 처리하는 컬럼
 
     private byte[] imagData;
     private eVmsImageType bitmapType;

+ 27 - 0
src/main/java/com/its/vms/dto/VwStrmCtlrDto.java

@@ -0,0 +1,27 @@
+package com.its.vms.dto;
+
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 스트리밍 정보 Entity Class
+ */
+@ApiModel("스트리밍 정보")
+@Getter
+@Builder
+@NoArgsConstructor//(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+public class VwStrmCtlrDto implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Long strmCtlrNmbr;
+    private String strmCtlrNm;
+    private String strmCtlrTp;
+    private String rtspAddr;
+
+}

+ 36 - 0
src/main/java/com/its/vms/entity/VwStrmCtlr.java

@@ -0,0 +1,36 @@
+package com.its.vms.entity;
+
+import com.its.vms.dto.VwStrmCtlrDto;
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * 스트리밍 정보 Entity Class
+ */
+@ApiModel("스트리밍 정보")
+@Getter
+@Builder
+@NoArgsConstructor//(access = AccessLevel.PROTECTED)
+@AllArgsConstructor
+public class VwStrmCtlr implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    private Long strmCtlrNmbr;
+    private String strmCtlrNm;
+    private String strmCtlrTp;
+    private String rtspAddr;
+
+    public VwStrmCtlrDto toDto() {
+        return VwStrmCtlrDto.builder()
+                .strmCtlrNmbr(this.strmCtlrNmbr)
+                .strmCtlrNm(this.strmCtlrNm)
+                .strmCtlrTp(this.strmCtlrTp)
+                .rtspAddr(this.rtspAddr)
+                .build();
+    }
+}

+ 2 - 3
src/main/java/com/its/vms/esb/service/EsbVmsTcpService.java

@@ -4,15 +4,14 @@ import com.its.app.utils.Elapsed;
 import com.its.app.utils.SysUtils;
 import com.its.vms.config.CommunicationConfig;
 import com.its.vms.dao.mapper.EsbVmsMapper;
-import com.its.vms.esb.dto.TbEsbVmsShortMsgDto;
 import com.its.vms.entity.NewIdSeq;
 import com.its.vms.entity.TbEsbVmsShortMsg;
 import com.its.vms.entity.TbEsbVmsShortMsgResult;
 import com.its.vms.esb.client.EsbVmsTcpClient;
+import com.its.vms.esb.dto.TbEsbVmsShortMsgDto;
 import com.its.vms.esb.protocol.EsbReqVmsShortMsg;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
 
 import java.io.IOException;
 import java.net.Socket;
@@ -20,7 +19,7 @@ import java.nio.ByteBuffer;
 import java.util.List;
 
 @Slf4j
-@Service
+//@Service
 @RequiredArgsConstructor
 public class EsbVmsTcpService {
 

+ 11 - 12
src/main/java/com/its/vms/scheduler/SchedulerTask.java

@@ -4,7 +4,6 @@ import com.its.app.AppUtils;
 import com.its.app.utils.Elapsed;
 import com.its.vms.config.ApplicationConfig;
 import com.its.vms.config.DebugConfig;
-import com.its.vms.esb.service.EsbVmsTcpService;
 import com.its.vms.service.*;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -26,7 +25,7 @@ public class SchedulerTask {
     private final VmsManageService vmsManageService;
     private final VmsDisplayOnOffService displayOnOffService;
     private final VmsSymbService symbService;
-    private final EsbVmsTcpService esbVmsTcpService;
+//    private final EsbVmsTcpService esbVmsTcpService;
     private final AppRepositoryService repoService;
 
     @PreDestroy
@@ -114,15 +113,15 @@ public class SchedulerTask {
     /**
      * ESB VMS 연계 서버에 전송할 단문 메시지가 존재하는 지 1분 주기로 체크하여 데이터를 전송한다.
      */
-    @Scheduled(cron = "15 * * * * *")  // 1분주기 작업 실행
-    public void scheduleEsbVmsShortMsg() {
-        if (!this.config.isStartSchedule()) {
-            return;
-        }
-        Elapsed elapsed = new Elapsed();
-        log.info("scheduleEsbVmsShortMsg: start. {}", Thread.currentThread().getName());
-        this.esbVmsTcpService.loadVmsShorMsg();
-        log.info("scheduleEsbVmsShortMsg: ..end. {} ms. {}", elapsed.milliSeconds(), Thread.currentThread().getName());
-    }
+//    @Scheduled(cron = "15 * * * * *")  // 1분주기 작업 실행
+//    public void scheduleEsbVmsShortMsg() {
+//        if (!this.config.isStartSchedule()) {
+//            return;
+//        }
+//        Elapsed elapsed = new Elapsed();
+//        log.info("scheduleEsbVmsShortMsg: start. {}", Thread.currentThread().getName());
+//        this.esbVmsTcpService.loadVmsShorMsg();
+//        log.info("scheduleEsbVmsShortMsg: ..end. {} ms. {}", elapsed.milliSeconds(), Thread.currentThread().getName());
+//    }
 
 }

+ 12 - 4
src/main/java/com/its/vms/service/VmsFormService.java

@@ -5,10 +5,7 @@ import com.its.app.utils.ItsUtils;
 import com.its.vms.config.ApplicationConfig;
 import com.its.vms.dao.mapper.VmsFormMapper;
 import com.its.vms.domain.enums.eVmsFormType;
-import com.its.vms.dto.TbVmsFormColrDto;
-import com.its.vms.dto.TbVmsFormDto;
-import com.its.vms.dto.TbVmsFormObjectDto;
-import com.its.vms.dto.TbVmsSymbLibDto;
+import com.its.vms.dto.*;
 import com.its.vms.entity.TbVmsForm;
 import com.its.vms.entity.TbVmsFormColr;
 import com.its.vms.entity.TbVmsFormObject;
@@ -31,6 +28,7 @@ public class VmsFormService {
     private final ApplicationConfig config;
     private final VmsFormMapper mapper;
     private final VmsSymbService vmsSymbService;
+    private final VwStrmCtlrService vwStrmCtlrService;
 
     private final ConcurrentHashMap<Integer, TbVmsFormDto> dataMap = new ConcurrentHashMap<>();
     private final ConcurrentHashMap<Integer, TbVmsFormColrDto> colrMap = new ConcurrentHashMap<>();
@@ -151,6 +149,16 @@ public class VmsFormService {
                     }
                     obj.setBitmapType(strmSymbLib.getImagType());
                     obj.setBitmapId(strmSymbLib.getDnldSymbLibNmbr());
+
+                    // 스트리밍 정보가 변경된 경우를 대비하여 처리
+                    VwStrmCtlrDto strmCtlrDto = this.vwStrmCtlrService.find(data.getStrmCtlrNmbr());
+                    if (strmCtlrDto != null) {
+                        if (strmCtlrDto.getRtspAddr() != null && !strmCtlrDto.getRtspAddr().equals(data.getStrmAddr())) {
+                            obj.setStrmAddr(strmCtlrDto.getRtspAddr());
+                        }
+                        // 스트리밍 이름을 추가로 업데이트(테이블에 존재하지 않는 컬럼)
+                        obj.setStrmCtlrNm(strmCtlrDto.getStrmCtlrNm());
+                    }
                 }
 
                 // 폼정보에 오브젝트 객체를 추가

+ 22 - 3
src/main/java/com/its/vms/service/VmsManageService.java

@@ -51,6 +51,7 @@ public class VmsManageService {
     private final VmsIfscService ifscService;
     private final VmsAtmpService atmpService;
     private final VmsParkService parkService;
+    private final VwStrmCtlrService vwStrmCtlrService;
     private final DbmsDataProcess dbmsDataProcess;
 
     private int toggleFormSeq = 1;
@@ -68,8 +69,7 @@ public class VmsManageService {
         Elapsed elapsed = new Elapsed();
         log.info("VmsManageService.loadBaseDatabase: START.");
         this.fontService.loadDb();
-        this.symbService.loadDb();
-        this.formService.loadDb();
+        this.vwStrmCtlrService.loadDb();
         log.info("VmsManageService.loadBaseDatabase: ..END. {} ms.", elapsed.milliSeconds());
     }
 
@@ -721,6 +721,8 @@ public class VmsManageService {
         if (this.config.isLoadDb()) {
             loadDb();
         }
+        this.symbService.loadDb();
+        this.formService.loadDb();
 
         this.atmpService.loadDb();  // 기상정보
         if (this.config.isUseParking()) {
@@ -859,6 +861,8 @@ public class VmsManageService {
                 VmsForm form = vmsObj.getFormManager().addForm(schedule.getVmsFormId(), schedule.getDnldFormId());
                 form.initDownload(vmsObj, vmsForm, schedule);
 
+                String videoFileName = "";
+                String strmAddrNm = "";
                 for (int objectIdx = 0; objectIdx < vmsForm.getObjects().size(); objectIdx++) {
                     if (objectIdx >= VmsConstants.VMS_MAX_FORM_OBJECTS) {
                         log.error("VmsManageService.makeVmsProvideForm: VMS({}), FormId({}), Form Object count overflow {} EA.",
@@ -916,10 +920,13 @@ public class VmsManageService {
                         if (obj.getVmsFormObjectTypeCd() == 200) {
                             formObj.setVideoFileName(obj.getVideoFileName());
                             formObj.setTextData(obj.getVideoFileName());
+                            videoFileName = formObj.getTextData();
                         }
                         else if (obj.getVmsFormObjectTypeCd() == 300) {
                             formObj.setStrmAddr(obj.getStrmAddr());
-                            formObj.setTextData(obj.getStrmAddr());
+                            formObj.setTextData(obj.getStrmCtlrNm());
+                            //formObj.setTextData(obj.getStrmAddr());
+                            strmAddrNm = formObj.getTextData();
                         }
                         form.setObjectDownload(true);
 
@@ -1383,6 +1390,18 @@ public class VmsManageService {
                             break;
                     }
                 } // (ii = 0; ii < vmsForm.getObjects().size()
+
+                // 동영상, 스트리밍 표출 텍스트 설정
+                List<VmsFormObject> tmpFormObjects = form.getObjects();
+                for (int kk = 0; kk < tmpFormObjects.size(); kk++) {
+                    VmsFormObject tmpFormObj = tmpFormObjects.get(kk);
+                    if (tmpFormObj.getObjectType() == 201) {
+                        tmpFormObj.setTextData(videoFileName);
+                    }
+                    else if (tmpFormObj.getObjectType() == 301) {
+                        tmpFormObj.setTextData(strmAddrNm);
+                    }
+                }
             } // (int ii = 0; ii < scheObj.size(); ii++)
         });
         log.info("VmsManageService.makeVmsProvideForm: {} ms.", elapsed.milliSeconds());

+ 47 - 0
src/main/java/com/its/vms/service/VwStrmCtlrService.java

@@ -0,0 +1,47 @@
+package com.its.vms.service;
+
+import com.its.app.utils.Elapsed;
+import com.its.vms.dao.mapper.VwStrmCtlrMapper;
+import com.its.vms.dto.VwStrmCtlrDto;
+import com.its.vms.entity.VwStrmCtlr;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.concurrent.ConcurrentHashMap;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class VwStrmCtlrService {
+
+    private final VwStrmCtlrMapper mapper;
+
+    private final ConcurrentHashMap<Long, VwStrmCtlrDto> dataMap = new ConcurrentHashMap<>();
+
+    public VwStrmCtlrDto find(Long strmCtlrNmbr) {
+        return this.dataMap.get(strmCtlrNmbr);
+    }
+
+    public void loadDb() {
+        loadStrmCtlrInfo();
+    }
+
+    public void loadStrmCtlrInfo() {
+        Elapsed elapsed = new Elapsed();
+        try {
+            List<VwStrmCtlr> infoList  = this.mapper.selectStrmCtlrInfo();
+            log.info("VwStrmCtlrService.loadStrmCtlrInfo: {} EA", infoList.size());
+            infoList.forEach(data -> {
+                VwStrmCtlrDto dto = data.toDto();
+               this.dataMap.put(dto.getStrmCtlrNmbr(), dto);
+            });
+        }
+        catch (Exception e) {
+            log.error("VwStrmCtlrService.loadStrmCtlrInfo: {}.", e.toString());
+        }
+        log.info("VwStrmCtlrService.loadStrmCtlrInfo: {} ms.", elapsed.milliSeconds());
+    }
+
+}

+ 69 - 69
src/main/java/com/its/vms/ui/SubUI.form

@@ -209,85 +209,103 @@
                       <text value="192.168.113.112"/>
                     </properties>
                   </component>
-                  <component id="8df61" class="javax.swing.JButton" binding="btnReqStatus">
+                  <component id="1d668" class="javax.swing.JButton" binding="btnTimeSync">
                     <constraints>
-                      <grid row="1" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="4" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="상태정보요청"/>
+                      <text value="시간 설정"/>
                     </properties>
                   </component>
-                  <component id="1fbd2" class="javax.swing.JButton" binding="btnReqParam">
+                  <component id="54bbc" class="javax.swing.JLabel">
                     <constraints>
-                      <grid row="2" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="3" column="5" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="파라미터 요청"/>
+                      <text value="ㅣ팬"/>
                     </properties>
                   </component>
-                  <component id="b14ca" class="javax.swing.JButton" binding="btnScnDnld">
+                  <component id="4b05a" class="javax.swing.JTextField" binding="txtState">
                     <constraints>
-                      <grid row="3" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="0" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
+                        <minimum-size width="100" height="-1"/>
+                        <preferred-size width="100" height="-1"/>
+                        <maximum-size width="100" height="-1"/>
+                      </grid>
                     </constraints>
                     <properties>
+                      <editable value="false"/>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="시나리오 다운로드"/>
+                      <horizontalAlignment value="0"/>
+                      <text value="통신"/>
                     </properties>
                   </component>
-                  <component id="1d668" class="javax.swing.JButton" binding="btnTimeSync">
+                  <component id="89546" class="javax.swing.JLabel">
                     <constraints>
-                      <grid row="4" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="0" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="시간 설정"/>
+                      <text value="ㅣ팬/히터 제어 구분"/>
                     </properties>
                   </component>
-                  <component id="a85f9" class="javax.swing.JButton" binding="btnSignBoardOff">
+                  <component id="b14ca" class="javax.swing.JButton" binding="btnScnDnld">
                     <constraints>
-                      <grid row="1" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="3" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="전광판 전원 OFF"/>
-                      <toolTipText value=""/>
+                      <text value="시나리오 다운로드"/>
                     </properties>
                   </component>
-                  <component id="7c99b" class="javax.swing.JButton" binding="btnSignBoardOn">
+                  <component id="1fbd2" class="javax.swing.JButton" binding="btnReqParam">
                     <constraints>
-                      <grid row="1" column="10" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="2" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="전광판 전원 ON"/>
-                      <toolTipText value=""/>
+                      <text value="파라미터 요청"/>
                     </properties>
                   </component>
-                  <component id="660a8" class="javax.swing.JButton" binding="btnReqFan">
+                  <component id="8df61" class="javax.swing.JButton" binding="btnReqStatus">
                     <constraints>
-                      <grid row="4" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="1" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="Fan 제어"/>
-                      <toolTipText value=""/>
+                      <text value="상태정보요청"/>
                     </properties>
                   </component>
-                  <component id="3d84f" class="javax.swing.JButton" binding="btnReqHeater">
+                  <grid id="37f8a" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+                    <margin top="0" left="0" bottom="0" right="0"/>
                     <constraints>
-                      <grid row="4" column="10" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="1" column="10" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+                    </constraints>
+                    <properties/>
+                    <border type="none"/>
+                    <children>
+                      <component id="b2552" class="javax.swing.JSpinner" binding="spControl">
+                        <constraints>
+                          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+                        </constraints>
+                        <properties/>
+                      </component>
+                    </children>
+                  </grid>
+                  <component id="ce753" class="javax.swing.JLabel">
+                    <constraints>
+                      <grid row="1" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="Heater 제어"/>
-                      <toolTipText value=""/>
+                      <text value="ㅣ팬/히터 제어 값"/>
                     </properties>
                   </component>
                   <component id="58c64" class="javax.swing.JComboBox" binding="cboControl">
                     <constraints>
-                      <grid row="3" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="0" column="10" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
@@ -298,80 +316,62 @@
                       </model>
                     </properties>
                   </component>
-                  <component id="54bbc" class="javax.swing.JLabel">
+                  <component id="7c99b" class="javax.swing.JButton" binding="btnSignBoardOn">
                     <constraints>
-                      <grid row="3" column="5" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                      <grid row="2" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="ㅣ팬"/>
+                      <text value="전광판 전원 ON"/>
+                      <toolTipText value=""/>
                     </properties>
                   </component>
-                  <component id="89546" class="javax.swing.JLabel">
+                  <component id="a85f9" class="javax.swing.JButton" binding="btnSignBoardOff">
                     <constraints>
-                      <grid row="2" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                      <grid row="3" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="ㅣ팬/히터 제어 구분"/>
+                      <text value="전광판 전원 OFF"/>
+                      <toolTipText value=""/>
                     </properties>
                   </component>
-                  <component id="ce753" class="javax.swing.JLabel">
+                  <component id="896ae" class="javax.swing.JButton" binding="btnSymbDnld">
                     <constraints>
-                      <grid row="2" column="10" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+                      <grid row="4" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="ㅣ팬/히터 제어 값"/>
+                      <text value="심벌 다운로드"/>
                     </properties>
                   </component>
-                  <grid id="37f8a" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
-                    <margin top="0" left="0" bottom="0" right="0"/>
-                    <constraints>
-                      <grid row="3" column="10" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
-                    </constraints>
-                    <properties/>
-                    <border type="none"/>
-                    <children>
-                      <component id="b2552" class="javax.swing.JSpinner" binding="spControl">
-                        <constraints>
-                          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
-                        </constraints>
-                        <properties/>
-                      </component>
-                    </children>
-                  </grid>
-                  <component id="896ae" class="javax.swing.JButton" binding="btnSymbDnld">
+                  <component id="660a8" class="javax.swing.JButton" binding="btnReqFan">
                     <constraints>
-                      <grid row="0" column="10" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="2" column="10" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="심벌라이브러리"/>
+                      <text value="함체 Fan 제어"/>
+                      <toolTipText value=""/>
                     </properties>
                   </component>
-                  <component id="4b05a" class="javax.swing.JTextField" binding="txtState">
+                  <component id="8a0d2" class="javax.swing.JButton" binding="btnReqFan2">
                     <constraints>
-                      <grid row="0" column="8" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
-                        <minimum-size width="100" height="-1"/>
-                        <preferred-size width="100" height="-1"/>
-                        <maximum-size width="100" height="-1"/>
-                      </grid>
+                      <grid row="4" column="10" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
-                      <editable value="false"/>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <horizontalAlignment value="0"/>
-                      <text value="통신"/>
+                      <text value="표출부 Fan 제어"/>
                     </properties>
                   </component>
-                  <component id="8a0d2" class="javax.swing.JButton" binding="btnReserved">
+                  <component id="3d84f" class="javax.swing.JButton" binding="btnReqHeater">
                     <constraints>
-                      <grid row="0" column="9" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
+                      <grid row="3" column="10" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
                     </constraints>
                     <properties>
                       <font name="Malgun Gothic" size="12" style="0"/>
-                      <text value="TEST"/>
+                      <text value="함체 Heater 제어"/>
+                      <toolTipText value=""/>
                     </properties>
                   </component>
                 </children>

+ 19 - 13
src/main/java/com/its/vms/ui/SubUI.java

@@ -4,11 +4,11 @@ import com.intellij.uiDesigner.core.GridConstraints;
 import com.intellij.uiDesigner.core.GridLayoutManager;
 import com.intellij.uiDesigner.core.Spacer;
 import com.its.vms.domain.NET;
-import com.its.vms.xnettcp.vms.protocol.enums.eVmsReqBoardPower;
 import com.its.vms.dto.TbVmsCtlrDto;
 import com.its.vms.entity.TbVmsCtlrStts;
 import com.its.vms.xnettcp.vms.process.TcpServerSendData;
 import com.its.vms.xnettcp.vms.protocol.enums.eVmsOpCode;
+import com.its.vms.xnettcp.vms.protocol.enums.eVmsReqBoardPower;
 import com.its.vms.xnettcp.vms.protocol.impl.VmsReqStatusControl;
 import com.sun.management.OperatingSystemMXBean;
 import lombok.Getter;
@@ -59,7 +59,7 @@ public abstract class SubUI {
     private JComboBox cboControl;
     private JSpinner spControl;
     private JButton btnSymbDnld;
-    private JButton btnReserved;
+    private JButton btnReqFan2;
     private JCheckBox chkDebug;
 
     protected abstract void actionButtonClicked();
@@ -82,12 +82,12 @@ public abstract class SubUI {
         SpinnerModel value = new SpinnerNumberModel(0, 0, 100, 1);
         spControl.setModel(value);
 
-        btnReserved.setVisible(false);
-        btnReserved.addActionListener(new ActionListener() {
+        //btnReqFan2.setVisible(false);
+        btnReqFan2.addActionListener(new ActionListener() {
             @Override
             public void actionPerformed(ActionEvent e) {
-                selObj.downloadSymbLib();
-                //selObj.addRequestData(new TcpServerSendData(eVmsOpCode.OP_VMS_DISPLAY_MODULE_STATUS_REQ, null));
+                //selObj.downloadSymbLib();
+                statusControl(9);   // 표출부 FAN 제어
             }
         });
         btnLogClear.addActionListener(new ActionListener() {
@@ -203,10 +203,13 @@ public abstract class SubUI {
                 message = "제어기의 전광판 전원을 ON 하시겠습니까?";
                 break;
             case 7:
-                message = "제어기의 FAN 을 제어 하시겠습니까?";
+                message = "제어기함체의 FAN 을 제어 하시겠습니까?";
                 break;
             case 8:
-                message = "제어기의 HEATER 를 제어 하시겠습니까?";
+                message = "제어기함체의 HEATER 를 제어 하시겠습니까?";
+                break;
+            case 9:
+                message = "표출부함체의 FAN 을 제어 하시겠습니까?";
                 break;
             default:
                 return;
@@ -241,6 +244,9 @@ public abstract class SubUI {
             case 8:
                 statusControl.controlHeater((byte) (cboControl.getSelectedIndex() & 0xff), (byte) ((Integer) spControl.getValue() & 0xFF));
                 break;
+            case 9:
+                statusControl.controlFan2((byte) (cboControl.getSelectedIndex() & 0xff), (byte) ((Integer) spControl.getValue() & 0xFF));
+                break;
         }
         this.selObj.addRequestData(new TcpServerSendData(eVmsOpCode.OP_VMS_STATUS_CONTROL, statusControl));
     }
@@ -515,11 +521,11 @@ public abstract class SubUI {
         txtState.setHorizontalAlignment(0);
         txtState.setText("통신");
         panel1.add(txtState, new GridConstraints(0, 8, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, new Dimension(100, -1), new Dimension(100, -1), new Dimension(100, -1), 0, false));
-        btnReserved = new JButton();
-        Font btnReservedFont = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, btnReserved.getFont());
-        if (btnReservedFont != null) btnReserved.setFont(btnReservedFont);
-        btnReserved.setText("TEST");
-        panel1.add(btnReserved, new GridConstraints(0, 9, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
+        btnReqFan2 = new JButton();
+        Font btnReservedFont = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, btnReqFan2.getFont());
+        if (btnReservedFont != null) btnReqFan2.setFont(btnReservedFont);
+        btnReqFan2.setText("TEST");
+        panel1.add(btnReqFan2, new GridConstraints(0, 9, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
         final JPanel panel3 = new JPanel();
         panel3.setLayout(new GridLayoutManager(2, 1, new Insets(0, 4, 0, 4), -1, -1));
         rootPanel.add(panel3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, new Dimension(-1, 200), null, null, 0, false));

+ 1 - 1
src/main/java/com/its/vms/xnettcp/vms/protocol/enums/eVmsStatusControl.java

@@ -5,7 +5,7 @@ import java.util.Map;
 
 public enum eVmsStatusControl {
 
-    CONTROL_DISPLAY_POWER             (0x01, "0x00.표출부함체 전광판 전원제어"),
+    CONTROL_DISPLAY_POWER             (0x01, "0x01.표출부함체 전광판 전원제어"),
     CONTROL_RESET                     (0x02, "0x02.제어기 리셋트"),
     CONTROL_RETRY_COUNT               (0x03, "0x03.통신 재시도 횟수"),
     CONTROL_SYSTEM_TIME               (0x04, "0x04.제어기 시간 설정"),

+ 10 - 0
src/main/java/com/its/vms/xnettcp/vms/protocol/impl/VmsReqStatusControl.java

@@ -106,6 +106,16 @@ public class VmsReqStatusControl extends VmsReqFramePacket {
         this.framePacket.setBody(this.body);
         log.info("VmsReqStatusControl.controlFan: VMS {}, {}, {}", this.vmsObj.getVmsCtlrNmbr(), String.format("0x%02X", this.body[1]), String.format("0x%02X", this.body[2]));
     }
+    public void controlFan2(byte type, byte temp) {
+        this.body = new byte[3];
+        this.body[0] = eVmsStatusControl.CONTROL_DISPLAY_FAN.getByteValue();
+        this.body[1] = (byte)(type & 0xFF);
+        if (type == eVmsReqFanControl.vms_req_fan_auto.getByteValue()) {
+            this.body[2] = (byte)(temp & 0xFF);
+        }
+        this.framePacket.setBody(this.body);
+        log.info("VmsReqStatusControl.controlFan2: VMS {}, {}, {}", this.vmsObj.getVmsCtlrNmbr(), String.format("0x%02X", this.body[1]), String.format("0x%02X", this.body[2]));
+    }
     public void controlHeater(byte type, byte temp) {
         this.body = new byte[3];
         this.body[0] = eVmsStatusControl.CONTROL_HEATER.getByteValue();

+ 16 - 0
src/main/resources/mybatis/mapper/VwStrmCtlrMapper.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="com.its.vms.dao.mapper.VwStrmCtlrMapper">
+
+    <select id="selectStrmCtlrInfo" resultType="com.its.vms.entity.VwStrmCtlr" fetchSize="200">
+    <![CDATA[
+        select t1.strm_ctlr_nmbr AS strmCtlrNmbr,
+               t1.strm_ctlr_nm   AS strmCtlrNm,
+               t1.strm_ctlr_tp   AS strmCtlrTp,
+               t1.rtsp_addr      AS rtspAddr
+        from vw_strm_ctlr t1
+        ]]>
+    </select>
+
+</mapper>