private String PrintDeg(double x)
 {
     return(DispFormat.DoubleFormat(MathTool.RadToDeg(x), 3));
 }
 private String PrintVal(double x)
 {
     return(DispFormat.DoubleFormat(x, 5, 3));
 }
        public void DrawData(Graphics g, SimulatorInterface simif)
        {
            if (recorder.N_record() == 0)
            {
                //g.SetColor(Java.Awt.Color.black);
                // g.SetFont(stdFont);
                // g.DrawString("No Data", 290, 180);
                return;
            }

            if (simif.record_output_sw == 1)
            {
                //  g.SetColor(Java.Awt.Color.red);
                //  g.SetFont(stdFont);
                //  g.DrawString("Writing Data", 270, 100);
                return;
            }

            RecordData data = recorder.GetData(currentDataIndex);

            VsPoint pos = new VsPoint(new Vector3D(data.wpos), Color.White);

            pos = (VsPoint)pos.Transform(mat);
            pos = (VsPoint)pos.Clip3DF(clip);
            pos = (VsPoint)pos.Project(proj);
            VsSegment seg = new VsSegment(new Vector3D(data.wpos), new Vector3D(
                                              data.wpos), suisenCol);

            seg.seg.p1.y = grid.ys;
            seg          = (VsSegment)seg.Transform(mat);
            seg          = (VsSegment)seg.Clip3DF(clip);
            seg          = (VsSegment)seg.Project(proj);
            seg.Draw(g);
            pos.Draw(g);
            if (pos.pos != null)
            {
                int px = (int)(pos.pos.x + 0.5D);
                int py = (int)(pos.pos.y + 0.5D);
                //g.SetColor(cursolCol);
                //g.DrawRect(px - 10, py - 10, 21, 21);
            }

            //g.SetColor(infoCol);
            //g.SetFont(stdFont);
            String str = "GRID SCALE:" + DispFormat.DoubleFormat(grid.grid_scale, 0) + "m";

            str = str + "   BASE ALT:" + DispFormat.DoubleFormat(LocusGrid.Y_base(locus.locusBBox), 0) + "m";
            // g.DrawString(str, 3, (int)(proj.screenYOffset + proj.screenYSize) - 4);

            str = "DATA No." + (currentDataIndex + 1) + " TIME:" + Jp.Maker1.Sim.Tools.Tool.TimeStr1(data.t);
            // g.DrawString(str, 300, 13);

            // g.SetFont(smallFont);

            int datax = 3;
            int datay = 30;
            int dy    = 10;

            if (simif.dispDataSw == 1)
            {
                double h = data.wpos.y;
                datay += 2;
                //g.DrawString("XE [m] : " + Jp.Maker1.Util.DispFormat.DoubleFormat(data.wpos.x, 4, 1), datax, datay);
                datay += dy;
                //g.DrawString("YE [m] : " + Jp.Maker1.Util.DispFormat.DoubleFormat(h, 4, 1), datax, datay);
                datay += dy;
                //g.DrawString("ZE [m] : " + Jp.Maker1.Util.DispFormat.DoubleFormat(data.wpos.z, 4, 1), datax, datay);
                datay += dy;
                //g.DrawString("YE [ft]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Sim.Tools.UnitConvert.M2ft(h), 4, 1), datax, datay);
                datay += dy;
                datay += 2;
                double v = data.vcDash.Length();
                //g.DrawString("VC [m/s]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(v, 3, 1), datax, datay);
                datay += dy;
                double ias = Jp.Maker1.Sim.Tools.UnitConvert.Mps2kt(v) * Math.Sqrt(Isa.Density(h) / Isa.Density(0.0D));
                //g.DrawString("IAS [kt]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(ias, 3, 1), datax, datay);
                datay += dy;
                double alpha = MathTool.RadToDeg(Jp.Maker1.Sim.Tools.Tool.CalcAlpha(data.vcDash));
                datay += 2;
                //g.DrawString("ƒ¿ [deg]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(alpha, 3, 1), datax, datay);
                datay += dy;
                double beta = MathTool.RadToDeg(Jp.Maker1.Sim.Tools.Tool.CalcBeta(data.vcDash));
                //g.DrawString("ƒÀ [deg]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(beta, 3, 1), datax, datay);
                datay += dy;
                datay += 2;
                //  g.DrawString("ƒ³ [deg]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.roll.GetValue()), 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("ƒ¦ [deg]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.pitch.GetValue()), 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("ĵ [deg]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.yaw.GetValue()), 3, 1), datax, datay);
                datay += dy;
                datay += 2;
                // g.DrawString("P [deg/s]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.omega.x), 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("Q [deg/s]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.omega.y), 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("R [deg/s]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.omega.z), 3, 1), datax, datay);
                datay += dy;
                datay += 2;
                // g.DrawString("dU/dt [m/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(data.d_vc.x, 2, 1), datax, datay);
                datay += dy;
                // g.DrawString("dV/dt [m/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(data.d_vc.y, 2, 1), datax, datay);
                datay += dy;
                // g.DrawString("dW/dt [m/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(data.d_vc.z, 2, 1), datax, datay);
                datay += dy;
                datay += 2;
                // g.DrawString("dP/dt [deg/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.d_omega.x), 3, 1), datax, datay);
                datay += dy;
                //g.DrawString("dQ/dt [deg/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.d_omega.y), 3, 1), datax, datay);
                datay += dy;
                //  g.DrawString("dR/dt [deg/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.d_omega.z), 3, 1), datax, datay);
                datay += dy;
                datay += 2;
                //g.DrawString("Į [deg]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.theta), 3, 1), datax, datay);
                datay += dy;
                datay += 2;
                //g.DrawString("Fx/m [m/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(data.f_m.x, 3, 1), datax, datay);
                datay += dy;
                //g.DrawString("Fy/m [m/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(data.f_m.y, 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("Fz/m [m/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(data.f_m.z, 3, 1), datax, datay);
                datay += dy;
                datay += 2;
                // g.DrawString("ƒÂe [deg] : " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.delta_e), 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("ƒÂaR [deg]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.delta_a_r), 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("ƒÂaL [deg]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.delta_a_l), 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("ƒÂr [deg]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.delta_r), 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("ƒÂf [deg]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(Jp.Maker1.Util.MathTool.RadToDeg(data.delta_t_flap), 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("L.GEAR: " + data.flag_gear, datax, datay);
                datay += dy;
                // g.DrawString("LAND: " + data.flag_land, datax, datay);
                datay += dy;
                datay += 2;
                // g.DrawString("Thrust/m [m/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(data.thrust_m, 3, 1), datax, datay);
                datay += dy;
                // g.DrawString("THR-POS [m/s2]: " + Jp.Maker1.Util.DispFormat.DoubleFormat(data.throttle_pos, 3, 2), datax, datay);
                datay += dy;
            }
        }
示例#4
0
 public String ToString3()
 {
     return("(roll, pitchm yaw)=(" + DispFormat.DoubleFormat(MathTool.RadToDeg(roll.GetValue()), 1) + DispFormat.DoubleFormat(MathTool.RadToDeg(pitch.GetValue()), 1) + DispFormat.DoubleFormat(MathTool.RadToDeg(yaw.GetValue()), 1) + ")[deg]");
 }
示例#5
0
 public void DispVec(String pref, String mid, String suf)
 {
     System.Console.Out.Write(pref + DispFormat.DoubleFormat(x, 3) + mid + DispFormat.DoubleFormat(y, 3) + mid + DispFormat.DoubleFormat(z, 3) + suf);
 }
示例#6
0
 public String ToString(String pref, String mid, String suf)
 {
     return(pref + DispFormat.DoubleFormat(x, 3) + mid + DispFormat.DoubleFormat(y, 3) + mid + DispFormat.DoubleFormat(z, 3) + suf);
 }