| | |
| | | using Hydro.MapView; |
| | | |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | using static Hydro.MapView.MapViewEnum; |
| | | using static Yw.WinFrmUI.Q3d.MapViewEnum; |
| | | |
| | | namespace Hydro.MapView.Common |
| | | namespace Yw.WinFrmUI.Q3d |
| | | { |
| | | |
| | | public static class Global |
| | |
| | | return new Point((int)p.X, (int)p.Y); |
| | | } |
| | | } |
| | | public class MapOption |
| | | { |
| | | public float Link_multiply { get; set; } = 0.6667f; |
| | | public float junction_multiply { get; set; } = 1f; |
| | | public bool _ShowValve { get; set; } = true; |
| | | public bool _ShowJunction { get; set; } = true; |
| | | } |
| | | //public class AutoBuildParams |
| | | //{ |
| | | // public int MaxLevel; |
| | | // public int FloorHeigh; |
| | | //} |
| | | |
| | | |
| | | public static class GlobalExtension |
| | | { |
| | |
| | | { |
| | | case MapObjectType.全部: return null; |
| | | case MapObjectType.节点: return typeof(JunctionViewModel); |
| | | case MapObjectType.水表:return typeof(MeterViewModel); |
| | | case MapObjectType.水表: return typeof(MeterViewModel); |
| | | case MapObjectType.水库: return typeof(ReservoirViewModel); |
| | | case MapObjectType.水池: return typeof(TankViewModel); |
| | | case MapObjectType.喷头: return typeof(NozzleViewModel); |
| | | case MapObjectType.管线: return typeof(PipeViewModel); |
| | | case MapObjectType.阀门: return typeof(ValveViewModel); |
| | | case MapObjectType.重复器: return typeof(RepeaterViewModel); |
| | | |
| | | case MapObjectType.水泵: return typeof(PumpViewModel); |
| | | case MapObjectType.阀门点: return typeof(ValveNodeViewModel); |
| | | case MapObjectType.水泵点: return typeof(PumpNodeViewModel); |
| | | |
| | | default: return null; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | public class MapObjectRecord |
| | | { |
| | | public IBaseViewModel mapObject { get; set; } |
| | |
| | | } |
| | | |
| | | |
| | | //public class message |
| | | //{ |
| | | // public static bool show(string caption, string content, MessageBoxButtons boxButtons = MessageBoxButtons.OKCancel) |
| | | // { |
| | | // var result = MessageBox.Show(content, caption, boxButtons, MessageBoxIcon.Information); |
| | | // if (result == DialogResult.OK || result == DialogResult.Yes) |
| | | // return true; |
| | | // else |
| | | // return false; |
| | | // } |
| | | //} |
| | | //public class Default |
| | | //{ |
| | | // static string _filePath = Path.Combine(Directory.GetCurrentDirectory(), @"default.ini"); |
| | | // //public static string JunctionPre = "J"; |
| | | // //public static string ReservoirPre = "R"; |
| | | // //public static string TankPre = "T"; |
| | | // //public static string PipePre = "P"; |
| | | // //public static string ValvePre = "V"; |
| | | // //public static string MeterPre = "M"; |
| | | // //public static string RepeaterPre = "Repeater"; |
| | | // public NodeViewModel junction; |
| | | // public ReservoirViewModel reservoir; |
| | | // public TankViewModel tank; |
| | | // public MeterViewModel meter; |
| | | // public NozzleViewModel nozzle; |
| | | // public LinkViewModel pipe; |
| | | // public ValveViewModel valve; |
| | | // public RepeaterViewModel repeater; |
| | | // public PumpViewModel pump; |
| | | // public static Default GetfaultINI() |
| | | // { |
| | | // StreamReader sr = new StreamReader(_filePath); |
| | | // string json = sr.ReadToEnd(); |
| | | // sr.Close(); |
| | | // return JsonConvert.DeserializeObject<Default>(json); |
| | | |
| | | // } |
| | | // public void SaveFile() |
| | | // { |
| | | // StreamWriter sw = new StreamWriter(_filePath); |
| | | // sw.WriteLine(JsonConvert.SerializeObject(this)); |
| | | // sw.Close(); |
| | | // } |
| | | |
| | | // public static Dictionary<MapObjectType, string> PreName = new Dictionary<MapObjectType, string>() |
| | | // { |
| | | // {MapObjectType.节点,"J" }, |
| | | // {MapObjectType.水库,"R" }, |
| | | // {MapObjectType.水池,"T" }, |
| | | // {MapObjectType.水表,"M" }, |
| | | // {MapObjectType.喷头,"N" }, |
| | | // {MapObjectType.管线,"P" }, |
| | | // {MapObjectType.阀门,"V" }, |
| | | // {MapObjectType.重复器,"Rp" }, |
| | | // {MapObjectType.水泵,"Pump" }, |
| | | // {MapObjectType.阀门点,"Vn" }, |
| | | // }; |
| | | // public static string GetPreString(IBaseViewModel obj) |
| | | // { |
| | | // return PreName[obj.Type]; |
| | | // } |
| | | //} |
| | | |
| | | //public enum MouseState |
| | | //{ |
| | | // 无, |
| | | // 新增节点, |
| | | // 新建水库, |
| | | // 新建水池, |
| | | // 新建水表, |
| | | // 新增喷头, |
| | | // 新增管线, |
| | | |
| | | // 新建阀门, |
| | | |
| | | // 新建重复器, |
| | | // 新建水泵, |
| | | // 设置底图范围, |
| | | |
| | | //} |
| | | } |