Пример #1
0
        public static void DrawPacketClear()
        {
            if (FormUiManager.InvokeRequired)
            {
                FormUiManager.Invoke((MethodInvoker)DrawPacketClear);
                return;
            }

            /* 表示処理中パケットをクリア */
            lock (draw_packets_sync_) {
                draw_packets_ = new Queue <IEnumerable <PacketObject> >();
            }

            /* 変換器をクリア */
            PacketConvertManager.Instance.InputStatusClear();

            /* パケットビューをクリア */
            PacketViewManager.Instance.ClearPacket();

            /* パケット数を更新 */
            packet_count_all_  = 0;
            packet_count_draw_ = 0;

            UpdatePacketCount();

            /* イベント通知 */
            DrawPacketCleared();
        }
Пример #2
0
        private static void OnUpdateConverter()
        {
            /* メニューを更新 */
            FormUiManager.MainFrameMenuBarUpdate();

            /* 変換器が更新されたので再描画 */
            RedrawPacketRequest();
        }
Пример #3
0
 private static void UpdatePacketCount()
 {
     FormUiManager.SetPacketCounter(GatePacketManager.PacketCount, packet_count_all_, packet_count_draw_, PacketViewManager.Instance.DrawPacketCount);
 }
Пример #4
0
        private static void RedrawPacketPoll()
        {
            if (!redraw_state_)
            {
                return;
            }

            switch (redraw_seq_)
            {
            case RedrawSequence.DrawingCancelStart:
            {
                /* イベント処理を一時停止 */
                GatePacketManager.Enable = false;

                redraw_seq_++;
            }
            break;

            case RedrawSequence.DrawingCancelBusy:
            {
                if (!IsDrawPreprocessBusy)
                {
                    /* 現在のパケットを全てクリア */
                    DrawPacketClear();

                    /* 描画処理開始 */
                    redraw_req_ = false;

                    redraw_seq_++;
                }
            }
            break;

            case RedrawSequence.Ready:
            {
                DebugManager.MessageOut(DebugMessageSender.Form, "RedrawSequence.Ready");

                /* 高速描画モード開始 */
                PacketViewManager.Instance.HiSpeedDrawStart(false);

                /* 現在のパケットを全て描画パケットにセットアップ */
                DrawPacketPush(GatePacketManager.GetPackets());

                redraw_seq_++;
            }
            break;

            case RedrawSequence.PreprocessingStart:
            {
                DebugManager.MessageOut(DebugMessageSender.Form, "RedrawSequence.PreprocessingStart");

                redraw_step_all_ = (ulong)(Math.Max(draw_packets_.Count, 1));
                redraw_step_end_ = 0;
                redraw_progress_ = 0;

                redraw_seq_++;

                /* プログレスバーを初期化 */
                FormUiManager.SetStatusText(StatusTextID.ReloadScreen, ConfigManager.Language.MainMessage.PacketNowPreprocessing.Value);
                FormUiManager.SetProgressBar(redraw_progress_, false);
            }
            break;

            case RedrawSequence.PreprocessingBusy:
            {
                redraw_step_end_ = Math.Min(redraw_step_all_ - (ulong)draw_packets_.Count, redraw_step_all_);
                redraw_step_end_ = Math.Max(redraw_step_end_, 1);
                redraw_progress_ = Math.Min((byte)(redraw_step_end_ * 100 / redraw_step_all_), (byte)100);

                if ((redraw_progress_ == 100) && (!IsDrawPreprocessBusy))
                {
                    redraw_seq_++;
                }

                /* プログレスバーに反映 */
                FormUiManager.SetProgressBar(redraw_progress_, false);
            }
            break;

            case RedrawSequence.DrawingStart:
            {
                DebugManager.MessageOut(DebugMessageSender.Form, "RedrawSequence.DrawingStart");

                redraw_step_all_ = (ulong)Math.Max(PacketViewManager.Instance.DrawPacketCount, 1);
                redraw_step_end_ = 0;
                redraw_progress_ = 0;

                redraw_seq_++;

                /* プログレスバーを初期化 */
                FormUiManager.SetStatusText(StatusTextID.ReloadScreen, ConfigManager.Language.MainMessage.PacketNowDrawing.Value);
                FormUiManager.SetProgressBar(0, false);
            }
            break;

            case RedrawSequence.DrawingBusy:
            {
                redraw_step_end_ = Math.Min(redraw_step_all_, redraw_step_all_ - (ulong)PacketViewManager.Instance.DrawPacketCount);
                redraw_step_end_ = Math.Max(redraw_step_end_, 1);
                redraw_progress_ = Math.Min((byte)(redraw_step_end_ * 100 / redraw_step_all_), (byte)100);

                if (redraw_progress_ == 100)
                {
                    redraw_seq_++;
                }

                /* プログレスバーに反映 */
                FormUiManager.SetProgressBar(redraw_progress_, false);
            }
            break;

            case RedrawSequence.Complete:
            {
                /* イベント処理再開 */
                GatePacketManager.Enable = true;

                /* 高速描画モード終了 */
                PacketViewManager.Instance.HiSpeedDrawStop();

                /* プログレスバーを最終値に設定 */
                FormUiManager.SetStatusText(StatusTextID.ReloadScreen, "");
                FormUiManager.SetProgressBar(100, true);

                redraw_state_ = false;

                DebugManager.MessageOut(DebugMessageSender.Form, "RedrawSequence.Complete");
            }
            break;

            default:
            {
                redraw_seq_++;
            }
            break;
            }
        }
Пример #5
0
 private static void OnViewStatusUpdated()
 {
     FormUiManager.MainFrameStatusBarUpdate();
 }
Пример #6
0
 private static void OnViewInstanceUpdated()
 {
     FormUiManager.MainFrameMenuBarUpdate();
 }