コード例 #1
0
ファイル: PRunFlowPanel.xaml.cs プロジェクト: WildGenie/863
        ///<summary>视图状态变化,改变列表显示内容</summary>
        void earth_VisualRangeChanged(object sender, EventArgs e)
        {
            double      curdistance   = root.earth.camera.curCameraDistanceToGround;
            EViewStatus newviewstatus = (curdistance < root.visualdistance) ? EViewStatus.显示变压器 : EViewStatus.显示变电站;

            if (viewstatus != newviewstatus)
            {
                viewstatus = newviewstatus;
                if (viewstatus == EViewStatus.显示变电站)
                {
                    var lst2 = (from e0 in root.earth.objManager.zLayers.Values
                                from e1 in e0.pModels.Values.Where(p => p.busiDesc != null && (p.busiDesc as DescData).objCategory == EObjectCategory.变电设施类 && p.busiRunData != null)
                                orderby(e1.busiRunData as RunDataTransformFacilityBase).rateOfLoad descending
                                select e1).Take(50);
                    lstStation.ItemsSource = lst2;
                }
                else if (viewstatus == EViewStatus.显示变压器)
                {
                    var lst2 = (from e0 in root.earth.objManager.zLayers.Values
                                from e1 in e0.pModels.Values.Where(p => p.busiDesc != null && (p.busiDesc as DescData).objCategory == EObjectCategory.变压器类 && p.busiRunData != null)
                                orderby(e1.busiRunData as RunDataTransformerBase).rateOfLoad descending
                                select e1).Take(50);
                    lstStation.ItemsSource = lst2;
                }
            }
        }
コード例 #2
0
        ///<summary>视图状态变化,改变列表显示内容</summary>
        void earth_VisualRangeChanged(object sender, EventArgs e)
        {
            double      curdistance   = root.earth.camera.curCameraDistanceToGround;
            EViewStatus newviewstatus = (curdistance < root.visualdistance) ? EViewStatus.显示变压器 : EViewStatus.显示变电站;

            if (viewstatus != newviewstatus)
            {
                viewstatus = newviewstatus;
                refreshTranformerlist();
            }
        }