如何在图表中绘制消息的延迟 [英] How to plot latencies of messages in graph

查看:85
本文介绍了如何在图表中绘制消息的延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我试图在一张图的半空间中绘制从总线1到总线2的消息,并在同一图形的另一半空间中绘制总线1到总线3的消息



以下代码绘制了同一图表中的所有消息。



Hi,
I am trying to plot messages passing from bus 1 to bus 2 in half space of one graph and bus 1 to bus 3 in another half space of same graph

The following code plots all the messages in same graph.

if (numofBuses == "3")
            {
 
                foreach (GatewayMessageDetails GWmsgDetails in GWmsgDetailsList)
                {
                    if (GWmsgDetails.LatencyBusOnetoBusTwo == 0)
                    {
 
                        int MsgNo = (GWmsgDetailsList.IndexOf(GWmsgDetails) + 1);
 
                        pltOutput.Series[Constants.LEGEND_CYCLETIME].Points.AddXY(MsgNo, GWmsgDetails.TotalDeadLineTimeOfBusOnetoBusTwo);
                        pltOutput.Series[Constants.LEGEND_RT_SUCCESS].Points.AddXY(MsgNo, GWmsgDetails.ResponseTimeBusOnetoBusTwo);
                        pltOutput.Series[Constants.LEGEND_LATENCY].Points.AddXY(MsgNo, GWmsgDetails.LatencyBusOnetoBusTwo);

 // Set Plot Type for each series
                        pltOutput.Series[Constants.LEGEND_CYCLETIME].ChartType = SeriesChartType.Point;
                        pltOutput.Series[Constants.LEGEND_LATENCY].ChartType = SeriesChartType.Point;
                        pltOutput.Series[Constants.LEGEND_RT_SUCCESS].ChartType = SeriesChartType.Point;


 
                        
                     
                    }
 
                   
                    if (GWmsgDetails.LatencyBusOnetoBusThree == 0)
                    {
                   
 
                        int MsgNo = (GWmsgDetailsList.IndexOf(GWmsgDetails) + 1);
 
                        pltOutput.Series[Constants.LEGEND_CYCLETIME].Points.AddXY(MsgNo, GWmsgDetails.TotalDeadLineTimeOfBusOnetoBusThree);
                        pltOutput.Series[Constants.LEGEND_RT_SUCCESS].Points.AddXY(MsgNo, GWmsgDetails.ResponseTimeBusOnetoBusThree);
                        pltOutput.Series[Constants.LEGEND_LATENCY].Points.AddXY(MsgNo, GWmsgDetails.LatencyBusOnetoBusThree);
 
                        // Set Plot Type for each series
                        pltOutput.Series[Constants.LEGEND_CYCLETIME].ChartType = SeriesChartType.Point;
                        pltOutput.Series[Constants.LEGEND_LATENCY].ChartType = SeriesChartType.Point;
                        pltOutput.Series[Constants.LEGEND_RT_SUCCESS].ChartType = SeriesChartType.Point;
 

                      
 
                   
 
                }
            }





我想将图表分成两半来分别显示消息



任何人都可以向我推荐一些关于这个的信息吗?





谢谢

John



I want to dividethe graph into 2 halfs to show the messages separately

Can anyone please suggest me something about this???


Thanks
John

推荐答案

让我们聊聊关于你的代码。如果numofBuses是一个整数,则应将其与整数而不是字符串进行比较,例如



if(numofBuses == 3)



if语句的两个分支之间有非常相似之处。我建议你创建一个方法来获取所需的参数,然后在两个if分支之间执行代码。



你有一个我回答的早期问题,询问ChartAreas 。用它们来分割图表。



最后,不要只是将一些代码复制到你的问题中。如果您这样做,请包括读者处理您的代码所需的所有声明。这将有助于我们为您提供帮助。
Let's talk about your code first. If numofBuses is an integer it should be compared to an integer not a string, like

if ( numofBuses == 3 )

There is extraordinary similarity between the two branches of the if statement. I recommend that you create a method that takes the needed parameters and executes the code between the two if branches.

You have an earlier question that I answered that asks about ChartAreas. Use them to split up your chart.

Lastly, do not just copy some of your code into your question. If you do, include all declarations necessary for a reader to undertand your code. That'll help us to help you.


这篇关于如何在图表中绘制消息的延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