コード例 #1
0
        public static TableMetaData CreateTableWithDimension(XElement xel, ECUMetaData def, TableMetaData basetable)
        {
            string type = null;

            if (xel.Attribute("type") != null)
            {
                type = xel.Attribute("type").Value.ToString();
            }
            else if (basetable != null && basetable.type != null)
            {
                type = basetable.type;
            }
            if (type != null)
            {
                switch (type)
                {
                case "1D":
                    return(new Table1DMetaData(xel, def, basetable));

                case "2D":
                    return(new Table2DMetaData(xel, def, basetable));

                case "3D":
                    return(new Table3DMetaData(xel, def, basetable));

                default:
                    break;
                }
            }
            return(new TableMetaData(xel, def, basetable));
        }
コード例 #2
0
        public override TableMetaData CreateChild(LookupTable ilut, ECUMetaData d)
        {
            //TODO: This is a major KLUDGE.
            if (ilut.GetType() != typeof(LookupTable2D))
            {
                return(base.CreateChild(ilut, d));
            }

            XElement      xel;
            LookupTable2D lut = (LookupTable2D)ilut;

            xel = new XElement("table");
            xel.SetAttributeValue("name", name);
            xel.SetAttributeValue("address", ilut.dataAddress.ToString("X"));
            if (this.xAxis != null)
            {
                XElement tx = new XElement("table");
                tx.SetAttributeValue("name", "X");
                tx.SetAttributeValue("address", lut.colsAddress.ToString("X"));
                tx.SetAttributeValue("elements", lut.cols);
                xel.Add(tx);
            }
            else
            {
                XElement ty = new XElement("table");
                ty.SetAttributeValue("name", "Y");
                ty.SetAttributeValue("address", lut.colsAddress.ToString("X"));
                ty.SetAttributeValue("elements", lut.cols);
                xel.Add(ty);
            }
            return(TableFactory.CreateTable(xel, name, d));
            //TODO also set attirbutes and split this up! Copy to table2D!!
            //return base.CreateChild(lut,d);
            //TODO FIX?? AND CHECK FOR STATIC AXES!!
        }
コード例 #3
0
ファイル: Table2DMetaData.cs プロジェクト: Merp/SharpTune
        public override TableMetaData CreateChild(LookupTable ilut,ECUMetaData d)
        {
            //TODO: This is a major KLUDGE.
            if (ilut.GetType() != typeof(LookupTable2D))
                return base.CreateChild(ilut, d);

            XElement xel;
            LookupTable2D lut = (LookupTable2D)ilut;
            xel = new XElement("table");
            xel.SetAttributeValue("name", name);
            xel.SetAttributeValue("address", ilut.dataAddress.ToString("X"));
            if (this.xAxis != null)
            {
                XElement tx = new XElement("table");
                tx.SetAttributeValue("name", "X");
                tx.SetAttributeValue("address", lut.colsAddress.ToString("X"));
                tx.SetAttributeValue("elements", lut.cols);
                xel.Add(tx);
            }
            else
            {
                XElement ty = new XElement("table");
                ty.SetAttributeValue("name", "Y");
                ty.SetAttributeValue("address", lut.colsAddress.ToString("X"));
                ty.SetAttributeValue("elements", lut.cols);
                xel.Add(ty);
            }
            return TableFactory.CreateTable(xel, name, d);
            //TODO also set attirbutes and split this up! Copy to table2D!!
            //return base.CreateChild(lut,d);
            //TODO FIX?? AND CHECK FOR STATIC AXES!!
        }
コード例 #4
0
ファイル: DefinitionEditor.cs プロジェクト: Merp/SharpTune
        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);
        }
コード例 #5
0
ファイル: ModDefinition.cs プロジェクト: nosajton/SharpTune
 public ModDefinition(AvailableDevices ad, Mod parent)
 {
     availableDevices = ad;
     parentMod = parent;
     RomLutList = new List<LookupTable>();
     RamTableList = new Dictionary<string, TableMetaData>();
     definition = new ECUMetaData(availableDevices);
 }
