private void DefinitionEditor_Load(object sender, EventArgs e) { Def = sharpTuner.activeImage.Definition; Exposed = Def.AggregateExposedRomTables; BaseTables = Def.AggregateBaseRomTables; TreeNode unexp = new TreeNode("Unexposed Rom Tables"); TreeNode exp = new TreeNode("Exposed Rom Tables"); //TODO SORT BY CATEGORY!! (ROUTINE IN DEFINITION) foreach (var t in BaseTables) { if (!Exposed.ContainsKey(t.Key)) { TreeNode tn = new TreeNode(t.Key);//TODO PUT THIS IN DEFINITION!! tn.Tag = t.Value; unexp.Nodes.Add(tn); } } foreach (var t in Exposed) { TreeNode tn = new TreeNode(t.Key); tn.Tag = t.Value; exp.Nodes.Add(tn); } defTreeView.Nodes.Add(exp); defTreeView.Nodes.Add(unexp); }
public ModDefinition(AvailableDevices ad, Mod parent) { availableDevices = ad; parentMod = parent; RomLutList = new List <LookupTable>(); RamTableList = new Dictionary <string, TableMetaData>(); definition = new ECUMetaData(availableDevices); }
private void UndefinedWindow_Load(object sender, EventArgs e) { defList = new List <string>(sharpTuner.AvailableDevices.IdentList.OrderBy(x => x.ToString()).ToList()); def = new ECUMetaData(sharpTuner.AvailableDevices); List <string> dss = new List <string>(); dss.Add("DEFAULT"); dss.AddRange(defList); comboBoxCopyDef.DataSource = dss; List <string> iss = new List <string>(); iss.AddRange(defList); comboBoxIncludeDef.DataSource = iss; textBoxDefXml.Text = defaultShortDef; }
/// <summary> /// /// </summary> /// <returns></returns> public bool TryReadDefs(String defPath) { Trace.WriteLine("Attempting to read patch definition metadata"); List <Blob> blobs = parentMod.blobList.Blobs; Blob metadataBlob; if (!this.parentMod.TryGetMetaBlob(defMetadataAddress, 10, out metadataBlob, blobs)) { Trace.WriteLine("This patch file does not contain metadata."); return(false); } this.defBlob = metadataBlob; int offs = 0; if (!TryParseDefs(this.defBlob, ref offs, defPath)) { return(false); } definition = new ECUMetaData(availableDevices, defPath, this.parentMod); return(true); }
private void convertEFXMLRRv2ToolStripMenuItem_Click(object sender, EventArgs e) { //TODO: this is a big f*****g mess List <XElement> xscalings = new List <XElement> (); List <XElement> xblobscalings = new List <XElement>(); List <String> blobscalings = new List <string>(); Dictionary <String, List <String> > t3d = new Dictionary <String, List <String> >(); Dictionary <String, List <String> > t2d = new Dictionary <String, List <String> >(); Dictionary <String, List <String> > t1d = new Dictionary <String, List <String> >(); t3d.Add("32BITBASE", new List <String>()); t2d.Add("32BITBASE", new List <String>()); t1d.Add("32BITBASE", new List <String>()); t3d.Add("16BITBASE", new List <String>()); t2d.Add("16BITBASE", new List <String>()); t1d.Add("16BITBASE", new List <String>()); Dictionary <String, String> imap = sharpTuner.AvailableDevices.BuildInheritanceMap(); foreach (String deffile in sharpTuner.AvailableDevices.DefDictionary.Keys) { ECUMetaData.pullScalings(deffile, ref xblobscalings, ref xscalings); } ECUMetaData.pullScalings("rommetadata\\bases\\32BITBASE.xml", ref xblobscalings, ref xscalings); ECUMetaData.pullScalings("rommetadata\\bases\\16BITBASE.xml", ref xblobscalings, ref xscalings); foreach (String deffile in sharpTuner.AvailableDevices.DefDictionary.Keys) { ECUMetaData.pullScalings(deffile, ref xblobscalings, ref xscalings); } foreach (XElement xbs in xblobscalings) { blobscalings.Add(xbs.Attribute("name").Value); } ECUMetaData.ConvertXML("rommetadata\\bases\\32BITBASE.xml", ref blobscalings, ref t3d, ref t2d, ref t1d, imap, true); ECUMetaData.ConvertXML("rommetadata\\bases\\16BITBASE.xml", ref blobscalings, ref t3d, ref t2d, ref t1d, imap, true); foreach (String deffile in sharpTuner.AvailableDevices.DefDictionary.Keys) { ECUMetaData.ConvertXML(deffile, ref blobscalings, ref t3d, ref t2d, ref t1d, imap, false); } string filename = "rommetadata\\Scalings\\";//scalings.xml"; Directory.CreateDirectory(filename); filename = filename + "scalings.xml"; using (XmlTextWriter xmlWriter = new XmlTextWriter(filename, new UTF8Encoding(false))) { xmlWriter.Formatting = Formatting.Indented; xmlWriter.Indentation = 4; xmlWriter.WriteStartDocument(); xmlWriter.WriteStartElement("scalings"); foreach (XElement xel in xscalings) { xel.WriteTo(xmlWriter); } foreach (XElement xel in xblobscalings) { xel.Name = "blobscaling"; xel.WriteTo(xmlWriter); } xmlWriter.WriteEndElement(); xmlWriter.WriteEndDocument(); } }