| | |
| | | using Hydro.Core.Model; |
| | | using Yw.WinFrmUI.Q3d; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | |
| | | using System.Text; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using static Hydro.MapView.MapViewEnum; |
| | | using static Yw.WinFrmUI.Q3d.MapViewEnum; |
| | | using System.Xml.Linq; |
| | | using Newtonsoft.Json; |
| | | using static Hydro.Core.ObjectEnum; |
| | | using static Yw.WinFrmUI.Q3d.ObjectEnum; |
| | | using System.Drawing.Design; |
| | | |
| | | namespace Hydro.MapView |
| | | namespace Yw.WinFrmUI.Q3d |
| | | { |
| | | [Serializable] |
| | | public class LinkViewModel : LinkCalcModel, IBaseViewModel |
| | | public class LinkViewModel : Q3DLinkCalcModel, IBaseViewModel |
| | | { |
| | | #region 构造函数 |
| | | |
| | |
| | | //Points = points; |
| | | } |
| | | #endregion |
| | | |
| | | #region 属性 |
| | | |
| | | |
| | |
| | | if (!is3Dview) |
| | | return new PointF[] { new PointF((float)(StartNode.X), (float)(StartNode.Y)), new PointF((float)(EndNode.X), (float)(EndNode.Y)) }; |
| | | else |
| | | return new PointF[] { new PointF((float)(StartNode.X), (float)(StartNode.Y - 2 * StartNode.Elev)), new PointF((float)(EndNode.X), (float)(EndNode.Y - 2 * EndNode.Elev)) }; |
| | | return new PointF[] { new PointF((float)(StartNode.X), (float)(StartNode.Y - 2 * StartNode.Z)), new PointF((float)(EndNode.X), (float)(EndNode.Y - 2 * EndNode.Z)) }; |
| | | } |
| | | |
| | | |
| | | [Category("基本信息")] |
| | | [DisplayName("标高(m)")] |
| | | [Browsable(false)] |
| | | public float Elev |
| | | public float Z |
| | | { |
| | | get |
| | | { |
| | | if (StartNode == null || EndNode == null) return 0; |
| | | return (StartNode.Elev + EndNode.Elev) / 2; |
| | | return (StartNode.Z + EndNode.Z) / 2; |
| | | } |
| | | set |
| | | { |
| | |
| | | [DisplayName("是否显示")] |
| | | public bool Visible { get; set; } = true; |
| | | |
| | | [Category("其他参数")] |
| | | [Description("标签")] |
| | | [DisplayName("标签")] |
| | | [Editor(typeof(MyEditor), typeof(UITypeEditor))] |
| | | public TagList Tags { get; set; } = null; |
| | | //[Category("其他参数")] |
| | | //[Description("标签")] |
| | | //[DisplayName("标签")] |
| | | //[Editor(typeof(MyEditor), typeof(UITypeEditor))] |
| | | //public TagList Tags { get; set; } = null; |
| | | |
| | | |
| | | |
| | |
| | | [DisplayName("ID类型")] |
| | | [Browsable(false)] |
| | | #endregion |
| | | |
| | | #region 方法 |
| | | |
| | | |
| | |
| | | if (this is TankViewModel) return MapObjectType.水池; |
| | | if (this is MeterViewModel) return MapObjectType.水表; |
| | | if (this is NozzleViewModel) return MapObjectType.喷头; |
| | | if (this is ValveNodeViewModel) return MapObjectType.阀门点; |
| | | |
| | | |
| | | |
| | | if (this is PipeViewModel) return MapObjectType.管线; |
| | | if (this is ValveViewModel) return MapObjectType.阀门; |
| | | if (this is RepeaterViewModel) return MapObjectType.重复器; |
| | | |
| | | if (this is PumpViewModel) return MapObjectType.水泵; |
| | | if (this is PumpNodeViewModel) return MapObjectType.水泵点; |
| | | |
| | | |
| | | return MapObjectType.节点; |
| | | } |