tbf/TBF/BenchControl/Dummy/Balance/Component.cs

82 lines
2.2 KiB
C#

///
/// Copyright (c) 2016-2017 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using Config.Entities;
using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.Dummy.Balance
{
public class Component : ComponentBase, IScale, IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
public override string ToString()
{
return string.Format("{0}({1})", this.GetType().Namespace.Substring(17), Cfg.ToString(1));
}
public Component()
{
}
public Component(Generic.IComponentCfg cfg)
: base(cfg)
{
log.Warn(this.ToString());
}
public int ScaleNr { get { return 0; } }
public double Capacity { get { return 10000.0; } }
public IValve DrainValve { get { return null; } }
public IValve DrainValve2 { get { return null; } }
public bool ContainsMoreThen(float thld) { return (thld == 0); }
public bool IsEmpty() { return true; }
public double EvaporationRate(double t) { return 0; }
public string Format { get { return "F3"; } }
public int EmptyTimeSec { get { return 5; } }
public float BuoyancyTemp { get { return 20.0f; } }
public float BuoyancyPress { get { return 1.013f; } }
public float BuoyancyHumi { get { return 50.0f; } }
public IOperation ZeroOp()
{
return this;
}
public IOperation ReadMassOp(ref Boxes.DoubleBox mass)
{
mass.Val = 0;
return this;
}
public IOperation ReadStableMassOp(ref Boxes.DoubleBox mass, int readingsCount, double maxSpread, Config.Entities.MassMethod method)
{
mass.Val = 0;
return this;
}
public IOperation GetSerNumOp(ref string serialNumber)
{
return null;
}
/// <summary>Start this operation</summary>
public void Start()
{
}
/// <summary>Run this operation</summary>
public Event Run()
{
return Event.BalanceDone;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}