Example #1
0
 public void resetPoint()
 {
     shots.Clear();
     shotTaken    = 0;
     shotAffected = 0;
     shotPoint.Clear();
     shotRadius.Clear();
     shotTime.Clear();
     TargetBoxController.getTargetBox().Invalidate();
 }
Example #2
0
 private void toolStripButton1_Click(object sender, EventArgs e)
 {
     oneButton.Visible   = true;
     twoButton.Visible   = true;
     threeButton.Visible = true;
     fourButton.Visible  = true;
     fiveButton.Visible  = true;
     sixButton.Visible   = true;
     sevenButton.Visible = true;
     eightButton.Visible = true;
     nineButton.Visible  = true;
     TargetBoxController.SnapShooting();
 }
Example #3
0
        private void loadAllClasses()
        {
            TargetBoxController.setTargetBox(mainTargetBox);
            allShots = ShootPointController.getController();
            //graphForm = new GraphForm(mainTargetBox);
            targetTimer.setMainForm(this);

            KeyPreview = true;

            targetTimer.countingComplete += new TargetTimer.eventDelegate(targetTimer_countingComplete);

            //this.FormBorderStyle = FormBorderStyle.None;
            //this.WindowState = FormWindowState.Normal;
        }
Example #4
0
        public void showDistanceForm()
        {
            // Lets generate sine and cosine wave
            ArrayList shots = TargetBoxController.getTargetBox().tempPoints;

            shotPoint = new ArrayList();
            for (int i = 0; i < shots.Count; i++)
            {
                Mrg.Point p        = (Mrg.Point)shots[i];
                float     distance = tb.findDistance(new Mrg.Point(tb.centerX, tb.centerY), new Mrg.Point(p.getX(), p.getY()));
                //distance = (10 - (((float)distance / tb.radius)) * 10);

                int distancePoint = (10 - ((int)(distance * (10.0 / tb.radius))));
                shotPoint.Add(distancePoint);
            }

            shotsTaken   = (short)shotInfo.shots.Count;
            hitsTergeted = (short)ShootPointController.getController().shotAffected;

            double[] x = new double[shotPoint.Count];
            double[] y = new double[shotPoint.Count];

            averageDistance = 0;

            for (int i = 0; i < shotPoint.Count; i++)
            {
                x[i]             = i + 1;
                y[i]             = (int)shotPoint[i];
                averageDistance += (int)y[i];
            }

            if (shotPoint.Count != 0)
            {
                averageDistance = (int)((float)averageDistance / shotPoint.Count);
            }

            avgAccuracy = (short)averageDistance;

            // This is to remove all plots
            //if (distanceZedGraphControl.GraphPane != null)

            distanceZedGraphControl.GraphPane.CurveList.Clear();


            // GraphPane object holds one or more Curve objects (or plots)
            GraphPane myPane = distanceZedGraphControl.GraphPane;

            // PointPairList holds the data for plotting, X and Y arrays
            PointPairList spl1 = new PointPairList(x, y);
            //PointPairList spl2 = new PointPairList(x, z);

            // Add cruves to myPane object
            BarItem myCurve1 = myPane.AddBar("Distance", spl1, Color.Blue);

            //LineItem myCurve2 = myPane.AddCurve("Cosine Wave", spl2, Color.Red, SymbolType.None);

            myCurve1.Bar.Border = new Border();
            //myCurve2.Line.Width = 3.0F;
            myPane.Title.Text = "Distance Summary";

            // I add all three functions just to be sure it refeshes the plot.
            distanceZedGraphControl.AxisChange();
            distanceZedGraphControl.Invalidate();
            distanceZedGraphControl.Refresh();

            MessageBox.Show(averageDistance.ToString());
        }
Example #5
0
 private void nineButton_Click(object sender, EventArgs e)
 {
     TargetBoxController.SnapShooting();
     TargetBoxController.SelectRegion(375 + 206 * 2, 206 + 206, 206, 206);
 }
Example #6
0
 private void zeroingToolStripButton_Click(object sender, EventArgs e)
 {
     TargetBoxController.zeroing();
 }
Example #7
0
 private void liveToolStripButton_Click(object sender, EventArgs e)
 {
     TargetBoxController.livaView();
 }
Example #8
0
 private void lessToolStripButton_Click(object sender, EventArgs e)
 {
     TargetBoxController.decrementCircle();
 }