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 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);
        }
示例#3
0
 private void cb_LinkedServers_CheckedChanged(object sender, EventArgs e)
 {
     Global_GUI.GroupboxEnableDisable(groupBoxLinked, cb_LinkedServers);
     if (!cb_LinkedServers.Checked)
     {
         this.CurURL.LinkedResultsServerList = "";
     }
 }
        private void LoadRO([CallerMemberName()] string memberName = null)
        {
            Loading = true;

            using var Trace = new Trace();  //This c# 8.0 using feature will auto dispose when the function is done.
            try
            {
                if (this.ro.IsNull())
                {
                    this.cb_enabled.Checked      = false;
                    this.cb_enabled.Enabled      = false;
                    this.tb_Name.Text            = "";
                    this.tb_Time.Text            = "";
                    this.tb_ConfidenceLower.Text = "";
                    this.tb_ConfidenceUpper.Text = "";
                }
                else
                {
                    this.cb_enabled.Checked      = this.ro.Enabled;
                    this.cb_enabled.Enabled      = true;
                    this.tb_Name.Text            = this.ro.Name;
                    this.tb_Time.Text            = this.ro.ActiveTimeRange;
                    this.tb_ConfidenceLower.Text = this.ro.Threshold_lower.ToString();
                    this.tb_ConfidenceUpper.Text = this.ro.Threshold_upper.ToString();

                    if (this.tb_Name.Text.EqualsIgnoreCase("NEW OBJECT") || this.tb_Name.Text.IsEmpty())
                    {
                        this.tb_Name.Enabled = true;
                    }
                    else
                    {
                        this.tb_Name.Enabled = false;
                    }

                    if (this.ro.Trigger)
                    {
                        rb_trigger.Checked = true;
                        rb_ignore.Checked  = false;
                    }
                    else
                    {
                        rb_trigger.Checked = false;
                        rb_ignore.Checked  = true;
                    }
                }

                Global_GUI.GroupboxEnableDisable(groupBox1, cb_enabled);
            }
            catch (Exception ex)
            {
                AITOOL.Log("Error: " + ex.Msg());
            }
            finally
            {
                NeedsSaving = false;
                Loading     = false;
            }
        }
        private void cb_enabled_CheckedChanged(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.GroupboxEnableDisable(groupBox1, cb_enabled);

            NeedsSaving = true;

            this.SaveRO();
        }
示例#6
0
        private void Frm_AIServerDeepstackEdit_Load(object sender, EventArgs e)
        {
            //Global_GUI.RestoreWindowState(this);

            this.tb_URL.Text   = this.CurURL.url;
            this.lbl_type.Text = this.CurURL.Type.ToString();

            if (this.CurURL.Type == URLTypeEnum.AWSRekognition)
            {
                this.tb_URL.Enabled = false;
            }
            else
            {
                this.tb_URL.Enabled = true;
            }

            this.tb_ActiveTimeRange.Text    = this.CurURL.ActiveTimeRange;
            this.chk_Enabled.Checked        = this.CurURL.Enabled.ReadFullFence();
            this.tb_ApplyToCams.Text        = this.CurURL.Cameras;
            this.tb_ImagesPerMonth.Text     = this.CurURL.MaxImagesPerMonth.ToString();
            this.cb_ImageAdjustProfile.Text = this.CurURL.ImageAdjustProfile;
            this.linkHelpURL.Text           = this.CurURL.HelpURL;
            this.tb_Lower.Text     = this.CurURL.Threshold_Lower.ToString();
            this.tb_Upper.Text     = this.CurURL.Threshold_Upper.ToString();
            this.tb_timeout.Text   = this.CurURL.HttpClientTimeoutSeconds.ToString();
            this.labelTimeout.Text = $"Timeout Seconds Override (Default={this.CurURL.GetTimeout().TotalSeconds}):";

            this.cb_RefinementServer.Checked = this.CurURL.UseAsRefinementServer;
            this.tb_RefinementObjects.Text   = this.CurURL.RefinementObjects;

            foreach (ClsImageAdjust ia in AppSettings.Settings.ImageAdjustProfiles)
            {
                this.cb_ImageAdjustProfile.Items.Add(ia.Name);
            }

            this.cb_ImageAdjustProfile.SelectedIndex = this.cb_ImageAdjustProfile.Items.IndexOf(this.CurURL.DefaultURL);

            Global_GUI.GroupboxEnableDisable(groupBox1, chk_Enabled);
        }
 private void cb_CancelURLEnabled_CheckedChanged(object sender, EventArgs e)
 {
     Global_GUI.GroupboxEnableDisable(groupBoxUrlCancel, cb_UrlCancelEnabled);
 }
 private void cb_TriggerURLEnabled_CheckedChanged(object sender, EventArgs e)
 {
     Global_GUI.GroupboxEnableDisable(groupBoxUrlTrigger, cb_UrlTriggerEnabled);
 }
 private void cb_MQTT_enabled_CheckedChanged(object sender, EventArgs e)
 {
     Global_GUI.GroupboxEnableDisable(groupBoxMQTT, (CheckBox)sender);
 }
 private void cb_telegram_CheckedChanged(object sender, EventArgs e)
 {
     Global_GUI.GroupboxEnableDisable(groupBoxTelegram, (CheckBox)sender);
 }
 private void cb_Pushover_Enabled_CheckedChanged(object sender, EventArgs e)
 {
     Global_GUI.GroupboxEnableDisable(groupBoxPushover, (CheckBox)sender);
 }
