Example #1
0
        private void Graph(Instruction instruction)
        {
            InstructionInterpreter instructionInterpreter = new InstructionInterpreter();

            instructionInterpreter.ProcessInstructionInput(instruction);

            // Graph Elevation vs. Time
            this.ELChart.Series[0].Points.Clear();
            foreach (var cmd in instructionInterpreter.trajectory)
            {
                this.ELChart.Series[0].Points.AddXY(cmd.diffSecs, cmd.coordinates.elevation);
            }

            // Graph Azimuth vs. Time
            this.AZChart.Series[0].Points.Clear();
            foreach (var cmd in instructionInterpreter.trajectory)
            {
                this.AZChart.Series[0].Points.AddXY(cmd.diffSecs, cmd.coordinates.azimuth);
            }

            // Graph Elevation vs. Azimuth
            this.ELAZChart.Series[0].Points.Clear();
            foreach (var cmd in instructionInterpreter.trajectory)
            {
                this.ELAZChart.Series[0].Points.AddXY(cmd.coordinates.azimuth, cmd.coordinates.elevation);
            }
        }
Example #2
0
        private void Graph(Instruction instruction)
        {
            InstructionInterpreter instructionInterpreter = new InstructionInterpreter();

            decimal currentAz = encoder.getCurrentAz();
            decimal currentEl = encoder.getCurrentEl();

            instructionInterpreter.ProcessInstructionInput(instruction, new AZELCoordinate(currentAz, currentEl));

            // Graph Elevation vs. Time
            this.ELChart.Series[0].Points.Clear();
            foreach (var cmd in instructionInterpreter.trajectory)
            {
                this.ELChart.Series[0].Points.AddXY(cmd.diffSecs, cmd.coordinates.elevation);
                encoder.moveEl(cmd.coordinates.elevation);
                unity.sendData(cmd.diffSecs);
                unity.sendData(cmd.coordinates.elevation);
            }

            // Graph Azimuth vs. Time
            this.AZChart.Series[0].Points.Clear();
            foreach (var cmd in instructionInterpreter.trajectory)
            {
                this.AZChart.Series[0].Points.AddXY(cmd.diffSecs, cmd.coordinates.azimuth);
                encoder.moveAz(cmd.coordinates.azimuth);
            }

            // Graph Elevation vs. Azimuth
            this.ELAZChart.Series[0].Points.Clear();
            foreach (var cmd in instructionInterpreter.trajectory)
            {
                this.ELAZChart.Series[0].Points.AddXY(cmd.coordinates.azimuth, cmd.coordinates.elevation);
            }

            this.label1.Text = "Elevation Position =" + Math.Round(encoder.getCurrentEl()).ToString();
            this.label2.Text = "Azimuth Position =" + Math.Round(encoder.getCurrentAz()).ToString();
        }