コード例 #1
0
        private void buttonLFDown_Click(object sender, EventArgs e)
        {
            textBox.Text = "";
            short steps = HotwireControl.Invert(trackBarStepsMotorB.Value, Configuration.ReverseB, true);

            Port.MoveMotor(2, steps);
        }
コード例 #2
0
        private void buttonRLUp_Click(object sender, EventArgs e)
        {
            textBox.Text = "";
            short steps = HotwireControl.Invert(trackBarStepsMotorD.Value, Configuration.ReverseD, false);

            Port.MoveMotor(4, 1);
        }
コード例 #3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            _control = new HotwireControl(Configuration, Port);
            _control.AfterMovement += (s, ev) => UpdatePositionInfo();
            UpdatePositionInfo();
        }
コード例 #4
0
        private void buttonLBDown_Click(object sender, EventArgs e)
        {
            textBox.Text = "";
            short steps = HotwireControl.Invert(trackBarStepsMotorA.Value, Configuration.ReverseA, true);

            if (checkBoxMaster.Checked == false)
            {
                Port.MoveMotor(1, steps);
            }
            else
            {
                Port.MoveMotors(steps, steps, steps, steps);
            }

            PortReader();
        }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: Romout/Hotwire
        private void buttonCut_Click(object sender, EventArgs e)
        {
            double minx, maxx, miny, maxy, scale, width, height;
            IEnumerable <Vector2> leftProfile, rightProfile;

            _data.ProcessProfiles(panelPreview.Width, out leftProfile, out rightProfile, out minx, out maxx, out miny, out maxy, out scale, out width, out height);

            HotwireControl control = new HotwireControl(_configuration, _port);
            Vector2        last    = null;

            foreach (Vector2 point in leftProfile)
            {
                if (last != null)
                {
                    Vector2 vec = point - last;
                    control.MoveRelative(vec.x, vec.y);
                }
                last = point;
            }
        }