Exemple #1
0
    IEnumerator SearcjLog()
    {
        Logger.Instance.WriteLog("检索视频巡航日志");
        VideoPatrolLogGrid.transform.DestroyChildren();
        VideoPatrolLogDao vplDao   = new VideoPatrolLogDao();
        string            dateFrom = "";
        string            dateTo   = "";
        string            selece   = selectChr.value.Trim();

        if (DateFrom.value.Trim() != "")
        {
            string date = DateFrom.value.Trim();
            dateFrom = date.Substring(0, 4) + "/" + date.Substring(4, 2) + "/" + date.Substring(6, 2);
        }
        if (DateTo.value.Trim() != "")
        {
            string date = DateTo.value.Trim();
            dateTo = date.Substring(0, 4) + "/" + date.Substring(4, 2) + "/" + date.Substring(6, 2);
        }

        vplDao.Select001("", "", selece);
        VideoPatrolLogInfo info;

        for (int i = 0; i < vplDao.Result.Count; i++)
        {
            info = vplDao.Result[i];
            GameObject go = Instantiate(VideoPatrolItemPrefab) as GameObject;
            VideoPatrolLogGrid.AddChild(go.transform);
            go.transform.localScale = new Vector3(1, 1, 1);
            go.GetComponent <VideoPatrolLogItem>().SetValue("" + (i + 1), info, null, ShowPictruePanel);
            yield return(null);
        }
    }
Exemple #2
0
    public void RunPlan()
    {
        Logger.Instance.WriteLog("运行当前选择的巡逻方案");
        MainMenuController.canNotOpen = true;
        UIPopupList         PopuList = PatrolPlanPopuplist.GetComponent <UIPopupList>();
        string              planName = PopuList.value;
        VideoPatrolPlanInfo info     = FindPlanInfo(planName);

        MonitorIdList = info.MonitorList.Split('|');
        PlayTimeList  = info.PlayTimeList.Split('|');
        //显示播放窗口,并设置相关的回调函数
        VideoPatrolWindow.SetActive(true);
        PlayVideoPatrolPlan pvpPlan = VideoPatrolWindow.GetComponent <PlayVideoPatrolPlan>();

        pvpPlan.NextVideo   = PlayNextMonitroVideo;
        pvpPlan.StopVideo   = StopPlan;
        pvpPlan.WriteLog    = WriteLog;
        pvpPlan.SavePicture = SavePicture;
        ConstomNext(pvpPlan);
        MapPanel.SetActive(true);
        MapPanel.GetComponent <DrawMap>().Draw(planName, MonitorIdList, true);
        nextVideoIndex = 0;
        PlayNextMonitroVideo();
        //巡逻方案开始后,禁用启动按钮和选择列表
        PatrolPlanPopuplist.GetComponent <BoxCollider>().enabled = false;
        BtnStartPlanNormalSprite = BtnStartPlan.GetComponent <UIButton>().normalSprite;
        BtnStartPlan.GetComponent <UIButton>().normalSprite = BtnStartPlan.GetComponent <UIButton>().pressedSprite;
        BtnStartPlan.GetComponent <BoxCollider>().enabled   = false;

        VideoPatrolLogDao vplDao = new VideoPatrolLogDao();
        string            time   = System.DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");

        vplDao.Insert001(DataStore.UserInfo.RealName, time, planName);
        PatrolLogID  = vplDao.currentId;
        dirctoryPath = Application.dataPath + "/SaveImage/" + planName + System.DateTime.Parse(time).ToString("yyyyMMddHHmmss");
        Directory.CreateDirectory(dirctoryPath);
    }