Ejemplo n.º 1
0
        public CapabilitySensorDetailsView(SensorCapability sensorCapabilities)
        {
            SensorResources = sensorCapabilities;

            InitializeComponent();

            drawChart();
        }
Ejemplo n.º 2
0
            public string GetMaxAmountString(SensorCapability capability)
            {
                var spaces = new List <int>();

                if (ZllCount > 0)
                {
                    spaces.Add((int)Math.Floor((double)capability.Zll.Total / ZllCount));
                }
                else
                {
                    spaces.Add(int.MaxValue);
                }

                if (ZgpCount > 0)
                {
                    spaces.Add((int)Math.Floor((double)capability.Zgp.Total / ZgpCount));
                }
                else
                {
                    spaces.Add(int.MaxValue);
                }

                if (ClipCount > 0)
                {
                    spaces.Add((int)Math.Floor((double)capability.Clip.Total / ClipCount));
                }
                else
                {
                    spaces.Add(int.MaxValue);
                }


                var i = spaces.IndexOf(spaces.Min());

                var result = new StringBuilder(spaces[i].ToString());

                //Schön ist anders...
                switch (i)
                {
                case 0:
                    result.Append($" ({spaces[i] * ZllCount} ZLL)");
                    break;

                case 1:
                    result.Append($" ({spaces[i] * ZgpCount} ZGP)");
                    break;

                case 2:
                    result.Append($" ({spaces[i] * ClipCount} Clip)");
                    break;

                default:
                    break;
                }

                return(result.ToString());
            }