Esempio n. 1
0
        static public bool Export(Simulation.StabilityDerivExportOutput output, ExportTextFileCache filecache = null)
        {
            StabilityDerivativeExportFile body  = new StabilityDerivativeExportFile();
            ExportTextFileCache           cache = (filecache != null) ? filecache : new ExportTextFileCache();

            body.LoadBodyText(cache);
            if (body.BodyTextLoaded())
            {
                body.AddResultElements(output);
                body.UpdateAllText(cache);
                if (filecache == null)
                {
                    cache.FlushTextFileLines();
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        public void AddResultElements(Simulation.StabilityDerivExportOutput output)
        {
            if (cellelement.subelems.Count > 0)
            {
                throw new InvalidOperationException("Cannot add result elements; top cell element was not empty.");
            }
            else
            {
                StructElement craft   = new StructElement("craft");
                StructElement env     = new StructElement("env");
                StructElement deriv   = new StructElement("deriv");
                StructElement inertia = new StructElement("inertia");

                craft.AddElement(new StringElement("name", EditorShipName));
                craft.AddScalar("mass", output.exportvals.craftmass);
                craft.AddScalar("span", output.outputvals.b);
                craft.AddScalar("chord", output.outputvals.MAC);
                craft.AddScalar("area", output.outputvals.area);
                craft.AddElement(inertia);
                inertia.AddScalar("lxx", output.outputvals.stabDerivs[0]);
                inertia.AddScalar("lyy", output.outputvals.stabDerivs[1]);
                inertia.AddScalar("lzz", output.outputvals.stabDerivs[2]);
                inertia.AddScalar("lxy", output.outputvals.stabDerivs[24]);
                inertia.AddScalar("lyz", output.outputvals.stabDerivs[25]);
                inertia.AddScalar("lxz", output.outputvals.stabDerivs[26]);

                env.AddElement(new StringElement("body", output.outputvals.body.name));
                env.AddScalar("altitude", output.outputvals.altitude);
                env.AddScalar("mach", output.exportvals.sitmach);
                env.AddScalar("pressure", output.exportvals.envpressure);
                env.AddScalar("temperature", output.exportvals.envtemperature);
                env.AddScalar("density", output.exportvals.envdensity);
                env.AddScalar("soundspeed", output.exportvals.envsoundspeed);
                env.AddScalar("g", output.exportvals.envg);
                env.AddScalar("speed", output.outputvals.nominalVelocity);
                env.AddScalar("dynpres", output.exportvals.sitdynpres);
                env.AddScalar("effg", output.exportvals.siteffg);

                deriv.AddScalar("Cl", output.outputvals.stableCondition.stableCl);
                deriv.AddScalar("Cd", output.outputvals.stableCondition.stableCd);
                deriv.AddScalar("Cm", output.outputvals.stableCondition.stableCm);
                deriv.AddScalar("AoA", output.outputvals.stableCondition.stableAoA);
                deriv.AddScalar("elevators", output.outputvals.stableCondition.stablePitchValue);
                deriv.AddScalar("Zw", output.outputvals.stabDerivs[3]);
                deriv.AddScalar("Xw", output.outputvals.stabDerivs[4]);
                deriv.AddScalar("Mw", output.outputvals.stabDerivs[5]);
                deriv.AddScalar("Zu", output.outputvals.stabDerivs[6]);
                deriv.AddScalar("Xu", output.outputvals.stabDerivs[7]);
                deriv.AddScalar("Mu", output.outputvals.stabDerivs[8]);
                deriv.AddScalar("Zq", output.outputvals.stabDerivs[9]);
                deriv.AddScalar("Xq", output.outputvals.stabDerivs[10]);
                deriv.AddScalar("Mq", output.outputvals.stabDerivs[11]);
                deriv.AddScalar("Ze", output.outputvals.stabDerivs[12]);
                deriv.AddScalar("Xe", output.outputvals.stabDerivs[13]);
                deriv.AddScalar("Me", output.outputvals.stabDerivs[14]);
                deriv.AddScalar("Yb", output.outputvals.stabDerivs[15]);
                deriv.AddScalar("Lb", output.outputvals.stabDerivs[16]);
                deriv.AddScalar("Nb", output.outputvals.stabDerivs[17]);
                deriv.AddScalar("Yp", output.outputvals.stabDerivs[18]);
                deriv.AddScalar("Lp", output.outputvals.stabDerivs[19]);
                deriv.AddScalar("Np", output.outputvals.stabDerivs[20]);
                deriv.AddScalar("Yr", output.outputvals.stabDerivs[21]);
                deriv.AddScalar("Lr", output.outputvals.stabDerivs[22]);
                deriv.AddScalar("Nr", output.outputvals.stabDerivs[23]);

                AddElement(craft);
                AddElement(env);
                AddElement(deriv);
            }
        }