private static Color SelectColor(FillColourType mFill, double value) { switch (mFill) { case FillColourType.Дискретный: if (value >= 0 && value < 0.2) { return(Color.Green); } if (value >= 0.2 && value < 0.4) { return(Color.LightYellow); } if (value >= 0.4 && value < 0.6) { return(Color.Yellow); } if (value >= 0.6 && value < 0.8) { return(Color.Orange); } else { return(Color.Red); } case FillColourType.Градиент: return(Color.FromArgb((value >= 0.5) ? 255 : (int)(255 * Math.Pow(2 * value, 0.5)), (value < 0.5) ? 255 : (int)(255 * Math.Pow((1 - value) * 2, 0.5)), 0)); default: return(Color.White); } }
public MatrixData(TaskType _tType, int _verticalCells, int _horizontalCells, double[,] _matrix, FillColourType colType = FillColourType.Отсутсвует) { verticalCells = _verticalCells; horizontalCells = _horizontalCells; matrix = _matrix; mColor = colType; tType = _tType; }
public static MatrixData ConvertToMatrixData(ModelElement mElement, TaskType tt, OutputType outs, int Layer = 0, FillColourType fill = FillColourType.Отсутсвует) { var matrix = new double[mElement.Size, mElement.Layers]; switch (outs) { case OutputType.CY: matrix = ConvertToCY2D(mElement, Layer); break; case OutputType.MR: matrix = ConvertToMR2D(mElement, Layer); break; case OutputType.pO2: matrix = ConvertToPO22D(mElement, Layer); break; } return(new MatrixData(tt, (Layer > 0) ? mElement.Size - 1 : mElement.Layers - 1, mElement.Size - 1, matrix, fill)); }