31 lines
834 B
C#
31 lines
834 B
C#
namespace RhSolutions.Parsers.Fittings;
|
|
|
|
[ParserKey("Муфта соединительная")]
|
|
public class Coupling : DrinkingWaterHeatingFitting
|
|
{
|
|
protected override string _title => "Муфта соединительная";
|
|
|
|
public override bool TryParse(string input, out string output)
|
|
{
|
|
output = string.Empty;
|
|
var diametersMatches = _diameter.Matches(input);
|
|
if (diametersMatches.Count == 0)
|
|
{
|
|
return false;
|
|
}
|
|
var diameters = diametersMatches.Select(x => x.Groups["Diameter"].Value)
|
|
.Take(2)
|
|
.OrderByDescending(x => int.Parse(x))
|
|
.ToArray();
|
|
if (diameters.Length == 1 || diameters[0] == diameters[1])
|
|
{
|
|
output = $"{_title} равнопроходная {diameters[0]}";
|
|
}
|
|
else
|
|
{
|
|
output = $"{_title} переходная {diameters[0]}-{diameters[1]}";
|
|
}
|
|
return true;
|
|
}
|
|
}
|