0
0
RhSolutions-Api/RhSolutions.Parsers/DrinkingWaterHeatingPipes/PinkPipe.cs

45 lines
1.0 KiB
C#
Raw Normal View History

2024-02-08 17:11:11 +03:00
namespace RhSolutions.Parsers.Pipes;
2024-01-26 15:50:41 +03:00
2024-02-08 17:11:11 +03:00
[ParserKey("Pink")]
2024-01-26 15:50:41 +03:00
public class PinkPipe : DrinkingWaterHeatingPipe
{
2024-02-16 14:09:55 +03:00
protected override string _title => "РЕХАУ PINK";
2024-01-26 15:50:41 +03:00
protected override Dictionary<string, string> _makeUp => new()
{
["бухт"] = "бухта",
["штанг"] = "прямые отрезки",
["отр"] = "прямые отрезки"
};
protected override Dictionary<int, string> _diameterNames => new()
{
[16] = "16х2,2",
[20] = "20х2,8",
[25] = "25х3,5",
[32] = "32х4,4",
[40] = "40х5,5",
[50] = "50х6,9",
[63] = "63х8,7"
};
2024-04-11 23:22:25 +03:00
public override bool TryParse(string input, out string output)
{
output = string.Empty;
var diameterMatch = _diameter.Match(input);
if (!diameterMatch.Success)
{
return false;
}
var diameter = int.Parse(diameterMatch.Groups["Diameter"].Value);
if (diameter < 40)
{
output = $"Труба {_title} {_diameterNames[diameter]}";
}
else
{
output = $"Труба pink+ {_diameterNames[diameter]}";
}
return true;
}
2024-01-26 15:50:41 +03:00
}