コード例 #6
0
        ///// <summary>
        ///// Creates a table XEL from the template file, adding proper addresses
        ///// </summary>
        ///// <param name="name"></param>
        ///// <param name="offset"></param>
        ///// <returns></returns>
        //public void ExposeTable(string name, Lut3D lut) //int offset)
        //{
        //    XElement bt = GetTableBase(name);
        //    if (bt == null) return;
        //    bt.SetAttributeValue("address", lut.dataAddress.ToString("X"));
        //    IEnumerable<XAttribute> tempattr = bt.Attributes();
        //    List<String> remattr = new List<String>();
        //    foreach (XAttribute attr in tempattr)
        //    {
        //        if (attr.Name != "address" && attr.Name != "name")
        //        {
        //            remattr.Add(attr.Name.ToString());
        //        }
        //    }
        //    foreach (String rem in remattr)
        //    {
        //        bt.Attribute(rem).Remove();
        //    }

        //    List<String> eleremlist = new List<String>();

        //    foreach (XElement ele in bt.Elements())
        //    {
        //        IEnumerable<XAttribute> childtempattr = ele.Attributes();
        //        List<String> childremattr = new List<String>();

        //        if (ele.Name.ToString() != "table")
        //        {
        //            eleremlist.Add(ele.Name.ToString());
        //            continue;
        //        }
        //        if (ele.Attribute("type").Value.ContainsCI("static"))
        //        {
        //            eleremlist.Add(ele.Name.ToString());
        //        }
        //        else if (ele.Attribute("type").Value.ContainsCI("x axis"))
        //        {
        //            ele.Attribute("name").Value = "X";
        //            ele.SetAttributeValue("address", lut.colsAddress.ToString("X"));
        //        }
        //        else if (ele.Attribute("type").Value.ContainsCI("y axis"))
        //        {
        //            ele.Attribute("name").Value = "Y";
        //            ele.SetAttributeValue("address", lut.rowsAddress.ToString("X"));
        //        }
        //        foreach (XAttribute attr in childtempattr)
        //        {
        //            if (attr.Name != "address" && attr.Name != "name")
        //            {
        //                childremattr.Add(attr.Name.ToString());
        //            }
        //        }
        //        foreach (String rem in childremattr)
        //        {
        //            ele.Attribute(rem).Remove();
        //        }
        //    }
        //    foreach (String rem in eleremlist)
        //    {
        //        bt.Element(rem).Remove();
        //    }
        //    if (lut.dataAddress < 0x400000)
        //    {
        //        RomTableList.Add(name, TableFactory.CreateTable(bt));
        //    }
        //    else
        //    {
        //        RamTableList.Add(name, TableFactory.CreateTable(bt));
        //    }
        //}

        public void CopyTables(ECUMetaData d)
        {
            ExposedRomTables = new Dictionary <string, TableMetaData>(d.ExposedRomTables);
            ExposedRamTables = new Dictionary <string, TableMetaData>(d.ExposedRamTables);
            BaseRomTables    = new Dictionary <string, TableMetaData>(d.BaseRomTables);
            BaseRamTables    = new Dictionary <string, TableMetaData>(d.BaseRamTables);
            ScalingList      = new Dictionary <string, Scaling>(d.ScalingList);
        }
コード例 #7
0
        public virtual TableMetaData CreateChild(LookupTable lut, ECUMetaData d)
        {
            XElement xel = new XElement("table");

            xel.SetAttributeValue("name", name);
            xel.SetAttributeValue("address", lut.dataAddress.ToString("X"));
            return(TableFactory.CreateTable(xel, name, d));
            //TODO also set attirbutes and split this up!
        }
コード例 #8
0
        /// <summary>
        /// Handles creation of different table types
        /// Passes XElement to the proper table
        /// </summary>
        /// <param name="xel"></param>
        /// <returns></returns>
        public static TableMetaData CreateTable(XElement xel, string tablename, ECUMetaData def)
        {
            TableMetaData basetable = null;

            if (def.GetBaseRomTable(tablename, out basetable))
            {
                //has a base table!! therefore not a base!
            }
            if (xel.Attribute("address") == null)
            {
                basetable = null;//sure???
            }
            return(CreateTableWithDimension(xel, def, basetable));
        }
