Exemplo n.º 1
0
        public static IFeedbackResolver Create(TargetDeviceTypeEnum deviceType)
        {
            IFeedbackResolver resolver = new PumpFeedbackResolver();

            switch (deviceType)
            {
            case TargetDeviceTypeEnum.Pump:
                resolver = new PumpFeedbackResolver();
                break;

            case TargetDeviceTypeEnum.Rocker:
                resolver = new RockerFeedbackResolver();
                break;

            case TargetDeviceTypeEnum.Temperature:
                resolver = new ThemometerFeedbackResolver();
                break;

            case TargetDeviceTypeEnum.Gas:
                resolver = new GasFeedbackResolver();
                break;

            default:
                break;
            }

            return(resolver);
        }
Exemplo n.º 2
0
        private TargetDeviceTypeEnum GetDeviceTypeById(int id)
        {
            TargetDeviceTypeEnum type = TargetDeviceTypeEnum.Unknown;

            switch (id)
            {
            case 1:
            case 2:
            case 3:
            case 4:
                type = TargetDeviceTypeEnum.Pump;
                break;

            case 0x80:
                type = TargetDeviceTypeEnum.Rocker;
                break;

            case 0xa0:
            case 0xa1:
            case 0x90:
                type = TargetDeviceTypeEnum.Temperature;
                break;

            case 0x91:
            case 0x92:
                type = TargetDeviceTypeEnum.Gas;
                break;
            }

            return(type);
        }
Exemplo n.º 3
0
 public CloseDirective(int targetDeviceId, TargetDeviceTypeEnum deviceType = TargetDeviceTypeEnum.Pump)
 {
     this.TargetDeviceId = targetDeviceId;
     this.DeviceType     = deviceType;
 }
        }                             //DirectionEnum RockEnum...

        public TryStartDirective(int targetDeviceId, double flowRate, double volume, int direction, TargetDeviceTypeEnum deviceType = TargetDeviceTypeEnum.Pump)
        {
            this.TargetDeviceId = targetDeviceId;
            this.Param1         = flowRate;
            this.Param2         = volume;
            this.Mode           = direction;
            this.DeviceType     = deviceType;
        }