Example #1
0
        public void Test_TemperatureSummaryPalette_ChooseColour_MachineLevels()
        {
            var palette = new TemperatureSummaryPalette();

            palette.Should().NotBeNull();

            palette.UseMachineTempWarningLevels = true;
            palette.UseMachineTempWarningLevels.Should().Be(true);

            var temperatureLevels = new TemperatureWarningLevelsRecord(TEMPERATURE_LEVEL_MIN, TEMPERATURE_LEVEL_MAX);

            var data = new SubGridCellPassDataTemperatureEntryRecord(MEASURED_TEMPERATURE, temperatureLevels);

            var colors = new[]
            {
                palette.BelowMinLevelColour,
                palette.WithinLevelsColour,
                palette.WithinLevelsColour,
                palette.WithinLevelsColour,
                palette.AboveMaxLevelColour,
                palette.AboveMaxLevelColour,
                palette.AboveMaxLevelColour
            };

            for (var i = 0; i < colors.Length; i++)
            {
                data.MeasuredTemperature = (ushort)(MEASURED_TEMPERATURE + i * TEMPERATURE_INCREMENT);
                palette.ChooseColour(data.MeasuredTemperature, data.TemperatureLevels.Min, data.TemperatureLevels.Max).Should().Be(colors[i]);
            }
        }
Example #2
0
        public void Creation2()
        {
            var rec = new SubGridCellPassDataTemperatureEntryRecord(123, new TemperatureWarningLevelsRecord(100, 200));

            rec.MeasuredTemperature.Should().Be(123);
            rec.TemperatureLevels.Min.Should().Be(100);
            rec.TemperatureLevels.Max.Should().Be(200);
        }
Example #3
0
        public void Creation()
        {
            SubGridCellPassDataTemperatureEntryRecord rec = new SubGridCellPassDataTemperatureEntryRecord();

            rec.Clear();

            Assert.True(rec.MeasuredTemperature == CellPassConsts.NullMaterialTemperatureValue);
            Assert.True(rec.TemperatureLevels.Min == CellPassConsts.NullMaterialTemperatureValue);
            Assert.True(rec.TemperatureLevels.Max == CellPassConsts.NullMaterialTemperatureValue);
        }
Example #4
0
        public void Test_NullCells()
        {
            var cell = new SubGridCellPassDataTemperatureEntryRecord();

            cell.Clear();

            var clientGrid = ClientLeafSubGridFactoryFactory.CreateClientSubGridFactory().GetSubGrid(GridDataType.Temperature) as ClientTemperatureLeafSubGrid;

            SubGridUtilities.SubGridDimensionalIterator((x, y) => Assert.True(clientGrid.Cells[x, y].Equals(cell)));
        }
Example #5
0
        public void Test_TemperatureSummaryPalette_ChooseColour_NullMachineLevels()
        {
            var palette = new TemperatureSummaryPalette();

            palette.Should().NotBeNull();

            palette.UseMachineTempWarningLevels = true;
            palette.UseMachineTempWarningLevels.Should().Be(true);

            var temperatureLevels = new TemperatureWarningLevelsRecord(CellPassConsts.NullMaterialTemperatureValue, CellPassConsts.NullMaterialTemperatureValue);

            var data = new SubGridCellPassDataTemperatureEntryRecord(MEASURED_TEMPERATURE, temperatureLevels);

            var colors = new[] { Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty, Color.Empty };

            for (var i = 0; i < colors.Length; i++)
            {
                data.MeasuredTemperature = (ushort)(MEASURED_TEMPERATURE + i * TEMPERATURE_INCREMENT);
                palette.ChooseColour(data.MeasuredTemperature, data.TemperatureLevels.Min, data.TemperatureLevels.Max).Should().Be(colors[i]);
            }
        }