fuliqi
2024-08-29 4163c93761115c7524ef74a557a1f5e01eafb429
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
package com.ycl.api.YS.vca.face;
 
import com.sun.jna.Memory;
import com.sun.jna.Pointer;
import com.ycl.api.YS.NetDemo;
import com.ycl.api.YS.util.Common;
import com.ycl.api.YS.lib.NetDEVSDKLib;
import com.ycl.api.YS.lib.NetDEVSDKLib.*;
 
import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Map;
 
public class PersonMonitor extends JDialog{
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    JPanel PersonMonitorPanel = new JPanel();
    JLabel lblPersonMonitorTaskName = new JLabel("* Task name");
    JTextField textFieldPersonMonitorTaskName = new JTextField();
    JLabel lblPersonMonitorType = new JLabel("* Monitor type");
    JRadioButton rdbtnPersonMonitorType = new JRadioButton("Match alarm");
    JRadioButton rdbtnPersonMonitorNoMatch = new JRadioButton("No match alarm");
    JLabel lblPersonMonitorDescribe = new JLabel("Describe");
    JTextField textFieldPersonMonitorDescribe = new JTextField();
    JLabel lblPersonAlarmObject = new JLabel("* Monitor object");
    JRadioButton rdbtnPersonAlarmObjectPersonLib = new JRadioButton("Person lib");
//    JRadioButton rdbtnPersonAlarmObjectPersonFace = new JRadioButton("Person face");
    JPanel panelPersonMonitorPersonLib = new JPanel();
    JComboBox<String> comboBoxPersonMonitorPersonLib = new JComboBox<String>();
    JButton btnPersonMonitorComplate = new JButton("Complete");
    JButton btnPersonMonitorCancle = new JButton("Cancel");
    
    JButton btnFindPersonLib;
    JButton btnFindPersonMonitor;
    
    public String strPersonMonitorName;
    
    NetDEVSDKLib netdevsdk = NetDEVSDKLib.NETDEVSDK_INSTANCE;
    private JTextField txtMultiplevalue;
    
    public static class PERSON_MONITOR_OPERATE_WINDOW_EFFECT{
        public static final int PERSON_MONITOR_OPERATE_WINDOW_ADDPERSONMONITOR             = 1;        /* 添加人脸布控 */
        public static final int PERSON_MONITOR_OPERATE_WINDOW_MODIFYPERSONMONITOR          = 2;        /* 修改人脸布控 */
    }
 
