Esempio n. 1
0
        private void UpdateDataRateView()
        {
            if (InvokeRequired)
            {
                BeginInvoke(new UpdateDataRateViewHandler(UpdateDataRateView));
                return;
            }

            PBox_DataRate.Invalidate();
        }
Esempio n. 2
0
        private void UpdateDataRate(ulong send_rate, ulong recv_rate)
        {
            /* 最新データを記憶 */
            send_data_rate_latest_ = send_rate;
            recv_data_rate_latest_ = recv_rate;

#if false
            /* グラフ表示用に入力データを補正 */
            send_rate = Math.Min(send_rate, gate_.GateProperty.DataRateGraphLimit) * (ulong)DATA_RATE_GRAPH_REGION.Height;
            recv_rate = Math.Min(recv_rate, gate_.GateProperty.DataRateGraphLimit) * (ulong)DATA_RATE_GRAPH_REGION.Height;

            if (send_rate > 0)
            {
                send_rate /= gate_.GateProperty.DataRateGraphLimit;
            }
            if (recv_rate > 0)
            {
                recv_rate /= gate_.GateProperty.DataRateGraphLimit;
            }
#endif

            /* グラフ表示用に入力データを補正して記憶 */
            send_data_rate_buffer_[data_rate_in_] = send_rate;
            recv_data_rate_buffer_[data_rate_in_] = recv_rate;

            /* 入力ポインタを移動 */
            if (data_rate_in_ < (send_data_rate_buffer_.Length - 1))
            {
                data_rate_in_++;
            }
            else
            {
                data_rate_in_ = 0;
            }

            PBox_DataRate.Invalidate();
        }