提交 | 用户 | 时间
|
ce910c
|
1 |
package com.iailab.module.data.dev.dahua; |
H |
2 |
|
|
3 |
import com.netsdk.lib.ToolKits; |
|
4 |
|
|
5 |
import java.io.File; |
|
6 |
import java.io.IOException; |
|
7 |
import java.util.Date; |
|
8 |
|
|
9 |
/** |
|
10 |
* @author PanZhibao |
|
11 |
* @Description |
|
12 |
* @createTime 2024年03月06日 |
|
13 |
*/ |
|
14 |
public class DHSavePath { |
|
15 |
|
|
16 |
private DHSavePath() {} |
|
17 |
|
|
18 |
private static DHSavePath instance = new DHSavePath(); |
|
19 |
|
1432cd
|
20 |
public final static String capturePath = "D:/irs/Capture/"; |
ce910c
|
21 |
|
1432cd
|
22 |
public final static String modelPath = "D:/irs/Model/"; |
ce910c
|
23 |
|
H |
24 |
public final static String capturePathUbuntu = "/home/dell/DLUT/irs/Capture/"; |
|
25 |
|
|
26 |
public final static String modelPathUbuntu = "/home/dell/DLUT/irs/Model/"; |
|
27 |
|
|
28 |
public static DHSavePath getSavePath() { |
|
29 |
return instance; |
|
30 |
} |
|
31 |
|
|
32 |
/** |
|
33 |
* 设置抓图保存路径 |
|
34 |
* |
|
35 |
* @return |
|
36 |
*/ |
|
37 |
public String getSaveCapturePath(String channel, Date curDate) { |
|
38 |
File path1 = new File(capturePath); |
|
39 |
if (!path1.exists()) { |
|
40 |
path1.mkdir(); |
|
41 |
} |
|
42 |
|
|
43 |
File path2 = new File(capturePath + ToolKits.getDay() + "/" + channel + "/"); |
|
44 |
if (!path2.exists()) { |
|
45 |
path2.mkdirs(); |
|
46 |
} |
|
47 |
|
|
48 |
String strFileName = path2.getAbsolutePath() + "/" + ToolKits.getDate(curDate) + ".jpg"; |
|
49 |
|
|
50 |
return strFileName; |
|
51 |
} |
|
52 |
|
|
53 |
/** |
|
54 |
* 设置模型输出图片保存路径 |
|
55 |
* |
|
56 |
* @param cameraCode |
|
57 |
* @param curDate |
|
58 |
* @return |
|
59 |
*/ |
|
60 |
public String getSaveModelPath(String cameraCode, Date curDate) throws IOException { |
|
61 |
// File path1 = new File(modelPath); |
|
62 |
// if (!path1.exists()) { |
|
63 |
// path1.mkdir(); |
|
64 |
// } |
|
65 |
|
|
66 |
File path2 = new File(modelPath + ToolKits.getDay() + "/" + cameraCode + "/"); |
|
67 |
// if (!path2.exists()) { |
|
68 |
// path2.mkdirs(); |
|
69 |
// } |
|
70 |
//return path2.getAbsolutePath() + "/"; |
|
71 |
return path2.getAbsolutePath(); |
|
72 |
} |
|
73 |
} |