Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface IMeasurementInterface
- {
- void Initialize();
- void Close();
- }
- interface IMeasurementInterface
- {
- void Initialize();
- void Close();
- void Setup(object Parameters);
- }
- public interface IMeasurement<PARAMTYPE> where PARAMTYPE : Parameters
- {
- void Init();
- void Close();
- void Setup(PARAMTYPE p);
- }
- public abstract class Parameters
- {
- }
- public class DeviceOne : IMeasurement<ParametersForDeviceOne>
- {
- public void Init() { }
- public void Close() { }
- public void Setup(ParametersForDeviceOne p) { }
- }
- public class ParametersForDeviceOne : Parameters
- {
- }
- class DeviceInterface
- {
- void Initialize(IController & Controller);
- void Close();
- bool ChangeParameter(const string & Name, const string & Value);
- bool GetParam(string & Name, string &Value );
- }
- interface IController
- {
- Initialize(DeviceSpecific & Params);
- Close();
- bool ChangeParameter(string & Name, string & Value);
- bool ChangeParams(string & Name[], string &Value []);
- }
- IController objController = new MeasurementDevice(MeasureParram);
- DeviceInterface MeasureDevice = new DeviceInterface(objController);
- string Value;
- MeasureDevice.GetParam("Temperature", Value);
- if (ConvertStringToInt(Value) > 80)
- {
- MeasureDevice.ChangeParameter("Shutdown", "True");
- RaiseAlert();
- }
- public interface IMeasurementInterface
- {
- void Initialize();
- void Close();
- void Setup( IConfigurer config );
- }
- public interface IConfigurer
- {
- void ApplyTo( object obj );
- }
- public abstract ConfigurerBase<T> : IConfigurer where T : IMeasurementInterface
- {
- protected abstract void ApplyTo( T item );
- void IConfigurator.ApplyTo(object obj )
- {
- var item = obj as T;
- if( item == null )
- throw new InvalidOperationException("Configurer can't be applied to this type");
- ApplyTo(item);
- }
- }
- interface IMeasurementInterface
- {
- void Initialize();
- void Close();
- void Setup();
- void Read (FileReader as <whatever read file object you are using>)
- void Store (FileReader as <whatever read file object you are using>)
- string Name();
- }
Add Comment
Please, Sign In to add comment