Ejemplo n.º 1
0
        private async Task FuzzyProcessing(FactSet factSet, FuzzyMethod method)
        {
            var socketParamsType  = typeof(FuzzySocketParams);
            var fuzzySocketParams = new FuzzySocketParams();

            foreach (var fact in factSet)
            {
                socketParamsType.GetProperty(fact.Domain.ToString()).SetValue(fuzzySocketParams, fact.Value);
            }

            try
            {
                var amperageCircuit = await Client.FuzzyGetAmperageCircuitByParamsAsync(new FuzzySocketRequest
                {
                    Method = method,
                    Socket = fuzzySocketParams
                });

                WritePaddedTop($"Максимальная сила тока при разрыве цепи: {amperageCircuit.AmperageCircuit} мА");
            }
            catch (Exception e)
            {
                WritePaddedTop(e.Message);
            }
        }
 private static FactSet SocketParamsToFactSet(FuzzySocketParams socket)
 {
     return(new FactSet(
                new Fact(SocketDomain.NumberOfContacts, socket.NumberOfContacts),
                new Fact(SocketDomain.SizeLength, socket.SizeLength),
                new Fact(SocketDomain.SizeWidth, socket.SizeWidth)
                ));
 }