void DumpInfo(ActionProgramRun ap, KeyValuePair <string, EliteDangerousCore.StarScan.ScanNode> scannode, string prefix, string subname) { EliteDangerousCore.JournalEvents.JournalScan sc = scannode.Value.ScanData; ap[prefix] = scannode.Key; ap[prefix + "_type"] = scannode.Value.NodeType.ToString(); ap[prefix + "_assignedname"] = scannode.Value.OwnName; ap[prefix + "_assignedfullname"] = scannode.Value.FullName; ap[prefix + "_data"] = (sc != null) ? "1" : "0"; ap[prefix + "_signals"] = scannode.Value.Signals != null?EliteDangerousCore.JournalEvents.JournalSAASignalsFound.SignalList(scannode.Value.Signals, 0, ",", true) : ""; if (sc != null) { ap[prefix + "_isstar"] = sc.IsStar ? "1" : "0"; ap[prefix + "_edsmbody"] = sc.IsEDSMBody ? "1" : "0"; ap[prefix + "_bodyname"] = sc.BodyName; ap[prefix + "_bodydesignation"] = sc.BodyDesignationOrName; ap[prefix + "_orbitalperiod"] = sc.nOrbitalPeriod.ToNANNullSafeString("0.###"); ap[prefix + "_rotationperiod"] = sc.nRotationPeriod.ToNANNullSafeString("0.###"); ap[prefix + "_surfacetemperature"] = sc.nSurfaceTemperature.ToNANNullSafeString("0.###"); ap[prefix + "_distls"] = sc.DistanceFromArrivalLS.ToNANSafeString("0.###"); if (sc.IsStar) { ap[prefix + "_startype"] = sc.StarType; ap[prefix + "_startypetext"] = sc.StarTypeText; ap[prefix + "_stellarmass"] = (sc.nStellarMass ?? 0).ToString("0.###"); ap[prefix + "_age"] = sc.nAge.ToNANNullSafeString("0.##"); ap[prefix + "_mag"] = sc.nAbsoluteMagnitude.ToNANNullSafeString("0"); EliteDangerousCore.JournalEvents.JournalScan.HabZones hz = sc.GetHabZones(); ap[prefix + "_habinner"] = hz != null?hz.HabitableZoneInner.ToString("0.##") : ""; ap[prefix + "_habouter"] = hz != null?hz.HabitableZoneOuter.ToString("0.##") : ""; } else { ap[prefix + "_class"] = sc.PlanetClass.ToNullSafeString(); ap[prefix + "_landable"] = sc.IsLandable ? "Landable" : "Not Landable"; ap[prefix + "_atmosphere"] = sc.Atmosphere.ToNullSafeString(); ap[prefix + "_terraformstate"] = sc.TerraformState.ToNullSafeString(); ap[prefix + "_volcanism"] = sc.Volcanism.ToNullSafeString(); ap[prefix + "_gravity"] = sc.nSurfaceGravity.ToNANNullSafeString("0.###"); ap[prefix + "_pressure"] = sc.nSurfacePressure.ToNANNullSafeString("0.###"); ap[prefix + "_mass"] = sc.nMassEM.ToNANNullSafeString("0.###"); ap.AddDataOfType(sc.Materials, typeof(Dictionary <string, double>), prefix + "_Materials"); } ap[prefix + "_text"] = sc.DisplayString(); ap[prefix + "_value"] = sc.EstimatedValue.ToStringInvariant(); } if (subname != null) { int totalchildren = (scannode.Value.Children != null) ? scannode.Value.Children.Count : 0; int totalbodies = (scannode.Value.Children != null) ? (from x in scannode.Value.Children where x.Value.NodeType == StarScan.ScanNodeType.body select x).Count() : 0; ap[prefix + subname] = totalchildren.ToStringInvariant(); ap[prefix + subname + "_Only"] = totalbodies.ToStringInvariant(); // we do this, because children can be other than bodies.. } }
void DumpInfo(ActionProgramRun ap, KeyValuePair <string, EliteDangerousCore.StarScan.ScanNode> scannode, string prefix, string subname) { EliteDangerousCore.JournalEvents.JournalScan sc = scannode.Value.ScanData; ap[prefix] = scannode.Key; ap[prefix + "_type"] = scannode.Value.type.ToString(); ap[prefix + "_assignedname"] = scannode.Value.ownname; ap[prefix + "_assignedfullname"] = scannode.Value.fullname; ap[prefix + "_data"] = (sc != null) ? "1" : "0"; if (sc != null) { ap[prefix + "_isstar"] = sc.IsStar ? "1" : "0"; ap[prefix + "_edsmbody"] = sc.IsEDSMBody ? "1" : "0"; ap[prefix + "_bodyname"] = sc.BodyName; ap[prefix + "_orbitalperiod"] = sc.nOrbitalPeriod.ToNANNullSafeString("0.###"); ap[prefix + "_rotationperiod"] = sc.nRotationPeriod.ToNANNullSafeString("0.###"); ap[prefix + "_surfacetemperature"] = sc.nSurfaceTemperature.ToNANNullSafeString("0.###"); ap[prefix + "_distls"] = sc.DistanceFromArrivalLS.ToNANSafeString("0.###"); if (sc.IsStar) { ap[prefix + "_startype"] = sc.StarType; ap[prefix + "_startypetext"] = sc.StarTypeText; ap[prefix + "_stellarmass"] = (sc.nStellarMass ?? 0).ToString("0.###"); ap[prefix + "_age"] = sc.nAge.ToNANNullSafeString("0.##"); ap[prefix + "_mag"] = sc.nAbsoluteMagnitude.ToNANNullSafeString("0"); ap[prefix + "_habinner"] = sc.HabitableZoneInner.ToNANNullSafeString("0.##"); ap[prefix + "_habouter"] = sc.HabitableZoneOuter.ToNANNullSafeString("0.##"); } else { ap[prefix + "_class"] = sc.PlanetClass.ToNullSafeString(); ap[prefix + "_landable"] = sc.IsLandable ? "Landable" : "Not Landable"; ap[prefix + "_atmosphere"] = sc.Atmosphere.ToNullSafeString(); ap[prefix + "_terraformstate"] = sc.TerraformState.ToNullSafeString(); ap[prefix + "_volcanism"] = sc.Volcanism.ToNullSafeString(); ap[prefix + "_gravity"] = sc.nSurfaceGravity.ToNANNullSafeString("0.###"); ap[prefix + "_pressure"] = sc.nSurfacePressure.ToNANNullSafeString("0.###"); ap[prefix + "_mass"] = sc.nMassEM.ToNANNullSafeString("0.###"); ap.AddDataOfType(sc.Materials, typeof(Dictionary <string, double>), prefix + "_Materials"); } ap[prefix + "_text"] = sc.DisplayString(); ap[prefix + "_value"] = sc.EstimatedValue.ToStringInvariant(); } if (subname != null) { int totalchildren = (scannode.Value.children != null) ? scannode.Value.children.Count : 0; ap[prefix + subname] = totalchildren.ToString(System.Globalization.CultureInfo.InvariantCulture); } }