示例#1
0
        private void OpenWindowsCharthistory(ChartType chartType)
        {
            try
            {
                ChartLiveData selected = null;

                foreach (var chartLiveData in AllCharts)
                {
                    if (chartLiveData.IsSelected)
                    {
                        selected = chartLiveData;
                        break;
                    }
                }

                if (selected == null)
                {
                    ShowMsgOnStatusBar("First select a item");
                    return;
                }


                Dictionary <int, int> dictionary = new Dictionary <int, int>();
                dictionary.Add(0, selected.ItemsAioViewModel.ItemId);
                WindowChartHistory windowChartHistory = new WindowChartHistory();
                windowChartHistory.ProcessDataServiceClient = this.ProcessDataServiceClient;
                windowChartHistory.ItemsId = dictionary;

                // TODO Parameter
                windowChartHistory.StartTime = DateTime.Now - new TimeSpan(0, 24, 0, 0);

                // TODO Parameter
                windowChartHistory.EndTime   = DateTime.Now;
                windowChartHistory.ChartType = chartType;

                windowChartHistory.Show();
                windowChartHistory.ShowData();
            }
            catch (Exception ex)
            {
                Logger.LogIndustrialMonitoring(ex);
            }
        }
示例#2
0
        private void OpenWindowChartHistoryInCompareMode(ChartType chartType)
        {
            try
            {
                if (ItemsForCompare.Count < 2)
                {
                    ShowMsgOnStatusBar(string.Format("At least 2 Item is needed for Compare,you have selected {0}",
                                                     ItemsForCompare.Count));
                    return;
                }

                Dictionary <int, int> dictionary = new Dictionary <int, int>();

                int i = 0;
                foreach (var chartLiveData in ItemsForCompare)
                {
                    dictionary.Add(i, chartLiveData.ItemsAioViewModel.ItemId);
                    i++;
                }

                WindowChartHistory windowChartHistory = new WindowChartHistory();
                windowChartHistory.ProcessDataServiceClient = this.ProcessDataServiceClient;
                windowChartHistory.ItemsId   = dictionary;
                windowChartHistory.ChartType = chartType;

                // TODO Parameter
                windowChartHistory.StartTime = DateTime.Now - new TimeSpan(0, 24, 0, 0);

                // TODO Parameter
                windowChartHistory.EndTime = DateTime.Now;

                windowChartHistory.Show();
                windowChartHistory.ShowData();
            }
            catch (Exception ex)
            {
                Logger.LogIndustrialMonitoring(ex);
            }
        }