コード例 #9
0
        /// <summary>
        /// Construct from XML Element
        /// </summary>
        /// <param name="xel"></param>
        public TableMetaData(XElement xel, ECUMetaData def, TableMetaData bt)
            : this()
        {
            try
            {
                parentDef = def;
                baseTable = bt;
                xml       = xel;

                ParseAttributes(xel);
                ParseChildren(xel);
            }
            catch (Exception crap)
            {
                Trace.WriteLine("Error creating table " + this.name);
                Trace.WriteLine("XML: " + xel.ToString());
                Trace.WriteLine(crap.Message);
            }
        }
コード例 #10
0
ファイル: Table3DMetaData.cs プロジェクト: Merp/SharpTune
 public override TableMetaData CreateChild(LookupTable ilut, ECUMetaData d)
 {
     XElement xel;
     LookupTable3D lut = (LookupTable3D)ilut;
     xel = new XElement("table");
     xel.SetAttributeValue("name", name);
     xel.SetAttributeValue("address", ilut.dataAddress.ToString("X"));
     XElement tx = new XElement("table");
     tx.SetAttributeValue("name", "X");
     tx.SetAttributeValue("address", lut.colsAddress.ToString("X"));
     tx.SetAttributeValue("elements", lut.cols);
     xel.Add(tx);
     XElement ty = new XElement("table");
     ty.SetAttributeValue("name", "Y");
     ty.SetAttributeValue("address", lut.rowsAddress.ToString("X"));
     ty.SetAttributeValue("elements", lut.rows);
     xel.Add(ty);
     return TableFactory.CreateTable(xel, name, d);
     //TODO also set attirbutes and split this up! Copy to table2D!!
 }
コード例 #11
0
        public override TableMetaData CreateChild(LookupTable ilut, ECUMetaData d)
        {
            XElement      xel;
            LookupTable3D lut = (LookupTable3D)ilut;

            xel = new XElement("table");
            xel.SetAttributeValue("name", name);
            xel.SetAttributeValue("address", ilut.dataAddress.ToString("X"));
            XElement tx = new XElement("table");

            tx.SetAttributeValue("name", "X");
            tx.SetAttributeValue("address", lut.colsAddress.ToString("X"));
            tx.SetAttributeValue("elements", lut.cols);
            xel.Add(tx);
            XElement ty = new XElement("table");

            ty.SetAttributeValue("name", "Y");
            ty.SetAttributeValue("address", lut.rowsAddress.ToString("X"));
            ty.SetAttributeValue("elements", lut.rows);
            xel.Add(ty);
            return(TableFactory.CreateTable(xel, name, d));
            //TODO also set attirbutes and split this up! Copy to table2D!!
        }
コード例 #12
0
ファイル: TableMetaData.cs プロジェクト: Merp/SharpTune
 // DeviceImage image)
 public RamTable(XElement xel, ECUMetaData def, TableMetaData basetable)
     : base(xel, def, basetable)
 {
     RRXML = xel;
 }
コード例 #13
0
ファイル: TableMetaData.cs プロジェクト: Merp/SharpTune
        /// <summary>
        /// Construct from XML Element
        /// </summary>
        /// <param name="xel"></param>
        public TableMetaData(XElement xel, ECUMetaData def, TableMetaData bt)
            : this()
        {
            try
            {
                parentDef = def;
                baseTable = bt;
                xml = xel;

                ParseAttributes(xel);
                ParseChildren(xel);
            }
            catch (Exception crap)
            {
                Trace.WriteLine("Error creating table " + this.name);
                Trace.WriteLine("XML: " + xel.ToString());
                Trace.WriteLine(crap.Message);
            }
        }
