Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

597 wiersze
22 KiB

  1. package com.netsdk.demo.frame.FaceRecognition;
  2. import java.awt.BorderLayout;
  3. import java.awt.Dimension;
  4. import java.awt.EventQueue;
  5. import java.awt.FlowLayout;
  6. import java.awt.event.ActionEvent;
  7. import java.awt.event.ActionListener;
  8. import java.awt.event.WindowAdapter;
  9. import java.awt.event.WindowEvent;
  10. import java.io.IOException;
  11. import java.io.UnsupportedEncodingException;
  12. import java.util.Vector;
  13. import java.util.concurrent.ExecutionException;
  14. import javax.swing.DefaultComboBoxModel;
  15. import javax.swing.JButton;
  16. import javax.swing.JCheckBox;
  17. import javax.swing.JComboBox;
  18. import javax.swing.JDialog;
  19. import javax.swing.JLabel;
  20. import javax.swing.JOptionPane;
  21. import javax.swing.JPanel;
  22. import javax.swing.JProgressBar;
  23. import javax.swing.JScrollPane;
  24. import javax.swing.JTextArea;
  25. import javax.swing.JTextField;
  26. import javax.swing.SwingUtilities;
  27. import javax.swing.SwingWorker;
  28. import com.sun.jna.Memory;
  29. import com.sun.jna.Pointer;
  30. import com.netsdk.common.DateChooserJButtonEx;
  31. import com.netsdk.common.PaintPanel;
  32. import com.netsdk.common.Res;
  33. import com.netsdk.demo.module.LoginModule;
  34. import com.netsdk.demo.module.SearchByPictureModule;
  35. import com.netsdk.lib.NetSDKLib;
  36. import com.netsdk.lib.ToolKits;
  37. import com.netsdk.lib.NetSDKLib.*;
  38. public class SearchByPicDialog extends JDialog {
  39. /**
  40. *
  41. */
  42. private static final long serialVersionUID = 1L;
  43. private Vector<String> chnList = new Vector<String>();
  44. private Memory memory = null;
  45. private static volatile int nProgress = 0; // 设备处理进度
  46. private static volatile int nCount = 0;
  47. public SearchByPicDialog() {
  48. setTitle(Res.string().getSearchByPic());
  49. setLayout(new BorderLayout());
  50. setModal(true);
  51. pack();
  52. setSize(780, 550);
  53. setResizable(false);
  54. setLocationRelativeTo(null);
  55. setDefaultCloseOperation(DISPOSE_ON_CLOSE); // 释放窗体
  56. JPanel panel = new JPanel();
  57. progressBar = new JProgressBar(0, 100);
  58. Dimension dimension = new Dimension();
  59. dimension.height = 18;
  60. progressBar.setPreferredSize(dimension);
  61. progressBar.setStringPainted(true);
  62. add(panel, BorderLayout.CENTER);
  63. add(progressBar, BorderLayout.SOUTH);
  64. ////////
  65. panel.setLayout(new BorderLayout());
  66. SearchPicConditionPanel searchPicConditionPanel = new SearchPicConditionPanel();
  67. searchPicInfoTextArea = new JTextArea();
  68. Dimension dimension1 = new Dimension();
  69. dimension1.width = 220;
  70. searchPicConditionPanel.setPreferredSize(dimension1);
  71. panel.add(searchPicConditionPanel, BorderLayout.WEST);
  72. panel.add(new JScrollPane(searchPicInfoTextArea), BorderLayout.CENTER);
  73. addWindowListener(new WindowAdapter() {
  74. public void windowClosing(WindowEvent e) {
  75. dispose();
  76. }
  77. });
  78. }
  79. private class SearchPicConditionPanel extends JPanel {
  80. /**
  81. *
  82. */
  83. private static final long serialVersionUID = 1L;
  84. public SearchPicConditionPanel() {
  85. setLayout(new BorderLayout());
  86. JPanel panelNorth = new JPanel();
  87. JPanel panelSouth = new JPanel();
  88. add(panelNorth, BorderLayout.NORTH);
  89. add(panelSouth, BorderLayout.SOUTH);
  90. ////////
  91. searchPicPanel = new PaintPanel();
  92. JButton selectPicBtn = new JButton(Res.string().getSelectPicture());
  93. JButton downloadBtn = new JButton(Res.string().getDownloadQueryPicture());
  94. searchPicPanel.setPreferredSize(new Dimension(210, 270));
  95. selectPicBtn.setPreferredSize(new Dimension(210, 20));
  96. downloadBtn.setPreferredSize(new Dimension(210, 20));
  97. panelNorth.setLayout(new FlowLayout());
  98. panelNorth.setPreferredSize(new Dimension(210, 330));
  99. panelNorth.add(searchPicPanel);
  100. panelNorth.add(selectPicBtn);
  101. panelNorth.add(downloadBtn);
  102. /////
  103. faceCheckBox = new JCheckBox(Res.string().getFaceLibrary());
  104. historyCheckBox = new JCheckBox(Res.string().getHistoryLibrary());
  105. faceCheckBox.setPreferredSize(new Dimension(100, 20));
  106. historyCheckBox.setPreferredSize(new Dimension(100, 20));
  107. startTimeLabel = new JLabel(Res.string().getStartTime(), JLabel.CENTER);
  108. endTimeLabel = new JLabel(Res.string().getEndTime(), JLabel.CENTER);
  109. chnLabel = new JLabel(Res.string().getChannel(), JLabel.CENTER);
  110. JLabel similaryLabel = new JLabel(Res.string().getSimilarity(), JLabel.CENTER);
  111. Dimension dimension1 = new Dimension();
  112. dimension1.width = 80;
  113. dimension1.height = 20;
  114. startTimeLabel.setPreferredSize(dimension1);
  115. endTimeLabel.setPreferredSize(dimension1);
  116. chnLabel.setPreferredSize(dimension1);
  117. similaryLabel.setPreferredSize(dimension1);
  118. startTimeBtn = new DateChooserJButtonEx("2018-11-07");
  119. endTimeBtn = new DateChooserJButtonEx();
  120. chnComboBox = new JComboBox();
  121. for(int i = 1; i < LoginModule.m_stDeviceInfo.byChanNum + 1; i++) {
  122. chnList.add(Res.string().getChannel() + " " + String.valueOf(i));
  123. }
  124. // 登陆成功,将通道添加到控件
  125. chnComboBox.setModel(new DefaultComboBoxModel(chnList));
  126. similaryTextField = new JTextField("60", JTextField.CENTER);
  127. Dimension dimension2 = new Dimension();
  128. dimension2.width = 120;
  129. dimension2.height = 20;
  130. startTimeBtn.setPreferredSize(dimension2);
  131. endTimeBtn.setPreferredSize(dimension2);
  132. chnComboBox.setPreferredSize(dimension2);
  133. similaryTextField.setPreferredSize(dimension2);
  134. searchPicBtn = new JButton(Res.string().getSearch());
  135. searchPicBtn.setPreferredSize(new Dimension(210, 20));
  136. panelSouth.setLayout(new FlowLayout());
  137. panelSouth.setPreferredSize(new Dimension(210, 160));
  138. panelSouth.add(faceCheckBox);
  139. panelSouth.add(historyCheckBox);
  140. panelSouth.add(startTimeLabel);
  141. panelSouth.add(startTimeBtn);
  142. panelSouth.add(endTimeLabel);
  143. panelSouth.add(endTimeBtn);
  144. panelSouth.add(chnLabel);
  145. panelSouth.add(chnComboBox);
  146. panelSouth.add(similaryLabel);
  147. panelSouth.add(similaryTextField);
  148. panelSouth.add(searchPicBtn);
  149. historyCheckBox.setSelected(true);
  150. faceCheckBox.setSelected(false);
  151. // 选择图片,获取图片的信息
  152. selectPicBtn.addActionListener(new ActionListener() {
  153. @Override
  154. public void actionPerformed(ActionEvent arg0) {
  155. String picPath = "";
  156. // 选择图片,获取图片路径,并在界面显示
  157. picPath = ToolKits.openPictureFile(searchPicPanel);
  158. if(!picPath.equals("")) {
  159. try {
  160. memory = ToolKits.readPictureFile(picPath);
  161. } catch (IOException e) {
  162. // TODO Auto-generated catch block
  163. e.printStackTrace();
  164. }
  165. }
  166. }
  167. });
  168. downloadBtn.addActionListener(new ActionListener() {
  169. @Override
  170. public void actionPerformed(ActionEvent arg0) {
  171. DownloadPictureDialog dialog = new DownloadPictureDialog();
  172. dialog.setVisible(true);
  173. }
  174. });
  175. searchPicBtn.addActionListener(new ActionListener() {
  176. @Override
  177. public void actionPerformed(ActionEvent arg0) {
  178. SwingUtilities.invokeLater(new Runnable() {
  179. @Override
  180. public void run() {
  181. searchPicBtn.setEnabled(false);
  182. progressBar.setValue(0);
  183. searchPicInfoTextArea.setText("");
  184. }
  185. });
  186. searchByPicture();
  187. }
  188. });
  189. faceCheckBox.addActionListener(new ActionListener() {
  190. @Override
  191. public void actionPerformed(ActionEvent arg0) {
  192. if(faceCheckBox.isSelected()) {
  193. historyCheckBox.setSelected(false);
  194. chnLabel.setVisible(false);
  195. chnComboBox.setVisible(false);
  196. startTimeLabel.setVisible(false);
  197. endTimeLabel.setVisible(false);
  198. startTimeBtn.setVisible(false);
  199. endTimeBtn.setVisible(false);
  200. } else {
  201. historyCheckBox.setSelected(true);
  202. chnLabel.setVisible(true);
  203. chnComboBox.setVisible(true);
  204. startTimeLabel.setVisible(true);
  205. endTimeLabel.setVisible(true);
  206. startTimeBtn.setVisible(true);
  207. endTimeBtn.setVisible(true);
  208. }
  209. }
  210. });
  211. historyCheckBox.addActionListener(new ActionListener() {
  212. @Override
  213. public void actionPerformed(ActionEvent arg0) {
  214. if(historyCheckBox.isSelected()) {
  215. faceCheckBox.setSelected(false);
  216. chnLabel.setVisible(true);
  217. chnComboBox.setVisible(true);
  218. startTimeLabel.setVisible(true);
  219. endTimeLabel.setVisible(true);
  220. startTimeBtn.setVisible(true);
  221. endTimeBtn.setVisible(true);
  222. } else {
  223. faceCheckBox.setSelected(true);
  224. chnLabel.setVisible(false);
  225. chnComboBox.setVisible(false);
  226. startTimeLabel.setVisible(false);
  227. endTimeLabel.setVisible(false);
  228. startTimeBtn.setVisible(false);
  229. endTimeBtn.setVisible(false);
  230. }
  231. }
  232. });
  233. }
  234. }
  235. private void searchByPicture() {
  236. new SwingWorker<Boolean, StringBuffer>() {
  237. int nTotalCount = 0; // 查询到的总个数
  238. @Override
  239. protected Boolean doInBackground() {
  240. int beginNum = 0; // 偏移量
  241. int nCount = 0; // 循环查询了几次
  242. int index = 0; // index + 1 为查询到的总个数
  243. int nFindCount = 10; // 每次查询的个数
  244. StringBuffer message = null;
  245. if(memory == null) {
  246. JOptionPane.showMessageDialog(null, Res.string().getChooseFacePic(), Res.string().getErrorMessage(), JOptionPane.ERROR_MESSAGE);
  247. return false;
  248. }
  249. // 获取查询句柄
  250. nTotalCount = SearchByPictureModule.startFindPerson(memory,
  251. startTimeBtn.getText(),
  252. endTimeBtn.getText(),
  253. historyCheckBox.isSelected(),
  254. chnComboBox.getSelectedIndex(),
  255. similaryTextField.getText());
  256. if(nTotalCount == 0) { // 查询失败
  257. // 查询失败,关闭查询
  258. SearchByPictureModule.doFindClosePerson();
  259. return false;
  260. } else if(nTotalCount == -1) { // 设备正在处理,通过订阅来查询处理进度
  261. nProgress = 0;
  262. nCount = 0;
  263. SearchByPictureModule.attachFaceFindState(fFaceFindStateCb.getInstance());
  264. } else {
  265. while(true) {
  266. CANDIDATE_INFOEX[] caInfoexs = SearchByPictureModule.doFindNextPerson(beginNum, nFindCount);
  267. if(caInfoexs == null) {
  268. break;
  269. }
  270. for(int i = 0; i < caInfoexs.length; i++) {
  271. index = i + nFindCount * nCount + 1;
  272. // 清空
  273. message = new StringBuffer();
  274. if(historyCheckBox.isSelected()) { // 历史库显示
  275. message.append("[" + index + "]"+Res.string().getTime()+":" + caInfoexs[i].stTime.toStringTimeEx() + "\n");
  276. message.append("[" + index + "]"+Res.string().getUid()+":" + new String(caInfoexs[i].stPersonInfo.szUID).trim() + "\n");
  277. message.append("[" + index + "]"+Res.string().getSex()+":" + Res.string().getSex(caInfoexs[i].stPersonInfo.bySex) + "\n");
  278. message.append("[" + index + "]"+Res.string().getAge()+":" + caInfoexs[i].stPersonInfo.byAge + "\n");
  279. message.append("[" + index + "]"+Res.string().getColor()+":" + Res.string().getColor(0) + "\n");
  280. message.append("[" + index + "]"+Res.string().getEye()+":" + Res.string().getEyeState(caInfoexs[i].stPersonInfo.emEye) + "\n");
  281. message.append("[" + index + "]"+Res.string().getMouth()+":" + Res.string().getMouthState(caInfoexs[i].stPersonInfo.emMouth) + "\n");
  282. message.append("[" + index + "]"+Res.string().getMask()+":" + Res.string().getMaskState(caInfoexs[i].stPersonInfo.emMask) + "\n");
  283. message.append("[" + index + "]"+Res.string().getBeard()+":" + Res.string().getBeardState(caInfoexs[i].stPersonInfo.emBeard) + "\n");
  284. message.append("[" + index + "]"+Res.string().getGlasses()+":" + Res.string().getGlasses(caInfoexs[i].stPersonInfo.byGlasses) + "\n");
  285. message.append("[" + index + "]"+Res.string().getSimilarity()+":" + caInfoexs[i].bySimilarity + "\n");
  286. message.append("[" + index + "]"+Res.string().getPicturePath()+":" + caInfoexs[i].stPersonInfo.szFacePicInfo[0].pszFilePath.getString(0) + "\n");
  287. } else { // 人脸库显示
  288. message.append("[" + index + "]"+Res.string().getFaceLibraryID()+":" + new String(caInfoexs[i].stPersonInfo.szGroupID).trim() + "\n");
  289. try {
  290. message.append("[" + index + "]"+Res.string().getFaceLibraryName()+":" + new String(caInfoexs[i].stPersonInfo.szGroupName, "GBK").trim() + "\n");
  291. message.append("[" + index + "]"+Res.string().getName()+":" + new String(caInfoexs[i].stPersonInfo.szPersonName, "GBK").trim() + "\n");
  292. } catch (UnsupportedEncodingException e) {
  293. e.printStackTrace();
  294. }
  295. message.append("[" + index + "]"+Res.string().getUid()+":" + new String(caInfoexs[i].stPersonInfo.szUID).trim() + "\n");
  296. message.append("[" + index + "]"+Res.string().getBirthday()+":" + (caInfoexs[i].stPersonInfo.wYear) + "-" +
  297. (0xff & caInfoexs[i].stPersonInfo.byMonth) + "-" +
  298. (0xff & caInfoexs[i].stPersonInfo.byDay) + "\n");
  299. message.append("[" + index + "]"+Res.string().getSex()+":" + Res.string().getSex(caInfoexs[i].stPersonInfo.bySex) + "\n");
  300. message.append("[" + index + "]"+Res.string().getCardType()+":" + Res.string().getIdType(caInfoexs[i].stPersonInfo.byIDType) + "\n");
  301. message.append("[" + index + "]"+Res.string().getCardNum()+":" + new String(caInfoexs[i].stPersonInfo.szID).trim() + "\n");
  302. message.append("[" + index + "]"+Res.string().getSimilarity()+":" + caInfoexs[i].bySimilarity + "\n");
  303. message.append("[" + index + "]"+Res.string().getPicturePath()+":" + caInfoexs[i].stPersonInfo.szFacePicInfo[0].pszFilePath.getString(0) + "\n");
  304. }
  305. message.append("\n");
  306. publish(message);
  307. }
  308. if(caInfoexs.length < nFindCount) {
  309. System.out.printf("No More Record, Find End!\n");
  310. break;
  311. } else {
  312. beginNum += nFindCount;
  313. nCount++;
  314. }
  315. }
  316. // 关闭查询
  317. SearchByPictureModule.doFindClosePerson();
  318. }
  319. return true;
  320. }
  321. @Override
  322. protected void process(java.util.List<StringBuffer> chunks) {
  323. for(StringBuffer data : chunks) {
  324. searchPicInfoTextArea.append(data.toString());
  325. searchPicInfoTextArea.updateUI();
  326. }
  327. super.process(chunks);
  328. }
  329. @Override
  330. protected void done() {
  331. if(nTotalCount == 0) { // 查询总个数失败
  332. searchPicBtn.setEnabled(true);
  333. progressBar.setValue(100);
  334. searchPicInfoTextArea.append("未查询到相关信息... \n");
  335. searchPicInfoTextArea.updateUI();
  336. } else if(nTotalCount == -1){ // 设备在处理中
  337. searchPicInfoTextArea.append(Res.string().getLoading()+"... \n");
  338. searchPicInfoTextArea.updateUI();
  339. } else {
  340. try {
  341. if(get()) { // 其他情况,查询信息结束
  342. searchPicBtn.setEnabled(true);
  343. progressBar.setValue(100);
  344. searchPicInfoTextArea.append("查询结束... \n");
  345. searchPicInfoTextArea.updateUI();
  346. }
  347. } catch (InterruptedException e) {
  348. e.printStackTrace();
  349. } catch (ExecutionException e) {
  350. e.printStackTrace();
  351. }
  352. }
  353. }
  354. }.execute();
  355. }
  356. /**
  357. * 订阅人脸回调函数
  358. */
  359. private static class fFaceFindStateCb implements NetSDKLib.fFaceFindState {
  360. private fFaceFindStateCb() {}
  361. private static class fFaceFindStateCbHolder {
  362. private static final fFaceFindStateCb instance = new fFaceFindStateCb();
  363. }
  364. public static fFaceFindStateCb getInstance() {
  365. return fFaceFindStateCbHolder.instance;
  366. }
  367. @Override
  368. public void invoke(LLong lLoginID, LLong lAttachHandle,
  369. Pointer pstStates, int nStateNum, Pointer dwUser) {
  370. if(nStateNum < 1) {
  371. return;
  372. }
  373. NET_CB_FACE_FIND_STATE[] msg = new NET_CB_FACE_FIND_STATE[nStateNum];
  374. for(int i = 0; i < nStateNum; i++) {
  375. msg[i] = new NET_CB_FACE_FIND_STATE();
  376. }
  377. ToolKits.GetPointerDataToStructArr(pstStates, msg);
  378. for(int i = 0; i < nStateNum; i++) {
  379. if(SearchByPictureModule.nToken == msg[i].nToken) {
  380. nProgress = msg[i].nProgress;
  381. nCount = msg[i].nCurrentCount; // 返回的总个数
  382. // 刷新设备处理进度
  383. // UI线程
  384. EventQueue.invokeLater(new Runnable() {
  385. @Override
  386. public void run() {
  387. progressBar.setValue(nProgress);
  388. if(nProgress == 100) { // 进度等于100,设备处理完毕,开始查询
  389. // 异步线程处理
  390. new SearchPictureWoker(nCount).execute();
  391. }
  392. }
  393. });
  394. }
  395. }
  396. }
  397. }
  398. /**
  399. * 用于订阅人脸状态后的查询
  400. * 以图搜图与查询人员信息的接口是一样的,只是逻辑不一样,doFindNextPerson接口时,都是指定每次查询的个数,最大20,然后根据偏移量循环查询
  401. * SwingWorker为异步线程,回调属于子线程,不能做耗时操作和刷新UI
  402. */
  403. private static class SearchPictureWoker extends SwingWorker<Boolean, StringBuffer> {
  404. private int nTotalCount; // 查询到的总个数
  405. public SearchPictureWoker(int nTotalCount) {
  406. this.nTotalCount = nTotalCount;
  407. }
  408. @Override
  409. protected Boolean doInBackground() {
  410. int beginNum = 0; // 偏移量
  411. int nCount = 0; // 循环查询了几次
  412. int index = 0; // index + 1 为查询到的总个数
  413. int nFindCount = 10; // 每次查询的个数
  414. StringBuffer message = null;
  415. // 进度达到100%,关闭订阅
  416. SearchByPictureModule.detachFaceFindState();
  417. System.out.println("nTotalCount = " + nTotalCount);
  418. if(nTotalCount == 0) {
  419. // 关闭查询
  420. SearchByPictureModule.doFindClosePerson();
  421. return false;
  422. }
  423. while(true) {
  424. CANDIDATE_INFOEX[] caInfoexs = SearchByPictureModule.doFindNextPerson(beginNum, nFindCount);
  425. if(caInfoexs == null) {
  426. break;
  427. }
  428. for(int i = 0; i < caInfoexs.length; i++) {
  429. index = i + nFindCount * nCount + 1;
  430. // 清空
  431. message = new StringBuffer();
  432. if(historyCheckBox.isSelected()) { // 历史库显示
  433. message.append("[" + index + "]"+Res.string().getTime()+":" + caInfoexs[i].stTime.toStringTimeEx() + "\n");
  434. message.append("[" + index + "]"+Res.string().getUid()+":" + new String(caInfoexs[i].stPersonInfo.szUID).trim() + "\n");
  435. message.append("[" + index + "]"+Res.string().getSex()+":" + Res.string().getSex(caInfoexs[i].stPersonInfo.bySex) + "\n");
  436. message.append("[" + index + "]"+Res.string().getAge()+":" + caInfoexs[i].stPersonInfo.byAge + "\n");
  437. message.append("[" + index + "]"+Res.string().getColor()+":" + Res.string().getColor(0) + "\n");
  438. message.append("[" + index + "]"+Res.string().getEye()+":" + Res.string().getEyeState(caInfoexs[i].stPersonInfo.emEye) + "\n");
  439. message.append("[" + index + "]"+Res.string().getMouth()+":" + Res.string().getMouthState(caInfoexs[i].stPersonInfo.emMouth) + "\n");
  440. message.append("[" + index + "]"+Res.string().getMask()+":" + Res.string().getMaskState(caInfoexs[i].stPersonInfo.emMask) + "\n");
  441. message.append("[" + index + "]"+Res.string().getBeard()+":" + Res.string().getBeardState(caInfoexs[i].stPersonInfo.emBeard) + "\n");
  442. message.append("[" + index + "]"+Res.string().getGlasses()+":" + Res.string().getGlasses(caInfoexs[i].stPersonInfo.byGlasses) + "\n");
  443. message.append("[" + index + "]"+Res.string().getSimilarity()+":" + caInfoexs[i].bySimilarity + "\n");
  444. message.append("[" + index + "]"+Res.string().getPicturePath()+":" + caInfoexs[i].stPersonInfo.szFacePicInfo[0].pszFilePath.getString(0) + "\n");
  445. } else { // 人脸库显示
  446. message.append("[" + index + "]"+Res.string().getFaceLibraryID()+":" + new String(caInfoexs[i].stPersonInfo.szGroupID).trim() + "\n");
  447. try {
  448. message.append("[" + index + "]"+Res.string().getFaceLibraryName()+":" + new String(caInfoexs[i].stPersonInfo.szGroupName, "GBK").trim() + "\n");
  449. message.append("[" + index + "]"+Res.string().getName()+":" + new String(caInfoexs[i].stPersonInfo.szPersonName, "GBK").trim() + "\n");
  450. } catch (UnsupportedEncodingException e) {
  451. e.printStackTrace();
  452. }
  453. message.append("[" + index + "]"+Res.string().getUid()+":" + new String(caInfoexs[i].stPersonInfo.szUID).trim() + "\n");
  454. message.append("[" + index + "]"+Res.string().getBirthday()+":" + (caInfoexs[i].stPersonInfo.wYear) + "-" +
  455. (0xff & caInfoexs[i].stPersonInfo.byMonth) + "-" +
  456. (0xff & caInfoexs[i].stPersonInfo.byDay) + "\n");
  457. message.append("[" + index + "]"+Res.string().getSex()+":" + Res.string().getSex(caInfoexs[i].stPersonInfo.bySex) + "\n");
  458. message.append("[" + index + "]"+Res.string().getCardType()+":" + Res.string().getIdType(caInfoexs[i].stPersonInfo.byIDType) + "\n");
  459. message.append("[" + index + "]"+Res.string().getCardNum()+":" + new String(caInfoexs[i].stPersonInfo.szID).trim() + "\n");
  460. message.append("[" + index + "]"+Res.string().getSimilarity()+":" + caInfoexs[i].bySimilarity + "\n");
  461. message.append("[" + index + "]"+Res.string().getPicturePath()+":" + caInfoexs[i].stPersonInfo.szFacePicInfo[0].pszFilePath.getString(0) + "\n");
  462. }
  463. message.append("\n");
  464. publish(message);
  465. }
  466. if(caInfoexs.length < nFindCount) {
  467. System.out.printf("No More Record, Find End!\n");
  468. break;
  469. } else {
  470. beginNum += nFindCount;
  471. nCount++;
  472. }
  473. }
  474. // 关闭查询
  475. SearchByPictureModule.doFindClosePerson();
  476. return true;
  477. }
  478. @Override
  479. protected void process(java.util.List<StringBuffer> chunks) {
  480. for(StringBuffer data : chunks) {
  481. searchPicInfoTextArea.append(data.toString());
  482. searchPicInfoTextArea.updateUI();
  483. }
  484. super.process(chunks);
  485. }
  486. @Override
  487. protected void done() {
  488. searchPicBtn.setEnabled(true);
  489. searchPicInfoTextArea.append(Res.string().getEndSearch()+"... \n");
  490. searchPicInfoTextArea.updateUI();
  491. }
  492. }
  493. private static JTextArea searchPicInfoTextArea;
  494. private static JProgressBar progressBar;
  495. private static JButton searchPicBtn;
  496. private PaintPanel searchPicPanel;
  497. private JComboBox chnComboBox;
  498. private JTextField similaryTextField;
  499. private DateChooserJButtonEx startTimeBtn;
  500. private DateChooserJButtonEx endTimeBtn;
  501. private JLabel chnLabel;
  502. private JLabel startTimeLabel;
  503. private JLabel endTimeLabel;
  504. private JCheckBox faceCheckBox;
  505. private static JCheckBox historyCheckBox;
  506. }