Update() public method

public Update ( ) : void
return void
 private void ButtonStart_Click(object sender, EventArgs e)
 {
     if (buttonStart.Text == "开始")
     {
         LOG.Clear();
         Result.Text      = "等待中";
         Result.BackColor = Color.Orange;
         Result.Update();
         buttonStart.Text = "结束";
         buttonStart.Update();
         runCa = new Thread(Runcal);
         runCa.Start();
     }
     else if (buttonStart.Text == "结束")
     {
         Result.Text      = "停止";
         Result.BackColor = Color.Orange;
         Result.Update();
         buttonStart.Text = "开始";
         buttonStart.Update();
         runCa.Abort();
         runCa.Join();
     }
     c2000.Text      = "待校准";
     c2000.BackColor = Color.Orange;
     c1040.Text      = "待校准";
     c1040.BackColor = Color.Orange;
     c800.Text       = "待校准";
     c800.BackColor  = Color.Orange;
     c500.Text       = "待校准";
     c500.BackColor  = Color.Orange;
     return;
 }
Exemplo n.º 2
0
        private void Detalle_Click(object sender, EventArgs e)
        {
            Result.SelectAll();
            Result.Clear();
            Result.Update();
            var fechaEvento = calendario.SelectionRange.Start.ToShortDateString();

            ArrayList array = EventoController.getInstancia().getEventosDiaEspecifico(fechaEvento);

            foreach (Evento x in array)
            {
                Result.AppendText("EVENTO: " + x.getNombreEvento() + "\n");
                Result.AppendText("DESCRIPCION: " + x.getDescripcion() + "\n");
                Result.AppendText("FECHA: " + x.getDia() + "-" + x.getMes() + "-" + x.getYear() + "" + "\n");

                string var = x.getImagen().Replace("\"", "");
                Console.WriteLine("la imagen es " + var);
                if (File.Exists(var))
                {
                    Clipboard.SetImage(Image.FromFile(x.getImagen().Replace("\"", "")));
                }
                else
                {
                    Result.AppendText("--IMAGEN NO DISPONIBLE---");
                }

                Result.Paste();
                Result.AppendText("\n");
            }
        }
Exemplo n.º 3
0
        public Result <string> UpdateMarketRawData(IEnumerable <MarketDataDefinition> definitions)
        {
            lock (_doManager)
            {
                var ret    = string.Empty;
                var result = new Result <string>();
                //_dispatcher.BeginInvoke(new Action(() =>
                //{
                //	try
                //	{
                //		foreach (var definition in definitions)
                //		{
                //			_doManager.Update(definition.Name, definition);
                //		}
                //	}
                //	catch (Exception ex)
                //	{
                //		Logger.Error(string.Format("Error when building market raw data {0}", ex.GetDetail()));
                //	}

                //	try
                //	{
                //		_doManager.ClearDependencyTree();
                //	}
                //	catch (Exception ex)
                //	{
                //		Logger.Error(string.Format("Error when building dependency tree {0}", ex.GetDetail()));
                //	}
                //	result.Update(ret, true);
                //}), RawDataUpdatePriority);

                try
                {
                    foreach (var definition in definitions)
                    {
                        _doManager.Update(definition.Name, definition);
                    }
                }
                catch (Exception ex)
                {
                    Logger.Error(string.Format("Error when building market raw data {0}", ex.GetDetail()));
                }

                try
                {
                    _doManager.ClearDependencyTree();
                }
                catch (Exception ex)
                {
                    Logger.Error(string.Format("Error when building dependency tree {0}", ex.GetDetail()));
                }
                result.Update(ret, true);

                return(result);
            }
        }
Exemplo n.º 4
0
        private void TextBox_Barcode_TextChanged(object sender, EventArgs e)
        {
            if (TextBox_Barcode.Text.Length == 10)
            {
                SN_Code = TextBox_Barcode.Text;
                if (Device_Address == null)
                {
                    MessageBox.Show("找不到可连接的 Agilent 34401A!");
                    TextBox_Barcode.Clear();
                    TextBox_Barcode.Focus();
                    return;
                }
                TextBox_Barcode.Clear();
                TextBox_Barcode.Focus();
                Current.Text     = "0.00";
                Result.BackColor = Color.Yellow;
                Result.Text      = "测试中,请等待......";
                Result.Update();
                Log.Clear();
                try
                {
                    if (measure != null && measure.IsAlive)
                    {
                        try
                        {
                            measure.Abort();
                        }
                        catch (ThreadAbortException)
                        {
                            Print_Log("终止线程");
                        }
                        finally
                        {
                            measure.Join();
                        }
                    }

                    measure = new Thread(Measure_Voltage);
                    measure.Start();
                    //measure.Join();
                }
                catch (Exception exp)
                {
                    Log.AppendText(exp.Message);
                }
            }
            if (TextBox_Barcode.Text.Length > 10)
            {
                Print_Log("输入字符超出预定长度,已重置!");
                TextBox_Barcode.Clear();
            }
        }
