private void LoadROMList() { //Global_GUI.UpdateFOLV(FOLV_RelevantObjects, this.TempObjectManager.ObjectList, UseSelected: true, SelectObject: this.ro, FullRefresh: true, ForcedSelection: true); Global_GUI.UpdateFOLV(FOLV_RelevantObjects, this.TempObjectManager.ObjectList, FullRefresh: true); Global_GUI.GroupboxEnableDisable(groupBox1, cb_enabled); }
private void Refresh() { //in case of disabled cameras: if (comboBox_filter_camera.Text != "All Cameras" && comboBox_filter_camera.Text.Trim().ToLower().Trim() != this.cam.name.Trim().ToLower()) { this.cam = AITOOL.GetCamera(comboBox_filter_camera.Text); } List <ObjectPosition> hist = new List <ObjectPosition>(); List <ObjectPosition> masked = new List <ObjectPosition>(); if (comboBox_filter_camera.Text == "All Cameras") { foreach (Camera curcam in AppSettings.Settings.CameraList) { hist.AddRange(curcam.maskManager.last_positions_history); masked.AddRange(curcam.maskManager.masked_positions); } } else { hist = cam.maskManager.last_positions_history; masked = cam.maskManager.masked_positions; } Global_GUI.UpdateFOLV(ref FOLV_MaskHistory, hist, true); Global_GUI.UpdateFOLV(ref FOLV_Masks, masked, true); this.CurObjPosLst.Clear(); ShowMaskImage(); ShowImageMask(null); }
private void btn_adddefaults_Click(object sender, EventArgs e) { using var Trace = new Trace(); //This c# 8.0 using feature will auto dispose when the function is done. this.TempObjectManager.AddDefaults(); // = new ClsRelevantObjectManager(AppSettings.Settings.ObjectPriority, this.ObjectManager.TypeName, this.ObjectManager.Camera); this.ro = null; Global_GUI.UpdateFOLV(FOLV_RelevantObjects, this.TempObjectManager.ObjectList, UseSelected: true, SelectObject: this.ro, FullRefresh: true, ForcedSelection: true); }
private void toolStripButtonDown_Click(object sender, EventArgs e) { using var Trace = new Trace(); //This c# 8.0 using feature will auto dispose when the function is done. if (this.ro == null) { return; } int idx = this.ObjectList.IndexOf(this.ro); if (idx > -1 && idx < this.ObjectList.Count - 1) { this.ObjectList.Move(idx, idx + 1); this.ro = this.ObjectList[idx + 1]; for (int i = 0; i < this.ObjectList.Count; i++) { this.ObjectList[i].Priority = i + 1; } Global_GUI.UpdateFOLV(FOLV_RelevantObjects, this.ObjectList, UseSelected: true, SelectObject: this.ro, FullRefresh: true, ForcedSelection: true); } }
private void Frm_RelevantObjects_Load(object sender, EventArgs e) { Loading = true; using var Trace = new Trace(); //This c# 8.0 using feature will auto dispose when the function is done. Global_GUI.ConfigureFOLV(FOLV_RelevantObjects, typeof(ClsRelevantObject)); this.FOLV_RelevantObjects.BooleanCheckStateGetter = delegate(Object rowObject) { return(((ClsRelevantObject)rowObject).Enabled); }; this.FOLV_RelevantObjects.BooleanCheckStatePutter = delegate(Object rowObject, bool newValue) { ((ClsRelevantObject)rowObject).Enabled = newValue; return(newValue); }; this.ObjectList = ObjectManager.ToList(); Global_GUI.UpdateFOLV(FOLV_RelevantObjects, this.ObjectList); Global_GUI.RestoreWindowState(this); Global_GUI.GroupboxEnableDisable(groupBox1, cb_enabled); Loading = false; }
private void Refresh() { Global_GUI.UpdateFOLV(ref FOLV_MaskHistory, cam.maskManager.last_positions_history, true); Global_GUI.UpdateFOLV(ref FOLV_Masks, cam.maskManager.masked_positions, true); this.CurObjPosLst.Clear(); ShowImageMask(null); }
private void FaceSelectionChanged() { using var Trace = new Trace(); //This c# 8.0 using feature will auto dispose when the function is done. try { if (this.FOLV_Faces.SelectedObjects != null && this.FOLV_Faces.SelectedObjects.Count > 0) { //set current selected object ClsFace face = (ClsFace)this.FOLV_Faces.SelectedObjects[0]; string mainface = Path.Combine(face.FaceStoragePath, $"{face.Name}.jpg"); if (File.Exists(mainface)) { pictureBoxCurrentFace.BackgroundImage = Image.FromFile(mainface); } else { pictureBoxCurrentFace.BackgroundImage = null; } Global_GUI.UpdateFOLV(FOLV_FaceFiles, face.Files.Values.ToList(), FullRefresh: true); } else { } } catch (Exception ex) { AITOOL.Log($"Error: {ex.Msg()}"); } }
private void Refresh() { //in case of disabled cameras: if (!string.Equals(this.comboBox_filter_camera.Text, "All Cameras", StringComparison.OrdinalIgnoreCase) && this.comboBox_filter_camera.Text.ToLower().Trim() != this.cam.Name.ToLower().Trim()) { this.cam = AITOOL.GetCamera(this.comboBox_filter_camera.Text); } List <ObjectPosition> hist = new List <ObjectPosition>(); List <ObjectPosition> masked = new List <ObjectPosition>(); if (this.comboBox_filter_camera.Text == "All Cameras") { foreach (Camera curcam in AppSettings.Settings.CameraList) { hist.AddRange(curcam.maskManager.LastPositionsHistory); masked.AddRange(curcam.maskManager.MaskedPositions); } } else { hist = this.cam.maskManager.LastPositionsHistory; masked = this.cam.maskManager.MaskedPositions; } Global_GUI.UpdateFOLV(this.FOLV_MaskHistory, hist, FullRefresh: true); Global_GUI.UpdateFOLV(this.FOLV_Masks, masked, FullRefresh: true); this.CurObjPosLst.Clear(); this.ShowMaskImage(); this.ShowImageMask(null); }
private void toolStripButtonDelete_Click(object sender, EventArgs e) { using var Trace = new Trace(); //This c# 8.0 using feature will auto dispose when the function is done. this.ro = this.TempObjectManager.Delete(ro, out int NewIDX); Global_GUI.UpdateFOLV(FOLV_RelevantObjects, this.TempObjectManager.ObjectList, UseSelected: true, SelectObject: this.ro, FullRefresh: true, ForcedSelection: true); }
private void deepstackToolStripMenuItem_Click(object sender, EventArgs e) { ClsURLItem url = new ClsURLItem("", AppSettings.Settings.AIURLList.Count + 1, URLTypeEnum.DeepStack); this.CurURL = url; AppSettings.Settings.AIURLList.Add(url); Global_GUI.UpdateFOLV(FOLV_AIServers, AppSettings.Settings.AIURLList, UseSelected: true, SelectObject: this.CurURL, FullRefresh: true); UpdateButtons(); }
private void Frm_Faces_Load(object sender, EventArgs e) { using var Trace = new Trace(); //This c# 8.0 using feature will auto dispose when the function is done. Global_GUI.ConfigureFOLV(FOLV_Faces, typeof(ClsFace)); Global_GUI.ConfigureFOLV(FOLV_FaceFiles, typeof(ClsFaceFile)); Global_GUI.UpdateFOLV(FOLV_Faces, AITOOL.FaceMan.Faces, FullRefresh: true); Global_GUI.RestoreWindowState(this); }
private void toolStripButtonAdd_Click(object sender, EventArgs e) { using var Trace = new Trace(); //This c# 8.0 using feature will auto dispose when the function is done. SaveRO(); ClsRelevantObject ro = new ClsRelevantObject("NEW OBJECT"); this.ro = ro; this.ro.Priority = this.ObjectList.Count + 1; this.ObjectList.Add(ro); Global_GUI.UpdateFOLV(FOLV_RelevantObjects, this.ObjectList, UseSelected: true, SelectObject: this.ro, FullRefresh: true, ForcedSelection: true); }
private void toolStripButtonDelete_Click(object sender, EventArgs e) { if (AppSettings.Settings.AIURLList.Contains(this.CurURL)) { AppSettings.Settings.AIURLList.Remove(this.CurURL); for (int i = 0; i < AppSettings.Settings.AIURLList.Count; i++) { AppSettings.Settings.AIURLList[i].Order = i + 1; } Global_GUI.UpdateFOLV(FOLV_AIServers, AppSettings.Settings.AIURLList, UseSelected: true, FullRefresh: true); } UpdateButtons(); }
private void Edit() { using (Frm_AIServerDeepstackEdit frm = new Frm_AIServerDeepstackEdit()) { frm.CurURL = this.CurURL; if (frm.ShowDialog() == DialogResult.OK) { this.CurURL = frm.CurURL; //this should update the list item by ref - prob not needed but makes me feel warm and fuzzy Global_GUI.UpdateFOLV(FOLV_AIServers, AppSettings.Settings.AIURLList, UseSelected: true, SelectObject: this.CurURL, FullRefresh: true); } } UpdateButtons(); }
private void toolStripButtonAdd_Click(object sender, EventArgs e) { using var Trace = new Trace(); //This c# 8.0 using feature will auto dispose when the function is done. SaveRO(); ClsRelevantObject ro = new ClsRelevantObject("NEW OBJECT"); this.ro = ro; if (this.TempObjectManager.TryAdd(ro, true, out int NewIDX)) { Global_GUI.UpdateFOLV(FOLV_RelevantObjects, this.TempObjectManager.ObjectList, UseSelected: true, SelectObject: this.ro, FullRefresh: true, ForcedSelection: true); } }
private void Frm_Actions_Load(object sender, EventArgs e) { try { Global_GUI.ConfigureFOLV(ref FOLV_Actions, typeof(CameraTriggerAction), null, null); Global_GUI.UpdateFOLV(ref FOLV_Actions, actions, true); string[] triggertypes = Enum.GetNames(typeof(TriggerType)); cbType.Items.AddRange(triggertypes); } catch (Exception ex) { Global.Log("Error: " + ex.Message); } }
private void addDoodsServerToolStripMenuItem_Click(object sender, EventArgs e) { ClsURLItem url = new ClsURLItem("", AppSettings.Settings.AIURLList.Count + 1, URLTypeEnum.DOODS); if (!AppSettings.Settings.AIURLList.Contains(url)) { this.CurURL = url; AppSettings.Settings.AIURLList.Add(url); Global_GUI.UpdateFOLV(FOLV_AIServers, AppSettings.Settings.AIURLList, UseSelected: true, SelectObject: this.CurURL, FullRefresh: true); } else { MessageBox.Show("Already exists"); } UpdateButtons(); }
private void Frm_Errors_Load(object sender, EventArgs e) { Global_GUI.RestoreWindowState(this); this.Show(); try { Global_GUI.ConfigureFOLV(this.folv_errors, typeof(ClsLogItm), null, null, "Time", SortOrder.Descending); Global_GUI.UpdateFOLV(this.folv_errors, this.errors); } catch (Exception) { throw; } }
private void Frm_ObjectDetail_Load(object sender, EventArgs e) { Global_GUI.RestoreWindowState(this); this.Show(); try { Global_GUI.ConfigureFOLV(this.folv_ObjectDetail, typeof(ClsPrediction), null, null); Global_GUI.UpdateFOLV(this.folv_ObjectDetail, this.PredictionObjectDetail); } catch (Exception) { throw; } }
private void toolStripButtonDown_Click(object sender, EventArgs e) { if (this.CurURL == null) { return; } int idx = AppSettings.Settings.AIURLList.IndexOf(this.CurURL); if (idx > -1) { AppSettings.Settings.AIURLList.Move(idx, idx + 1); for (int i = 0; i < AppSettings.Settings.AIURLList.Count; i++) { AppSettings.Settings.AIURLList[i].Order = i + 1; } Global_GUI.UpdateFOLV(FOLV_AIServers, AppSettings.Settings.AIURLList, UseSelected: true, SelectObject: this.CurURL, FullRefresh: true); } }
private void Frm_ObjectDetail_Load(object sender, EventArgs e) { Global_GUI.RestoreWindowState(this); this.Show(); try { Global_GUI.ConfigureFOLV(this.folv_ObjectDetail, typeof(ClsPrediction), null, null); Global_GUI.UpdateFOLV(this.folv_ObjectDetail, this.PredictionObjectDetails); if (!String.IsNullOrEmpty(this.ImageFileName) && this.ImageFileName.Contains("\\") && File.Exists(this.ImageFileName)) { OriginalBMP = new Bitmap(this.ImageFileName); this.pictureBox1.Image = OriginalBMP; //load actual image as background, so that an overlay can be added as the image } } catch (Exception) { throw; } }
private void Frm_Variables_Load(object sender, EventArgs e) { Global_GUI.ConfigureFOLV(FOLV_Vars, typeof(ClsProp)); Global_GUI.UpdateFOLV(FOLV_Vars, props, ResizeColsStyle: ColumnHeaderAutoResizeStyle.ColumnContent); Global_GUI.RestoreWindowState(this); }
private void Frm_AddAIServers_Load(object sender, EventArgs e) { Global_GUI.RestoreWindowState(this); Global_GUI.ConfigureFOLV(FOLV_AIServers, typeof(ClsURLItem), null, this.imageList1); Global_GUI.UpdateFOLV(FOLV_AIServers, AppSettings.Settings.AIURLList); }