public UCCounter() { InitializeComponent(); _counter = new Counter(); FormTimer = new FormTimer(_counter); FormTimer.Hide(); }
public UCCounterTypeChanger() { InitializeComponent(); _counter = new Counter(); FormTimer1 = new FormTimer(_counter); FormTimer1.Hide(); FormTimer2 = new FormTimer(_counter); FormTimer2.Hide(); UcCounter = new UCCounter(); }
public void Save(FormTimer formTimer) { var existing = _session.Get <FormTimer>(formTimer); if (existing == null) { _session.Save(formTimer); _session.Flush(); } }
private IEnumerator AfterTimeBackToMenu() { yield return new WaitForSeconds(7.5f); FormTimer x = FindObjectOfType<FormTimer>(); if (x) { x.OpenForm(); } SceneManager.LoadScene(0); }
public UCTimeSettings() { InitializeComponent(); Counter = new Counter(); _formTimer1 = new FormTimer(Counter); _formTimer1.Hide(); _formTimer2 = new FormTimer(Counter); _formTimer2.Hide(); GlobalSettings = new GlobalSettings(); UcCounter = new UCCounter(); _ucEffectBox = new UCEffectBox(); }
public UCFontSizeBox() { InitializeComponent(); _counter = new Counter(); _formTimer = new FormTimer(_counter); _formTimer.Hide(); _globalSettings = new GlobalSettings(); //nupdFontSize.Value = _counter.FontSize; nupdFontSize.Value = 219; }
public UCEffectBox() { InitializeComponent(); _counter = new Counter(); FormTimer1 = new FormTimer(_counter); FormTimer1.Hide(); FormTimer2 = new FormTimer(_counter); FormTimer2.Hide(); chbEffectBackCounter.Text = "Visszaszámlálásnál figyelmeztetés \r\n( KI )"; chbFlash.Text = "Villog, ha lejárt az idő \r\n( KI )"; }
void Start() { if (Instance == null) { Instance = this; } else { Destroy(gameObject); } questionGameObject.gameObject.SetActive(false); DontDestroyOnLoad(gameObject); StartCoroutine(Timer(time)); timeIsOver = false; }
public UCMonitorControlBox() { InitializeComponent(); _counter = new Counter(); _globalSettings = new GlobalSettings(); nupdMonitor.Minimum = 1; nupdMonitor.Maximum = _counter.MonitorQuantity; _minimized = false; _maximized = true; _formTimer = new FormTimer(_counter); _formTimer.Hide(); _windowPriority = 3; }
private bool disposedValue = false; // To detect redundant calls // IDisposable /// <summary> /// ''' Disposes of resources used by the profile object - called by IDisposable interface /// ''' </summary> /// ''' <param name="disposing"></param> /// ''' <remarks></remarks> protected virtual void Dispose(bool disposing) { if (!this.disposedValue) { if (disposing) { TL.Enabled = false; TL.Dispose(); } if (!(FormTimer == null)) { if (!FormTimer == null) { FormTimer.Enabled = false; } FormTimer.Dispose(); FormTimer = null; } } this.disposedValue = true; }
void SetupSolutionParams() { SolutionPanel.SolveButtonHandler = solution; void solution(bool isGraphic) { GraphicSettings settings = null; SolutionPanel.button1.Enabled = false; if (isMethodParams && isFuncParams) { if (isGraphic) { this.graphicFirstDimension = (int)SolutionPanel.firstVar.Value; this.graphicSecondDimension = ((int)SolutionPanel.secondVar.Value != graphicFirstDimension) ? (int)SolutionPanel.secondVar.Value : ((int)SolutionPanel.secondVar.Value != (int)SolutionPanel.secondVar.Maximum) ? Math.Min(this.graphicFirstDimension + 1, (int)SolutionPanel.secondVar.Maximum): this.graphicFirstDimension - 1; graphic = new GraphicWindow(graphicWindowHeight, graphicWindowWidth, graphicWindowFPS, graphicWindowVsync, graphicWindowAnit); graphic.SetRectangleLimit(rectangleLimit); RectangleHandler handler = new RectangleHandler(graphic.GetRectangleFromMethod); settings = new GraphicSettings(handler, graphicFirstDimension, graphicSecondDimension); graphic?.Window.SetActive(false); } if (isDihtomiaCurrentMethod) { var method = currentMethodSettings as DihtomiaParams; double funcMin = 0; int counter = 0; int optimal = 0; List <double> optimalPoint = null; FormTimer.Start(); watch.Restart(); Task.Run(() => { this.isCalculating = true; var solve = MNPD.Solve(method.Function, method.Lipzits, method.Precision, method.LipzitsParametr, method.LowerPoint, method.UpperPoint, method.Rule, settings); funcMin = solve.FunctionMinimum; counter = solve.counter; optimal = solve.optimal; optimalPoint = solve.optimalPoint; this.Invoke(new Action(() => { watch.Stop(); Logs($"Мин. значение функции={funcMin}\nЧисло итерации={counter}\nИтерация оптимального значения={optimal}"); Logs(string.Join("\r\n", optimalPoint.Select((point, index) => $"x{index} = {String.Format("{0:F8}", point)}"))); graphic?.ShowWindow(); SolutionPanel.button1.Enabled = false; } )); }).ContinueWith((taskRes) => { this.isCalculating = false; this.Invoke(new Action(() => { SolutionPanel.button1.Enabled = true; FormTimer.Stop(); })); //TODO: NORMAL RESET }); } else { var method = currentMethodSettings as ModificatedParams; double funcMin = 0; int counter = 0; int optimal = 0; List <double> optimalPoint = null; FormTimer.Start(); watch.Restart(); Task.Run(() => { this.isCalculating = true; var solve = MNPANK.Solve(method.Function, method.Lipzits, method.Precision, method.LipzitsParametr, method.LowerPoint, method.UpperPoint, method.SubRule, method.MainRule, settings); funcMin = solve.FunctionMinimum; counter = solve.counter; optimal = solve.optimal; optimalPoint = solve.optimalPoint; this.Invoke(new Action(() => { watch.Stop(); Logs($"\r\nМин. значение функции={funcMin}\r\nЧисло итерации={counter}\r\nИтерация оптимального значения={optimal}\r\n"); Logs("Точка оптимума:"); Logs(string.Join("\r\n", optimalPoint.Select((point, index) => $"x{index} = {String.Format("{0:F8}", point)}"))); graphic?.ShowWindow(); SolutionPanel.button1.Enabled = false; } )); //graphic?.Window.SetActive(true); }).ContinueWith((taskRes) => { this.isCalculating = false; this.Invoke(new Action(() => { SolutionPanel.button1.Enabled = true; FormTimer.Stop(); })); }); } } GC.Collect(); } }