Example #1
0
        public CurvePresetForm(ResponseCurve editcurve)
        {
            InitializeComponent();
            EditingCurve = editcurve;

            SuggestedPresetList.SelectedIndexChanged += (e, args) =>
            {
                PreviewBox.Refresh();
            };

            PreviewBox.Paint += (e, args) =>
            {
                if (SuggestedPresetList.Items.Count <= 0 || SuggestedPresetList.SelectedItems.Count <= 0)
                {
                    return;
                }

                var curve = SuggestedPresetList.SelectedItems[0].Tag as ResponseCurve;

                Point previousPoint = ConvertXYToPoint(0.0, curve.ComputeValue(0.0));

                for (double x = 0.0; x <= 1.0; x += 0.001)
                {
                    double y = curve.ComputeValue(x);
                    Point  p = ConvertXYToPoint(x, y);

                    args.Graphics.DrawLine(Pens.Blue, previousPoint, p);
                    previousPoint = p;
                }
            };

            PopulateSuggestions();
        }
Example #2
0
 public void CopyFrom(ResponseCurve other)
 {
     Type     = other.Type;
     Slope    = other.Slope;
     Exponent = other.Exponent;
     XShift   = other.XShift;
     YShift   = other.YShift;
 }
Example #3
0
        internal void AttachCurve(ResponseCurve curve)
        {
            EditCurve = curve;

            CurveTypeDropdown.SelectedIndex = (int)curve.Type;
            SlopeEditBox.Value           = (decimal)curve.Slope;
            ExponentEditBox.Value        = (decimal)curve.Exponent;
            HorizontalShiftEditBox.Value = (decimal)curve.XShift;
            VerticalShiftEditBox.Value   = (decimal)curve.YShift;

            CurvePictureBox.Refresh();
        }
 public Consideration(string name)
 {
     ReadableName    = name;
     ParameterValues = new List <InputParameterValue>();
     Curve           = new ResponseCurve(ResponseCurve.CurveType.Linear, 1.0, 1.0, 0.0, 0.0);
 }
Example #5
0
 public CurvePresetForm(ResponseCurve editingcurve)
 {
     InitializeComponent();
     EditingCurve = editingcurve;
 }