/// <summary> /// 开发使用自动跳过下一个按键的XML读取配置函数 /// </summary> /// <param name="plan"></param> private void ConstomNext(PlayVideoPatrolPlan plan) { System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.Load(Application.dataPath + "/YF_Config/PatrolConfig.xml"); System.Xml.XmlElement el = (System.Xml.XmlElement)doc.SelectSingleNode("config"); string value = el.GetAttribute("next"); if (value == "0") { plan.constomNext = false; } else { plan.constomNext = true; } }
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); }