summaryrefslogtreecommitdiff
path: root/ProjectedStripBoard/FormDeltaParam.cs
blob: 6c8fbbd0e300f66b64fedd617a22718e24d38afc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ProjectedStripBoard
{
    public partial class FormDeltaParam : Form
    {
        FormProjectedStripBoard MyFormProjectedStripBoard;

        public FormDeltaParam(FormProjectedStripBoard myFormProjectedStripBoard)
        {
            InitializeComponent();
            MyFormProjectedStripBoard = myFormProjectedStripBoard;
        }

        private void numericUpDownMinX_ValueChanged(object sender, EventArgs e)
        {
            //Get the data
         float dx = (float)   numericUpDownDx.Value;
         float dy = (float)numericUpDownDy.Value;
         float MarkerHeight = (float)numericUpDownMarkerHeight.Value;
         float MarkerWidth = (float)numericUpDownMarkerWidth.Value;
         float MinX = (float)numericUpDownMinX.Value;
         float MinY = (float)numericUpDownMinY.Value;
         float MaxX = (float)numericUpDownMaxX.Value;
         float MaxY = (float)numericUpDownMaxY.Value;


            //Populate the data
         if ( MyFormProjectedStripBoard != null)
            MyFormProjectedStripBoard.Set(dx,dy,MarkerHeight,MarkerWidth,MinX,MinY,MaxX,MaxY);
        }

        private void FormDeltaParam_Load(object sender, EventArgs e)
        {

        }

        /*  f.populateData(ProjectedStrip.DX,

            ProjectedStrip.DY,
            ProjectedStrip.MarkerWidth,
            ProjectedStrip.MarkerHeight,
            ProjectedStrip.TopLeft,
            ProjectedStrip.BottomRight, Square);
        */
        internal void populateData(float dx, float dy, float markerWidth, float markerHeight, OpenTK.Vector2 topleft, OpenTK.Vector2 bottomRight, OpenTK.Vector2[] Square)
        {
            textBox1.Text = "";
            string s = "";
            foreach (var item in Square)
            {
                s += item.X + ";" + item.Y + System.Environment.NewLine;
            }
            textBox1.Text = s;

            numericUpDownDx.Value = (decimal)dx;
            numericUpDownDy.Value = (decimal)dy;
            numericUpDownMarkerHeight.Value = (decimal)markerHeight;
            numericUpDownMarkerWidth.Value = (decimal)markerWidth;


            numericUpDownMinX.Value = (decimal)topleft.X;
            numericUpDownMinY.Value = (decimal)topleft.Y;
            numericUpDownMaxX.Value = (decimal)bottomRight.X;
            numericUpDownMaxY.Value = (decimal)bottomRight.Y;

        }
    }
}