|
@@ -12,6 +12,7 @@ import com.persagy.cameractl.model.Camera;
|
|
|
import com.persagy.cameractl.model.Channel;
|
|
|
import com.persagy.cameractl.model.NvrSceneRelation;
|
|
|
import com.persagy.cameractl.model.SceneConfig;
|
|
|
+import com.persagy.cameractl.service.socket.TclSocketClient;
|
|
|
import com.persagy.cameractl.utils.OtherTools;
|
|
|
import com.persagy.cameractl.utils.ResultClass;
|
|
|
import com.persagy.vsknet.structure.CurShowDevEx;
|
|
@@ -28,6 +29,7 @@ import com.sun.jna.platform.win32.WinDef.UINT;
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.util.BooleanUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
/**
|
|
@@ -39,11 +41,34 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
*/
|
|
|
@Slf4j
|
|
|
public class Nvr9CameraExecuteApi {
|
|
|
-
|
|
|
+
|
|
|
/** 当前登陆者 */
|
|
|
private UINT login_id;
|
|
|
|
|
|
+ /**
|
|
|
+ * 切换场景
|
|
|
+ *
|
|
|
+ * @param sceneConfig
|
|
|
+ * @return
|
|
|
+ * @date 2021年10月27日 下午6:01:38
|
|
|
+ */
|
|
|
+ public ResultClass transitionScene(SceneConfig sceneConfig) {
|
|
|
+ if (sceneConfig.getGroup() <= 0 || sceneConfig.getScene() <= 0) {
|
|
|
+ return this.executeErr(false, null, "非法场景参数");
|
|
|
+ }
|
|
|
+
|
|
|
+ TclSocketClient.connectAndSend(NVR9Config.tclIp, NVR9Config.tclPort,
|
|
|
+ StrUtil.format(TclSocketClient.COMMAND, sceneConfig.getGroup(), sceneConfig.getScene()));
|
|
|
+ return this.executeSuccess(false, "场景已切换");
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 轮询设置
|
|
|
+ *
|
|
|
+ * @param sceneConfig
|
|
|
+ * @return
|
|
|
+ * @date 2021年10月27日 下午6:01:31
|
|
|
+ */
|
|
|
public ResultClass lunx(SceneConfig sceneConfig) {
|
|
|
List<Channel> channels = sceneConfig.getChannels();
|
|
|
for (Channel channel : channels) {
|
|
@@ -472,5 +497,5 @@ public class Nvr9CameraExecuteApi {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|