Exemplo n.º 5
0
        void ProcessFirstStage(ApiInfo rpInfo)
        {
            SetEnemy((RawBattleBase)rpInfo.Data);
            SetFormationAndEngagementForm(rpInfo);

            switch (rpInfo.Api)
            {
            case "api_req_sortie/battle":
            case "api_req_practice/battle":
                First = new DayNormalStage(this, rpInfo);
                break;

            case "api_req_battle_midnight/sp_midnight": First = new NightOnlyStage(this, rpInfo); break;

            case "api_req_sortie/airbattle":
            case "api_req_combined_battle/airbattle":
                First = new AerialCombatStage(this, rpInfo);
                break;

            case "api_req_sortie/ld_airbattle":
            case "api_req_combined_battle/ld_airbattle":
                First = new AerialAttackStage(this, rpInfo);
                break;

            case "api_req_combined_battle/battle": First = new FriendCombinedFleetCTFDayNormalStage(this, rpInfo); break;

            case "api_req_combined_battle/battle_water": First = new FriendCombinedFleetSTFDayNormalStage(this, rpInfo); break;

            case "api_req_combined_battle/sp_midnight": First = new FriendCombinedFleetNightOnlyStage(this, rpInfo); break;

            case "api_req_combined_battle/ec_battle": First = new EnemyCombinedFleetDay(this, rpInfo); break;

            case "api_req_combined_battle/each_battle": First = new CombinedFleetCTFDayNormalStage(this, rpInfo); break;

            case "api_req_combined_battle/each_battle_water": First = new CombinedFleetSTFDayNormalStage(this, rpInfo); break;
            }

            First.Process(rpInfo);
            First.Postprocess();
            Result.Update(First, Second);

            IsInitialized = true;

            CurrentStage = First;
            OnPropertyChanged(nameof(First));
            OnPropertyChanged(nameof(CurrentStage));
            OnPropertyChanged(nameof(AerialCombat));
            OnPropertyChanged(nameof(IsInitialized));
        }
Exemplo n.º 6
0
        internal void Question1()
        {
            if (!TryParseInput(0))
            {
                MessageBox.Show("Can't parse");
                return;
            }

            m_ring.DoTheCrab(100, (a_trace) =>
            {
                Result.Text += Environment.NewLine;
                Result.Text += a_trace;
                Result.Update();
            }
                             );
            Result.Text += Environment.NewLine;
            Result.Text += m_ring.ResultString();
        }
Exemplo n.º 7
0
        /// <summary>
        /// Add fill to position tracker
        /// </summary>
        /// <param name="fill"></param>
        internal void Adjust(Fill fill)
        {
            //Add to known fills
            TotalFillCount++;
            TotalFillValue += fill.Security.ConvertValue(fill.FillValue, Account.Currency);

            //Get position
            var pos = this[fill.Security];

            //Set new fill
            var trade = pos.Adjust(fill);

            //Set results (in case the fill triggered a trade)
            if (trade != null)
            {
                Result.Update(trade);
            }
        }
Exemplo n.º 8
0
        void ProcessSecondStage(ApiData rpData)
        {
            switch (rpData.Api)
            {
            case "api_req_battle_midnight/battle":
            case "api_req_practice/midnight_battle":
                Second = new NightNormalStage(this, rpData);
                break;

            case "api_req_combined_battle/midnight_battle": Second = new CombinedFleetNightNormalStage(this, rpData); break;
            }

            Second.Process(rpData);
            InheritFromPreviousStage(Second);
            Second.ProcessMVP();
            Result.Update(First, Second);

            CurrentStage = Second;
            OnPropertyChanged(nameof(Second));
            OnPropertyChanged(nameof(CurrentStage));
        }
Exemplo n.º 9
0
 public override void Run()
 {
     if (myUpdates.Count != 0)
     {
         PhysicsUpdate Result;
         if (myUpdates.TryDequeue(out Result))
         {
             Result.Update();
             Result.Ready();
         }
     }
     else if (myRequests.Count != 0)
     {
         PhysicsRequest Result;
         if (myRequests.TryDequeue(out Result))
         {
             Result.Perform();
             Result.Ready();
         }
     }
 }
Exemplo n.º 10
0
        public override void Update(GameTime gameTime, GameState gameState)
        {
            var Width  = gameState.Width;
            var Height = gameState.Height;

            Result.Update(Players);

            var viewPort = gameState.ViewPort.Size.ToVector2();

            UpdatePlayers(gameTime, gameState, viewPort, Players, Balls);

            UpdateBalls(gameTime, gameState, viewPort, Balls);
            Engine.Update();


            if (Result.Winner != null)
            {
                ResetGame(Width, Height);
                PongGame.ShowMainMenu();
            }
            base.Update(gameTime, gameState);
        }
Exemplo n.º 11
0
        void ProcessSecondStage(ApiInfo rpInfo)
        {
            switch (rpInfo.Api)
            {
            case "api_req_battle_midnight/battle":
            case "api_req_practice/midnight_battle":
                Second = new NightNormalStage(this, rpInfo);
                break;

            case "api_req_combined_battle/midnight_battle": Second = new FriendCombinedFleetNightNormalStage(this, rpInfo); break;

            case "api_req_combined_battle/ec_midnight_battle": Second = new EnemyCombinedFleetNight(this, rpInfo); break;
            }

            Second.Process(rpInfo, First);
            InheritFromPreviousStage(Second);
            Second.Postprocess();
            Result.Update(First, Second);

            CurrentStage = Second;
            OnPropertyChanged(nameof(Second));
            OnPropertyChanged(nameof(CurrentStage));
        }
Exemplo n.º 12
0
 /// <summary>
 /// Update results
 /// </summary>
 internal void UpdateResult() => Result.Update(this);