Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/ConversionHelper.cs =================================================================== diff -u -r1594 -r1624 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/ConversionHelper.cs (.../ConversionHelper.cs) (revision 1594) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/ConversionHelper.cs (.../ConversionHelper.cs) (revision 1624) @@ -1192,5 +1192,127 @@ }; return translationTable[timeStepUnit]; } + + + /// + /// Constants for translating to Enums PlLineType + /// + public const uint PlLineTypePl1 = 1; + public const uint PlLineTypePl2 = 2; + public const uint PlLineTypePl3 = 3; + public const uint PlLineTypePl4 = 4; + + /// + /// Converts the input plLineType to Dam plLineType. + /// + /// Type of the pl line. + /// plLineType + public static PLLineType ConvertToPlLineType(uint plLineType) + { + var translationTable = new Dictionary() + { + {PlLineTypePl1, PLLineType.PL1}, + {PlLineTypePl2, PLLineType.PL2}, + {PlLineTypePl3, PLLineType.PL3}, + {PlLineTypePl4, PLLineType.PL4} + }; + return translationTable[plLineType]; + } + + /// + /// Converts the Dam plLineType to input plLineType. + /// + /// Type of the pl line. + /// plLineType as integer + public static uint ConvertToInputPlLineType(PLLineType plLineType) + { + var translationTable = new Dictionary() + { + {PLLineType.PL1, PlLineTypePl1}, + {PLLineType.PL2, PlLineTypePl2}, + {PLLineType.PL3, PlLineTypePl3}, + {PLLineType.PL4, PlLineTypePl4} + }; + return translationTable[plLineType]; + } + + /// + /// Constants for translating to Enums SensorType + /// + public const uint SensorTypePiezometricHead = 0; + public const uint SensorTypeWaterLevel = 1; + public const uint SensorTypePolderLevel = 2; + + /// + /// Converts the Dam sensorType to input sensorType. + /// + /// Type of the sensor. + /// sensorType + public static SensorType ConvertToSensorType(uint sensorType) + { + var translationTable = new Dictionary() + { + {SensorTypePiezometricHead, SensorType.PiezometricHead}, + {SensorTypePolderLevel, SensorType.PolderLevel}, + {SensorTypeWaterLevel, SensorType.WaterLevel} + }; + return translationTable[sensorType]; + } + + /// + /// Converts the Dam sensorType to input sensorType. + /// + /// Type of the sensor. + /// sensorType as integer + public static uint ConvertToInputSensorType(SensorType sensorType) + { + var translationTable = new Dictionary() + { + {SensorType.PiezometricHead, SensorTypePiezometricHead}, + {SensorType.PolderLevel, SensorTypePolderLevel}, + {SensorType.WaterLevel, SensorTypeWaterLevel} + }; + return translationTable[sensorType]; + } + + public const uint DataSourceTypeSensorsIgnore = 0; + public const uint DataSourceTypeSensorsLocationData = 1; + public const uint DataSourceTypeSensorsSensor = 2; + + /// + /// Converts the Dam DataSourceType to input DataSourceTypeSensors. + /// + /// The data source type sensors. + /// + /// DataSourceTypeSensors + /// + public static DataSourceTypeSensors ConvertToDataSourceTypeSensors(uint dataSourceTypeSensors) + { + var translationTable = new Dictionary() + { + {DataSourceTypeSensorsIgnore, DataSourceTypeSensors.Ignore}, + {DataSourceTypeSensorsLocationData, DataSourceTypeSensors.LocationData}, + {DataSourceTypeSensorsSensor, DataSourceTypeSensors.Sensor} + }; + return translationTable[dataSourceTypeSensors]; + } + + /// + /// Converts the Dam DataSourceType to input DataSourceType. + /// + /// The data source type sensors. + /// + /// DataSourceType as integer + /// + public static uint ConvertToInputDataSourceTypeSensors(DataSourceTypeSensors dataSourceTypeSensors) + { + var translationTable = new Dictionary() + { + {DataSourceTypeSensors.Ignore, DataSourceTypeSensorsIgnore}, + {DataSourceTypeSensors.LocationData, DataSourceTypeSensorsLocationData}, + {DataSourceTypeSensors.Sensor, DataSourceTypeSensorsSensor} + }; + return translationTable[dataSourceTypeSensors]; + } } }