Browse Source

应用启动初始化时清空设备状态

master
sige 1 year ago
parent
commit
cdc9b72653
  1. 11
      src/src/main/java/com/my/graphiteDigesterBg/MyApplicationRunner.java

11
src/src/main/java/com/my/graphiteDigesterBg/MyApplicationRunner.java

@ -1,4 +1,6 @@
package com.my.graphiteDigesterBg;
import com.my.graphiteDigesterBg.diframe.DiDevice;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
@ -10,8 +12,17 @@ public class MyApplicationRunner implements ApplicationRunner {
@Value("${opencv.library-path}")
private String opencvLibraryPath;
@Resource
private DiDevice device;
@Override
public void run(ApplicationArguments args) throws Exception {
System.load(this.opencvLibraryPath);
var runtimeVars = this.device.getRuntimeVariables();
runtimeVars.remove("IsDeviceReady");
runtimeVars.remove("IsTaskStartResetExecuting");
runtimeVars.remove("TaskStartResetMessage");
runtimeVars.remove("StatusMessage");
}
}
Loading…
Cancel
Save