Пример #1
0
        public ListViewPanel CreateDataViewPanel(DBDataProvider dataProvider, ConfigEntry entry, bool showList = true)
		{
            string deviceKey = entry.DeviceKey;
            string displayName = entry.DisplayName;
            if (this.panelDict.ContainsKey(deviceKey))
            {
                ListViewPanel panel = this.panelDict[deviceKey];
                if (this.currentPanel != panel)
                {
                    this.currentPanel.Visibility = Visibility.Hidden;
                }
                panel.Visibility = Visibility.Visible;
                this.currentPanel = panel;
                return panel;
            }
            else
            {
                // !
                ListViewPanel panel = new ListViewPanel(dataProvider, entry);
                DataListener dataListener = dataProvider.GetDataListener(deviceKey);
                panel.SetIcon(entry.Icon);
                panel.AddDataListener(dataListener);
                if (showList)
                {
                    panel.ListView = this.ShowListView(panel, dataListener);
                    panel.SearchView = this.ShowListView(panel, dataListener);
                    panel.GraphView = this.ShowGraphView(panel, dataListener);
                    panel.GraphSearchView = this.ShowSearchGraphView(panel, dataListener);

                    // Notice; Comment 4-7.
                    // panel.ListRecentData();
                    // 是否显示 控制面板
                    if (deviceKey == DataProvider.DeviceKey_MDS)
                    {
                        panel.ControlPanel = this.ShowControlView(DataProvider.DeviceKey_MDS);
                    }
                    else if (deviceKey == DataProvider.DeviceKey_AIS)
                    {
                        panel.ControlPanel = this.ShowControlView(DataProvider.DeviceKey_AIS);
                    }
                    else if (deviceKey == DataProvider.DeviceKey_NaI)
                    {
                        panel.SetupContextMenu((ListView)panel.ListView);
                        panel.SetupContextMenu((ListView)panel.SearchView);
                        panel.EnergyPanel = this.ShowEnergyView(DataProvider.DeviceKey_NaI);
                    }
                }

                if (this.currentPanel != null)
                {
                    this.currentPanel.Visibility = Visibility.Hidden;
                }
                this.currentPanel = panel;

                this.panelDict.Add(deviceKey, panel);
                return panel;
            }
		}
Пример #2
0
        public ListViewPanel CreateDataViewPanel(DataProvider dataProvider, ConfigEntry entry, bool showList = true)
		{
            string deviceKey = entry.DeviceKey;
            string displayName = entry.DisplayName;
            if (this.panelDict.ContainsKey(deviceKey))
            {
                ListViewPanel panel = this.panelDict[deviceKey];
                if (this.currentPanel != panel)
                {
                    this.currentPanel.Visibility = Visibility.Hidden;
                }
                panel.Visibility = Visibility.Visible;
                this.currentPanel = panel;
                return panel;
            }
            else
            {
                // !
                ListViewPanel panel = new ListViewPanel(dataProvider, entry);
                DataListener dataListener = dataProvider.GetDataListener(deviceKey);
                panel.AddDataListener(dataListener);
                if (showList)
                {
                    panel.ListView = this.ShowListView(panel, dataListener);
                    panel.SearchView = this.ShowListView(panel, dataListener);
                    panel.GraphView = this.ShowGraphView(panel, dataListener, true);
                    panel.GraphSearchView = this.ShowSearchGraphView(panel, dataListener, false);

                    panel.ListRecentData();
                    // 是否显示 控制面板
                    if (deviceKey == DataProvider.DeviceKey_HvSampler)
                    {
                        panel.ControlPanel = this.ShowControlView(DataProvider.DeviceKey_HvSampler);
                    }
                    else if (deviceKey == DataProvider.DeviceKey_ISampler)
                    {
                        panel.ControlPanel = this.ShowControlView(DataProvider.DeviceKey_ISampler);
                    }
                }

                if (this.currentPanel != null)
                {
                    this.currentPanel.Visibility = Visibility.Hidden;
                }
                this.currentPanel = panel;

                this.panelDict.Add(deviceKey, panel);
                return panel;
            }
		}