コード例 #14
0
ファイル: TableMetaData.cs プロジェクト: Merp/SharpTune
 public static TableMetaData CreateTableWithDimension(XElement xel, ECUMetaData def, TableMetaData basetable)
 {
     string type = null;
     if (xel.Attribute("type") != null)
         type = xel.Attribute("type").Value.ToString();
     else if (basetable != null && basetable.type != null)
         type = basetable.type;
     if(type != null)
     {
         switch (type)
         {
             case "1D":
                 return new Table1DMetaData(xel, def, basetable);
             case "2D":
                 return new Table2DMetaData(xel, def, basetable);
             case "3D":
                 return new Table3DMetaData(xel, def, basetable);
             default:
                 break;
         }
     }
     return new TableMetaData(xel,def, basetable);
 }
コード例 #15
0
ファイル: Table1DMetaData.cs プロジェクト: Merp/SharpTune
 public Table1DMetaData(XElement xel, ECUMetaData def, TableMetaData basetable)
     : base(xel, def, basetable)
 {
     this.type = "1D";
 }
コード例 #16
0
ファイル: UndefinedWindow.cs プロジェクト: nosajton/SharpTune
        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;
        }
コード例 #17
0
        public static TableMetaData CreateRamTableWithDimension(XElement xel, string storageType, ECUMetaData def, TableMetaData basetable)
        {
            TableMetaData tempTable = null;
            string        type      = null;

            if (xel.Attribute("type") != null)
            {
                type = xel.Attribute("type").Value.ToString();
            }
            else if (basetable != null && basetable.type != null)
            {
                type = basetable.type;
            }
            if (type != null)
            {
                switch (type)
                {
                case "1D":
                    tempTable = new RamTable1DMetaData(xel, def, basetable);
                    break;

                case "2D":
                    tempTable = new RamTable2DMetaData(xel, def, basetable);
                    break;

                case "3D":
                    tempTable = new RamTable3DMetaData(xel, def, basetable);
                    break;

                default:
                    tempTable = new RamTable(xel, def, basetable);
                    break;
                }
            }
            if (tempTable == null)
            {
                tempTable = new RamTable(xel, def, basetable);
            }
            tempTable.storageTypeString = storageType;
            return(tempTable);
        }
コード例 #18
0
ファイル: Table1DMetaData.cs プロジェクト: Merp/SharpTune
 public override TableMetaData CreateChild(LookupTable lut,ECUMetaData d)
 {
     return base.CreateChild(lut,d);
 }
コード例 #19
0
ファイル: TableMetaData.cs プロジェクト: Merp/SharpTune
 public virtual TableMetaData CreateChild(LookupTable lut, ECUMetaData d)
 {
     XElement xel = new XElement("table");
     xel.SetAttributeValue("name", name);
     xel.SetAttributeValue("address", lut.dataAddress.ToString("X"));
     return TableFactory.CreateTable(xel,name, d);
     //TODO also set attirbutes and split this up!
 }
コード例 #20
0
 public RamTable(XElement xel, ECUMetaData def, TableMetaData basetable)// DeviceImage image)
     : base(xel, def, basetable)
 {
     RRXML = xel;
 }
コード例 #21
0
ファイル: TableMetaData.cs プロジェクト: Merp/SharpTune
        /// <summary>
        /// Handles creation of different table types
        /// Passes XElement to the proper table
        /// </summary>
        /// <param name="xel"></param>
        /// <returns></returns>
        public static TableMetaData CreateRamTable(XElement xel, string tablename, string type, ECUMetaData def)
        {
            TableMetaData basetable = null;
            //if (def.GetBaseRamTable(tablename, out basetable))
            //{
                //has a base table!! therefore not a base!

            //}
            if (xel.Attribute("address") == null)
                basetable = null;//sure???

            return CreateRamTableWithDimension(xel, type, def, basetable);
        }
コード例 #22
0
ファイル: ModDefinition.cs プロジェクト: nosajton/SharpTune
        /// <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;
        }
コード例 #23
0
 public Table3DMetaData(XElement xel, ECUMetaData def, TableMetaData basetable)
     : base(xel, def, basetable)
 {
     this.type = "3D";
 }
