shjung %!s(int64=2) %!d(string=hai) anos
pai
achega
75d6dd8758

+ 55 - 51
src/main/java/com/its/vms/dto/TbVmsCtlrDto.java

@@ -16,10 +16,8 @@ import com.its.vms.xnettcp.vms.protocol.dto.*;
 import com.its.vms.xnettcp.vms.protocol.enums.eVmsFileSaveLocation;
 import com.its.vms.xnettcp.vms.protocol.enums.eVmsFormObjectKind;
 import com.its.vms.xnettcp.vms.protocol.enums.eVmsImageType;
-import com.its.vms.xnettcp.vms.protocol.impl.VmsReqBlank;
-import com.its.vms.xnettcp.vms.protocol.impl.VmsReqDataDownload;
-import com.its.vms.xnettcp.vms.protocol.impl.VmsReqDownloadForm;
-import com.its.vms.xnettcp.vms.protocol.impl.VmsReqDownloadFormSchedule;
+import com.its.vms.xnettcp.vms.protocol.enums.eVmsOpCode;
+import com.its.vms.xnettcp.vms.protocol.impl.*;
 import com.its.vms.xnettcp.vms.task.VmsTimeoutTask;
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelFuture;
@@ -191,6 +189,10 @@ public class TbVmsCtlrDto implements Serializable {
         this.dataProcess.run();
     }
 
+    public String getLogKey() {
+        return this.ctlrId;
+    }
+
     /**
      * 파일 다운로드 정보 초기화
      */
