public void SimpleTest() { var activityHook = new FakeUserActivityHook(); var tp = new FakeTimeProvider(); var fs = new FlowSensor(activityHook); }
private TaskCompletionSource <bool> m_dataPlotTaskComp; // 用于监控数据输出到Plot数据完成事件 public Form1() { /* 流量传感器 */ m_flowSensor = new FlowSensor(); /* 肺功能参数计算器 */ m_pulmonaryFunc = new PulmonaryFunction(m_flowSensor.SAMPLE_TIME); InitializeComponent(); this.Text = $"{Application.ProductName} {Application.ProductVersion}"; }
public void TestSaveConfiguration() { var fs = new FlowSensor(); var xmlHelper = new XmlConfigurationHelper(); fs.SaveConfiguration(xmlHelper.GetEventArgs()); var expectedConfig = "<plugins><plugin name=\"User Activity\" enabled=\"True\" /></plugins>"; Assert.That(xmlHelper.GetPluginsElement().OuterXml, Is.EqualTo(expectedConfig)); }
private double m_maxPresure = 0.0; // 最大压差 public FormCalibration(FlowSensor flowSensor, double calVolume = 1.0) { /* 流量传感器 */ m_flowSensor = flowSensor; /* 流量校准器 */ m_flowCalibrator = new FlowCalibrator(m_flowSensor.SAMPLE_RATE, calVolume); InitializeComponent(); this.Text = $"校准-{calVolume}L定标桶"; }
private double m_errorRateAbsSum = 0.0; // 误差率绝对值求和值 public FormVerification(FlowSensor flowSensor, double calVolume = 1.0, double allowErrorRate = 3.0) { /* 允许的误差率 */ ALLOW_ERROR_RATE = allowErrorRate; /* 流量传感器 */ m_flowSensor = flowSensor; /* 流量验证器 */ m_flowValidator = new FlowValidator(m_flowSensor.SAMPLE_RATE, calVolume); InitializeComponent(); this.Text = $"验证-{calVolume}L定标桶"; }
public void TestLoadConfiguration() { var fs = new FlowSensor(); var configString = "<cherryTomato><config><plugins>" + "<plugin name=\"User Activity\" enabled=\"True\" />" + "</plugins></config></cherryTomato>"; var xd = new XmlDocument(); xd.LoadXml(configString); var userActivityElement = (XmlElement)xd.SelectSingleNode("cherryTomato/config/plugins/plugin"); fs.LoadConfiguration(new ConfigurePluginEventArgs(xd)); Assert.That(fs.Enabled); }
public FormFirmwareUpdate(FlowSensor flowSensor) { m_flowSensor = flowSensor; InitializeComponent(); }