    public PersonMonitor(int dwOperateType,JButton btnFindPersonLib,JButton btnFindPersonMonitor,String strPersonMonitorName) {
        this.setSize(689,600);
        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
        this.setTitle("Add Person monitor");
        this.setVisible(true);
        this.btnFindPersonLib=btnFindPersonLib;
        this.btnFindPersonMonitor=btnFindPersonMonitor;
        
        
        this.strPersonMonitorName=strPersonMonitorName;;
        
        btnFindPersonLib.doClick();
        
        Toolkit toolkit=Toolkit.getDefaultToolkit();
        Dimension screenSize =toolkit.getScreenSize();
        int x=(screenSize.width-this.getWidth())/2;
        int y=(screenSize.height-this.getHeight())/2;
        this.setLocation(x,y);
        
        getContentPane().add(PersonMonitorPanel, BorderLayout.CENTER);
        PersonMonitorPanel.setLayout(null);
        
        JLabel lblPersonMonitorTaskName = new JLabel("* Task name");
        lblPersonMonitorTaskName.setBounds(24, 10, 90, 15);
        PersonMonitorPanel.add(lblPersonMonitorTaskName);
        
        
        textFieldPersonMonitorTaskName.setBounds(126, 7, 483, 21);
        PersonMonitorPanel.add(textFieldPersonMonitorTaskName);
        textFieldPersonMonitorTaskName.setColumns(10);
        
        
        lblPersonMonitorType.setBounds(24, 46, 90, 15);
        PersonMonitorPanel.add(lblPersonMonitorType);
        
        
        rdbtnPersonMonitorType.setBounds(126, 42, 121, 23);
        PersonMonitorPanel.add(rdbtnPersonMonitorType);
        
        
        rdbtnPersonMonitorNoMatch.setBounds(312, 42, 121, 23);
        PersonMonitorPanel.add(rdbtnPersonMonitorNoMatch);
        
        ButtonGroup MonitorTypeGroup = new ButtonGroup();
        MonitorTypeGroup.add(rdbtnPersonMonitorType);
        MonitorTypeGroup.add(rdbtnPersonMonitorNoMatch);
        
        
        lblPersonMonitorDescribe.setBounds(37, 83, 54, 15);
        PersonMonitorPanel.add(lblPersonMonitorDescribe);
        
        
        textFieldPersonMonitorDescribe.setBounds(126, 80, 483, 21);
        PersonMonitorPanel.add(textFieldPersonMonitorDescribe);
        textFieldPersonMonitorDescribe.setColumns(10);
        
        
        lblPersonAlarmObject.setBounds(24, 120, 96, 15);
        PersonMonitorPanel.add(lblPersonAlarmObject);
        
        
        rdbtnPersonAlarmObjectPersonLib.setBounds(126, 116, 121, 23);
        PersonMonitorPanel.add(rdbtnPersonAlarmObjectPersonLib);
        
        
    
        ButtonGroup MonitorObjectGroup = new ButtonGroup();
        MonitorObjectGroup.add(rdbtnPersonAlarmObjectPersonLib);
        
        JLabel lblNewMultipleValue = new JLabel("MultipleValue");
        lblNewMultipleValue.setBounds(37, 155, 84, 15);
        PersonMonitorPanel.add(lblNewMultipleValue);
        
        txtMultiplevalue = new JTextField();
        txtMultiplevalue.setBounds(126, 152, 90, 21);
        PersonMonitorPanel.add(txtMultiplevalue);
        txtMultiplevalue.setColumns(10);
        txtMultiplevalue.setEnabled(true);
 
        
        
        panelPersonMonitorPersonLib.setBorder(new TitledBorder(null, "Person Lib", TitledBorder.LEADING, TitledBorder.TOP, null, null));
        panelPersonMonitorPersonLib.setBounds(24, 187, 618, 174);
        PersonMonitorPanel.add(panelPersonMonitorPersonLib);
        panelPersonMonitorPersonLib.setLayout(null);
        
        
        comboBoxPersonMonitorPersonLib.setBounds(10, 26, 170, 21);
        panelPersonMonitorPersonLib.add(comboBoxPersonMonitorPersonLib);
        
        
        if(dwOperateType == PERSON_MONITOR_OPERATE_WINDOW_EFFECT.PERSON_MONITOR_OPERATE_WINDOW_ADDPERSONMONITOR)
        {
            this.setTitle("Add Person monitor");
            AddPersonMonitorInit();
        }
        else if(dwOperateType == PERSON_MONITOR_OPERATE_WINDOW_EFFECT.PERSON_MONITOR_OPERATE_WINDOW_MODIFYPERSONMONITOR)
        {
            this.setTitle("Modify Person monitor");
            
            
            
//            String strPersonMonitorName = (String) NetDemo.PersonMonitorTable.getValueAt(NetDemo.PersonMonitorTable.getSelectedRow(), 0);
            NETDEV_MONITION_INFO_S stPersonMonitorInfo = NetDemo.mapPersonMonitorMap.get(strPersonMonitorName);
            
            ModifyPesonLibMonitorInit();
            
            textFieldPersonMonitorTaskName.setText(Common.byteArrayToString(stPersonMonitorInfo.stMonitorRuleInfo.szName));
            if(stPersonMonitorInfo.stMonitorRuleInfo.udwMonitorType == 0)
            {
                rdbtnPersonMonitorType.setSelected(true);
            }
            else
            {
                rdbtnPersonMonitorNoMatch.setSelected(true);
            }
            
            textFieldPersonMonitorDescribe.setText(Common.byteArrayToString(stPersonMonitorInfo.stMonitorRuleInfo.szReason));
            
            try {
                txtMultiplevalue.setText(String.valueOf(stPersonMonitorInfo.stMonitorRuleInfo.udwMultipleValue));
            }catch(Exception mt) {
                
            }
        
            
            rdbtnPersonAlarmObjectPersonLib.setSelected(true);
            
            
            rdbtnPersonAlarmObjectPersonLib.setEnabled(false);
            comboBoxPersonMonitorPersonLib.setEnabled(false);
            rdbtnPersonMonitorType.setEnabled(false);
            rdbtnPersonMonitorNoMatch.setEnabled(false);
        }
        
        btnPersonMonitorComplate.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
                if(dwOperateType == PERSON_MONITOR_OPERATE_WINDOW_EFFECT.PERSON_MONITOR_OPERATE_WINDOW_ADDPERSONMONITOR)
                {
                    NETDEV_MONITION_INFO_S stMonitorInfo = new NETDEV_MONITION_INFO_S();
                    stMonitorInfo.stMonitorRuleInfo = new NETDEV_MONITION_RULE_INFO_S();
                    stMonitorInfo.stMonitorRuleInfo.udwMonitorRuleType=1;
                    stMonitorInfo.stMonitorRuleInfo.bEnabled = 1;
                    Common.stringToByteArray(textFieldPersonMonitorTaskName.getText(), stMonitorInfo.stMonitorRuleInfo.szName);
                    Common.stringToByteArray(textFieldPersonMonitorDescribe.getText(), stMonitorInfo.stMonitorRuleInfo.szReason);
                    
                    int Multiplevalue=0;
                    try {
                        String getMultiplevalue=txtMultiplevalue.getText();
                        Multiplevalue=Integer.parseInt(getMultiplevalue);
                    }
                    
                    catch(Exception tt) {
                        
                    }
                    stMonitorInfo.stMonitorRuleInfo.udwMultipleValue=Multiplevalue;
                    
                    
                     if(NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC ||
                                 NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC_FISHEYE ||
                                 NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC_ECONOMIC_FISHEYE ||
                                 NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC_ACS
                             ){
                             
                             stMonitorInfo.stWeekPlan=new  NETDEV_VIDEO_WEEK_PLAN_S();
                             
                             stMonitorInfo.stWeekPlan.bEnabled=1;
                             
                             stMonitorInfo.stWeekPlan.udwDayNum=7;
                                for(int i=0;i<stMonitorInfo.stWeekPlan.udwDayNum;i++) {
                                    stMonitorInfo.stWeekPlan.astDayPlan[i]=new NETDEV_VIDEO_DAY_PLAN_S();
                                    
                                    stMonitorInfo.stWeekPlan.astDayPlan[i].udwIndex=i+1;
                                    if(stMonitorInfo.stWeekPlan.astDayPlan[i].udwIndex-1==i) {
                                        stMonitorInfo.stWeekPlan.astDayPlan[i].udwSectionNum=1;
                                        
                                        for(int j=0;j<stMonitorInfo.stWeekPlan.astDayPlan[i].udwSectionNum;j++) {
                                            
                                            stMonitorInfo.stWeekPlan.astDayPlan[i].astTimeSection[j]=new NETDEV_VIDEO_TIME_SECTION_S();
                                            Common.stringToByteArray("00:00:00", stMonitorInfo.stWeekPlan.astDayPlan[i].astTimeSection[j].szBeginTime);
                                            Common.stringToByteArray("23:59:59", stMonitorInfo.stWeekPlan.astDayPlan[i].astTimeSection[j].szEndTime);
                                        }
                                    }
 
                                }
                         }else if(NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_HNVR||
                                 NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_NVR||
                                 NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_NVR_BACKUP){
                             stMonitorInfo.stWeekPlan=new  NETDEV_VIDEO_WEEK_PLAN_S();
                             
                             
                             stMonitorInfo.stWeekPlan.udwDayNum=8;
                                for(int i=0;i<stMonitorInfo.stWeekPlan.udwDayNum;i++) {
                                    stMonitorInfo.stWeekPlan.astDayPlan[i]=new NETDEV_VIDEO_DAY_PLAN_S();
                                    
                                    stMonitorInfo.stWeekPlan.astDayPlan[i].udwIndex=i+1;
                                    if(stMonitorInfo.stWeekPlan.astDayPlan[i].udwIndex-1==i) {
                                        stMonitorInfo.stWeekPlan.astDayPlan[i].udwSectionNum=1;
                                        
                                        for(int j=0;j<stMonitorInfo.stWeekPlan.astDayPlan[i].udwSectionNum;j++) {
                                            
                                            stMonitorInfo.stWeekPlan.astDayPlan[i].astTimeSection[j]=new NETDEV_VIDEO_TIME_SECTION_S();
                                            Common.stringToByteArray("00:00:00", stMonitorInfo.stWeekPlan.astDayPlan[i].astTimeSection[j].szBeginTime);
                                            Common.stringToByteArray("24:00:00", stMonitorInfo.stWeekPlan.astDayPlan[i].astTimeSection[j].szEndTime);
                                        }
                                    }
                                }
                         }
    
                    if(rdbtnPersonMonitorType.isSelected() == true)
                    {
                        stMonitorInfo.stMonitorRuleInfo.udwMonitorType = 0;
                    }
                    else
                    {
                        stMonitorInfo.stMonitorRuleInfo.udwMonitorType = 1;
                    }
                    stMonitorInfo.stMonitorRuleInfo.udwLibNum = 1;        
                    
                    
                    NETDEV_LIB_INFO_S stPersonLibInfo = NetDemo.mapPersonLib.get(comboBoxPersonMonitorPersonLib.getItemAt(comboBoxPersonMonitorPersonLib.getSelectedIndex()));
                     if(stPersonLibInfo==null) {
                         JOptionPane.showMessageDialog(null, "There are no person libraries to use. error code"+NetDemo.netdevsdk.NETDEV_GetLastError());
                         return;
                     }
                    stMonitorInfo.stMonitorRuleInfo.audwLibList[0] = stPersonLibInfo.udwID;
                    
                    
                    if(NetDemo.jComboBoxDeviceType.getSelectedIndex() == 1)
                    {
                        stMonitorInfo.stMonitorRuleInfo.udwMonitorRuleType = 1;
                    }
 
                        stMonitorInfo.stMonitorRuleInfo.udwChannelNum = 1;
                        stMonitorInfo.stMonitorRuleInfo.pudwMonitorChlIDList = new Memory(4);
                        stMonitorInfo.stMonitorRuleInfo.pudwMonitorChlIDList.setInt(0, NetDemo.ChannelID);
 
                    
                    NETDEV_MONITOR_RESULT_INFO_S stMonitorResultInfo = new NETDEV_MONITOR_RESULT_INFO_S();
                    stMonitorResultInfo.udwChannelNum = 1;
                    NETDEV_MONITION_CHL_INFO_S stMonitorChlInfos = new NETDEV_MONITION_CHL_INFO_S(); 
                    stMonitorChlInfos.write();
                    stMonitorResultInfo.pstMonitorChlInfos = stMonitorChlInfos.getPointer();
                    
                    
                    
                    boolean bRet = netdevsdk.NETDEV_AddPersonMonitorInfo(NetDemo.lpUserID, stMonitorInfo, stMonitorResultInfo);
                    if(false == bRet)
                    {
                        System.out.printf("NETDEV_AddPersonMonitorInfo failed:%d\n", netdevsdk.NETDEV_GetLastError());
                        return;
                    }
                }
                else if(dwOperateType == PERSON_MONITOR_OPERATE_WINDOW_EFFECT.PERSON_MONITOR_OPERATE_WINDOW_MODIFYPERSONMONITOR) 
                {
                    String strPersonMonitorName = (String) NetDemo.PersonMonitorTable.getValueAt(NetDemo.PersonMonitorTable.getSelectedRow(), 0);
                    NETDEV_MONITION_INFO_S stPersonMonitorInfo = NetDemo.mapPersonMonitorMap.get(strPersonMonitorName);
                    
                    
                    
                    boolean bRet = false;
                    
                    if(NetDemo.jComboBoxDeviceType.getSelectedIndex() == 1)
                    {
                        bRet = netdevsdk.NETDEV_GetPersonMonitorRuleInfo(NetDemo.lpUserID, stPersonMonitorInfo);
                        if(false == bRet)
                        {
                            System.out.printf("NETDEV_GetPersonMonitorRuleInfo failed:%d\n", netdevsdk.NETDEV_GetLastError());
                            return;
                        }else {
                            stPersonMonitorInfo.stMonitorRuleInfo.udwLibNum = 1;        
                            NETDEV_LIB_INFO_S stPersonLibInfo = NetDemo.mapPersonLib.get(comboBoxPersonMonitorPersonLib.getItemAt(comboBoxPersonMonitorPersonLib.getSelectedIndex()));
                            stPersonMonitorInfo.stMonitorRuleInfo.audwLibList[0] = stPersonLibInfo.udwID;
                        }
                    }
                    else if(NetDemo.jComboBoxDeviceType.getSelectedIndex() == 0)
                    {
                        stPersonMonitorInfo.udwLinkStrategyNum = 0;
                        stPersonMonitorInfo.stMonitorRuleInfo.udwLibNum = 1;        
                        NETDEV_LIB_INFO_S stPersonLibInfo = NetDemo.mapPersonLib.get(comboBoxPersonMonitorPersonLib.getItemAt(comboBoxPersonMonitorPersonLib.getSelectedIndex()));
                        stPersonMonitorInfo.stMonitorRuleInfo.audwLibList[0] = stPersonLibInfo.udwID;
                        
                    }
                    
                    Common.stringToByteArray(textFieldPersonMonitorTaskName.getText(), stPersonMonitorInfo.stMonitorRuleInfo.szName);
                    Common.stringToByteArray(textFieldPersonMonitorDescribe.getText(), stPersonMonitorInfo.stMonitorRuleInfo.szReason);
                    
                    int Multiplevalue=0;
                    try {
                        String getMultiplevalue=txtMultiplevalue.getText();
                        Multiplevalue=Integer.parseInt(getMultiplevalue);
                    }
                    
                    catch(Exception tt) {
                        
                    }
                    stPersonMonitorInfo.stMonitorRuleInfo.udwMultipleValue=Multiplevalue;
                    
                    
                    stPersonMonitorInfo.write();
                    
                    bRet = netdevsdk.NETDEV_SetPersonMonitorRuleInfo(NetDemo.lpUserID, stPersonMonitorInfo);
                    if(false == bRet)
                    {
                        System.out.printf("NETDEV_SetPersonMonitorRuleInfo failed:%d\n", netdevsdk.NETDEV_GetLastError());
                        return;
                    }
                }
                
                dispose();
                btnFindPersonMonitor.doClick();
            }
        });
        
        
        btnPersonMonitorComplate.setBounds(363, 414, 108, 23);
        PersonMonitorPanel.add(btnPersonMonitorComplate);
        btnPersonMonitorCancle.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
                dispose();
            }
        });
        
        
        btnPersonMonitorCancle.setBounds(549, 414, 93, 23);
        PersonMonitorPanel.add(btnPersonMonitorCancle);
        
    
        
 
    }
    
    void AddPersonMonitorInit()
    {
        
        
            if(NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_VMS
                    ){
                for(Map.Entry<String, NETDEV_LIB_INFO_S> entry : NetDemo.mapPersonLib.entrySet())
                {
                    String strPersonLibNameString = entry.getKey();
                    
                    
                    NETDEV_LIB_INFO_S stPersonLibInfo =entry.getValue();
                    if(stPersonLibInfo.udwID==1) {
                        continue;
                    }else if(stPersonLibInfo.udwMemberNum==0) {
                        continue;
                    }
                    else {
                        comboBoxPersonMonitorPersonLib.addItem(strPersonLibNameString);
                    }
                }
            }else 
                if(NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC ||
                        NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC_FISHEYE ||
                                NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC_ECONOMIC_FISHEYE ||
                                        NetDemo.pstDeviceInfo.dwDeviceType == NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_IPC_ACS||NetDemo.pstDeviceInfo.dwDeviceType ==NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_NVR||
                                        NetDemo.pstDeviceInfo.dwDeviceType ==NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_NVR_BACKUP||NetDemo.pstDeviceInfo.dwDeviceType ==NETDEV_DEVICE_TYPE_E.NETDEV_DTYPE_HNVR
            ){
                for(Map.Entry<String, NETDEV_LIB_INFO_S> entry : NetDemo.mapPersonLib.entrySet())
                {
                    String strPersonLibNameString = entry.getKey();
                    
                    comboBoxPersonMonitorPersonLib.addItem(strPersonLibNameString);
                    
                }
            }
            
        
 
    }
    
    
