Compare commits

..

2 Commits

Author SHA1 Message Date
LAPTOP-S9HJSOEB\昊天 9b3360404e no message 1 month ago
LAPTOP-S9HJSOEB\昊天 9f92084490 修改一部分无意义的逻辑 1 month ago

@ -22,8 +22,6 @@ import com.zhehekeji.web.service.sick.SickSocket;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.opencv.core.Mat;
import org.opencv.imgcodecs.Imgcodecs;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;

@ -6,9 +6,12 @@ import com.sun.jna.ptr.PointerByReference;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -21,6 +24,30 @@ public class LxPointCloudSaveImage {
public static DcLibrary INSTANCER = (DcLibrary) Native.loadLibrary((System.getProperty("user.dir"))+"\\libs\\lx\\LxCameraApi.dll", DcLibrary.class); public static DcLibrary INSTANCER = (DcLibrary) Native.loadLibrary((System.getProperty("user.dir"))+"\\libs\\lx\\LxCameraApi.dll", DcLibrary.class);
static Map<String ,DcLibrary> instanceMap = new ConcurrentHashMap<>();
public static boolean copyFileIfNotExists(String sourcePath, String destinationPath) {
Path destPath = Paths.get(destinationPath);
// 检查目标文件是否存在
if (Files.exists(destPath)) {
System.out.println("文件已存在: " + destinationPath);
return false;
}
try {
// 创建父目录(如果不存在)
Files.createDirectories(destPath.getParent());
// 复制文件
Files.copy(Paths.get(sourcePath), destPath, StandardCopyOption.REPLACE_EXISTING);
System.out.println("文件复制成功: " + sourcePath + " -> " + destinationPath);
return true;
} catch (IOException e) {
System.err.println("文件复制失败: " + e.getMessage());
return false;
}
}
// 设备句柄映射 // 设备句柄映射
static Map<String, DeviceInfo> handleMap = new ConcurrentHashMap<>(); static Map<String, DeviceInfo> handleMap = new ConcurrentHashMap<>();

Loading…
Cancel
Save