0
0
RhSolutions-Api/RhSolutions.Parsers/DrinkingWaterHeatingPipes/PinkPipe.cs
Serghei Cebotari ab91f7c24b
All checks were successful
Test and release / release-image (push) Successful in 5m34s
Test and release / test (push) Successful in 2m17s
Fix РЕХАУ pipes lookup
2024-04-11 23:22:25 +03:00

45 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace RhSolutions.Parsers.Pipes;
[ParserKey("Pink")]
public class PinkPipe : DrinkingWaterHeatingPipe
{
protected override string _title => "РЕХАУ PINK";
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"
};
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;
}
}