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); }
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); }
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; }