|
|
@ -1,6 +1,8 @@ |
|
|
|
package com.iflytop.digester; |
|
|
|
import com.iflytop.digester.deviceinstance.Device; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.boot.ApplicationArguments; |
|
|
|
import org.springframework.boot.ApplicationRunner; |
|
|
@ -9,6 +11,9 @@ import org.springframework.stereotype.Component; |
|
|
|
@Order(2) |
|
|
|
@Component |
|
|
|
public class DigesterApplicationRunner implements ApplicationRunner { |
|
|
|
// logger |
|
|
|
public static final Logger LOG = LoggerFactory.getLogger(DigesterApplicationRunner.class); |
|
|
|
|
|
|
|
@Resource |
|
|
|
private Device device; |
|
|
|
@Value("${app.opencv-library-path}") |
|
|
@ -20,9 +25,15 @@ public class DigesterApplicationRunner implements ApplicationRunner { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void run(ApplicationArguments args) throws Exception { |
|
|
|
LOG.info("[APP] loading : {}", this.opencvLibraryPath); |
|
|
|
System.load(this.opencvLibraryPath); |
|
|
|
|
|
|
|
LOG.info("[APP] loading : {}", this.pylonLibraryPath); |
|
|
|
System.load(this.pylonLibraryPath); |
|
|
|
|
|
|
|
LOG.info("[APP] loading : {}", this.pylonWrapperPath); |
|
|
|
System.load(this.pylonWrapperPath); |
|
|
|
|
|
|
|
this.device.liquidAddition.setup(); |
|
|
|
DigestionTaskTheadManager.getInstance().setup(); |
|
|
|
} |
|
|
|