public void SimpleTest()
        {
            var activityHook = new FakeUserActivityHook();
            var tp           = new FakeTimeProvider();

            var fs = new FlowSensor(activityHook);
        }
示例#2
0
        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));
        }
示例#4
0
        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定标桶";
        }
示例#5
0
        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);
        }
示例#7
0
        public FormFirmwareUpdate(FlowSensor flowSensor)
        {
            m_flowSensor = flowSensor;

            InitializeComponent();
        }