private void GroupBoxMMParametersCustomChanged(object sender, EventArgs e) { //return if form load hasn't finished if (textBoxLMax.Text == "" || textBoxRssiMin.Text == "" || textBoxRssiMax.Text == "" || textBoxXAmp.Text == "") { return; } //return if not a number if (!regexNumbers.Match(textBoxLMax.Text).Success || !regexNumbers.Match(textBoxRssiMin.Text).Success || !regexNumbers.Match(textBoxRssiMax.Text).Success || !regexNumbers.Match(textBoxXAmp.Text).Success) { return; } MathematicModelParameters.UpdateParams( lMax: Convert.ToDouble(textBoxLMax.Text), rssiMin: Convert.ToDouble(textBoxRssiMin.Text), rssiMax: Convert.ToDouble(textBoxRssiMax.Text), xAmp: Convert.ToDouble(textBoxXAmp.Text) ); }
private void ButtonUseParametersConfigFile_Click(object sender, EventArgs e) { WriteLog("Loading Mathematical Parameters configuration file...", 0); dc.LoadMMParametersConfigFile(); UpdateUIMMParams(); WriteLog(String.Format("Using Mathematical Model Parameters: {0}", MathematicModelParameters.ParametersToString()), 0); }
private void Form1_Load(object sender, EventArgs e) { DisabledForm(); /// Used to workaround the replacing of '.' to ',' when converting strings into floating-point numbers Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); #region Vareables Initialization tagsBindingList = new BindingList <Tag>(); dataGridViewTagsList.DataSource = tagsBindingList; devicesFound = new List <Device>(); devicesConnected = new List <Device>(); dc = new DataController( writeLog: WriteLog, updateUIGridMetaTagsDel: UpdateUIGridMetaTagsDel, removeFromUIGridMetaTagsDel: RemoveFromUIGridMetaTagsDel, clearUIGridMetaTagsDel: ClearUIGridMetaTagsDel, updateUIGridTagsDel: UpdateUIGridTagsDel); /// Loads all configuration files dc.LoadConfigFiles(); /// Tests if MySQL connection is successful dc.TestMySQLConnection(); //dc.ConnectAllDevices(); //dc.StartReads(null); #endregion UpdateUI(); WriteLog(String.Format("Using Mathematical Model Parameters: {0}", MathematicModelParameters.ParametersToString()), 0); WriteToWriteLogDevicesFound(); }