コード例 #24
0
ファイル: AvailableDevices.cs プロジェクト: Merp/SharpTune
        public bool GetDevices(string directory)
        {
            try
            {
                string[] files = Directory.GetFiles(directory);
                //Parallel.ForEach(
                  //  files, f =>
                foreach(var f in files)
                    {
                        try
                        {
                            ECUMetaData d = new ECUMetaData(this, f);
                            if(d.isBase)
                                d.Populate();
                            lock(DefDictionary)
                            {
                                if (DefDictionary.ContainsKey(d.calibrationlId))
                                {
                                    Trace.WriteLine("Duplicate definition found for: " + d.calibrationlId + " in file: " + f + " Check the definitions!!");
                                    Trace.WriteLine("Definition was previously found in file: " + DefDictionary[d.calibrationlId].filePath);
                                }
                                else
                                {
                                    DefDictionary.Add(d.calibrationlId, d);

                                    lock (IdentList)
                                    {
                                        IdentList.Add(d.calibrationlId);
                                        DeviceCount++;
                                    }
                                }
                            }
                        }
                        catch (System.Exception excpt)
                        {
                            Trace.WriteLine("Error reading XML file " + f);
                            Trace.WriteLine(excpt.Message);
                        }
                }
            //});

                List<string> directories = Directory.GetDirectories(directory).ToList();

                //Parallel.ForEach(
                 //   directories, d =>
                  foreach(var d in directories)  {
                        if (!GetDevices(d))
                        {
                            return false;
                        }
                  }// });

                return true;
            }
            catch (System.Exception excpt)
            {
                Trace.WriteLine(excpt.Message);
            }

            return false;
        }
コード例 #25
0
 public RamTable3DMetaData(XElement xel, ECUMetaData def, TableMetaData basetable)
     : base(xel, def, basetable)
 {
 }
コード例 #26
0
ファイル: TableMetaData.cs プロジェクト: Merp/SharpTune
 public static TableMetaData CreateRamTableWithDimension(XElement xel, string storageType, ECUMetaData def, TableMetaData basetable)
 {
     TableMetaData tempTable = null;
     string type = null;
     if (xel.Attribute("type") != null)
         type = xel.Attribute("type").Value.ToString();
     else if (basetable != null && basetable.type != null)
         type = basetable.type;
     if (type != null)
     {
         switch (type)
         {
             case "1D":
                 tempTable = new RamTable1DMetaData(xel, def, basetable);
                 break;
             case "2D":
                 tempTable = new RamTable2DMetaData(xel, def, basetable);
                 break;
             case "3D":
                 tempTable = new RamTable3DMetaData(xel, def, basetable);
                 break;
             default:
                 tempTable = new RamTable(xel, def, basetable);
                 break;
         }
     }
     if (tempTable == null)
         tempTable = new RamTable(xel, def, basetable);
     tempTable.storageTypeString = storageType;
     return tempTable;
 }
