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

+ 5 - 1
src/main/resources/static/application/op/09.cros/01.system/03.analysis-monitoring/analysis-monitoring.css

@@ -12,7 +12,7 @@ body{
     padding: 10px;
     width: calc(100% - 20px);
     height: calc(100% - 20px);
-    min-width: 800px;
+    min-width: 1500px;
     min-height: 640px;
 }
 
@@ -66,6 +66,10 @@ body{
     height: calc(100%  - 26px);
     background-color: black;
 }
+#video{
+    width: 100%;
+    height: 100%;
+}
 .top-section{
     width: 100%;
     height: calc(100% - 246px);

+ 1 - 1
src/main/resources/static/application/op/09.cros/01.system/03.analysis-monitoring/analysis-monitoring.html

@@ -37,7 +37,7 @@
                             카메라 영상 <span class="list-title ml-3"></span>
                         </div>
                         <div class="video-box">
-                            <video src=""></video>
+                            <video id="video" style="width: 100%; height: 100%;"></video>
                         </div>
                     </div>
                     <div class="right-section">

+ 2 - 2
src/main/resources/static/application/op/09.cros/01.system/03.analysis-monitoring/analysis-monitoring.js

@@ -319,7 +319,6 @@ function recvCdData(jsonData){
 function recvListData(jsonData){
     _listData = jsonData;
     if (_listData.length > 0) {
-        console.log(_listData);
         _listData.map((item)=>{
             if (item.ixr_id && item.ixr_nm) {
                 item.desc = "[" + item.ixr_id + "] " + item.ixr_nm;
@@ -342,7 +341,8 @@ function listDblClick(data){
     if (data) {
         $('.list-title').text(' - ' + data.desc);
         $('.video-box').empty();
-        webRtcConnector(data, $('.video-box'), 'video1', false);
+        $('.video-box').append($('<video id="video" autoplay playsinline muted></video>'))
+        webRtcConnector(data, $('.video-box'), 'video', false);
         let now = new Date();
         let fromDt = getSendDate(now).substring(0,8) + '000000';
         let toDt = getSendDate(now).substring(0,8) + '235959';

+ 202 - 0
src/test/java/com/its/op/UtilTest.java

@@ -0,0 +1,202 @@
+package com.its.op;
+
+import lombok.*;
+import org.junit.jupiter.api.Test;
+import org.springframework.test.context.ActiveProfiles;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Optional;
+import java.util.function.*;
+import java.util.stream.Stream;
+
+@ActiveProfiles(profiles = "dev")
+public class UtilTest {
+
+    @Test
+    void test1() {
+        ZonedDateTime a = ZonedDateTime.now();
+        System.out.println(a);
+
+        ZonedDateTime i = ZonedDateTime.now(ZoneId.of("UTC"));
+        System.out.println(i);
+
+        LocalDateTime b = LocalDateTime.now();
+        System.out.println(b);
+
+        ZonedDateTime c = LocalDateTime.now().atZone(ZoneId.of("UTC"));
+        System.out.println(c);
+
+        String d = "2023-02-15 15:12:14";
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        LocalDateTime e = LocalDateTime.parse(d, formatter);
+        ZonedDateTime f = LocalDateTime.parse(d, formatter).atZone(ZoneId.of("Asia/Seoul"));
+        System.out.println(e);
+        System.out.println(f);
+
+        ZonedDateTime g = f.withZoneSameInstant(ZoneId.of("UTC"));
+        System.out.println("g : " + g);
+
+        LocalDateTime h = c.toLocalDateTime();
+        System.out.println(h);
+    }
+
+    @Test
+    void test2() {
+        double plusDoubleValue = 0;
+        for (int i = 0; i < 100; i++) {
+            plusDoubleValue += 0.1;
+        }
+        double multipleDoubleValue = 0.1 * 100;
+        System.out.println("double plusValue : " + plusDoubleValue);
+        System.out.println("double multipleValue : " + multipleDoubleValue);
+
+        float plusFloatValue = 0;
+        for (int i = 0; i < 100; i++) {
+            plusFloatValue += 0.1;
+        }
+        float multipleFloatValue = 0.1f * 100;
+        System.out.println("float plusValue : " + plusFloatValue);
+        System.out.println("float multipleValue : " + multipleFloatValue);
+
+        BigDecimal plusBigDecimal = new BigDecimal("0");
+        for (int i = 0; i < 100; i++) {
+            plusBigDecimal = plusBigDecimal.add(new BigDecimal("0.1"));
+        }
+        BigDecimal multipleBigDecimal = new BigDecimal("10.0");
+
+        System.out.println("BigDecimal plusBigDecimal : " + plusBigDecimal);
+        System.out.println("BigDecimal multipleBigDecimal : " + multipleBigDecimal);
+    }
+
+    @FunctionalInterface // 함수형 인터페이스 요건에 맞지 않으면 에러가 발생
+    public interface CustomFunctionalInterface {
+
+        void called(String message, String data);
+
+        default void printHello() {
+            System.out.println("Hello Around Hub!");
+        }
+    }
+
+    @Test
+    void test3() {
+        CustomFunctionalInterface customInterface = (message, data) -> System.out.println(message + " ===> " + data);
+
+        String message = "Hello! Around Hub Studio";
+        customInterface.called(message, "dddd");
+
+        customInterface.printHello();
+
+        Predicate<Integer> greaterThanTen = (num) -> num > 10;
+        Predicate<Integer> lessThanTwenty = (num) -> num < 20;
+
+        Predicate<Integer> betweenTenAndTwenty = greaterThanTen.and(lessThanTwenty);
+        boolean result = betweenTenAndTwenty.test(15);
+        System.out.println(result); // true
+
+        Predicate<Integer> equalsCount = (count) -> count.equals(50);
+        System.out.println(equalsCount.test(50));
+        System.out.println(equalsCount.test(20));
+
+        Supplier<String> getMessage = () -> "Around Hub Studio!";
+        System.out.println(getMessage.get());
+
+        // param, result
+        Function<String, Integer> function = (msg) -> msg.length();//"Message : " + msg;
+        System.out.println(function.apply("Around Hub Studio!"));
+
+        // param1, param2, result
+        BiFunction<String, Integer, String> biFunction = (msg, count) -> {
+            int resultCount = count + 10;
+            return "Message : " + msg + ", Count : " + resultCount;
+        };
+
+        System.out.println(biFunction.apply("Around Hub Studio!", 5));
+
+        Consumer<String> print = (msg) -> System.out.println("Message : " + msg);
+        print.accept("Around Hub Studio!----------");
+    }
+
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @Getter
+    @Setter
+    @ToString
+    public class SampleObject {
+        private String name;
+        private String age;
+        private String organization;
+    }
+
+    private SampleObject getNullObject() {
+        return null;
+    }
+
+    private SampleObject getObject() {
+        return new SampleObject("flature", "10", "Around Hub Studio");
+    }
+
+    @Test
+    void test4() {
+        // filter
+        Optional<SampleObject> sampleObject1 = Optional.of(getObject())
+                .filter(object -> object.getName().equals("flature"));
+        System.out.println(sampleObject1.get());
+
+        Optional<SampleObject> sampleObject2 = Optional.of(getObject())
+                .filter(object -> object.getName().equals("flature123"));
+        System.out.println(sampleObject2.isPresent());
+
+        // map
+        Optional<String> StringObject1 = Optional.of(getObject())
+                .map(sampleObject -> sampleObject.getName());
+        System.out.println(StringObject1.get());
+
+        // ifPresent
+        Optional.of(getObject())
+                .ifPresent(object -> System.out.println(object));
+
+        // ifPresentOrElse
+//        Optional.ofNullable(getNullObject())
+//                .ifPresent(object -> {
+//                                System.out.println(object);
+//                            }, () -> {
+//                            System.out.println("null object");
+//                            }
+//                        );
+
+        // isPresent
+        if (Optional.ofNullable(getObject()).isPresent()) {
+            System.out.println("is present!");
+        }
+
+
+        // get
+        Optional<SampleObject> sampleObject3 = Optional.of(getObject());
+        System.out.println(sampleObject3.get());
+
+        // orElse : 값이 있어도 실행됨
+        SampleObject sampleObject4 = Optional.ofNullable(getNullObject())
+                .orElse(new SampleObject("flature123", "around hub", "12"));
+        System.out.println(sampleObject4);
+
+        // orElseGet : supplier 를 인자로 받음, 값이 없을 때만 실행됨
+        SampleObject sampleObject5 = Optional.ofNullable(getNullObject())
+                .orElseGet(() -> new SampleObject("flature1234", "Around Hub", "14"));
+        System.out.println(sampleObject5);
+    }
+
+    @Test
+    void test5() {
+        Stream<Integer> stream1 = Stream.of(1, 2, 3);
+        Stream<Integer> stream2 = Stream.of(4, 5, 6);
+        Stream<Integer> concat = Stream.concat(stream1, stream2);
+
+        concat.filter(val -> (val % 2) == 0)
+                .forEach(System.out::println);
+    }
+}