Пример #1
0
        public void DERDashboardFlexibility(object parameter)
        {
            _dERDashboardFlexibility = parameter;

            if (UserControlPresenter.GetType().Name == "DERDashboardUserControl")
            {
                ((DERDashboardUserControlViewModel)UserControlPresenter.DataContext).DERDashboardFlexibility(parameter);
            }
        }
Пример #2
0
        public void DERDashboardDerForecastDayAhead(object parameter)
        {
            _dERDashboardDerForecastDayAhead = parameter;

            if (UserControlPresenter.GetType().Name == "DERDashboardUserControl")
            {
                ((DERDashboardUserControlViewModel)UserControlPresenter.DataContext).DERDashboardDerForecastDayAhead(parameter);
            }
        }
Пример #3
0
        public void NetworkModelTreeClassChangedMenu(object parameter)
        {
            _networkModelTreeClass = ((DataToUI)parameter).NetworkModelTreeClass;

            if (_tree != null)
            {
                List <NetworkModelTreeClass> _networkModelTreeClass = ((DataToUI)parameter).NetworkModelTreeClass;

                foreach (NetworkModelTreeClass io in _networkModelTreeClass)
                {
                    foreach (GeographicalRegionTreeClass geographicalRegionTreeClass in io.GeographicalRegions)
                    {
                        foreach (GeographicalSubRegionTreeClass geographicalSubRegionTreeClass in geographicalRegionTreeClass.GeographicalSubRegions)
                        {
                            foreach (SubstationTreeClass substationTreeClass in geographicalSubRegionTreeClass.Substations)
                            {
                                foreach (SubstationElementTreeClass substationElementTreeClass in substationTreeClass.SubstationElements)
                                {
                                    if (substationElementTreeClass.Type.Equals(DMSType.GENERATOR))
                                    {
                                        TreeNode <NodeData> nodeData = _tree.Where(x => x.Data.IdentifiedObject.GlobalId.Equals(substationElementTreeClass.GID)).FirstOrDefault();
                                        if (nodeData.Data.IdentifiedObject != null)
                                        {
                                            ((Generator)nodeData.Data.IdentifiedObject).MinFlexibility = substationElementTreeClass.MinFlexibility;
                                            ((Generator)nodeData.Data.IdentifiedObject).MaxFlexibility = substationElementTreeClass.MaxFlexibility;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }

            if (UserControlPresenter.GetType().Name == "DERDashboardUserControl")
            {
                ((DERDashboardUserControlViewModel)UserControlPresenter.DataContext).NetworkModel = _networkModelTreeClass;
            }

            if (UserControlPresenter.GetType().Name == "GISUserControl")
            {
                ((GISUserControlViewModel)UserControlPresenter.DataContext).Tree = _tree;;
            }
        }
Пример #4
0
        private void GetNetworkModelFromProxy(object parameter)
        {
            if (loadingWindow != null)
            {
                loadingWindow.Close();
                loadingWindow = null;
            }

            List <object> obj = (List <object>)parameter;

            _tree = (TreeNode <NodeData>)obj[0];
            _networkModelTreeClass = (List <NetworkModelTreeClass>)obj[1];

            if (UserControlPresenter.GetType().Name == "GISUserControl")
            {
                ((GISUserControlViewModel)UserControlPresenter.DataContext).Tree = _tree;
            }
            //SetUserContro("GIS");
        }