@@ -215,7 +217,8 @@ public class TbVmsCtlrDto implements Serializable {
     public short getSeqNext() {
         return this.seq.nextValue();
     }
-    public boolean addRequestData(TcpServerSendData data) {
+
+    public synchronized boolean addRequestData(TcpServerSendData data) {
         return this.dataProcess.add(data);
     }
 
@@ -236,13 +239,9 @@ public class TbVmsCtlrDto implements Serializable {
         this.stts.initError();
     }
 
-    public String getLogKey() {
-        return this.ctlrId;
-    }
-
     public String getLastRecvTimeFmt() {
         SimpleDateFormat sdfDate = new SimpleDateFormat("MM-dd HH:mm:ss");
-        return sdfDate.format(lastRecvTime);
+        return sdfDate.format(this.lastRecvTime);
     }
 
     public void resetConnectCount() {
@@ -301,7 +300,7 @@ public class TbVmsCtlrDto implements Serializable {
      * @param packetDesc
      * @return
      */
-    public boolean sendData(ByteBuffer sendBuffer, int delayMilliSeconds, String packetDesc) {
+    public synchronized boolean sendData(ByteBuffer sendBuffer, int delayMilliSeconds, String packetDesc) {
         boolean result = false;
         log.info("~REQUEST-{}. VMS {}, {} Bytes.", packetDesc, this.vmsCtlrNmbr, sendBuffer.capacity());
         if (this.channel != null) {
@@ -330,26 +329,14 @@ public class TbVmsCtlrDto implements Serializable {
         return true;
     }
 
-    public int reset(int devcType, int cntlType, TbVmsCtrlHs ctrlHs) {
-//        if (getChannel() == null || getNetState() == NET.CLOSED) {
-//            log.error("Reset Request: channel not connected: [{}]", this);
-//            return 1;
-//        }
-//        eControlDeviceId controlDeviceId = eControlDeviceId.getByValue(devcType);
-//        eControlCommand commandType = eControlCommand.getByValue(cntlType);
-//        if (controlDeviceId == null || commandType == null) {
-//            log.error("Reset Request: control type missMatched: [{}], {}, {}", this, controlDeviceId, commandType);
-//            return 2;
-//        }
-//
-//        log.warn("[{}] [{},{}], controlDeviceId: {}, commandType: {}", this.vmsCtlrNmbr, devcType, cntlType, controlDeviceId.toString(), commandType.toString());
-//		boolean res = ControlDeviceService.getInstance().requestResetCommand(true, this, getChannel());
-//		if (res) {
-//			log.info("RSE REQ CONTROL SEND OK: [{}] [{},{}]", this.RSE_CTLR_NMBR, devcType, cntlType);
-//			return 0;
-//		}
-        log.error("RSE REQ CONTROL SEND Error: [{}] [{},{}]", this.vmsCtlrNmbr, devcType, cntlType);
-        return 3;
+    public boolean reset(TbVmsCtrlHs ctrlHs) {
+        if (getChannel() == null || getNetState() == NET.CLOSED) {
+            log.error("Reset Request: channel not connected: [{}]", this);
+            return false;
+        }
+        VmsReqStatusControl resetControl = new VmsReqStatusControl(this);
+        resetControl.controlReset();
+        return addRequestData(new TcpServerSendData(eVmsOpCode.OP_VMS_STATUS_CONTROL, resetControl));
     }
 
     public synchronized boolean addUserCommands(Long packetNmbr, TbVmsCtrlHs command) {
@@ -438,15 +425,6 @@ public class TbVmsCtlrDto implements Serializable {
 //		return c2c;
 //	}
 
-    public synchronized boolean sendFrED() {
-        if (getChannel() == null || getNetState() == NET.CLOSED) {
-            log.error("sendFrED Request: channel not connected: [{}]", this);
-            return false;
-        }
-        return true;
-        //return FredResponse.sendFrED(this, getChannel());
-    }
-
     public TbVmsCtlr toDto() {
         return TbVmsCtlr.builder()
                 .vmsCtlrNmbr(this.vmsCtlrNmbr)
@@ -661,7 +639,40 @@ public class TbVmsCtlrDto implements Serializable {
             log.info("downloadAutoFixForm: VMS {}, Download Schedule Form Count Zero. {} EA.", this.vmsCtlrNmbr, formCnt);
             return true;
         }
-        return true;
+        int downloadCnt = this.downloadData.getDownloadCnt();
+        if (downloadCnt >= formCnt) {
+            // 폼정보를 모두 다운로드 했기때문에 폼파일을 다운로드 해야 한다.
+            this.downloadData.setDownloadCnt(0); // 폼이미지파일을 다운로드해야 하기때문에 다운로드 인덱스를 다시 0으로 리셋
+            return downloadFile();
+        }
+
+        // 폼아이디는 제어기가 최초에 접속했을때 한번만 내려보내기 때문에
+        // 폼아이디를 여기서 설정해 주어야 한다.
+        VmsDownloadData.VmsDownloadDataInfo[] units = this.downloadData.getUnits();
+        int formId   = units[downloadCnt].getFormNo();
+        int displaySec = units[downloadCnt].getDisplaySec();
+        int displayType = units[downloadCnt].getDisplayType();
+        int bitmapId = units[downloadCnt].getBitmapId();
+        int formIdx  = units[downloadCnt].getFormIdx();
+        int downloadFormCnt = 1;
+        VmsForm pForm = this.formManager.getItem(formIdx);
+        int objSize = 7;
+        int blinking = pForm.getVmsFormDsplMthdCd();
+        int posX = 0;
+        int posY = 0;
+        int bkClr = units[downloadCnt].getBkClr();
+
+        VmsFormDataDto formData = new VmsFormDataDto(formId, downloadFormCnt);
+        VmsFormDto formDto = formData.addForm(formId, displaySec, displayType, bkClr, objSize);
+        VmsFormObj formObjDto= new VmsFormObjBitmapId(objSize, blinking, posX, posY, bkClr, this.vmsWidth, this.vmsHeight, eVmsImageType.VMS_IMAGE_TYPE_BMP.getValue(), bitmapId);
+        formObjDto.calSize();
+        formDto.addObject(formObjDto);
+        formData.calFormCount();
+
+        this.downloadData.setDownloadCnt(downloadCnt+1);
+
+        VmsReqDownloadForm downloadForm = new VmsReqDownloadForm(this, formData);
+        return sendData(downloadForm.getByteBuffer(), 10, downloadForm.getOpCodeDesc());
     }
 
     /**
@@ -682,7 +693,6 @@ public class TbVmsCtlrDto implements Serializable {
         }
 
         ApplicationConfig config = (ApplicationConfig)AppUtils.getBean(ApplicationConfig.class);
-        boolean endDownload = true;
         VmsDownloadData.VmsDownloadDataInfo[] units = this.downloadData.getUnits();
         for (int ii = downloadCnt; ii < formCnt; ii++) {
             this.downloadData.setDownloadCnt(downloadCnt+1);
@@ -697,24 +707,18 @@ public class TbVmsCtlrDto implements Serializable {
                 continue;
             }
 
-            endDownload = false;
             this.downloadFormId = units[ii].getVmsFormId();
 
             log.info("downloadFile: DownloadCnt: VMS {}, IDX {}, FormId {}, BitmapId {}, VMS_FORM_ID: {}", this.vmsCtlrNmbr, ii, formId, bitmapId, this.downloadFormId);
-
-//            int fileNameSize = 11;
-//            int fileSize     = pForm.getImageData().length;
             String fileName = String.format("BID%04d.BMP", bitmapId);
             eVmsFileSaveLocation saveLoc = eVmsFileSaveLocation.LOC_DOWNLOAD_PROG_IMAGE;
 
             VmsReqDataDownload dataDownload = new VmsReqDataDownload(this, saveLoc, fileName, pForm.getImageData());
             return sendData(dataDownload.getByteBuffer(), 10, dataDownload.getOpCodeDesc());
         }
-        if (endDownload) {
-            // 폼이미지 정보가 모두 다운로드 되었으므로 스케쥴 정보를 다운로드 한다.
-            return downloadFormSchedule();  // Display Schedule Form
-        }
-        return true;
+
+        // 폼이미지 정보가 모두 다운로드 되었으므로 스케쥴 정보를 다운로드 한다.
+        return downloadFormSchedule();  // Display Schedule Form
     }
 
     /**

+ 9 - 12
src/main/java/com/its/vms/service/VmsManageService.java

@@ -21,9 +21,9 @@ import com.its.vms.process.DbmsDataType;
 import com.its.vms.xnettcp.vms.process.TcpServerRecvDataProcess;
 import com.its.vms.xnettcp.vms.process.TcpServerSendData;
 import com.its.vms.xnettcp.vms.protocol.VmsProtocolConst;
-import com.its.vms.xnettcp.vms.protocol.dto.VmsReqControlDto;
 import com.its.vms.xnettcp.vms.protocol.enums.eVmsFormObjectKind;
 import com.its.vms.xnettcp.vms.protocol.enums.eVmsOpCode;
+import com.its.vms.xnettcp.vms.protocol.impl.VmsReqStatusControl;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -71,8 +71,8 @@ public class VmsManageService {
 
         List<TbVmsOnOffTime> result = this.mapper.selectVmsOnOffTime();
         result.forEach(obj -> {
-            TbVmsCtlrDto vmsCtlr = this.repoService.getCtrlMap(obj.getVmsCtlrNmbr());
-            if (vmsCtlr == null) {
+            TbVmsCtlrDto vmsObj = this.repoService.getCtrlMap(obj.getVmsCtlrNmbr());
+            if (vmsObj == null) {
                 log.error("VmsManageService.loadVmsOnOffTime: VMS Not Found {}", obj.getVmsCtlrNmbr());
                 return;
             }
@@ -86,10 +86,10 @@ public class VmsManageService {
                 offTime = "0000";
             }
 
-            byte oldOnOff = vmsCtlr.getModule().getOnOff();
+            byte oldOnOff = vmsObj.getModule().getOnOff();
             byte controlOnOff = eVmsReqBoardPower.vms_req_board_power_on.getValue();
-            vmsCtlr.getModule().setPowerOnTime(sysDay + onTime);
-            vmsCtlr.getModule().setPowerOffTime(sysDay + offTime);
+            vmsObj.getModule().setPowerOnTime(sysDay + onTime);
+            vmsObj.getModule().setPowerOffTime(sysDay + offTime);
 
             int nOnTime = ItsUtils.parseIntDef(onTime, 0);
             int nOffTime = ItsUtils.parseIntDef(offTime, 0);
@@ -109,12 +109,9 @@ public class VmsManageService {
                 }
             }
             if (!Objects.equals(controlOnOff, oldOnOff)) {
-                byte[] command = new byte[1];
-                command[0] = controlOnOff;
-                VmsReqControlDto control = new VmsReqControlDto(eVmsReqControl.vms_req_control_signboard, command);
-                TcpServerSendData reqData = new TcpServerSendData(eVmsOpCode.OP_VMS_STATUS_CONTROL, control);
-                vmsCtlr.addRequestData(reqData);
-                //TODO: 요청패킷 처리하는 곳에서 네트워크 상태에 따라 메모리 정보 셋팅
+                VmsReqStatusControl signboardControl = new VmsReqStatusControl(vmsObj);
+                signboardControl.controlSignboardPower(controlOnOff);
+                vmsObj.addRequestData(new TcpServerSendData(eVmsOpCode.OP_VMS_STATUS_CONTROL, signboardControl));
             }
         });
     }

+ 1 - 1
src/main/java/com/its/vms/ui/MainUI.java

@@ -257,7 +257,7 @@ public class MainUI {
                 result = this.selObj.channelClose();
                 break;
             case 2:
-                result = (this.selObj.reset(0, 1, null) == 0);
+                result = (this.selObj.reset(null) == 0);
                 break;
             case 4:
                 result = true;

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

@@ -140,21 +140,6 @@
                       <text value="192.168.113.112"/>
                     </properties>
                   </component>
-                  <component id="3b1f0" class="javax.swing.JTextField" binding="txtPort">
-                    <constraints>
-                      <grid row="2" column="5" row-span="1" col-span="2" 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"/>
-                      <horizontalAlignment value="0"/>
-                      <text value="3001"/>
-                    </properties>
-                  </component>
                   <component id="a2741" class="javax.swing.JTextField" binding="txtDoor">
                     <constraints>
                       <grid row="3" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
@@ -202,7 +187,7 @@
                   </component>
                   <component id="9e468" class="javax.swing.JTextField" binding="txtCtlrId">
                     <constraints>
-                      <grid row="0" column="4" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
+                      <grid row="0" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
                         <preferred-size width="150" height="-1"/>
                       </grid>
                     </constraints>
@@ -233,11 +218,26 @@
                       <text value="ㅣVMS"/>
                     </properties>
                   </component>
+                  <component id="3b1f0" class="javax.swing.JTextField" binding="txtPort">
+                    <constraints>
+                      <grid row="2" column="7" 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"/>
+                      <horizontalAlignment value="0"/>
+                      <text value="3001"/>
+                    </properties>
+                  </component>
                 </children>
               </grid>
             </children>
           </grid>
-          <grid id="62443" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+          <grid id="62443" layout-manager="GridLayoutManager" row-count="4" 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="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
@@ -245,29 +245,29 @@
             <properties/>
             <border type="none"/>
             <children>
-              <component id="a85f9" class="javax.swing.JButton" binding="btnZoomIn">
+              <component id="a85f9" class="javax.swing.JButton" binding="btnSingnBoardOff">
                 <constraints>
-                  <grid row="1" column="0" 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="0" 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="14" style="1"/>
-                  <text value="Zoom (+)"/>
-                  <toolTipText value="ZOOM In"/>
+                  <font name="Malgun Gothic" size="12" style="0"/>
+                  <text value="전광판 전원 OFF"/>
+                  <toolTipText value=""/>
                 </properties>
               </component>
-              <component id="7c99b" class="javax.swing.JButton" binding="btnZoomOut">
+              <component id="7c99b" class="javax.swing.JButton" binding="btnSingnBoardOn">
                 <constraints>
-                  <grid row="2" column="0" 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="0" 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="14" style="1"/>
-                  <text value="Zoom (-)"/>
-                  <toolTipText value="ZOOM Out"/>
+                  <font name="Malgun Gothic" size="12" style="0"/>
+                  <text value="전광판 전원 ON"/>
+                  <toolTipText value=""/>
                 </properties>
               </component>
               <component id="660a8" class="javax.swing.JButton" binding="btnFocusIn">
                 <constraints>
-                  <grid row="3" column="0" 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="0" 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="14" style="1"/>
@@ -277,7 +277,7 @@
               </component>
               <component id="3d84f" class="javax.swing.JButton" binding="btnFocusOut">
                 <constraints>
-                  <grid row="4" column="0" 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="0" 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="14" style="1"/>
@@ -285,15 +285,9 @@
                   <toolTipText value="FOCUS Far"/>
                 </properties>
               </component>
-              <component id="8bdb5" class="javax.swing.JSpinner" binding="spSpeed">
-                <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>
-          <grid id="e429a" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="true" same-size-vertically="true" hgap="-1" vgap="-1">
+          <grid id="e429a" layout-manager="GridLayoutManager" row-count="4" 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="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
@@ -301,139 +295,40 @@
             <properties/>
             <border type="none"/>
             <children>
-              <component id="6057a" class="javax.swing.JButton" binding="btnPanLeft">
-                <constraints>
-                  <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
-                    <minimum-size width="50" height="50"/>
-                    <preferred-size width="50" height="50"/>
-                    <maximum-size width="50" height="50"/>
-                  </grid>
-                </constraints>
-                <properties>
-                  <font name="Malgun Gothic" size="16" style="0"/>
-                  <horizontalTextPosition value="2"/>
-                  <text value="◀"/>
-                  <toolTipText value="PAN Left"/>
-                </properties>
-              </component>
-              <component id="90c8c" class="javax.swing.JButton" binding="btnPanTiltLeftDown">
+              <component id="8df61" class="javax.swing.JButton" binding="btnReqStatus">
                 <constraints>
-                  <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
-                    <minimum-size width="50" height="50"/>
-                    <preferred-size width="50" height="50"/>
-                    <maximum-size width="50" height="50"/>
-                  </grid>
+                  <grid row="0" column="0" 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="16" style="0"/>
-                  <horizontalTextPosition value="2"/>
-                  <text value=""/>
-                  <toolTipText value="PAN TILT Left Down"/>
-                </properties>
-              </component>
-              <component id="83d68" class="javax.swing.JButton" binding="btnStop">
-                <constraints>
-                  <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
-                    <minimum-size width="50" height="50"/>
-                    <preferred-size width="50" height="50"/>
-                    <maximum-size width="50" height="50"/>
-                  </grid>
-                </constraints>
-                <properties>
-                  <font name="Malgun Gothic" size="16" style="0"/>
-                  <horizontalTextPosition value="2"/>
-                  <text value="■"/>
-                  <toolTipText value="STOP"/>
-                </properties>
-              </component>
-              <component id="d5b58" class="javax.swing.JButton" binding="btnTiltDown">
-                <constraints>
-                  <grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
-                    <minimum-size width="50" height="50"/>
-                    <preferred-size width="50" height="50"/>
-                    <maximum-size width="50" height="50"/>
-                  </grid>
-                </constraints>
-                <properties>
-                  <font name="Malgun Gothic" size="16" style="0"/>
-                  <horizontalTextPosition value="2"/>
-                  <text value="▼"/>
-                  <toolTipText value="TILT Down"/>
-                </properties>
-              </component>
-              <component id="9f7a9" class="javax.swing.JButton" binding="btnPanRight">
-                <constraints>
-                  <grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
-                    <minimum-size width="50" height="50"/>
-                    <preferred-size width="50" height="50"/>
-                    <maximum-size width="50" height="50"/>
-                  </grid>
-                </constraints>
-                <properties>
-                  <font name="Malgun Gothic" size="16" style="0"/>
-                  <horizontalTextPosition value="2"/>
-                  <text value="▶"/>
-                  <toolTipText value="PAN Right"/>
-                </properties>
-              </component>
-              <component id="ec78f" class="javax.swing.JButton" binding="btnPanTiltRightDown">
-                <constraints>
-                  <grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
-                    <minimum-size width="50" height="50"/>
-                    <preferred-size width="50" height="50"/>
-                    <maximum-size width="50" height="50"/>
-                  </grid>
-                </constraints>
-                <properties>
-                  <font name="Malgun Gothic" size="16" style="0"/>
-                  <horizontalTextPosition value="2"/>
-                  <text value=""/>
-                  <toolTipText value="PAN TILT Left Down"/>
+                  <font name="Malgun Gothic" size="12" style="0"/>
+                  <text value="상태정보요청"/>
                 </properties>
               </component>
-              <component id="90b80" class="javax.swing.JButton" binding="btnPanTiltLeftUp">
+              <component id="1fbd2" class="javax.swing.JButton" binding="btnReqParam">
                 <constraints>
-                  <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false">
-                    <minimum-size width="50" height="50"/>
-                    <preferred-size width="50" height="50"/>
-                    <maximum-size width="50" height="50"/>
-                  </grid>
+                  <grid row="1" column="0" 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="16" style="0"/>
-                  <horizontalTextPosition value="2"/>
-                  <text value=""/>
-                  <toolTipText value="PAN TILT Left Up"/>
+                  <font name="Malgun Gothic" size="12" style="0"/>
+                  <text value="파라미터 요청"/>
                 </properties>
               </component>
-              <component id="2920a" class="javax.swing.JButton" binding="btnTiltUp">
+              <component id="b14ca" class="javax.swing.JButton" binding="btnScnDnld">
                 <constraints>
-                  <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
-                    <minimum-size width="50" height="50"/>
-                    <preferred-size width="50" height="50"/>
-                    <maximum-size width="50" height="50"/>
-                  </grid>
+                  <grid row="2" column="0" 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="16" style="0"/>
-                  <horizontalTextPosition value="2"/>
-                  <text value="▲"/>
-                  <toolTipText value="TILT Up"/>
+                  <font name="Malgun Gothic" size="12" style="0"/>
+                  <text value="시나리오 다운로드"/>
                 </properties>
               </component>
-              <component id="e2bad" class="javax.swing.JButton" binding="btnPanTiltRightUp">
+              <component id="1d668" class="javax.swing.JButton" binding="btnTimeSync">
                 <constraints>
-                  <grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
-                    <minimum-size width="50" height="50"/>
-                    <preferred-size width="50" height="50"/>
-                    <maximum-size width="50" height="50"/>
-                  </grid>
+                  <grid row="3" column="0" 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="16" style="0"/>
-                  <horizontalTextPosition value="2"/>
-                  <text value=""/>
-                  <toolTipText value="PAN TILT Right Up"/>
+                  <font name="Malgun Gothic" size="12" style="0"/>
+                  <text value="시간 설정"/>
                 </properties>
               </component>
             </children>

+ 18 - 24
src/main/java/com/its/vms/ui/SubUI.java

@@ -34,19 +34,10 @@ public abstract class SubUI {
     private JPanel pnlControl;
     private JButton btnFocusIn;
     private JButton btnFocusOut;
-    private JButton btnZoomOut;
-    private JButton btnZoomIn;
+    private JButton btnSingnBoardOn;
+    private JButton btnSingnBoardOff;
     private JTextField txtName;
     private JTextField txtNmbr;
-    private JButton btnPanTiltLeftUp;
-    private JButton btnPanLeft;
-    private JButton btnPanTiltLeftDown;
-    private JButton btnTiltUp;
-    private JButton btnStop;
-    private JButton btnTiltDown;
-    private JButton btnPanTiltRightUp;
-    private JButton btnPanRight;
-    private JButton btnPanTiltRightDown;
     private JTextField txtPort;
     private JTextField txtIpAddr;
     private JTextField txtDoor;
@@ -55,8 +46,11 @@ public abstract class SubUI {
     private JTextField txtTemp;
     private JTextField txtState;
     private JButton btnLogClear;
-    private JSpinner spSpeed;
     private JTextField txtCtlrId;
+    private JButton btnReqStatus;
+    private JButton btnReqParam;
+    private JButton btnScnDnld;
+    private JButton btnTimeSync;
 
     protected abstract void actionButtonClicked();
 
@@ -275,18 +269,18 @@ public abstract class SubUI {
         final JPanel panel2 = new JPanel();
         panel2.setLayout(new GridLayoutManager(5, 1, new Insets(0, 0, 0, 0), -1, -1));
         pnlCtlr.add(panel2, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
-        btnZoomIn = new JButton();
-        Font btnZoomInFont = this.$$$getFont$$$("Malgun Gothic", Font.BOLD, 14, btnZoomIn.getFont());
-        if (btnZoomInFont != null) btnZoomIn.setFont(btnZoomInFont);
-        btnZoomIn.setText("Zoom (+)");
-        btnZoomIn.setToolTipText("ZOOM In");
-        panel2.add(btnZoomIn, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
-        btnZoomOut = new JButton();
-        Font btnZoomOutFont = this.$$$getFont$$$("Malgun Gothic", Font.BOLD, 14, btnZoomOut.getFont());
-        if (btnZoomOutFont != null) btnZoomOut.setFont(btnZoomOutFont);
-        btnZoomOut.setText("Zoom (-)");
-        btnZoomOut.setToolTipText("ZOOM Out");
-        panel2.add(btnZoomOut, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
+        btnSingnBoardOff = new JButton();
+        Font btnZoomInFont = this.$$$getFont$$$("Malgun Gothic", Font.BOLD, 14, btnSingnBoardOff.getFont());
+        if (btnZoomInFont != null) btnSingnBoardOff.setFont(btnZoomInFont);
+        btnSingnBoardOff.setText("Zoom (+)");
+        btnSingnBoardOff.setToolTipText("ZOOM In");
+        panel2.add(btnSingnBoardOff, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
+        btnSingnBoardOn = new JButton();
+        Font btnZoomOutFont = this.$$$getFont$$$("Malgun Gothic", Font.BOLD, 14, btnSingnBoardOn.getFont());
+        if (btnZoomOutFont != null) btnSingnBoardOn.setFont(btnZoomOutFont);
+        btnSingnBoardOn.setText("Zoom (-)");
+        btnSingnBoardOn.setToolTipText("ZOOM Out");
+        panel2.add(btnSingnBoardOn, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
         btnFocusIn = new JButton();
         Font btnFocusInFont = this.$$$getFont$$$("Malgun Gothic", Font.BOLD, 14, btnFocusIn.getFont());
         if (btnFocusInFont != null) btnFocusIn.setFont(btnFocusInFont);

+ 1 - 1
src/main/java/com/its/vms/xnettcp/vms/process/TcpServerRecvDataProcess.java

@@ -105,7 +105,7 @@ public class TcpServerRecvDataProcess {
                     response = new VmsResDisplayFormId(vmsObj, packet);
                     break;
                 case OP_VMS_UPLOAD_FORM_SCHEDULE:
-                    response = new VmsResUploadScheduleForm(vmsObj, packet);
+                    response = new VmsResUploadFormSchedule(vmsObj, packet);
                 default:
                     log.warn("TcpServerRecvDataProcess.process: Unknown Op Code Packet: VMS {}, {}", vmsObj.getVmsCtlrNmbr(), packet.getOpCode());
                     break;

+ 14 - 15
src/main/java/com/its/vms/xnettcp/vms/process/TcpServerSendDataProcess.java

@@ -2,7 +2,6 @@ package com.its.vms.xnettcp.vms.process;
 
 import com.its.vms.domain.NET;
 import com.its.vms.dto.TbVmsCtlrDto;
-import com.its.vms.xnettcp.vms.protocol.dto.VmsReqControlDto;
 import com.its.vms.xnettcp.vms.protocol.impl.*;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
@@ -92,24 +91,24 @@ public class TcpServerSendDataProcess {
                         result = this.vmsObj.sendData(reqDisplayFormId.getByteBuffer(), 10, reqDisplayFormId.getOpCodeDesc());
                         break;
                     case OP_VMS_UPLOAD_FORM_SCHEDULE:
-                        VmsReqUploadScheduleForm reqUploadScheduleFrom = new VmsReqUploadScheduleForm(this.vmsObj);
+                        VmsReqUploadFormSchedule reqUploadScheduleFrom = new VmsReqUploadFormSchedule(this.vmsObj);
                         result = this.vmsObj.sendData(reqUploadScheduleFrom.getByteBuffer(), 10, reqUploadScheduleFrom.getOpCodeDesc());
                         break;
 
                     case OP_VMS_STATUS_CONTROL:
-                        VmsReqControlDto control = (VmsReqControlDto) data.getData();
-                        byte[] command = control.getCommand();
-                        // TODO: 전송성공하면
-
-                        if (isRequested) {
-                            this.vmsObj.getModule().setOnOff(true);
-                            //this.vmsCtlr.getModule().setOnOff(command[0]);
-                        } else {
-                            int retry = this.vmsObj.getModule().getRetry();
-                            retry++;
-                            this.vmsObj.getModule().setRetry(retry);
-                            this.vmsObj.getModule().setOnOff(false);
-                        }
+                        VmsReqStatusControl statusControl = (VmsReqStatusControl) data.getData();
+                        result = this.vmsObj.sendData(statusControl.getByteBuffer(), 10, statusControl.getOpCodeDesc());
+//                        byte[] command = control.getCommand();
+//                        // TODO: 전송성공하면
+//                        if (isRequested) {
+//                            this.vmsObj.getModule().setOnOff(true);
+//                            //this.vmsCtlr.getModule().setOnOff(command[0]);
+//                        } else {
+//                            int retry = this.vmsObj.getModule().getRetry();
+//                            retry++;
+//                            this.vmsObj.getModule().setRetry(retry);
+//                            this.vmsObj.getModule().setOnOff(false);
+//                        }
                         break;
                     default:
                         break;

+ 3 - 3
src/main/java/com/its/vms/xnettcp/vms/process/response/impl/VmsResUploadScheduleForm.java → src/main/java/com/its/vms/xnettcp/vms/process/response/impl/VmsResUploadFormSchedule.java

@@ -12,7 +12,7 @@ import java.nio.ByteBuffer;
 
 @Slf4j
 @RequiredArgsConstructor
-public class VmsResUploadScheduleForm implements VmsResponse {
+public class VmsResUploadFormSchedule implements VmsResponse {
 
     private final TbVmsCtlrDto vmsObj;
     private final VmsFramePacket resFramePacket;
@@ -23,9 +23,9 @@ public class VmsResUploadScheduleForm implements VmsResponse {
     public boolean process() {
 
         byte[] body = this.resFramePacket.getBody();
-        log.info("VmsResUploadScheduleForm.process: VMS {}, body length: {} ", this.vmsObj.getVmsCtlrNmbr(), body != null ? body.length : 0);
+        log.info("VmsResUploadFormSchedule.process: VMS {}, body length: {} ", this.vmsObj.getVmsCtlrNmbr(), body != null ? body.length : 0);
         if (body == null || body.length < 30) {
-            log.error("VmsResUploadScheduleForm.process: VMS {}, body length error: {} ", this.vmsObj.getVmsCtlrNmbr(), body != null ? body.length : 0);
+            log.error("VmsResUploadFormSchedule.process: VMS {}, body length error: {} ", this.vmsObj.getVmsCtlrNmbr(), body != null ? body.length : 0);
             return false;
         }
 

+ 0 - 20
src/main/java/com/its/vms/xnettcp/vms/protocol/dto/VmsReqControlDto.java

@@ -1,20 +0,0 @@
-package com.its.vms.xnettcp.vms.protocol.dto;
-
-import com.its.vms.domain.enums.eVmsReqControl;
-import lombok.Data;
-
-import java.io.Serializable;
-
-@Data
-public class VmsReqControlDto implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    private eVmsReqControl control;
-    private byte[] command;
-
-    public VmsReqControlDto(eVmsReqControl control, byte[] command) {
-        this.control = control;
-        this.command = command;
-    }
-
-}

+ 58 - 0
src/main/java/com/its/vms/xnettcp/vms/protocol/impl/VmsReqDataUpload.java

@@ -0,0 +1,58 @@
+package com.its.vms.xnettcp.vms.protocol.impl;
+
+import com.its.vms.dto.TbVmsCtlrDto;
+import com.its.vms.xnettcp.vms.protocol.VmsFramePacket;
+import com.its.vms.xnettcp.vms.protocol.VmsReqFramePacket;
+import com.its.vms.xnettcp.vms.protocol.enums.eVmsFileSaveLocation;
+import com.its.vms.xnettcp.vms.protocol.enums.eVmsOpCode;
+import com.its.vms.xnettcp.vms.protocol.impl.dle.VmsDleFramePacket;
+import lombok.extern.slf4j.Slf4j;
+
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+
+/**
+ * Data Upload 요청
+ */
+@Slf4j
+public class VmsReqDataUpload implements VmsReqFramePacket {
+
+    private VmsFramePacket framePacket;
+
+    public VmsReqDataUpload(TbVmsCtlrDto vmsObj, eVmsFileSaveLocation saveLoc, String fileName) {
+        if (vmsObj.getProtocolVer() == 0) {
+            this.framePacket = new VmsDleFramePacket(vmsObj.getGroupNo().intValue(), vmsObj.getCtlrLocalNo(), (byte)eVmsOpCode.OP_VMS_DATA_UPLOAD.getValue());
+        }
+        makeBody(saveLoc, fileName);
+    }
+
+    public void makeBody(eVmsFileSaveLocation saveLoc, String fileName) {
+//        Download Data 저장 위치 Code   1
+//        파일명 길이                    1
+//        기타                           1
+//        저장할 파일명                  n
+        int fileNameSize = fileName.length();
+        int bodySize = 3 + fileNameSize;
+        log.info("VmsReqDataUpload.makeBody: bodySize {}", bodySize);
+        ByteBuffer byteBuffer = ByteBuffer.allocate(bodySize);
+        byteBuffer.order(ByteOrder.BIG_ENDIAN);
+
+        byteBuffer.put((byte)(saveLoc.getValue() & 0xFF));
+        byteBuffer.put((byte)(fileNameSize & 0xFF));
+        byteBuffer.put((byte)0x00);
+        byteBuffer.put(fileName.getBytes());
+
+        this.framePacket.setBody(byteBuffer.array());
+    }
+
+    @Override
+    public ByteBuffer getByteBuffer() {
+        return this.framePacket.getByteBuffer();
+    }
+
+    @Override
+    public String getOpCodeDesc() {
+        return this.framePacket.getOpCodeDesc();
+    }
+
+}

+ 3 - 3
src/main/java/com/its/vms/xnettcp/vms/protocol/impl/VmsReqUploadScheduleForm.java → src/main/java/com/its/vms/xnettcp/vms/protocol/impl/VmsReqUploadFormSchedule.java

@@ -9,13 +9,13 @@ import com.its.vms.xnettcp.vms.protocol.impl.dle.VmsDleFramePacket;
 import java.nio.ByteBuffer;
 
 /**
- * Upload Schedule Form 요청
+ * Upload Form Schedule 요청
  */
-public class VmsReqUploadScheduleForm implements VmsReqFramePacket {
+public class VmsReqUploadFormSchedule implements VmsReqFramePacket {
 
     private VmsFramePacket framePacket;
 
-    public VmsReqUploadScheduleForm(TbVmsCtlrDto vmsObj) {
+    public VmsReqUploadFormSchedule(TbVmsCtlrDto vmsObj) {
         if (vmsObj.getProtocolVer() == 0) {
             this.framePacket = new VmsDleFramePacket(vmsObj.getGroupNo().intValue(), vmsObj.getCtlrLocalNo(), (byte)eVmsOpCode.OP_VMS_UPLOAD_FORM_SCHEDULE.getValue());
         }

+ 23 - 0
src/main/resources/mybatis/mapper/VmsSymbMapper.xml

@@ -44,4 +44,27 @@
         ]]>
     </select>
 
+    <select id="selectVmsSymbol" resultType="com.its.vms.entity.TbVmsSymbIfsc" fetchSize="200">
+    <![CDATA[
+        select a.vms_ctlr_nmbr as vmsCtlrNmbr,
+               b.symb_lib_nmbr as symbLibNmbr,
+               min(c.updt_dt)  as updtDt
+        from (select vms_ctlr_nmbr, vms_form_id
+              from tb_vms_dspl_sch
+              group by vms_ctlr_nmbr, vms_form_id) a,
+             (select vms_form_id, symb_lib_nmbr
+              from tb_vms_form_object
+              where vms_form_object_type_cd in (1, 2, 17, 27, 37, 47, 406, 407, 408)
+              group by vms_form_id, symb_lib_nmbr) b,
+             (select symb_lib_nmbr, updt_dt
+              from tb_vms_symb_lib
+              where symb_type in ('SBT0', 'SBT2', 'SBT4')) c
+        where a.vms_form_id = b.vms_form_id
+          and b.symb_lib_nmbr = c.symb_lib_nmbr
+        group by a.vms_ctlr_nmbr, b.symb_lib_nmbr
+        order by a.vms_ctlr_nmbr, b.symb_lib_nmbr
+    ]]>
+    </select>
+
+
 </mapper>