コード例 #27
0
ファイル: ECUMetaData.cs プロジェクト: nosajton/SharpTune
 ///// <summary>
 ///// Creates a table XEL from the template file, adding proper addresses
 ///// </summary>
 ///// <param name="name"></param>
 ///// <param name="offset"></param>
 ///// <returns></returns>
 //public void ExposeTable(string name, Lut3D lut) //int offset)
 //{
 //    XElement bt = GetTableBase(name);
 //    if (bt == null) return;
 //    bt.SetAttributeValue("address", lut.dataAddress.ToString("X"));
 //    IEnumerable<XAttribute> tempattr = bt.Attributes();
 //    List<String> remattr = new List<String>();
 //    foreach (XAttribute attr in tempattr)
 //    {
 //        if (attr.Name != "address" && attr.Name != "name")
 //        {
 //            remattr.Add(attr.Name.ToString());
 //        }
 //    }
 //    foreach (String rem in remattr)
 //    {
 //        bt.Attribute(rem).Remove();
 //    }
 //    List<String> eleremlist = new List<String>();
 //    foreach (XElement ele in bt.Elements())
 //    {
 //        IEnumerable<XAttribute> childtempattr = ele.Attributes();
 //        List<String> childremattr = new List<String>();
 //        if (ele.Name.ToString() != "table")
 //        {
 //            eleremlist.Add(ele.Name.ToString());
 //            continue;
 //        }
 //        if (ele.Attribute("type").Value.ContainsCI("static"))
 //        {
 //            eleremlist.Add(ele.Name.ToString());
 //        }
 //        else if (ele.Attribute("type").Value.ContainsCI("x axis"))
 //        {
 //            ele.Attribute("name").Value = "X";
 //            ele.SetAttributeValue("address", lut.colsAddress.ToString("X"));
 //        }
 //        else if (ele.Attribute("type").Value.ContainsCI("y axis"))
 //        {
 //            ele.Attribute("name").Value = "Y";
 //            ele.SetAttributeValue("address", lut.rowsAddress.ToString("X"));
 //        }
 //        foreach (XAttribute attr in childtempattr)
 //        {
 //            if (attr.Name != "address" && attr.Name != "name")
 //            {
 //                childremattr.Add(attr.Name.ToString());
 //            }
 //        }
 //        foreach (String rem in childremattr)
 //        {
 //            ele.Attribute(rem).Remove();
 //        }
 //    }
 //    foreach (String rem in eleremlist)
 //    {
 //        bt.Element(rem).Remove();
 //    }
 //    if (lut.dataAddress < 0x400000)
 //    {
 //        RomTableList.Add(name, TableFactory.CreateTable(bt));
 //    }
 //    else
 //    {
 //        RamTableList.Add(name, TableFactory.CreateTable(bt));
 //    }
 //}
 public void CopyTables(ECUMetaData d)
 {
     ExposedRomTables = new Dictionary<string,TableMetaData>(d.ExposedRomTables);
     ExposedRamTables = new Dictionary<string,TableMetaData>(d.ExposedRamTables);
     BaseRomTables = new Dictionary<string, TableMetaData>(d.BaseRomTables);
     BaseRamTables = new Dictionary<string, TableMetaData>(d.BaseRamTables);
     ScalingList = new Dictionary<string, Scaling>(d.ScalingList);
 }
コード例 #28
0
ファイル: Table1DMetaData.cs プロジェクト: Merp/SharpTune
 // DeviceImage image)
 public RamTable1DMetaData(XElement xel, ECUMetaData def, TableMetaData basetable)
     : base(xel, def, basetable)
 {
 }
コード例 #29
0
        public bool GetDevices(string directory)
        {
            try
            {
                string[] files = Directory.GetFiles(directory);
                //Parallel.ForEach(
                //  files, f =>
                foreach (var f in files)
                {
                    try
                    {
                        ECUMetaData d = new ECUMetaData(this, f);
                        if (d.isBase)
                        {
                            d.Populate();
                        }
                        lock (DefDictionary)
                        {
                            if (DefDictionary.ContainsKey(d.calibrationlId))
                            {
                                Trace.WriteLine("Duplicate definition found for: " + d.calibrationlId + " in file: " + f + " Check the definitions!!");
                                Trace.WriteLine("Definition was previously found in file: " + DefDictionary[d.calibrationlId].filePath);
                            }
                            else
                            {
                                DefDictionary.Add(d.calibrationlId, d);

                                lock (IdentList)
                                {
                                    IdentList.Add(d.calibrationlId);
                                    DeviceCount++;
                                }
                            }
                        }
                    }
                    catch (System.Exception excpt)
                    {
                        Trace.WriteLine("Error reading XML file " + f);
                        Trace.WriteLine(excpt.Message);
                    }
                }
                //});

                List <string> directories = Directory.GetDirectories(directory).ToList();

                //Parallel.ForEach(
                //   directories, d =>
                foreach (var d in directories)
                {
                    if (!GetDevices(d))
                    {
                        return(false);
                    }
                }  // });

                return(true);
            }
            catch (System.Exception excpt)
            {
                Trace.WriteLine(excpt.Message);
            }

            return(false);
        }
コード例 #30
0
 public override TableMetaData CreateChild(LookupTable lut, ECUMetaData d)
 {
     return(base.CreateChild(lut, d));
 }