示例#12
0
 private void chk_Enabled_CheckedChanged(object sender, EventArgs e)
 {
     Global_GUI.GroupboxEnableDisable(groupBox1, chk_Enabled);
 }
示例#13
0
 private void cb_RefinementServer_CheckedChanged(object sender, EventArgs e)
 {
     Global_GUI.GroupboxEnableDisable(groupBoxRefine, cb_RefinementServer);
 }
示例#14
0
        private void Frm_AIServerDeepstackEdit_Load(object sender, EventArgs e)
        {
            //Global_GUI.RestoreWindowState(this);

            this.tb_URL.Text   = this.CurURL.url;
            this.lbl_type.Text = this.CurURL.Type.ToString();

            if (this.CurURL.Type == URLTypeEnum.AWSRekognition_Objects || this.CurURL.Type == URLTypeEnum.AWSRekognition_Faces)
            {
                this.tb_URL.Enabled = false;
            }
            else
            {
                this.tb_URL.Enabled = true;
            }

            this.tb_ActiveTimeRange.Text    = this.CurURL.ActiveTimeRange;
            this.chk_Enabled.Checked        = this.CurURL.Enabled.ReadFullFence();
            this.tb_ApplyToCams.Text        = this.CurURL.Cameras;
            this.tb_ImagesPerMonth.Text     = this.CurURL.MaxImagesPerMonth.ToString();
            this.cb_ImageAdjustProfile.Text = this.CurURL.ImageAdjustProfile;
            this.linkHelpURL.Text           = this.CurURL.HelpURL;
            this.tb_Lower.Text     = this.CurURL.Threshold_Lower.ToString();
            this.tb_Upper.Text     = this.CurURL.Threshold_Upper.ToString();
            this.tb_timeout.Text   = this.CurURL.HttpClientTimeoutSeconds.ToString();
            this.labelTimeout.Text = $"Timeout Seconds Override (Default={this.CurURL.GetTimeout().TotalSeconds}):";

            this.cb_RefinementServer.Checked = this.CurURL.UseAsRefinementServer;
            this.tb_RefinementObjects.Text   = this.CurURL.RefinementObjects;

            this.cb_LinkedServers.Checked = this.CurURL.LinkServerResults;

            this.cb_TimeoutError.Checked     = AppSettings.Settings.MaxWaitForAIServerTimeoutError;
            this.tb_LinkedRefineTimeout.Text = AppSettings.Settings.MaxWaitForAIServerMS.ToString();

            this.cb_OnlyLinked.Checked = this.CurURL.UseOnlyAsLinkedServer;

            List <string> linked = this.CurURL.LinkedResultsServerList.SplitStr(",;|");

            //Add all servers except current one and refinement server
            int idx = 0;

            foreach (ClsURLItem url in AppSettings.Settings.AIURLList)
            {
                if (!url.UseAsRefinementServer && !string.Equals(this.CurURL.ToString(), url.ToString(), StringComparison.OrdinalIgnoreCase))
                {
                    this.checkedComboBoxLinked.Items.Add(url);
                    if (Global.IsInList(url.ToString(), this.CurURL.LinkedResultsServerList, TrueIfEmpty: false))
                    {
                        this.checkedComboBoxLinked.SetItemChecked(idx, true);
                    }
                    idx++;
                }
            }

            foreach (ClsImageAdjust ia in AppSettings.Settings.ImageAdjustProfiles)
            {
                this.cb_ImageAdjustProfile.Items.Add(ia.Name);
            }

            this.cb_ImageAdjustProfile.SelectedIndex = this.cb_ImageAdjustProfile.Items.IndexOf(this.CurURL.DefaultURL);

            Global_GUI.GroupboxEnableDisable(groupBox1, chk_Enabled);
            Global_GUI.GroupboxEnableDisable(groupBoxRefine, cb_RefinementServer);
            Global_GUI.GroupboxEnableDisable(groupBoxLinked, cb_LinkedServers);
        }
        private void LoadRO([CallerMemberName()] string memberName = null)
        {
            Loading = true;

            using var Trace = new Trace();  //This c# 8.0 using feature will auto dispose when the function is done.
            try
            {
                if (this.ro.IsNull())
                {
                    this.cb_enabled.Checked      = false;
                    this.cb_enabled.Enabled      = false;
                    this.tb_Name.Text            = "";
                    this.tb_Time.Text            = "";
                    this.tb_ConfidenceLower.Text = "";
                    this.tb_ConfidenceUpper.Text = "";
                    this.tb_MinPercent.Text      = "";
                    this.tb_maxpercent.Text      = "";
                }
                else
                {
                    this.cb_enabled.Checked      = this.ro.Enabled;
                    this.cb_enabled.Enabled      = true;
                    this.tb_Name.Text            = this.ro.Name;
                    this.tb_Time.Text            = this.ro.ActiveTimeRange;
                    this.tb_ConfidenceLower.Text = this.ro.Threshold_lower.ToString();
                    this.tb_ConfidenceUpper.Text = this.ro.Threshold_upper.ToString();

                    this.tb_MinPercent.Text = this.ro.PredSizeMinPercentOfImage.ToString();
                    this.tb_maxpercent.Text = this.ro.PredSizeMaxPercentOfImage.ToString();

                    if (this.tb_Name.Text.EqualsIgnoreCase("NEW OBJECT") || this.tb_Name.Text.IsEmpty())
                    {
                        this.tb_Name.Enabled = true;
                    }
                    else
                    {
                        this.tb_Name.Enabled = false;
                    }

                    this.cb_ObjectTriggers.Checked = this.ro.Trigger;

                    this.cb_ObjectIgnoreImageMask.Checked = this.ro.IgnoreImageMask;
                    if (this.ro.IgnoreDynamicMask.HasValue)
                    {
                        this.cb_ObjectIgnoreDynamicMask.Checked = this.ro.IgnoreDynamicMask.Value;
                    }

                    if (this.ROMName.Has("\\default"))
                    {
                        this.cb_ObjectIgnoreDynamicMask.Enabled = true;
                        this.cb_ObjectIgnoreImageMask.Enabled   = true;
                    }
                    else
                    {
                        this.cb_ObjectIgnoreDynamicMask.Enabled = false;
                        this.cb_ObjectIgnoreImageMask.Enabled   = false;
                    }
                }

                Global_GUI.GroupboxEnableDisable(groupBox1, cb_enabled);
            }
            catch (Exception ex)
            {
                AITOOL.Log("Error: " + ex.Msg());
            }
            finally
            {
                NeedsSaving = false;
                Loading     = false;
            }
        }
示例#16
0
 private void cb_LinkedServers_CheckedChanged(object sender, EventArgs e)
 {
     Global_GUI.GroupboxEnableDisable(groupBoxLinked, cb_LinkedServers);
 }