|
|
|
@ -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<>();
|
|
|
|
|
|
|
|
|
|
|
|
|