From c230ec470460833cacb7128f53d371e86c61d8bc Mon Sep 17 00:00:00 2001 From: Neil Huth Date: Fri, 2 Oct 2015 11:02:59 +1000 Subject: [PATCH 1/2] validation set --- Prototypes/Agroforestry/Agroforestry.apsimx | 40 +++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/Prototypes/Agroforestry/Agroforestry.apsimx b/Prototypes/Agroforestry/Agroforestry.apsimx index 278ace1d76..c62aaf31d2 100644 --- a/Prototypes/Agroforestry/Agroforestry.apsimx +++ b/Prototypes/Agroforestry/Agroforestry.apsimx @@ -4152,6 +4152,46 @@ namespace Models false + + SW90cm + + Series1 + Scatter + Bottom + Left + -16776961 + -1 + -1 + -1 + FilledCircle + None + PredictedObserved + Observed.SW90cm + Predicted.SW90cm + true + false + false + + + Bottom + + <Inverted>false</Inverted> + <Minimum>NaN</Minimum> + <Maximum>NaN</Maximum> + <Interval>NaN</Interval> + </Axis> + <Axis> + <Type>Left</Type> + <Title /> + <Inverted>false</Inverted> + <Minimum>NaN</Minimum> + <Maximum>NaN</Maximum> + <Interval>NaN</Interval> + </Axis> + <LegendPosition>BottomRight</LegendPosition> + <DisabledSeries /> + <IncludeInDocumentation>true</IncludeInDocumentation> + </Graph> <Area>0.55</Area> <Slope>0</Slope> </ForestrySystem> From 9321b342dea967314bdbc61053d792588b570fc9 Mon Sep 17 00:00:00 2001 From: Neil Huth <neil.huth@csiro.au> Date: Fri, 2 Oct 2015 11:47:15 +1000 Subject: [PATCH 2/2] Standardised naming of agroforestry systems --- ...{ForestrySystem.cs => AgroforestrySystem.cs} | 2 +- Models/Core/Model.cs | 2 +- Models/Core/Zone.cs | 2 +- Models/Manager.cs | 2 +- Models/Models.csproj | 2 +- Models/Zones/CircularZone.cs | 6 +++--- Models/Zones/RectangularZone.cs | 6 +++--- .../Agroforestry/AgroforestryExample.apsimx | 16 ++++++++-------- ...orestry.apsimx => AgroforestrySystem.apsimx} | 14 ++++++++++---- UserInterface/Presenters/TreeProxyPresenter.cs | 2 +- ...orestrySystem.png => AgroforestrySystem.png} | Bin UserInterface/UserInterface.csproj | 10 +++++++--- 12 files changed, 37 insertions(+), 27 deletions(-) rename Models/Agroforestry/{ForestrySystem.cs => AgroforestrySystem.cs} (97%) rename Prototypes/Agroforestry/{Agroforestry.apsimx => AgroforestrySystem.apsimx} (97%) rename UserInterface/Resources/TreeViewImages/{ForestrySystem.png => AgroforestrySystem.png} (100%) diff --git a/Models/Agroforestry/ForestrySystem.cs b/Models/Agroforestry/AgroforestrySystem.cs similarity index 97% rename from Models/Agroforestry/ForestrySystem.cs rename to Models/Agroforestry/AgroforestrySystem.cs index bb13410e43..59579ba362 100644 --- a/Models/Agroforestry/ForestrySystem.cs +++ b/Models/Agroforestry/AgroforestrySystem.cs @@ -19,7 +19,7 @@ namespace Models.Agroforestry [ViewName("UserInterface.Views.GridView")] [PresenterName("UserInterface.Presenters.PropertyPresenter")] [ValidParent(ParentModels = new Type[] { typeof(Simulation), typeof(Zone) })] - public class ForestrySystem : Zone + public class AgroforestrySystem : Zone { /// <summary> /// Return the area of the zone. diff --git a/Models/Core/Model.cs b/Models/Core/Model.cs index 802412ffe5..caa08cdcd7 100644 --- a/Models/Core/Model.cs +++ b/Models/Core/Model.cs @@ -46,7 +46,7 @@ public Model() [XmlElement(typeof(ModelCollectionFromResource))] [XmlElement(typeof(Models.Agroforestry.LocalMicroClimate))] [XmlElement(typeof(Models.Agroforestry.TreeProxy))] - [XmlElement(typeof(Models.Agroforestry.ForestrySystem))] + [XmlElement(typeof(Models.Agroforestry.AgroforestrySystem))] [XmlElement(typeof(Models.Graph.Graph))] [XmlElement(typeof(Models.Graph.Series))] [XmlElement(typeof(Models.Graph.Regression))] diff --git a/Models/Core/Zone.cs b/Models/Core/Zone.cs index 377980cd16..a31bb5ca7d 100644 --- a/Models/Core/Zone.cs +++ b/Models/Core/Zone.cs @@ -16,7 +16,7 @@ namespace Models.Core [ViewName("UserInterface.Views.GridView")] [PresenterName("UserInterface.Presenters.PropertyPresenter")] [Serializable] - [ValidParent(ParentModels = new Type[] { typeof(Simulation), typeof(Agroforestry.ForestrySystem) })] + [ValidParent(ParentModels = new Type[] { typeof(Simulation), typeof(Agroforestry.AgroforestrySystem) })] public class Zone : Model { /// <summary>Area of the zone.</summary> diff --git a/Models/Manager.cs b/Models/Manager.cs index ca577b23ab..b4ef62f191 100644 --- a/Models/Manager.cs +++ b/Models/Manager.cs @@ -16,7 +16,7 @@ namespace Models [Serializable] [ViewName("UserInterface.Views.ManagerView")] [PresenterName("UserInterface.Presenters.ManagerPresenter")] - [ValidParent(ParentModels=new Type[] { typeof(Simulation), typeof(Zone), typeof(Zones.RectangularZone), typeof(Zones.CircularZone), typeof(Agroforestry.ForestrySystem) })] + [ValidParent(ParentModels=new Type[] { typeof(Simulation), typeof(Zone), typeof(Zones.RectangularZone), typeof(Zones.CircularZone), typeof(Agroforestry.AgroforestrySystem) })] public class Manager : Model { // ----------------- Privates diff --git a/Models/Models.csproj b/Models/Models.csproj index d9ae58b086..aa912fd2c2 100644 --- a/Models/Models.csproj +++ b/Models/Models.csproj @@ -98,7 +98,7 @@ <Compile Include="AgPasture.cs" /> <Compile Include="AgPasture\AgPasture1.Sward.cs" /> <Compile Include="AgPasture\AgPasture1.PastureSpecies.cs" /> - <Compile Include="Agroforestry\ForestrySystem.cs" /> + <Compile Include="Agroforestry\AgroforestrySystem.cs" /> <Compile Include="Agroforestry\LocalMicroClimate.cs" /> <Compile Include="Agroforestry\TreeProxy.cs" /> <Compile Include="Aqua\FoodInPond.cs" /> diff --git a/Models/Zones/CircularZone.cs b/Models/Zones/CircularZone.cs index 19feaae3ae..c329b34f74 100644 --- a/Models/Zones/CircularZone.cs +++ b/Models/Zones/CircularZone.cs @@ -12,7 +12,7 @@ namespace Models.Zones [Serializable] [ViewName("UserInterface.Views.GridView")] [PresenterName("UserInterface.Presenters.PropertyPresenter")] - [ValidParent(ParentModels = new Type[] { typeof(Zone), typeof(Simulation), typeof(Agroforestry.ForestrySystem) })] + [ValidParent(ParentModels = new Type[] { typeof(Zone), typeof(Simulation), typeof(Agroforestry.AgroforestrySystem) })] public class CircularZone : Zone { /// <summary>Radius of the zone.</summary> @@ -32,8 +32,8 @@ public double Distance { get { - if (Parent is ForestrySystem) - return (Parent as ForestrySystem).GetDistanceFromTrees(this); + if (Parent is AgroforestrySystem) + return (Parent as AgroforestrySystem).GetDistanceFromTrees(this); throw new ApsimXException(this, "Not implemented for this system"); } } diff --git a/Models/Zones/RectangularZone.cs b/Models/Zones/RectangularZone.cs index 6d4f14fa3e..9dd14d35ad 100644 --- a/Models/Zones/RectangularZone.cs +++ b/Models/Zones/RectangularZone.cs @@ -12,7 +12,7 @@ namespace Models.Zones [Serializable] [ViewName("UserInterface.Views.GridView")] [PresenterName("UserInterface.Presenters.PropertyPresenter")] - [ValidParent(ParentModels = new Type[] { typeof(Zone), typeof(Simulation), typeof(Agroforestry.ForestrySystem) })] + [ValidParent(ParentModels = new Type[] { typeof(Zone), typeof(Simulation), typeof(Agroforestry.AgroforestrySystem) })] public class RectangularZone : Zone { /// <summary>Length of the zone.</summary> @@ -32,8 +32,8 @@ public double Distance { get { - if (Parent is ForestrySystem) - return (Parent as ForestrySystem).GetDistanceFromTrees(this); + if (Parent is AgroforestrySystem) + return (Parent as AgroforestrySystem).GetDistanceFromTrees(this); throw new ApsimXException(this, "Not implemented for this system"); } } diff --git a/Prototypes/Agroforestry/AgroforestryExample.apsimx b/Prototypes/Agroforestry/AgroforestryExample.apsimx index d425cf034b..6db5c3d593 100644 --- a/Prototypes/Agroforestry/AgroforestryExample.apsimx +++ b/Prototypes/Agroforestry/AgroforestryExample.apsimx @@ -18,7 +18,7 @@ <SoilArbitrator> <Name>Soil Arbitrator</Name> </SoilArbitrator> - <ForestrySystem> + <AgroforestrySystem> <Name>WindbreakSystem</Name> <TreeProxy> <Name>TreeProxy</Name> @@ -3363,7 +3363,7 @@ namespace Models </Graph> <Area>0.25</Area> <Slope>0</Slope> - </ForestrySystem> + </AgroforestrySystem> <Area>0</Area> <Slope>0</Slope> </Simulation> @@ -3384,7 +3384,7 @@ namespace Models <SoilArbitrator> <Name>Soil Arbitrator</Name> </SoilArbitrator> - <ForestrySystem> + <AgroforestrySystem> <Name>WindbreakSystem</Name> <TreeProxy> <Name>TreeProxy</Name> @@ -10877,7 +10877,7 @@ namespace Models </Graph> <Area>3.05</Area> <Slope>0</Slope> - </ForestrySystem> + </AgroforestrySystem> <Area>0</Area> <Slope>0</Slope> </Simulation> @@ -10949,7 +10949,7 @@ namespace Models <SoilArbitrator> <Name>Soil Arbitrator</Name> </SoilArbitrator> - <ForestrySystem> + <AgroforestrySystem> <Name>SingleTreeSystem</Name> <TreeProxy> <Name>TreeProxy</Name> @@ -13909,7 +13909,7 @@ namespace Models </Graph> <Area>0.19634954084936207</Area> <Slope>0</Slope> - </ForestrySystem> + </AgroforestrySystem> <Area>0</Area> <Slope>0</Slope> </Simulation> @@ -13932,7 +13932,7 @@ namespace Models <SoilArbitrator> <Name>Soil Arbitrator</Name> </SoilArbitrator> - <ForestrySystem> + <AgroforestrySystem> <Name>WindbreakSystem</Name> <TreeProxy> <Name>TreeProxy</Name> @@ -18455,7 +18455,7 @@ namespace Models </Graph> <Area>0.54999999999999993</Area> <Slope>0</Slope> - </ForestrySystem> + </AgroforestrySystem> <Area>0</Area> <Slope>0</Slope> </Simulation> diff --git a/Prototypes/Agroforestry/Agroforestry.apsimx b/Prototypes/Agroforestry/AgroforestrySystem.apsimx similarity index 97% rename from Prototypes/Agroforestry/Agroforestry.apsimx rename to Prototypes/Agroforestry/AgroforestrySystem.apsimx index c62aaf31d2..fa057ca948 100644 --- a/Prototypes/Agroforestry/Agroforestry.apsimx +++ b/Prototypes/Agroforestry/AgroforestrySystem.apsimx @@ -350,6 +350,12 @@ </EventNames> <ResultsPerPage>0</ResultsPerPage> </Report> + <Plant15> + <Name>Wheat</Name> + <ResourceName>Wheat</ResourceName> + <AutoHarvest>true</AutoHarvest> + <CropType>Wheat</CropType> + </Plant15> </Replacements> <DataStore> <Name>DataStore</Name> @@ -388,7 +394,7 @@ <SoilArbitrator> <Name>Soil Arbitrator</Name> </SoilArbitrator> - <ForestrySystem> + <AgroforestrySystem> <Name>WindbreakSystem</Name> <Manager> <Name>SowingRule</Name> @@ -4194,7 +4200,7 @@ namespace Models </Graph> <Area>0.55</Area> <Slope>0</Slope> - </ForestrySystem> + </AgroforestrySystem> <Graph> <Name>YieldTransect</Name> <Series> @@ -4494,7 +4500,7 @@ namespace Models <SoilArbitrator> <Name>Soil Arbitrator</Name> </SoilArbitrator> - <ForestrySystem> + <AgroforestrySystem> <Name>WindbreakSystem</Name> <Manager> <Name>SowingRule</Name> @@ -9484,7 +9490,7 @@ namespace Models </RectangularZone> <Area>2.05</Area> <Slope>0</Slope> - </ForestrySystem> + </AgroforestrySystem> <Graph> <Name>YieldTransect</Name> <Series> diff --git a/UserInterface/Presenters/TreeProxyPresenter.cs b/UserInterface/Presenters/TreeProxyPresenter.cs index 00e674a80c..523540b3c3 100644 --- a/UserInterface/Presenters/TreeProxyPresenter.cs +++ b/UserInterface/Presenters/TreeProxyPresenter.cs @@ -74,7 +74,7 @@ private void OnCellEndEdit(object sender, EventArgs e) public void AttachData() { - if (!(ForestryModel.Parent is ForestrySystem)) + if (!(ForestryModel.Parent is AgroforestrySystem)) throw new ApsimXException(ForestryModel, "Error: TreeProxy must be a child of ForestrySystem."); Soil Soil; diff --git a/UserInterface/Resources/TreeViewImages/ForestrySystem.png b/UserInterface/Resources/TreeViewImages/AgroforestrySystem.png similarity index 100% rename from UserInterface/Resources/TreeViewImages/ForestrySystem.png rename to UserInterface/Resources/TreeViewImages/AgroforestrySystem.png diff --git a/UserInterface/UserInterface.csproj b/UserInterface/UserInterface.csproj index a6618ed9a6..5f4a78f093 100644 --- a/UserInterface/UserInterface.csproj +++ b/UserInterface/UserInterface.csproj @@ -169,8 +169,12 @@ </Compile> <Compile Include="Settings.cs" /> <Compile Include="Utility\ColumnXYSeries.cs" /> - <Compile Include="Utility\DateTimeCellType.cs" /> - <Compile Include="Utility\FindAndReplaceForm.cs" /> + <Compile Include="Utility\DateTimeCellType.cs"> + <SubType>Component</SubType> + </Compile> + <Compile Include="Utility\FindAndReplaceForm.cs"> + <SubType>Form</SubType> + </Compile> <Compile Include="Utility\FindAndReplaceForm.designer.cs"> <DependentUpon>FindAndReplaceForm.cs</DependentUpon> </Compile> @@ -712,7 +716,7 @@ <EmbeddedResource Include="Resources\TreeViewImages\Regression.png" /> <EmbeddedResource Include="Resources\TreeViewImages\CircularZone.png" /> <EmbeddedResource Include="Resources\TreeViewImages\RectangularZone.png" /> - <EmbeddedResource Include="Resources\TreeViewImages\ForestrySystem.png" /> + <EmbeddedResource Include="Resources\TreeViewImages\AgroforestrySystem.png" /> <EmbeddedResource Include="Resources\TreeViewImages\FieldPea.png" /> <EmbeddedResource Include="Resources\TreeViewImages\NodeNumberPhase.png" /> <EmbeddedResource Include="Resources\TreeViewImages\SoilArbitrator.png" />