Index: src/Plugins/Wti/Wti.Data/PipingData.cs
===================================================================
diff -u -r197fbe469c4b157c584994358432370a45110bff -rf65154bc499025f9f5b37b9de0ebdf8026336020
--- src/Plugins/Wti/Wti.Data/PipingData.cs (.../PipingData.cs) (revision 197fbe469c4b157c584994358432370a45110bff)
+++ src/Plugins/Wti/Wti.Data/PipingData.cs (.../PipingData.cs) (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -154,6 +154,11 @@
public double ExitPointXCoordinate { get; set; }
///
+ /// Gets or sets the surface line.
+ ///
+ public PipingSurfaceLine SurfaceLine { get; set; }
+
+ ///
/// Gets or sets , which contains the results of a Piping calculation.
///
public PipingOutput Output { get; set; }
Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingCalculationInputsNodePresenter.cs
===================================================================
diff -u
--- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingCalculationInputsNodePresenter.cs (revision 0)
+++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingCalculationInputsNodePresenter.cs (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -0,0 +1,116 @@
+using System;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using DelftTools.Controls;
+using DelftTools.Utils.Collections;
+using Wti.Data;
+using Wti.Forms.PresentationObjects;
+using Wti.Forms.Properties;
+using Wti.Service;
+
+namespace Wti.Forms.NodePresenters
+{
+ ///
+ /// This class presents the data on as a node in a and
+ /// implements the way the user can interact with the node.
+ ///
+ public class PipingCalculationInputsNodePresenter : ITreeNodePresenter
+ {
+ public ITreeView TreeView { get; set; }
+
+ public Type NodeTagType
+ {
+ get
+ {
+ return typeof(PipingCalculationInputs);
+ }
+ }
+
+ public void UpdateNode(ITreeNode parentNode, ITreeNode node, object nodeData)
+ {
+ node.Text = Resources.PipingDataDisplayName;
+ node.Image = Resources.PipingIcon;
+ }
+
+ public IEnumerable GetChildNodeObjects(object parentNodeData, ITreeNode node)
+ {
+ var pipingData = ((PipingCalculationInputs) parentNodeData).PipingData.Output;
+ if (pipingData != null)
+ {
+ yield return pipingData;
+ }
+ }
+
+ public bool CanRenameNode(ITreeNode node)
+ {
+ return false;
+ }
+
+ public bool CanRenameNodeTo(ITreeNode node, string newName)
+ {
+ return false;
+ }
+
+ public void OnNodeRenamed(object nodeData, string newName)
+ {
+ throw new InvalidOperationException(string.Format("Cannot rename tree node of type {0}.", GetType().Name));
+ }
+
+ public void OnNodeChecked(ITreeNode node) {}
+
+ public DragOperations CanDrag(object nodeData)
+ {
+ return DragOperations.None;
+ }
+
+ public DragOperations CanDrop(object item, ITreeNode sourceNode, ITreeNode targetNode, DragOperations validOperations)
+ {
+ return DragOperations.None;
+ }
+
+ public bool CanInsert(object item, ITreeNode sourceNode, ITreeNode targetNode)
+ {
+ return false;
+ }
+
+ public void OnDragDrop(object item, object sourceParentNodeData, object targetParentNodeData, DragOperations operation, int position) {}
+
+ public void OnNodeSelected(object nodeData) {}
+
+ public ContextMenuStrip GetContextMenu(ITreeNode sender, object nodeData)
+ {
+ var contextMenu = new PipingContextMenuStrip((PipingData) nodeData);
+
+ contextMenu.OnCalculationClick += PerformPipingCalculation;
+ contextMenu.OnValidationClick += PerformPipingValidation;
+
+ return contextMenu;
+ }
+
+ public void OnPropertyChanged(object sender, ITreeNode node, PropertyChangedEventArgs e) {}
+
+ public void OnCollectionChanged(object sender, NotifyCollectionChangingEventArgs e) {}
+
+ public bool CanRemove(object parentNodeData, object nodeData)
+ {
+ return false;
+ }
+
+ public bool RemoveNodeData(object parentNodeData, object nodeData)
+ {
+ throw new InvalidOperationException(String.Format("Cannot delete node of type {0}.", GetType().Name));
+ }
+
+ private void PerformPipingValidation(PipingData pipingData)
+ {
+ PipingCalculationService.Validate(pipingData);
+ }
+
+ private void PerformPipingCalculation(PipingData pipingData)
+ {
+ PipingCalculationService.PerfromValidatedCalculation(pipingData);
+ pipingData.NotifyObservers();
+ }
+ }
+}
\ No newline at end of file
Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingContextMenuStrip.cs
===================================================================
diff -u -r49b7320ad56bfa60788e8792b79dd537318f68ff -rf65154bc499025f9f5b37b9de0ebdf8026336020
--- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingContextMenuStrip.cs (.../PipingContextMenuStrip.cs) (revision 49b7320ad56bfa60788e8792b79dd537318f68ff)
+++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingContextMenuStrip.cs (.../PipingContextMenuStrip.cs) (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -6,7 +6,7 @@
namespace Wti.Forms.NodePresenters
{
///
- /// Class for creating a for a .
+ /// Class for creating a for a .
///
internal sealed class PipingContextMenuStrip : ContextMenuStrip
{
Fisheye: Tag f65154bc499025f9f5b37b9de0ebdf8026336020 refers to a dead (removed) revision in file `src/Plugins/Wti/Wti.Forms/NodePresenters/PipingDataNodePresenter.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs
===================================================================
diff -u -rfa9b36343401d44cb6813d7871903782d0dedec9 -rf65154bc499025f9f5b37b9de0ebdf8026336020
--- src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs (.../PipingFailureMechanismNodePresenter.cs) (revision fa9b36343401d44cb6813d7871903782d0dedec9)
+++ src/Plugins/Wti/Wti.Forms/NodePresenters/PipingFailureMechanismNodePresenter.cs (.../PipingFailureMechanismNodePresenter.cs) (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -5,6 +5,7 @@
using DelftTools.Controls;
using DelftTools.Utils.Collections;
using Wti.Data;
+using Wti.Forms.PresentationObjects;
using Wti.Forms.Properties;
namespace Wti.Forms.NodePresenters
@@ -35,7 +36,11 @@
if (failureMechanism.PipingData != null)
{
- yield return failureMechanism.PipingData;
+ yield return new PipingCalculationInputs
+ {
+ PipingData = failureMechanism.PipingData,
+ AvailablePipingSurfaceLines = failureMechanism.SurfaceLines
+ };
}
}
Index: src/Plugins/Wti/Wti.Forms/PresentationObjects/PipingCalculationInputs.cs
===================================================================
diff -u
--- src/Plugins/Wti/Wti.Forms/PresentationObjects/PipingCalculationInputs.cs (revision 0)
+++ src/Plugins/Wti/Wti.Forms/PresentationObjects/PipingCalculationInputs.cs (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -0,0 +1,33 @@
+using System.Collections.Generic;
+using System.Linq;
+
+using Wti.Data;
+
+namespace Wti.Forms.PresentationObjects
+{
+ ///
+ /// Presentation object for all data required to configure an instance of
+ /// in order to prepare it for performing a calculation.
+ ///
+ public class PipingCalculationInputs
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public PipingCalculationInputs()
+ {
+ AvailablePipingSurfaceLines = Enumerable.Empty();
+ }
+
+ ///
+ /// Gets or sets the piping data to be configured.
+ ///
+ public PipingData PipingData { get; set; }
+
+ ///
+ /// Gets or sets the available piping surface lines in order for the user to select
+ /// one to set .
+ ///
+ public IEnumerable AvailablePipingSurfaceLines { get; set; }
+ }
+}
\ No newline at end of file
Index: src/Plugins/Wti/Wti.Forms/Properties/Resources.Designer.cs
===================================================================
diff -u -rdd0526758fbd88f786a78a847b84a58faf464c1b -rf65154bc499025f9f5b37b9de0ebdf8026336020
--- src/Plugins/Wti/Wti.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision dd0526758fbd88f786a78a847b84a58faf464c1b)
+++ src/Plugins/Wti/Wti.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -459,6 +459,24 @@
}
///
+ /// Looks up a localized string similar to De dwarsdoorsnede die voor de piping berekening gebruikt wordt..
+ ///
+ public static string PipingDataSurfaceLineDescription {
+ get {
+ return ResourceManager.GetString("PipingDataSurfaceLineDescription", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Drawsdoorsnede.
+ ///
+ public static string PipingDataSurfaceLineDisplayName {
+ get {
+ return ResourceManager.GetString("PipingDataSurfaceLineDisplayName", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to De dikte van de eerste of bovenste voor doorlatendheid te onderscheiden zandlaag van mogelijk meerdere zandlagen vanaf de cohesieve grondlaag..
///
public static string PipingDataThicknessAquiferLayerDescription {
Index: src/Plugins/Wti/Wti.Forms/Properties/Resources.resx
===================================================================
diff -u -rdd0526758fbd88f786a78a847b84a58faf464c1b -rf65154bc499025f9f5b37b9de0ebdf8026336020
--- src/Plugins/Wti/Wti.Forms/Properties/Resources.resx (.../Resources.resx) (revision dd0526758fbd88f786a78a847b84a58faf464c1b)
+++ src/Plugins/Wti/Wti.Forms/Properties/Resources.resx (.../Resources.resx) (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -379,4 +379,10 @@
Dwarsdoorsnede
+
+ De dwarsdoorsnede die voor de piping berekening gebruikt wordt.
+
+
+ Drawsdoorsnede
+
\ No newline at end of file
Index: src/Plugins/Wti/Wti.Forms/PropertyClasses/PipingCalculationInputsProperties.cs
===================================================================
diff -u
--- src/Plugins/Wti/Wti.Forms/PropertyClasses/PipingCalculationInputsProperties.cs (revision 0)
+++ src/Plugins/Wti/Wti.Forms/PropertyClasses/PipingCalculationInputsProperties.cs (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -0,0 +1,360 @@
+using DelftTools.Shell.Gui;
+using DelftTools.Utils;
+
+using Wti.Data;
+using Wti.Forms.PresentationObjects;
+using Wti.Forms.Properties;
+
+namespace Wti.Forms.PropertyClasses
+{
+ [ResourcesDisplayName(typeof(Resources), "PipingDataPropertiesDisplayName")]
+ public class PipingCalculationInputsProperties : ObjectProperties
+ {
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataWaterVolumetricWeightDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataWaterVolumetricWeightDescription")]
+ public double WaterVolumetricWeight
+ {
+ get
+ {
+ return data.PipingData.WaterVolumetricWeight;
+ }
+ set
+ {
+ data.PipingData.WaterVolumetricWeight = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataUpliftModelFactorDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataUpliftModelFactorDescription")]
+ public double UpliftModelFactor
+ {
+ get
+ {
+ return data.PipingData.UpliftModelFactor;
+ }
+ set
+ {
+ data.PipingData.UpliftModelFactor = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataAssessmentLevelDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataAssessmentLevelDescription")]
+ public double AssessmentLevel
+ {
+ get
+ {
+ return data.PipingData.AssessmentLevel;
+ }
+ set
+ {
+ data.PipingData.AssessmentLevel = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataPiezometricHeadExitDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataPiezometricHeadExitDescription")]
+ public double PiezometricHeadExit
+ {
+ get
+ {
+ return data.PipingData.PiezometricHeadExit;
+ }
+ set
+ {
+ data.PipingData.PiezometricHeadExit = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataDampingFactorExitDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataDampingFactorExitDescription")]
+ public double DampingFactorExit
+ {
+ get
+ {
+ return data.PipingData.DampingFactorExit;
+ }
+ set
+ {
+ data.PipingData.DampingFactorExit = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataPhreaticLevelExitDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataPhreaticLevelExitDescription")]
+ public double PhreaticLevelExit
+ {
+ get
+ {
+ return data.PipingData.PhreaticLevelExit;
+ }
+ set
+ {
+ data.PipingData.PhreaticLevelExit = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataPiezometricHeadPolderDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataPiezometricHeadPolderDescription")]
+ public double PiezometricHeadPolder
+ {
+ get
+ {
+ return data.PipingData.PiezometricHeadPolder;
+ }
+ set
+ {
+ data.PipingData.PiezometricHeadPolder = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataCriticalHeaveGradientDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataCriticalHeaveGradientDescription")]
+ public double CriticalHeaveGradient
+ {
+ get
+ {
+ return data.PipingData.CriticalHeaveGradient;
+ }
+ set
+ {
+ data.PipingData.CriticalHeaveGradient = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataThicknessCoverageLayerDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataThicknessCoverageLayerDescription")]
+ public double ThicknessCoverageLayer
+ {
+ get
+ {
+ return data.PipingData.ThicknessCoverageLayer;
+ }
+ set
+ {
+ data.PipingData.ThicknessCoverageLayer = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataSellmeijerModelFactorDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataSellmeijerModelFactorDescription")]
+ public double SellmeijerModelFactor
+ {
+ get
+ {
+ return data.PipingData.SellmeijerModelFactor;
+ }
+ set
+ {
+ data.PipingData.SellmeijerModelFactor = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataSellmeijerReductionFactorDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataSellmeijerReductionFactorDescription")]
+ public double SellmeijerReductionFactor
+ {
+ get
+ {
+ return data.PipingData.SellmeijerReductionFactor;
+ }
+ set
+ {
+ data.PipingData.SellmeijerReductionFactor = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataSeepageLengthDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataSeepageLengthDescription")]
+ public double SeepageLength
+ {
+ get
+ {
+ return data.PipingData.SeepageLength;
+ }
+ set
+ {
+ data.PipingData.SeepageLength = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataSandParticlesVolumicWeightDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataSandParticlesVolumicWeightDescription")]
+ public double SandParticlesVolumicWeight
+ {
+ get
+ {
+ return data.PipingData.SandParticlesVolumicWeight;
+ }
+ set
+ {
+ data.PipingData.SandParticlesVolumicWeight = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataWhitesDragCoefficientDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataWhitesDragCoefficientDescription")]
+ public double WhitesDragCoefficient
+ {
+ get
+ {
+ return data.PipingData.WhitesDragCoefficient;
+ }
+ set
+ {
+ data.PipingData.WhitesDragCoefficient = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataDiameter70DisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataDiameter70Description")]
+ public double Diameter70
+ {
+ get
+ {
+ return data.PipingData.Diameter70;
+ }
+ set
+ {
+ data.PipingData.Diameter70 = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataDarcyPermeabilityDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataDarcyPermeabilityDescription")]
+ public double DarcyPermeability
+ {
+ get
+ {
+ return data.PipingData.DarcyPermeability;
+ }
+ set
+ {
+ data.PipingData.DarcyPermeability = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataWaterKinematicViscosityDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataWaterKinematicViscosityDescription")]
+ public double WaterKinematicViscosity
+ {
+ get
+ {
+ return data.PipingData.WaterKinematicViscosity;
+ }
+ set
+ {
+ data.PipingData.WaterKinematicViscosity = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataGravityDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataGravityDescription")]
+ public double Gravity
+ {
+ get
+ {
+ return data.PipingData.Gravity;
+ }
+ set
+ {
+ data.PipingData.Gravity = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataThicknessAquiferLayerDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataThicknessAquiferLayerDescription")]
+ public double ThicknessAquiferLayer
+ {
+ get
+ {
+ return data.PipingData.ThicknessAquiferLayer;
+ }
+ set
+ {
+ data.PipingData.ThicknessAquiferLayer = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataMeanDiameter70DisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataMeanDiameter70Description")]
+ public double MeanDiameter70
+ {
+ get
+ {
+ return data.PipingData.MeanDiameter70;
+ }
+ set
+ {
+ data.PipingData.MeanDiameter70 = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataBeddingAngleDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataBeddingAngleDescription")]
+ public double BeddingAngle
+ {
+ get
+ {
+ return data.PipingData.BeddingAngle;
+ }
+ set
+ {
+ data.PipingData.BeddingAngle = value;
+ data.PipingData.NotifyObservers();
+ }
+ }
+
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "PipingDataSurfaceLineDisplayName")]
+ [ResourcesDescription(typeof(Resources), "PipingDataSurfaceLineDescription")]
+ public PipingSurfaceLine SurfaceLine
+ {
+ get
+ {
+ return data.PipingData.SurfaceLine;
+ }
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag f65154bc499025f9f5b37b9de0ebdf8026336020 refers to a dead (removed) revision in file `src/Plugins/Wti/Wti.Forms/PropertyClasses/PipingDataProperties.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: src/Plugins/Wti/Wti.Forms/Wti.Forms.csproj
===================================================================
diff -u -rdd0526758fbd88f786a78a847b84a58faf464c1b -rf65154bc499025f9f5b37b9de0ebdf8026336020
--- src/Plugins/Wti/Wti.Forms/Wti.Forms.csproj (.../Wti.Forms.csproj) (revision dd0526758fbd88f786a78a847b84a58faf464c1b)
+++ src/Plugins/Wti/Wti.Forms/Wti.Forms.csproj (.../Wti.Forms.csproj) (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -57,18 +57,19 @@
-
+
+
True
True
Resources.resx
-
+
Index: src/Plugins/Wti/Wti.Plugin/WtiGuiPlugin.cs
===================================================================
diff -u -rdd0526758fbd88f786a78a847b84a58faf464c1b -rf65154bc499025f9f5b37b9de0ebdf8026336020
--- src/Plugins/Wti/Wti.Plugin/WtiGuiPlugin.cs (.../WtiGuiPlugin.cs) (revision dd0526758fbd88f786a78a847b84a58faf464c1b)
+++ src/Plugins/Wti/Wti.Plugin/WtiGuiPlugin.cs (.../WtiGuiPlugin.cs) (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -6,6 +6,7 @@
using Mono.Addins;
using Wti.Data;
using Wti.Forms.NodePresenters;
+using Wti.Forms.PresentationObjects;
using Wti.Forms.PropertyClasses;
namespace Wti.Plugin
@@ -61,7 +62,7 @@
};
yield return new PropertyInfo
{
- ObjectType = typeof(PipingData), PropertyType = typeof(PipingDataProperties)
+ ObjectType = typeof(PipingCalculationInputs), PropertyType = typeof(PipingCalculationInputsProperties)
};
yield return new PropertyInfo
{
@@ -76,7 +77,7 @@
public override IEnumerable GetProjectTreeViewNodePresenters()
{
yield return new WtiProjectNodePresenter();
- yield return new PipingDataNodePresenter();
+ yield return new PipingCalculationInputsNodePresenter();
yield return new PipingFailureMechanismNodePresenter();
yield return new PipingSurfaceLineCollectionNodePresenter
{
Index: test/Plugins/Wti/Wti.Data.Test/PipingDataTest.cs
===================================================================
diff -u -r2d05e18d1fcde2d8d00d2434a6e560d65337d2f7 -rf65154bc499025f9f5b37b9de0ebdf8026336020
--- test/Plugins/Wti/Wti.Data.Test/PipingDataTest.cs (.../PipingDataTest.cs) (revision 2d05e18d1fcde2d8d00d2434a6e560d65337d2f7)
+++ test/Plugins/Wti/Wti.Data.Test/PipingDataTest.cs (.../PipingDataTest.cs) (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -33,6 +33,7 @@
Assert.AreEqual(0, defaultConstructed.Diameter70);
Assert.AreEqual(0, defaultConstructed.ThicknessAquiferLayer);
Assert.AreEqual(0, defaultConstructed.DarcyPermeability);
+ Assert.IsNull(defaultConstructed.SurfaceLine);
Assert.AreEqual(1.0, defaultConstructed.DampingFactorExit);
Assert.AreEqual(0.3, defaultConstructed.SellmeijerReductionFactor);
Index: test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingCalculationInputsNodePresenterTest.cs
===================================================================
diff -u
--- test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingCalculationInputsNodePresenterTest.cs (revision 0)
+++ test/Plugins/Wti/Wti.Forms.Test/NodePresenters/PipingCalculationInputsNodePresenterTest.cs (revision f65154bc499025f9f5b37b9de0ebdf8026336020)
@@ -0,0 +1,487 @@
+using System;
+using System.ComponentModel;
+using DelftTools.Controls;
+using DelftTools.Shell.Core;
+using DelftTools.TestUtils;
+using DelftTools.Utils.Collections;
+using NUnit.Framework;
+using Rhino.Mocks;
+using Wti.Calculation.Test.Piping.Stub;
+using Wti.Data;
+using Wti.Forms.NodePresenters;
+using Wti.Forms.PresentationObjects;
+
+using WtiFormsResources = Wti.Forms.Properties.Resources;
+
+namespace Wti.Forms.Test.NodePresenters
+{
+ [TestFixture]
+ public class PipingCalculationInputsNodePresenterTest
+ {
+ private MockRepository mockRepository;
+
+ [SetUp]
+ public void SetUp()
+ {
+ mockRepository = new MockRepository();
+ }
+
+ [Test]
+ public void DefaultConstructor_ExpectedValues()
+ {
+ // Call
+ var nodePresenter = new PipingCalculationInputsNodePresenter();
+
+ // Assert
+ Assert.IsInstanceOf(nodePresenter);
+ Assert.IsNull(nodePresenter.TreeView);
+ Assert.AreEqual(typeof(PipingCalculationInputs), nodePresenter.NodeTagType);
+ }
+
+ [Test]
+ public void UpdateNode_WithData_InitializeNode()
+ {
+ // Setup
+ const string nodeName = "Piping";
+
+ var mocks = new MockRepository();
+ var pipingNode = mocks.Stub();
+ mocks.ReplayAll();
+
+ var nodePresenter = new PipingCalculationInputsNodePresenter();
+
+ var pipingData = new PipingData
+ {
+ AssessmentLevel = 2.0
+ };
+
+ // Call
+ nodePresenter.UpdateNode(null, pipingNode, pipingData);
+
+ // Assert
+ Assert.AreEqual(nodeName, pipingNode.Text);
+ Assert.AreEqual(16, pipingNode.Image.Height);
+ Assert.AreEqual(16, pipingNode.Image.Width);
+ }
+
+ [Test]
+ public void GetChildNodeObjects_WithOutputData_ReturnOutputChildNode()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var nodeMock = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ var nodePresenter = new PipingCalculationInputsNodePresenter();
+
+ var pipingCalculationInputs = new PipingCalculationInputs
+ {
+ PipingData = new PipingData
+ {
+ Output = new PipingOutput(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
+ }
+ };
+
+ // Call
+ var children = nodePresenter.GetChildNodeObjects(pipingCalculationInputs, nodeMock);
+
+ // Assert
+ Assert.AreEqual(1, children.Count());
+ CollectionAssert.AllItemsAreInstancesOfType(children, typeof(PipingOutput));
+ mocks.VerifyAll(); // Expect no calls on tree node
+ }
+
+ [Test]
+ public void GetChildNodeObjects_WithoutOutput_ReturnNoChildNodes()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var nodeMock = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ var nodePresenter = new PipingCalculationInputsNodePresenter();
+
+ var pipingCalculationInputs = new PipingCalculationInputs
+ {
+ PipingData = new PipingData()
+ };
+
+ // Call
+ var children = nodePresenter.GetChildNodeObjects(pipingCalculationInputs, nodeMock);
+
+ // Assert
+ Assert.AreEqual(0, children.Count());
+ mocks.VerifyAll(); // Expect no calls on tree node
+ }
+
+ [Test]
+ public void CanRenameNode_Always_ReturnFalse()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var nodeMock = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ var nodePresenter = new PipingCalculationInputsNodePresenter();
+
+ // Call
+ var renameAllowed = nodePresenter.CanRenameNode(nodeMock);
+
+ // Assert
+ Assert.IsFalse(renameAllowed);
+ mocks.VerifyAll(); // Expect no calls on tree node
+ }
+
+ [Test]
+ public void CanRenameNodeTo_Always_ReturnFalse()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var nodeMock = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ var nodePresenter = new PipingCalculationInputsNodePresenter();
+
+ // Call
+ var renameAllowed = nodePresenter.CanRenameNodeTo(nodeMock, "");
+
+ // Assert
+ Assert.IsFalse(renameAllowed);
+ mocks.ReplayAll(); // Expect no calls on tree node
+ }
+
+
+ [Test]
+ public void OnNodeRenamed_Always_ThrowInvalidOperationException()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var nodeMock = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ var nodePresenter = new PipingCalculationInputsNodePresenter();
+
+ // Call
+ TestDelegate call = () => { nodePresenter.OnNodeRenamed(nodeMock, ""); };
+
+ // Assert
+ var exception = Assert.Throws(call);
+ var expectedMessage = string.Format("Cannot rename tree node of type {0}.", nodePresenter.GetType().Name);
+ Assert.AreEqual(expectedMessage, exception.Message);
+ mocks.ReplayAll(); // Expect no calls on tree node
+ }
+
+ [Test]
+ public void OnNodeChecked_Always_DoNothing()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var nodeMock = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ var nodePresenter = new PipingCalculationInputsNodePresenter();
+
+ // Call
+ nodePresenter.OnNodeChecked(nodeMock);
+
+ // Assert
+ mocks.VerifyAll(); // Expect no calls on tree node
+ }
+
+ [Test]
+ public void CanDrag_Always_ReturnNone()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var dataMock = mocks.StrictMock