| 123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- using SHJX.Service.ServerClient;
- using System.Collections.Concurrent;
- using SHJX.Service.Control.PortOperate.Interface;
- namespace SHJX.Service.Control.PortOperate.Content
- {
- public class StorageContent
- {
- private readonly ConcurrentDictionary<string, StorageOperateImp> _storages;
- public StorageContent(OptClient client)
- {
- _storages = new ConcurrentDictionary<string, StorageOperateImp>();
- _storages.TryAdd("Timer", new TimerOperate(client));
- _storages.TryAdd("DripNozzle", new DripNozzleOperate(client));
- //_storages.TryAdd("DripNozzle2", new DripNozzleOperateHigh(client));
- //_storages.TryAdd("TitrationStir2", new TitrationStirOperateHigh(client));
- //_storages.TryAdd("Indicator2", new IndicatorOperateHigh(client));
- _storages.TryAdd("SilverSulfatePipe", new SilverSulfatePipeOperate(client));
- _storages.TryAdd("Mercury", new MercuryOperate(client));
- _storages.TryAdd("Water", new WaterOperate(client));
- _storages.TryAdd("Indicator", new IndicatorOperate(client));
- _storages.TryAdd("SampleFan", new SampleFanOperate(client));
- _storages.TryAdd("DissolveFan", new DissolveFanOperate(client));
- _storages.TryAdd("LiquidStir", new LiquidStirOperate(client));
- _storages.TryAdd("TitrationStir", new TitrationStirOperate(client));
- }
- public StorageOperateImp Factory(string pumpName)
- {
- if (_storages.TryGetValue(pumpName, out var storage))
- {
- return storage;
- }
- throw new ArgumentNullException(pumpName);
- }
- }
- }
|