From 45bf682392ce7314189740504f98f1e7aeeb701d Mon Sep 17 00:00:00 2001 From: Anton Kudryashov <qubabox@mail.ru> Date: Mon, 5 Dec 2016 22:40:10 +0300 Subject: [PATCH] - fixed exceptions - added ascessors for wind 5 --- WindStressPRM/Objects/ClimateCell.cs | 10 +++++----- WindStressPRM/Objects/PowerStation.cs | 2 +- WindStressPRM/Objects/Powerline.cs | 10 +++++----- WindStressPRM/Utils/Index.cs | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/WindStressPRM/Objects/ClimateCell.cs b/WindStressPRM/Objects/ClimateCell.cs index 66d93f6..939ad30 100644 --- a/WindStressPRM/Objects/ClimateCell.cs +++ b/WindStressPRM/Objects/ClimateCell.cs @@ -15,7 +15,7 @@ namespace WindStressPRM /// once-in-5-years frequency wind module, m/s /// модуль скорости ветра с повторяемостью один раз в 5 лет, м/с /// </summary> - public double Wind5; + public double Wind5 { get; private set; } /// <summary> /// once-in-10-years frequency wind module, m/s /// модуль скорости ветра с повторяемостью один раз в 10 лет, м/с @@ -77,19 +77,19 @@ namespace WindStressPRM // ветер по модулю не должен превышать 70м/с if (w5 < 0 || w5 > 70) { - throw new System.ArgumentOutOfRangeException("w5", w5, "Expected 0=<w5<70"); + throw new System.ArgumentOutOfRangeException("w5", w5, "Expected 0=<w5<=70"); } if (w10 < 0 || w10 > 70) { - throw new System.ArgumentOutOfRangeException("w10", w10, "Expected 0=<w10<70"); + throw new System.ArgumentOutOfRangeException("w10", w10, "Expected 0=<w10<=70"); } if (w15 < 0 || w15 > 70) { - throw new System.ArgumentOutOfRangeException("w15", w15, "Expected 0=<w15<70"); + throw new System.ArgumentOutOfRangeException("w15", w15, "Expected 0=<w15<=70"); } if (w25 < 0 || w25 > 70) { - throw new System.ArgumentOutOfRangeException("w25", w25, "Expected 0=<w25<70"); + throw new System.ArgumentOutOfRangeException("w25", w25, "Expected 0=<w25<=70"); } } } diff --git a/WindStressPRM/Objects/PowerStation.cs b/WindStressPRM/Objects/PowerStation.cs index 1f96a56..0e78460 100644 --- a/WindStressPRM/Objects/PowerStation.cs +++ b/WindStressPRM/Objects/PowerStation.cs @@ -78,7 +78,7 @@ namespace WindStressPRM /// asigned powerlines list /// список оканчивающихся/начинающихся на подстанции ЛЭП /// </summary> - public IList<Powerline> LineList { get; set; } + public List<Powerline> LineList { get; private set; } /// <summary> /// designated constructor /// </summary> diff --git a/WindStressPRM/Objects/Powerline.cs b/WindStressPRM/Objects/Powerline.cs index f6f6016..45fca47 100644 --- a/WindStressPRM/Objects/Powerline.cs +++ b/WindStressPRM/Objects/Powerline.cs @@ -35,7 +35,7 @@ namespace WindStressPRM /// Line vertices coordinate list /// список координат вершин ЛЭП как линейного объекта /// </summary> - public IList<Coordinate> Coordinates { get; set; } + public List<Coordinate> Coordinates { get; set; } /// <summary> /// assigned powerstation/pole /// идентификатор соответсвующего конца/начала линии (столб, трансформаторная подстанция, понижающая подстанция) @@ -66,7 +66,7 @@ namespace WindStressPRM /// <param name="voltage"> voltage class kV for switches, Напряжение ЛЭП, кВ</param> /// <param name="toID"> assigned powerstation/pole/идентификатор соответсвующего конца/начала линии (столб, трансформаторная подстанция, понижающая подстанция)</param> /// <param name="fromID"> assigned powerstation/pole/идентификатор соответсвующего конца/начала линии (столб, трансформаторная подстанция, понижающая подстанция)</param> - public Powerline(IList<Coordinate> coordinates, int id, int year, double height, int voltage, int toID, int fromID) + public Powerline(List<Coordinate> coordinates, int id, int year, double height, int voltage, int toID, int fromID) { this.Coordinates = coordinates; this.Identifier = id; @@ -87,7 +87,7 @@ namespace WindStressPRM { if (Identifier < 0) { - throw new System.ArgumentOutOfRangeException("Identifier", Identifier, "Expected >0"); + throw new System.ArgumentOutOfRangeException("Identifier", Identifier, "Expected >=0"); } if (Year > 2050 || Year < 1900) { @@ -103,11 +103,11 @@ namespace WindStressPRM } if (PointFromID < 0) { - throw new System.ArgumentOutOfRangeException("PointFromID", PointFromID, "Expected >0"); + throw new System.ArgumentOutOfRangeException("PointFromID", PointFromID, "Expected >=0"); } if (PointToID < 0) { - throw new System.ArgumentOutOfRangeException("PointToID", PointToID, "Expected >0"); + throw new System.ArgumentOutOfRangeException("PointToID", PointToID, "Expected >=0"); } } } diff --git a/WindStressPRM/Utils/Index.cs b/WindStressPRM/Utils/Index.cs index e115fee..089241c 100644 --- a/WindStressPRM/Utils/Index.cs +++ b/WindStressPRM/Utils/Index.cs @@ -13,12 +13,12 @@ namespace WindStressPRM /// Outer index /// Внешний индекс /// </summary> - public int Row { get; set; } + public int Row { get; private set; } /// <summary> /// Inner index /// Внутренний индекс /// </summary> - public int Col { get; set; } + public int Col { get; private set; } /// <summary> /// designated constructor /// </summary> -- GitLab