public void OpenWindow(int _index, CAMARE_INFO info) { index = _index; cmsManageInstance = CMSManage.Instance; currentCameraGUID = info.camareGuid; cmsManageInstance.OpenCamera(index, currentCameraGUID, StartReadMem); }
void Binding(CAMARE_INFO info) { List <byte> des = new List <byte>(); foreach (byte b in info.describe) { if (b == 0) { break; } des.Add(b); } List <byte> name = new List <byte>(); foreach (byte b in info.name) { if (b == 0) { break; } name.Add(b); } initDescription = System.Text.Encoding.Default.GetString(des.ToArray()); if (string.IsNullOrEmpty(Description.GetComponent <UIInput>().value)) { Description.GetComponent <UIInput>().value = initDescription; } //Description.GetComponent<UIInput>().value = initDescription; DeviceDao dDao = new DeviceDao(); dDao.Select002(CameraTag); if (dDao.Result.Count <= 0) { dDao.Insert001(CMSManage.GUIDToString(info.camareGuid), Encoding.Default.GetString(name.ToArray()), Description.GetComponent <UIInput>().value, monitor.transform.position.x.ToString(), monitor.transform.position.y.ToString(), monitor.transform.position.z.ToString(), CameraTag); //Encoding.Default.GetString (des.ToArray()) } else { dDao.Update002(CMSManage.GUIDToString(info.camareGuid), Encoding.Default.GetString(name.ToArray()), Description.GetComponent <UIInput>().value, dDao.Result[0].Id); } phyDevicePanel.SetActive(false); Configure.IsOperating = false; EditCameraManager.instance.CloseCamera(); delBind.bind = null; Description.GetComponent <BoxCollider>().enabled = true; monitorScope = Instantiate(MonitorScopePrefab, new Vector3(monitor.transform.position.x, 0.2f, monitor.transform.position.z), Quaternion.Euler(0, 0, 0)) as GameObject; monitorScope.SetActive(false); }
void ReturnCameraList(SocketMessage sm) { if (sm.realHeader.nError == (UInt16)GAMESERVER_ERROR.ERR_GAMESERVER_SUCCESS) { NetworkClient.Instance.cameraList = new List <CAMARE_INFO>(); int sum = BitConverter.ToInt32(sm.realMsg, Marshal.SizeOf(sm.realHeader)); for (int i = 0; i < sum; i++) { CAMARE_INFO info = SocketDataTool.GetStruct <CAMARE_INFO>(sm.realMsg, Marshal.SizeOf(sm.realHeader) + Marshal.SizeOf(typeof(int)) + i * Marshal.SizeOf(typeof(CAMARE_INFO))); NetworkClient.Instance.cameraList.Add(info); } } }
public void SetValue(int _index, CAMARE_INFO info, DelBind delBind) { this.delBind = delBind; this.info = info; this.index = _index; List <byte> des = new List <byte>(); foreach (byte b in info.name) { if (b == 0) { break; } des.Add(b); } Description.text = System.Text.Encoding.Default.GetString(des.ToArray()); }
public void OpenCamera(int index, CAMARE_INFO info) { if (currentEditCameraWindow != null) { currentEditCameraWindow.StopCamera(); Object.Destroy(currentEditCameraWindow.gameObject); } GameObject obj = Instantiate(editCameraWindowPrefab) as GameObject; obj.transform.parent = node; obj.transform.localScale = Vector3.one; obj.transform.localPosition = new Vector3(800, 300, 0); EditCameraWindow window = obj.GetComponent <EditCameraWindow>(); window.transform.parent = transform; window.transform.localScale = new Vector3(1, 1, 1); window.OpenWindow(index, info); currentEditCameraWindow = window; currentCameraInfo = info; }