/// <summary> /// 播放下一个摄像头 /// </summary> void PlayNextMonitroVideo() { Logger.Instance.WriteLog("播放下一个摄像监控"); if (nextVideoIndex > 0) { GameObject lingxing = FindLingXing(FindDeviceInfo(MonitorIdList[nextVideoIndex - 1]).CameraTag); if (lingxing != null) { lingxing.SetActive(false); } MapPanel.GetComponent <DrawMap>().SetMapIconColor(FindDeviceInfo(MonitorIdList[nextVideoIndex - 1]).Id, Color.green); } if (monitorScope != null) { Destroy(monitorScope); } DeviceInfo dInfo = FindDeviceInfo(MonitorIdList[nextVideoIndex]); GameObject lingxing2 = FindLingXing(dInfo.CameraTag); if (lingxing2 != null) { lingxing2.SetActive(true); } MapPanel.GetComponent <DrawMap>().SetMapIconColor(dInfo.Id, Color.red, true); Transform trans = FindMonitor(dInfo.CameraTag).transform; monitorScope = Instantiate(MonitorScopePrefab, new Vector3(trans.position.x, 0.2f, trans.position.z), Quaternion.Euler(0, 0, 0)) as GameObject; DrawSector ds = monitorScope.GetComponent <DrawSector>(); ds.Scope = int.Parse(dInfo.MonitorScope); ds.Radio = int.Parse(dInfo.MonitorRadio); ds.Offset = int.Parse(dInfo.MonitorOffset); ds.ReDrawSector(); //判断是否已经是最后一个摄像头 bool isLast = false; if (nextVideoIndex == MonitorIdList.Length - 1) { isLast = true; } //判断指定的摄像头是否存在,如果存在着播放此摄像头的视频 if (MonitorIdList.Length > nextVideoIndex) { PlayMonitorVideo(MonitorIdList[nextVideoIndex], PlayTimeList[nextVideoIndex], isLast); nextVideoIndex++; } else { nextVideoIndex = 0; VideoPatrolWindow.SetActive(false); } }
public void SetValue(GameObject monitor, DelBind delBind, GameObject phyDevicePanel, GameObject SMSPanel, GameObject RTSPPanel) { Logger.Instance.WriteLog("初始化场景摄像机列表项目"); this.delBind = delBind; this.monitor = monitor; this.phyDevicePanel = phyDevicePanel; setMonitorScopePanel = SMSPanel; setRTSPPanel = RTSPPanel; BtnSetScope.SetActive(false); BtnSetRTSP.SetActive(false); CameraTag = monitor.transform.GetChild(0).name; Logger.Instance.WriteLog("从数据加载此列表项相关信息"); DeviceDao dDao = new DeviceDao(); dDao.Select002(CameraTag); if (dDao.Result.Count > 0) { Logger.Instance.WriteLog("数据加载成功"); info = dDao.Result[0]; Description.GetComponent <UIInput>().value = info.Description; Description.GetComponent <BoxCollider>().enabled = true; Existing = true; monitorScope = Instantiate(MonitorScopePrefab, new Vector3(monitor.transform.position.x, 0.2f, monitor.transform.position.z), Quaternion.Euler(0, 0, 0)) as GameObject; DrawSector ds = monitorScope.GetComponent <DrawSector>(); ds.Scope = int.Parse(info.MonitorScope); ds.Radio = int.Parse(info.MonitorRadio); ds.Offset = int.Parse(info.MonitorOffset); monitorScope.SetActive(false); monitor.GetComponent <MonitorInfoData>().Data = dDao.Result[0]; } else { Logger.Instance.WriteLog("数据加载失败"); Description.GetComponent <UIInput>().value = CameraTag; Description.GetComponent <BoxCollider>().enabled = false; Existing = false; } initDescription = Description.GetComponent <UIInput>().value; // lingxing = Instantiate(lingxingPrefab) as GameObject; // lingxing.transform.parent = monitor.transform; // lingxing.transform.localPosition = Vector3.zero; //lingxing.SetActive(false); }
public void SetValue(GameObject monitorScope, string id) { Logger.Instance.WriteLog("初始化摄像机监控区域面板"); this.monitorScope = monitorScope; this.id = id; sector = monitorScope.GetComponent <DrawSector>(); RadioSlider.value = sector.Radio / 100.0f; ScopeSlider.value = sector.Scope / 360.0f; OffsetSlider.value = sector.Offset / 360.0f; RadioValue.text = sector.Radio.ToString(); ScopeValue.text = sector.Scope.ToString(); OffsetValue.text = sector.Offset.ToString(); isInit = false; }
//从数据库中重新加载数据 void ReloadData() { Logger.Instance.WriteLog("从数据库中重新加载此列表项相关信息"); DeviceDao dDao = new DeviceDao(); dDao.Select002(CameraTag); if (dDao.Result.Count > 0) { info = dDao.Result[0]; DrawSector ds = monitorScope.GetComponent <DrawSector>(); ds.Scope = int.Parse(info.MonitorScope); ds.Radio = int.Parse(info.MonitorRadio); ds.Offset = int.Parse(info.MonitorOffset); Description.GetComponent <UIInput>().value = info.Description; } }