Skip to content

Commit

Permalink
Merge pull request #2241 from janmarius/FIX-2240-copying-trajectories…
Browse files Browse the repository at this point in the history
…-bug

FIX-2240 fix copying trajectories bug
  • Loading branch information
janmarius authored Feb 14, 2024
2 parents 7435f04 + 96d3509 commit a144a70
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Src/Witsml/Data/Tubular/WitsmlMotor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public string LobesStatorText
[XmlElement("rotorCatcher")]
public string RotorCatcherText
{
get => RotorCatcher?.ToString(CultureInfo.InvariantCulture);
get => RotorCatcher.HasValue ? XmlConvert.ToString(RotorCatcher.Value) : null;
set => RotorCatcher = string.IsNullOrEmpty(value) ? default(bool?) : bool.Parse(value);
}

Expand All @@ -70,7 +70,7 @@ public string RotorCatcherText
[XmlElement("dumpValve")]
public string DumpValveText
{
get => DumpValve?.ToString(CultureInfo.InvariantCulture);
get => DumpValve.HasValue ? XmlConvert.ToString(DumpValve.Value) : null;
set => DumpValve = string.IsNullOrEmpty(value) ? default(bool?) : bool.Parse(value);
}

Expand All @@ -82,7 +82,7 @@ public string DumpValveText
[XmlElement("rotatable")]
public string RotatableText
{
get => Rotatable?.ToString(CultureInfo.InvariantCulture);
get => Rotatable.HasValue ? XmlConvert.ToString(Rotatable.Value) : null;
set => Rotatable = string.IsNullOrEmpty(value) ? default(bool?) : bool.Parse(value);
}

Expand Down
4 changes: 2 additions & 2 deletions Src/Witsml/Data/Tubular/WitsmlTubular.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public override WitsmlTubulars AsItemInWitsmlList()
[XmlElement("valveFloat")]
public string ValveFloatText
{
get => ValveFloat?.ToString(CultureInfo.InvariantCulture);
get => ValveFloat.HasValue ? XmlConvert.ToString(ValveFloat.Value) : null;
set => ValveFloat = string.IsNullOrEmpty(value) ? default(bool?) : bool.Parse(value);
}

Expand All @@ -35,7 +35,7 @@ public string ValveFloatText
[XmlElement("sourceNuclear")]
public string SourceNuclearText
{
get => SourceNuclear?.ToString(CultureInfo.InvariantCulture);
get => SourceNuclear.HasValue ? XmlConvert.ToString(SourceNuclear.Value) : null;
set => SourceNuclear = string.IsNullOrEmpty(value) ? default(bool?) : bool.Parse(value);
}

Expand Down
2 changes: 1 addition & 1 deletion Src/Witsml/Data/WitsmlLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class WitsmlLocation
[XmlElement("original")]
public string OriginalText
{
get => Original?.ToString(CultureInfo.InvariantCulture);
get => Original.HasValue ? XmlConvert.ToString(Original.Value) : null;
set => Original = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}
[XmlElement("description")] public string Description { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Src/Witsml/Data/WitsmlTrajectory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public override WitsmlTrajectories AsItemInWitsmlList()
[XmlElement("objectGrowing")]
public string ObjectGrowingText
{
get => ObjectGrowing?.ToString(CultureInfo.InvariantCulture);
get => ObjectGrowing.HasValue ? XmlConvert.ToString(ObjectGrowing.Value) : null;
set => ObjectGrowing = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}

Expand Down
18 changes: 9 additions & 9 deletions Src/Witsml/Data/WitsmlTrajectoryStation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class WitsmlTrajectoryStation
[XmlElement("magXAxialCorUsed")]
public string MagXAxialCorUsedText
{
get => MagXAxialCorUsed?.ToString(CultureInfo.InvariantCulture);
get => MagXAxialCorUsed.HasValue ? XmlConvert.ToString(MagXAxialCorUsed.Value) : null;
set => MagXAxialCorUsed = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}

Expand All @@ -50,7 +50,7 @@ public string MagXAxialCorUsedText
[XmlElement("sagCorUsed")]
public string SagCorUsedText
{
get => SagCorUsed?.ToString(CultureInfo.InvariantCulture);
get => SagCorUsed.HasValue ? XmlConvert.ToString(SagCorUsed.Value) : null;
set => SagCorUsed = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}

Expand All @@ -59,7 +59,7 @@ public string SagCorUsedText
[XmlElement("magDrlstrCorUsed")]
public string MagDrlstrCorUsedText
{
get => MagDrlstrCorUsed?.ToString(CultureInfo.InvariantCulture);
get => MagDrlstrCorUsed.HasValue ? XmlConvert.ToString(MagDrlstrCorUsed.Value) : null;
set => MagDrlstrCorUsed = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}

Expand All @@ -68,7 +68,7 @@ public string MagDrlstrCorUsedText
[XmlElement("infieldRefCorUsed")]
public string InfieldRefCorUsedText
{
get => InfieldRefCorUsed?.ToString(CultureInfo.InvariantCulture);
get => InfieldRefCorUsed.HasValue ? XmlConvert.ToString(InfieldRefCorUsed.Value) : null;
set => InfieldRefCorUsed = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}

Expand All @@ -77,7 +77,7 @@ public string InfieldRefCorUsedText
[XmlElement("interpolatedInfieldRefCorUsed")]
public string InterpolatedInfieldRefCorUsedText
{
get => InterpolatedInfieldRefCorUsed?.ToString(CultureInfo.InvariantCulture);
get => InterpolatedInfieldRefCorUsed.HasValue ? XmlConvert.ToString(InterpolatedInfieldRefCorUsed.Value) : null;
set => InterpolatedInfieldRefCorUsed = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}

Expand All @@ -86,7 +86,7 @@ public string InterpolatedInfieldRefCorUsedText
[XmlElement("inHoleRefCorUsed")]
public string InHoleRefCorUsedText
{
get => InHoleRefCorUsed?.ToString(CultureInfo.InvariantCulture);
get => InHoleRefCorUsed.HasValue ? XmlConvert.ToString(InHoleRefCorUsed.Value) : null;
set => InHoleRefCorUsed = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}

Expand All @@ -96,7 +96,7 @@ public string InHoleRefCorUsedText
[XmlElement("axialMagInterferenceCorUsed")]
public string AxialMagInterferenceCorUsedText
{
get => AxialMagInterferenceCorUsed?.ToString(CultureInfo.InvariantCulture);
get => AxialMagInterferenceCorUsed.HasValue ? XmlConvert.ToString(AxialMagInterferenceCorUsed.Value) : null;
set => AxialMagInterferenceCorUsed = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}

Expand All @@ -105,7 +105,7 @@ public string AxialMagInterferenceCorUsedText
[XmlElement("cosagCorUsed")]
public string CosagCorUsedText
{
get => CosagCorUsed?.ToString(CultureInfo.InvariantCulture);
get => CosagCorUsed.HasValue ? XmlConvert.ToString(CosagCorUsed.Value) : null;
set => CosagCorUsed = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}

Expand All @@ -114,7 +114,7 @@ public string CosagCorUsedText
[XmlElement("MSACorUsed")]
public string MsaCorUsedText
{
get => MsaCorUsed?.ToString(CultureInfo.InvariantCulture);
get => MsaCorUsed.HasValue ? XmlConvert.ToString(MsaCorUsed.Value) : null;
set => MsaCorUsed = !string.IsNullOrEmpty(value) ? bool.Parse(value) : default(bool?);
}

Expand Down

0 comments on commit a144a70

Please sign in to comment.