コード例 #1
0
        private void DoLoadByArea(List <Maticsoft.Model.SMT_CONTROLLER_ZONE> areas, string filter = null)
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    string strWhere = "1=1";
                    if (areas != null && areas.Count > 0)
                    {
                        strWhere = "AREA_ID in (";
                        foreach (var item in areas)
                        {
                            strWhere += item.ID + ",";
                        }
                        strWhere  = strWhere.TrimEnd(',');
                        strWhere += ")";
                    }
                    List <Maticsoft.Model.SMT_FACERECG_DEVICE> ctrls = FaceRecgHelper.GetList(strWhere, true);//获取所有人脸设备
                    this.Invoke(new Action(() =>
                    {
                        ShowDevs(ctrls, filter);
                    }));
                }
                catch (System.Exception ex)
                {
                    WinInfoHelper.ShowInfoWindow(this, "加载人脸识别设备异常:" + ex.Message);
                    log.Error("加载人脸识别设备异常:", ex);
                }
            });

            waiting.Show(this);
        }
コード例 #2
0
ファイル: RealDoorState.cs プロジェクト: radtek/smartaccess
        private void InitDoors()
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    var doors = DoorDataHelper.GetDoors();
                    Maticsoft.BLL.SMT_CARD_INFO cardBll = new Maticsoft.BLL.SMT_CARD_INFO();
                    _cards = cardBll.GetModelList("");
                    this.Invoke(new Action(() =>
                    {
                        AddDoorsToView(doors);
                    }));

                    var facedevs = FaceRecgHelper.GetList("");
                    this.Invoke(new Action(() =>
                    {
                        AddFaceDevsToView(facedevs);
                    }));
                }
                catch (Exception ex)
                {
                    WinInfoHelper.ShowInfoWindow(this, "加载门禁异常!" + ex.Message);
                    log.Error("加载门禁异常:", ex);
                }
            });

            waiting.Show(this, 200);
        }
コード例 #3
0
ファイル: RealMapDetect.cs プロジェクト: radtek/smartaccess
 private void GetDoors(MapCtrl mapCtrl, out List <Maticsoft.Model.SMT_DOOR_INFO> doors, out List <Maticsoft.Model.SMT_FACERECG_DEVICE> faceDevs)
 {
     Maticsoft.Model.SMT_MAP_INFO mapInfo = (Maticsoft.Model.SMT_MAP_INFO)mapCtrl.Tag;
     doors    = new List <Maticsoft.Model.SMT_DOOR_INFO>();
     faceDevs = new List <Maticsoft.Model.SMT_FACERECG_DEVICE>();
     if (mapInfo.MAP_DOORS == null || mapInfo.MAP_DOORS.Count == 0)
     {
         return;
     }
     foreach (var item in mapInfo.MAP_DOORS)
     {
         if (item.DOOR_TYPE == 1)
         {
             if (!item.DOOR.IS_ENABLE || item.DOOR.CTRL_ID == null || item.DOOR.CTRL_DOOR_INDEX == null)
             {
                 continue;
             }
             if (DoorDataHelper.LastDoors != null)
             {
                 if (DoorDataHelper.LastDoors.Exists(m => m.ID == item.DOOR.ID))
                 {
                     doors.Add(item.DOOR);
                 }
             }
             else
             {
                 doors.Add(item.DOOR);
             }
         }
         else if (item.DOOR_TYPE == 2)
         {
             if (!item.FACE.FACEDEV_IS_ENABLE)
             {
                 continue;
             }
             var faces = FaceRecgHelper.GetList("", false, false);
             if (faces != null)
             {
                 if (faces.Exists(m => m.ID == item.FACE.ID))
                 {
                     faceDevs.Add(item.FACE);
                 }
             }
             else
             {
                 faceDevs.Add(item.FACE);
             }
         }
     }
 }
コード例 #4
0
        private void Init(int time = 300)
        {
            CtrlWaiting waiting = new CtrlWaiting(() =>
            {
                try
                {
                    List <Maticsoft.Model.SMT_FACERECG_DEVICE> devs  = FaceRecgHelper.GetList("1=1", true); //获取所有控制器
                    List <Maticsoft.Model.SMT_CONTROLLER_ZONE> areas = AreaDataHelper.GetAreas(true);       //获取所有区域
                    this.Invoke(new Action(() =>
                    {
                        ShowAreas(areas);
                        ShowDevs(devs);
                    }));
                }
                catch (System.Exception ex)
                {
                    WinInfoHelper.ShowInfoWindow(this, "加载异常:" + ex.Message);
                    log.Error("加载异常:", ex);
                }
            });

            waiting.Show(this, time);
        }
コード例 #5
0
 private void DoLoadCtrlrs(List <decimal> areaIds)
 {
     List <Maticsoft.Model.SMT_FACERECG_DEVICE> devs = FaceRecgHelper.GetList(areaIds);
 }