void Start() { //必要なスクリプトを所持 obj_sceneControll = GameObject.Find("SceneController"); sceneControll = obj_sceneControll.GetComponent <SceneControll>(); obj_portal = GameObject.Find("TutrialCamera"); distortPortal = obj_portal.GetComponent <DistortPortal>(); obj_crtNoise = GameObject.Find("TutrialCamera"); crtNoise = obj_crtNoise.GetComponent <CRTnoise>(); obj_cameraInformation = GameObject.Find("CameraInformation"); cameraInformation = obj_cameraInformation.GetComponent <CameraInformation>(); //ゴールorPortalのメアスオブジェ portalPosObj = GameObject.FindGameObjectWithTag("GoleObject"); //キャンバスを最初は消しておく foreach (var image in PouseRogo) { image.enabled = false; } //フラグ関係の初期化 changeSceneFrag = false; stageClearFrag = false; playerDeadFrag = false; outBlackAlpha = true; pouseSelect = PouseSelect.ToContinue; }
public static DetailInfo DetailInfo(ThermalImageFile th) { ImageParameters imageParameters = th.ThermalParameters; CameraInformation camera = th.CameraInformation; DetailInfo detailInfo = new DetailInfo(); //文件信息 detailInfo.Title = th.Title; //图片名 detailInfo.Width = th.Size.Width; detailInfo.Height = th.Size.Height; detailInfo.Max = th.Statistics.Max.Value; //全图最高温 detailInfo.Min = th.Statistics.Min.Value; //全图最低温 detailInfo.Average = th.Statistics.Average.Value; //全图平均温 detailInfo.DateTaken = (th.DateTaken - startTime).TotalMilliseconds.ToString(); //拍摄日期 毫秒数 //图像目标参数 detailInfo.AtmosphericTemperature = Math.Round(imageParameters.AtmosphericTemperature, 2).ToString(); //大气温度 //相机信息 detailInfo.Lens = camera.Lens; //相机镜头信息 detailInfo.Model = camera.Model; //相机模型信息 detailInfo.Range_max = Math.Round(camera.Range.Maximum, 2).ToString(); //测量范围 detailInfo.Range_min = Math.Round(camera.Range.Minimum, 2).ToString(); //测量范围 detailInfo.SerialNumber = camera.SerialNumber; //相机的序列号 //图像目标参数 detailInfo.DistanceUnit = th.DistanceUnit.ToString(); //距离单位 detailInfo.Distance = imageParameters.Distance; //到被聚焦对象的距离 detailInfo.Emissivity = imageParameters.Emissivity; //红外图像的默认发射率 detailInfo.RelativeHumidity = imageParameters.RelativeHumidity; //相对湿度(0.0 - 1.0) detailInfo.ReflectedTemperature = imageParameters.ReflectedTemperature; //反射温度 return(detailInfo); }
void Start() { //必要なスクリプトを所持 obj_sceneControll = GameObject.Find("SceneController"); sceneControll = obj_sceneControll.GetComponent <SceneControll>(); obj_portal = GameObject.Find("PlayCamera"); distortPortal = obj_portal.GetComponent <DistortPortal>(); obj_crtNoise = GameObject.Find("PlayCamera"); crtNoise = obj_crtNoise.GetComponent <CRTnoise>(); obj_cameraInformation = GameObject.Find("CameraInformation"); cameraInformation = obj_cameraInformation.GetComponent <CameraInformation>(); //ゴールorPortalのメアスオブジェ portalPosObj = GameObject.FindGameObjectWithTag("GoleObject"); //キャンバスを最初は消しておく foreach (var image in PouseRogo) { image.enabled = false; } //フラグ関係の初期化 changeSceneFrag = false; stageClearFrag = false; playerDeadFrag = false; outBlackAlpha = true; lastStageClearFrag = false; pouseSelect = PouseSelect.ToContinue; //シーン移行の際につかう黒い画像なので最初は表示しない // LeanTween.colorText(outBlack.GetComponent<RectTransform>(), new Color(1, 1, 1, 0), 0.5f); }
void Start() { //シーン情報を取得 obj_PerformanceCamera = GameObject.Find("PerformanceCamera"); obj_scene = GameObject.Find("SceneController"); sceneControll = obj_scene.GetComponent <SceneControll>(); obj_stageInstructs = GameObject.Find("StageConfiguration"); stageInstructs = obj_stageInstructs.GetComponent <StageInstructs>(); obj_cameraInformation = GameObject.Find("CameraInformation"); cameraInformation = obj_cameraInformation.GetComponent <CameraInformation>(); obj_crtNoise = GameObject.Find("SelectMainCamera"); crtNoise = obj_crtNoise.GetComponent <CRTnoise>(); //演出用のカメラの情報を一つ前のシーンの状態と同じにする obj_PerformanceCamera.transform.position = cameraInformation.CameraPos; obj_PerformanceCamera.transform.rotation = cameraInformation.CameraRota; //セレクトシーンに入った瞬間はNoneとして初期化 sceneControll.CurrentStage = NextStage.None; ChangeSceneFrag = false; ChangeSceneCount = 2; //シーン移行の際につかう黒い画像なので最初は表示しない image.enabled = false; }
public CameraContainer(int cameraNum, ImageEntity Tray, ListBox gallery) { preview = new Preview(this); camNum = cameraNum; hist = new Histogram(); settings = new settingsContainer(this); LsImageGallery = gallery; trayImage = Tray; ReturnCode rc = Api.Initialize(serialNums[cameraNum], ref m_hCamera); if (cameraNum == 0) { bActive = true; } CameraInformation info = new CameraInformation(); rc = Api.GetCameraInformation(m_hCamera, ref info); this.Name = Tray.CameraName = "a" + info.SerialNumber; LoadCameraFeatures(); s_callbackDelegate[cameraNum] = new Api.Callback(MyCallbackFunction); Api.SetCallback(m_hCamera, Overlays.Frame, 0xD00D, s_callbackDelegate[cameraNum]); Api.SetStreamState(m_hCamera, StreamState.Start); }
public static string GetImage(CameraInformation camera) { if (camera == null) { throw new ArgumentNullException("camera"); } return(string.Format("https://{0}/get_image?uuid={1}&cachebuster={2}&width=1280", camera.nexus_api_nest_domain_host, camera.uuid, UnixTime.GetCurrentUnixTimestampSeconds())); }
// GET: /<controller>/ public IActionResult GraphDashboard(int cameraId) { if (HttpContext.Session.GetString("currentUsername") == null) { return(RedirectToAction("SignIn", "Home")); } CameraInformation cameraInfoWithStatistics = CameraService.GetCameraInformationWithYearlyData(cameraId); return(View(cameraInfoWithStatistics)); }
public CameraInformation GetCameraInformationWithYearlyData(int cameraId) { CameraInformation cameraInformation = getCameraInformationById(cameraId); // Line below is what it should be... but we're using the placeholder graphStatisticService for now GraphStatistics graphStatistics = _graphStatisticsService.GetYearlyGraphStatistics(cameraId); // GraphStatistics graphStatistics = new PlaceholderGraphStatisticsService().GetYearlyGraphStatistics(cameraId); cameraInformation.GraphStatistics = graphStatistics; return(cameraInformation); }
// GET: /<controller>/ public IActionResult GraphDashboard(int cameraId, PastPeriod pastPeriod = PastPeriod.LastDay, DateTime?startDate = null, DateTime?endDate = null) { if (HttpContext.Session.GetString("currentUsername") == null) { return(RedirectToAction("SignIn", "Home")); } CameraInformation cameraInfo = CameraService.getCameraInformationById(cameraId); cameraInfo.GraphStatistics.SelectedPeriod = pastPeriod; cameraInfo.GraphStatistics.StartDate = startDate; cameraInfo.GraphStatistics.EndDate = endDate; return(View(cameraInfo)); }
public async Task <ClipInfo> RecordClip(CameraInformation camera, DateTime startTime, double lengthInSeconds) { Logger.Log("RecordClip: Creating client..."); using (var c = WebRequestHelper.GetClient()) { var content = new FormUrlEncodedContent(new[] { new KeyValuePair <string, string>("uuid", camera.uuid), new KeyValuePair <string, string>("start_date", startTime.GetUnixTime().ToString()), new KeyValuePair <string, string>("length", lengthInSeconds.ToString()), new KeyValuePair <string, string>("is_time_lapse", "false"), }); Logger.Log("RecordClip: Posting request..."); var videoSubmission = await c.PostAsync(URLs.RequestVideo, content); if (videoSubmission.StatusCode != System.Net.HttpStatusCode.OK) { Logger.Log("ErrorCode: {0}-{1}", (int)videoSubmission.StatusCode, videoSubmission.ToString()); if (videoSubmission.StatusCode == System.Net.HttpStatusCode.Conflict) { Logger.Log("Conflict found, may abort."); throw new OutOfMemoryException("You have exceeded the amount of recordings supported."); } else if (videoSubmission.StatusCode == System.Net.HttpStatusCode.NotFound) { Logger.Log("File not found, lets try again."); throw new KeyNotFoundException("Requested clip could not be found"); } else { throw new Exception($"Unknown failure requesting clip. Code: {videoSubmission.StatusCode}"); } } else { Logger.Log("RecordClip: Reading response..."); var responseBody = await videoSubmission.Content.ReadAsStringAsync(); var item = JsonConvert.DeserializeObject <ClipInfo[]>(responseBody); return(item.FirstOrDefault()); } } }
public CameraStatistics getCameraStatisticsForNowById(int cameraId) { CameraInformation cameraInformation = this.getCameraInformationById(cameraId); if (cameraInformation != null) { CameraStatistics cameraStatisticsModel = new CameraStatistics(); cameraStatisticsModel.CameraInformation = cameraInformation; // In this placeholder model, we always use the same statistics cameraStatisticsModel.LastUpdatedTime = new DateTime(2018, 2, 18, 14, 11, 2); cameraStatisticsModel.MostRecentPeopleCount = 21; cameraStatisticsModel.DayTimeOfTheWeekAverageCount = 30; cameraStatisticsModel.DayTimeOfTheWeekAverageCountDisplayString = "On a Friday between 2:00 PM and 3:00 PM"; cameraStatisticsModel.PeriodOfTheDayAverageCount = 25; cameraStatisticsModel.PeriodOfTheDayAverageCountDisplayString = "On an average afternoon"; return(cameraStatisticsModel); } else { return(null); } }
//Target URL no longer valid, more re-investigation is required for settings setting. /* * public async Task<DetailedCameraInformation> GetDetailedCameraInfo(CameraInformation cameraInformation) * { * if (cameraInformation == null) * { * throw new ArgumentNullException("cameraInformation"); * } * * try * { * Logger.Log("GetDetailedCameraInfo: Creating client..."); * var req = WebRequestHelper.GetClient(); * * Logger.Log("GetDetailedCameraInfo: Adding custom headers..."); * Logger.Log("GetDetailedCameraInfo: Awaiting string result..."); * var res = await req.GetStringAsync(string.Format(URLs.GetDetailedCameraInfo, cameraInformation.uuid)); * * Logger.Log("GetDetailedCameraInfo: Deserializing"); * var item = JsonConvert.DeserializeObject<DetailedCameraInformation>(res); * * return item; * } * catch (Exception ex) * { * Logger.Log("GetDetailedCameraInfo: " + ex.ToString()); * } * * return null; * } */ //Untested in quite a while, provided for reference only. /* * public async Task SetCameraSetting(Property property) * { * await SetCameraSetting(new SettingSubmission() { camera_uuid = property.camera_uuid, name = property.name, value = (string)property.value }); * } * * public async Task SetCameraSetting(SettingSubmission submissionValue) * { * Logger.Log("SetCameraSetting: Creating client..."); * var client = WebRequestHelper.GetClient(); * * string value = JsonConvert.SerializeObject(submissionValue); * * Logger.Log("SetCameraSetting: Awaiting posting..."); * var result = await client.PostAsync(string.Format(URLs.SetCameraProperty, submissionValue.camera_uuid), new StringContent(value)); * result.EnsureSuccessStatusCode(); * * Logger.Log("SetCameraSetting: Reading response..."); * string s = await result.Content.ReadAsStringAsync(); * Logger.Log("SetCameraSettings() reply: " + s); * } */ private static async Task <CuePoint[]> GetCuePoints(CameraInformation cameraInformation) { Logger.Log("GetCuePoints: Creating client..."); using (var c = WebRequestHelper.GetClient()) { try { Logger.Log("GetCuePoints: Getting body..."); var responseBody = await c.GetStringAsync(string.Format(URLs.GetCuePoint, cameraInformation.uuid)); Logger.Log(responseBody); Logger.Log("GetCuePoints: Deserializing..."); var item = JsonConvert.DeserializeObject <CuePoint[]>(responseBody); return(item); } catch (Exception ex) { Logger.Log(ex); throw; } } }
public async Task <byte[]> GetCameraImage(CameraInformation cameraInformation) { try { var url = URLs.GetImage(cameraInformation); Logger.Log("GetCameraImage: Creating Client..."); var client = WebRequestHelper.GetClient(); Logger.Log("GetCameraImage: Getting response..."); var response = await client.GetAsync(url); response.EnsureSuccessStatusCode(); Logger.Log("GetCameraImage: Getting body..."); return(await response.Content.ReadAsByteArrayAsync()); } catch (Exception ex) { Logger.Log(ex); throw; } }
//string name; void Start() { //持っているカメラ情報を取得 MainCam = GameObject.Find("TitleMainCamera"); SubCam = GameObject.Find("TitleSubCamera"); //使用するスクリプトを保持 //シーン情報を取得 obj_scene = GameObject.Find("SceneController"); sceneControll = obj_scene.GetComponent <SceneControll>(); //ポータルに支持を出すための変数 distortPortal = MainCam.GetComponent <DistortPortal>(); obj_crtNoise = GameObject.Find("TitleMainCamera"); crtNoise = obj_crtNoise.GetComponent <CRTnoise>(); obj_cameraInformation = GameObject.Find("CameraInformation"); cameraInformation = obj_cameraInformation.GetComponent <CameraInformation>(); //演出の関係上必要になったフラグ sceneChangeFrag = false; image_black.enabled = false; //SoundManager.GetInstance.PlayBGM("6815"); }
private void InitCameraInfo(CameraInformation cameraInfo) { CameraID = cameraInfo.CameraID; DeviceID = cameraInfo.DeviceID.ToString(); InUse = cameraInfo.InUse; Module = Name = cameraInfo.Model; SensorID = cameraInfo.SensorID; SerialNumber = cameraInfo.SerialNumber; Status = cameraInfo.Status; }