public CDTRecord(CDTRecord a_obj) { this._chipClass = ""; this._chipType = ""; this._radioSystem = ""; this._chipRevision = ""; this._licenseList = new List<LicenseItem>(); this._chipType = a_obj._chipType; this._chipRevision = a_obj._chipRevision; this._chipClass = a_obj._chipClass; this._radioSystem = a_obj._radioSystem; this._defaultRev = a_obj._defaultRev; this._advanced = a_obj._advanced; this._licenseList = a_obj._licenseList; }
public CDTManager(string xmlFile) { this._chipDatabase = new List<CDTRecord>(); try { XmlDocument document = new XmlDocument(); document.Load(xmlFile); document.PreserveWhitespace = false; foreach (XmlNode node in document.GetElementsByTagName("CDT_Record")) { CDTRecord item = new CDTRecord(); if (item.restore(node) != 0) { return; } this._chipDatabase.Add(item); } } catch (Exception exception) { MessageBox.Show("XML Reading error! \n" + exception.Message, "CDTManager.CDTManager()"); } }
public bool isMatchFilter(ChipClassFilter classFilter, ChipSystemFilter[] systemFilter, bool a_checkType, bool a_checkRevision, CDTRecord a_rec) { if ((classFilter != ChipClassFilter.All) && (this.ChipClass != classFilter.ToString())) { return false; } List<ChipSystemFilter> list = new List<ChipSystemFilter>(systemFilter); if (!list.Contains(ChipSystemFilter.All) && !list.Contains((ChipSystemFilter) Enum.Parse(typeof(ChipSystemFilter), this.RadioSystem, true))) { return false; } if (a_checkType && (this._chipType != a_rec._chipType)) { return false; } if (a_checkRevision && (this._chipRevision != a_rec._chipRevision)) { return false; } return true; }
public bool EqualsChipType(CDTRecord ddtRecord) { return (this.ChipType == ddtRecord.ChipType); }
public bool Equals(CDTRecord ddtRecord) { return (this == ddtRecord); }
private void btnSelectRadio_Click(object sender, EventArgs e) { if (_pollDeviceTimer != null) _pollDeviceTimer.Stop(); string str = dgvChipTypes.SelectedRows[0].Cells[1].Value.ToString(); string str2 = dgvChipTypes.SelectedRows[0].Cells[0].Value.ToString(); foreach (CDTRecord record in _cdtDatabase) { if ((record.ChipType == str2) && (record.ChipRevision == str)) { _selectedChip = record; break; } } _adt.DeviceInfo.UserEBID = _selectedChip; DeviceDescriptor item = new DeviceDescriptor(); try { item.DeviceType = new DeviceType((DeviceTypeID)Enum.Parse(typeof(DeviceTypeID), "Radio_" + _selectedChip.ChipType.Replace('I', 'i'))); item.DeviceName = _selectedChip.ChipType; item.DeviceVersion = new DeviceVersion(_selectedChip.ChipRevision); _adt.DeviceInfo.ComponentList.Add(item); } catch { } base.DialogResult = System.Windows.Forms.DialogResult.OK; base.Close(); }
private void Network_Wizard_CP_Load(object sender, EventArgs e) { this._msgshown = 0; foreach (TabPage page in this.tabControl.TabPages) { page.EnabledChanged += new EventHandler(this.tabPage_EnabledChanged); } foreach (TabPage page2 in this.tabControl.TabPages) { page2.Enabled = false; } this.tabControl.TabPages[0].Enabled = true; this.lblFirmwareType.Text = "Firmware Type: " + this._ioph.getAdtRecord().DeviceInfo.ShowFirmwareType; this.lblFirmwareVersion.Text = "Firmware Version: " + this._ioph.getAdtRecord().DeviceInfo.ShowFirmwareVersion; string str = ""; this._SelectedAssociatedAppName = this._ioph.getAdtRecord().SelectedAssociatedAppName; this._EBIDInfo = this._ioph.getAdtRecord().DeviceInfo.PnPEBID; string str2 = this._SelectedAssociatedAppName; if (str2 != null) { if (!(str2 == "Remote Keyless Entry Demo")) { if (str2 == "Security Demo") { str = "Network_Wizard_Security_Resource"; } else if (str2 == "EZMac Network Demo") { str = "Network_Wizard_EzMacNetwork_Resource"; } else if (str2 == "Network Demo") { str = "Network_Wizard_Network_Resource"; } } else { str = "Network_Wizard_RKE_Resource"; } } this._myResources = new ResourceManager("NewWDS.Demo_applications.Network_demo." + str, base.GetType().Assembly); }
private void loadADCRRecordsFromXml() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); executingAssembly.GetManifestResourceNames(); Stream manifestResourceStream = executingAssembly.GetManifestResourceStream("NewWDS.WDS_Resources.ADCR.xml"); List<ADCRRecord> list = new List<ADCRRecord>(); try { XmlDocument document = new XmlDocument(); document.Load(manifestResourceStream); foreach (XmlNode node in document.GetElementsByTagName("ADCR_Record")) { ApplicationDescriptor app = new ApplicationDescriptor(); CompatibleDeviceDescriptor comaptibleDevices = new CompatibleDeviceDescriptor(); CompatibleChipDescriptor chips = new CompatibleChipDescriptor(); CompatibleLicenseDescriptor licenses = new CompatibleLicenseDescriptor(); foreach (XmlNode node2 in node.ChildNodes) { string name = node2.Name; if (name != null) { if (!(name == "Application")) { if (name == "Chips") { goto Label_0377; } if (name == "Devices") { goto Label_053F; } } else { foreach (XmlNode node3 in node2.ChildNodes) { switch (node3.Name) { case "Type": app.AppType = this.getAppTypeItemByName(node3.InnerText); break; case "Class": app.AppClass = this.getAppClassItemByName(node3.InnerText); break; case "Name": app.AppName = node3.InnerText; break; case "Description": app.ApplicationDescription = node3.InnerText; break; case "Simulation": app.SimulationCapable = bool.Parse(node3.InnerText); break; case "Advanced": app.Advanced = bool.Parse(node3.InnerText); break; case "StartupApplication": app.StartupApplication = node3.InnerText; break; case "EBIDRequired": app.EBIDRequired = bool.Parse(node3.InnerText); break; case "AllowedToRunOnDifferentFwType": app.AllowedToRunOnDifferentFwType = bool.Parse(node3.InnerText); break; case "TopOnAppList": app.TopOnAppList = bool.Parse(node3.InnerText); break; case "Licenses": foreach (XmlNode node4 in node3.ChildNodes) { if ((node4.NodeType != XmlNodeType.Comment) && (node4.Name == "Name")) { LicenseItem item = new LicenseItem { Name = node4.InnerText }; licenses.LicenseList.Add(item); } } break; } } } } continue; Label_0377: foreach (XmlNode node5 in node2.ChildNodes) { CDTRecord record = new CDTRecord(); foreach (XmlNode node6 in node5.ChildNodes) { string str3 = node6.Name; if (str3 != null) { if (!(str3 == "Type")) { if (str3 == "Revision") { goto Label_042D; } if (str3 == "DefaultRev") { goto Label_0440; } if (str3 == "Advanced") { goto Label_0458; } if (str3 == "Licenses") { goto Label_046D; } } else { record.ChipType = node6.InnerText; } } continue; Label_042D: record.ChipRevision = node6.InnerText; continue; Label_0440: record.DefaultRev = bool.Parse(node6.InnerText); continue; Label_0458: record.Advanced = bool.Parse(node6.InnerText); continue; Label_046D: foreach (XmlNode node7 in node6.ChildNodes) { if ((node7.NodeType != XmlNodeType.Comment) && (node7.Name == "Name")) { LicenseItem item2 = new LicenseItem { Name = node7.InnerText }; record.LicenseList.Add(item2); } } } chips.ChipList.Add(record); } continue; Label_053F: this.parseCompatibleDevices(comaptibleDevices, node2); } list.Add(new ADCRRecord(app, comaptibleDevices, chips, licenses)); } this._adcrRecordSet = list.ToArray(); } catch (Exception exception) { MessageBox.Show("ADCR XML Reading error! \n" + exception.Message, "ADCRManager.loadADCRRecordsFromXml()"); } }
public bool hasDDTRecord(CDTRecord ddtRecord) { foreach (CDTRecord record in this._chipDatabase) { if (ddtRecord == record) { return true; } } return false; }