shjung пре 2 година
родитељ
комит
3d5508232e

+ 5 - 4
src/main/java/com/its/cctv/CctvCommServerApplication.java

@@ -15,6 +15,7 @@ import com.its.cctv.xnettcp.cctv.process.CctvDataProcess;
 import com.its.cctv.xnettcp.cctvserver.CctvTcpServerService;
 import com.its.cctv.xnettcp.center.CenterTcpServerService;
 import lombok.extern.slf4j.Slf4j;
+import org.checkerframework.checker.guieffect.qual.UI;
 import org.springframework.beans.factory.DisposableBean;
 import org.springframework.beans.factory.InitializingBean;
 import org.springframework.boot.Banner;
@@ -100,11 +101,11 @@ public class CctvCommServerApplication implements CommandLineRunner, Application
     @Override
     public void run(String... args) throws Exception {
         if (OS.isWindows()) {
+            String sysTime = SysUtils.getSysTimeStr();
+            //JFrame.setDefaultLookAndFeelDecorated(true);
+            JFrame frame = new JFrame("CCTV 통신 서버 - [" + sysTime + "]");
+            MainUI UI = new MainUI(frame);
             SwingUtilities.invokeLater(() -> {
-                String sysTime = SysUtils.getSysTimeStr();
-                //JFrame.setDefaultLookAndFeelDecorated(true);
-                JFrame frame = new JFrame("CCTV 통신 서버 - [" + sysTime + "]");
-                MainUI UI = new MainUI(frame);
                 try {
                     ClassPathResource file = new ClassPathResource("static/image/application.png");
                     URL imgURL = file.getURL();

+ 12 - 1
src/main/java/com/its/cctv/xnettcp/cctv/protocol/CctvReqPtzCtrl.java

@@ -94,7 +94,18 @@ public class CctvReqPtzCtrl extends CctvReqFramePacket {
         if (focusSped >= 0x40) {
             focusSped = 0x3F;    // 63
         }
-        byte ptz = (byte)((pan & 0xFF) << 6 | (tilt& 0xFF) << 4 | (zoom & 0xFF) << 2 | (focus & 0xFF));
+        //        zoom in ---> tilt up
+        //        zoom out ---> tilt down
+        //        focus in ---> pan left
+        //        focus out ---> pan right
+        //        tilt up ---> zoom in
+        //        tilt down ---> zoom out
+        //        pan left ---> focus in
+        //        pan right ---> foucs out
+
+
+        //byte ptz = (byte)((pan & 0xFF) << 6 | (tilt & 0xFF) << 4 | (zoom & 0xFF) << 2 | (focus & 0xFF));
+        byte ptz = (byte)((focus & 0xFF) << 6 | (zoom & 0xFF) << 4 | (tilt & 0xFF) << 2 | (pan & 0xFF));
         this.body[0] = ptz;
         this.body[1] = panSped;
         this.body[2] = tiltSped;