Exemplo n.º 1
0
        public SensorInfoImpl(int aId, string aName, SensorType aSensorType, SensorSide aSide, double aShift)
        {
            if (string.IsNullOrEmpty(aName)) {
                throw new ArgumentNullException("aName");
            }

            id = aId;
            name = aName;
            sType = aSensorType;
            side = aSide;
            shift = aShift;
        }
Exemplo n.º 2
0
 private string ConvertSensorSideToSrt(SensorSide aSize)
 {
     switch (aSize) {
         case SensorSide.BOTTOM:
             return "Нижняя";
         case SensorSide.LEFT:
             return "Левая";
         case SensorSide.RIGHT:
             return "Правая";
         default:
             return "Верхняя";
     }
 }
Exemplo n.º 3
0
        private List<ISensorInfo> GetProximitySensors(SensorSide aSensorSide)
        {
            var sensors = new List<ISensorInfo>();
            var sensorCount = configuration.GetSensorInfoCount();
            for (var i = 0; i < sensorCount; ++i) {
                var sensorInfo = configuration.ReadSensorInfoByIndex(i);
                if (sensorInfo.GetSensorSide() == aSensorSide &&
                    sensorInfo.GetSensorType() == SensorType.PROXIMITY) {
                    sensors.Add(sensorInfo);
                }
            }

            return sensors;
        }