// Metóda na nastavenie textu na labeloch. public void SetOptionsLablesText(OptionsInput settings) { XSizeLabel.Text = $"X size (actual {settings.xSize}):"; YSizeLabel.Text = $"Y size (actual {settings.ySize}):"; XStartLabel.Text = $"X start position (actual {settings.xStart}):"; YStartLabel.Text = $"Y start position (actual {settings.yStart}):"; TresholdLabel.Text = $"Size of K (actual {settings.tresHold}):"; ReplicationsLabel.Text = $"Replications (actual {settings.numberOfReplications}):"; PreheatingLabel.Text = $"Preheating (actual {settings.preheating}):"; RecordIntervalLabel.Text = $"Record interval (actual {settings.recordInterval}):"; }
// Nastaví hodnoty, textových oblastí. public void SetOptionsInputText(OptionsInput settings) { this.XSizeInput.Text = settings.xSize; this.YSizeInput.Text = settings.ySize; this.XStartInput.Text = settings.xStart; this.YStartInput.Text = settings.yStart; this.ReplicationsInput.Text = settings.numberOfReplications; this.TresholdInput.Text = settings.tresHold; this.PreheatingInput.Text = settings.preheating; this.RecordIntervalInput.Text = settings.recordInterval; if (!this.RandomSeedCheck.Checked) { this.SeedInput.Text = settings.seed; } }
// Metóda, ktorá nastaví zobrazované hodnoty v paneli nastavení na základe aktuálnych nastavení simulácie. public void InitilaizeOptionsValues(Model.SimulationSettings settings) { var data = new OptionsInput { xSize = settings.XSize.ToString(), ySize = settings.YSize.ToString(), xStart = settings.XStart.ToString(), yStart = settings.YStart.ToString(), numberOfReplications = settings.NumberOfReplications.ToString(), tresHold = settings.TresHold.ToString(), preheating = settings.Preheating.ToString(), recordInterval = settings.RecordInterval.ToString(), errorOccured = false }; SimOptionsView.SetOptionsInputText(data); SimOptionsView.SetOptionsLablesText(data); }
// Získa hodnoty, ktoré boli zadané na vstupe jednotlivých TextBoxov. public OptionsInput GetOptionsInput() { var settings = new OptionsInput(); settings.xSize = this.XSizeInput.Text; settings.ySize = this.YSizeInput.Text; settings.xStart = this.XStartInput.Text; settings.yStart = this.YStartInput.Text; settings.numberOfReplications = this.ReplicationsInput.Text; settings.tresHold = this.TresholdInput.Text; settings.autoSeed = this.RandomSeedCheck.Checked; settings.preheating = this.PreheatingInput.Text; settings.recordInterval = this.RecordIntervalInput.Text; if (!this.RandomSeedCheck.Checked) { settings.seed = this.SeedInput.Text; } settings.errorOccured = false; return(settings); }