void ModifyPesonLibMonitorInit() {
        
        
    btnFindPersonLib.doClick();
        
    comboBoxPersonMonitorPersonLib.setEnabled(false);
    
    NETDEV_MONITION_INFO_S stPersonMonitorInfo = NetDemo.mapPersonMonitorMap.get(strPersonMonitorName);
    
     boolean bRet2 = netdevsdk.NETDEV_GetPersonMonitorRuleInfo(NetDemo.lpUserID, stPersonMonitorInfo);
            if(false == bRet2)
            {
                if(netdevsdk.NETDEV_GetLastError()!=130) {
                    System.out.printf("GetPersonMonitorRuleInfo failed:%d\n", netdevsdk.NETDEV_GetLastError());
                    return;
                }
                else {
                    stPersonMonitorInfo.read();
                    stPersonMonitorInfo.write();
                    bRet2 = netdevsdk.NETDEV_GetPersonMonitorRuleInfo(NetDemo.lpUserID, stPersonMonitorInfo);
                    if(bRet2) {
                        stPersonMonitorInfo.read();                        
                        NETDEV_MONITOR_QUERY_INFO_S stQueryInfo = new NETDEV_MONITOR_QUERY_INFO_S();
                        stQueryInfo.udwLimit = 20;
                        
                        Pointer lpPersonMonitorHandle = netdevsdk.NETDEV_FindPersonMonitorList(NetDemo.lpUserID, NetDemo.ChannelID, stQueryInfo);
                        if(lpPersonMonitorHandle != null)
                        {
                            while(true)
                            {
                                NETDEV_MONITION_INFO_S stMonitorInfo = new NETDEV_MONITION_INFO_S();
                                stMonitorInfo.stMonitorRuleInfo = new NETDEV_MONITION_RULE_INFO_S();
 
                                stMonitorInfo.stMonitorRuleInfo.udwChannelNum = 1;
                                stMonitorInfo.stMonitorRuleInfo.pudwMonitorChlIDList = new Memory(4 * stMonitorInfo.stMonitorRuleInfo.udwChannelNum);
                                stMonitorInfo.stMonitorRuleInfo.pudwMonitorChlIDList.setInt(0, 0);
 
                                stMonitorInfo.udwLinkStrategyNum = 10;
                                NETDEV_LINKAGE_STRATEGY_S stLinkStrategyList = new NETDEV_LINKAGE_STRATEGY_S();
 
                                stMonitorInfo.pstLinkStrategyList = new Memory(stLinkStrategyList.size() * 10);
 
 
 
                                stMonitorInfo.stWeekPlan = new NETDEV_VIDEO_WEEK_PLAN_S();
                                for(int i =0; i < NetDEVSDKLib.NETDEV_MAX_DAY_NUM; i++)
                                {
                                    stMonitorInfo.stWeekPlan.astDayPlan[i] = new NETDEV_VIDEO_DAY_PLAN_S();
                                }
                                stMonitorInfo.write();
 
                                boolean bbRet = netdevsdk.NETDEV_FindNextPersonMonitorInfo(lpPersonMonitorHandle, stMonitorInfo);
                                if(bbRet != true)
                                {
                                    System.out.printf("NETDEV_FindNextPersonMonitorInfo failed:%d\n", netdevsdk.NETDEV_GetLastError());
                                    break;
                                }
                                else
                                {
                                    comboBoxPersonMonitorPersonLib.removeAllItems();
                                    
                                    for(Map.Entry<String, NETDEV_LIB_INFO_S> entry : NetDemo.mapPersonLib.entrySet())
                                    {
                                        
                                        NETDEV_LIB_INFO_S lib2=entry.getValue();
                                        
                                        
                                        String strPersonLibNameString = entry.getKey();
                                        
                                        comboBoxPersonMonitorPersonLib.addItem(strPersonLibNameString);
                                        if(lib2.udwID==stPersonMonitorInfo.stMonitorRuleInfo.audwLibList[0]) {
                                            
                                            for(int s=0;s<comboBoxPersonMonitorPersonLib.getItemCount();s++) {
                                                if(comboBoxPersonMonitorPersonLib.getItemAt(s).equals(Common.byteArrayToString(lib2.szName))) {
                                                    comboBoxPersonMonitorPersonLib.setSelectedIndex(s);
                                                }
                                            }
//                                            comboBoxPersonMonitorPersonLib.addItem(Common.byteArrayToString(lib2.szName));
                                        }
                                    }
                                    
                                }
                            }
                            boolean bRett = netdevsdk.NETDEV_FindClosePersonMonitorList(lpPersonMonitorHandle);
                            if(bRett != true)
                            {
                                System.out.printf("NETDEV_FindClosePersonMonitorList failed:%d\n", netdevsdk.NETDEV_GetLastError());
                                return;
                            }
                        }
                        
                    }
                }
            }
            else 
                {
                stPersonMonitorInfo.read();                
                NETDEV_MONITOR_QUERY_INFO_S stQueryInfo = new NETDEV_MONITOR_QUERY_INFO_S();
                stQueryInfo.udwLimit = 20;
                
                Pointer lpPersonMonitorHandle = netdevsdk.NETDEV_FindPersonMonitorList(NetDemo.lpUserID, NetDemo.ChannelID, stQueryInfo);
                if(lpPersonMonitorHandle != null)
                {
                    while(true)
                    {
                        NETDEV_MONITION_INFO_S stMonitorInfo = new NETDEV_MONITION_INFO_S();
                        stMonitorInfo.stMonitorRuleInfo = new NETDEV_MONITION_RULE_INFO_S();
 
                        stMonitorInfo.stMonitorRuleInfo.udwChannelNum = 1;
                        stMonitorInfo.stMonitorRuleInfo.pudwMonitorChlIDList = new Memory(4 * stMonitorInfo.stMonitorRuleInfo.udwChannelNum);
                        stMonitorInfo.stMonitorRuleInfo.pudwMonitorChlIDList.setInt(0, 0);
 
                        stMonitorInfo.udwLinkStrategyNum = 10;
                        NETDEV_LINKAGE_STRATEGY_S stLinkStrategyList = new NETDEV_LINKAGE_STRATEGY_S();
 
                        stMonitorInfo.pstLinkStrategyList = new Memory(stLinkStrategyList.size() * 10);
 
 
 
                        stMonitorInfo.stWeekPlan = new NETDEV_VIDEO_WEEK_PLAN_S();
                        for(int i =0; i < NetDEVSDKLib.NETDEV_MAX_DAY_NUM; i++)
                        {
                            stMonitorInfo.stWeekPlan.astDayPlan[i] = new NETDEV_VIDEO_DAY_PLAN_S();
                        }
                        stMonitorInfo.write();
 
                        boolean bbRet = netdevsdk.NETDEV_FindNextPersonMonitorInfo(lpPersonMonitorHandle, stMonitorInfo);
                        if(bbRet != true)
                        {
                            System.out.printf("NETDEV_FindNextPersonMonitorInfo failed:%d\n", netdevsdk.NETDEV_GetLastError());
                            break;
                        }
                        else
                        {
                            comboBoxPersonMonitorPersonLib.removeAllItems();
                            
                            for(Map.Entry<String, NETDEV_LIB_INFO_S> entry : NetDemo.mapPersonLib.entrySet())
                            {
                                
                                NETDEV_LIB_INFO_S lib2=entry.getValue();
                                
                                
                                String strPersonLibNameString = entry.getKey();
                                
                                comboBoxPersonMonitorPersonLib.addItem(strPersonLibNameString);
                                if(lib2.udwID==stPersonMonitorInfo.stMonitorRuleInfo.audwLibList[0]) {
                                    
                                    for(int s=0;s<comboBoxPersonMonitorPersonLib.getItemCount();s++) {
                                        if(comboBoxPersonMonitorPersonLib.getItemAt(s).equals(Common.byteArrayToString(lib2.szName))) {
                                            comboBoxPersonMonitorPersonLib.setSelectedIndex(s);
                                        }
                                    }
                                }
                            }
                            
                        }
                    }
                    boolean bRett = netdevsdk.NETDEV_FindClosePersonMonitorList(lpPersonMonitorHandle);
                    if(bRett != true)
                    {
                        System.out.printf("NETDEV_FindClosePersonMonitorList failed:%d\n", netdevsdk.NETDEV_GetLastError());
                        return;
                    }
                }
                
                
        }
    }
}