public ByteDescription GetTreeRootByteDescription() { var rootByteDescription = new ByteDescription() { Description = Name, IsHeader = true }; foreach (var table in Tables) { var tableByteDescription = table.GetTreeRootByteDescription(); rootByteDescription.Children.Add(tableByteDescription); } var rootChild = rootByteDescription.Children.FirstOrDefault(); if (rootChild != null) { rootByteDescription.Offset = rootChild.Offset; } else { rootByteDescription.HasNoOffset = true; } return rootByteDescription; }
public PanelUnequalByteViewModel(PanelDatabaseViewModel panelDatabaseViewModel, bool isFirstDatabase, ByteDescription byteDescription) { ShowUnEqualBytesCommand = new RelayCommand(OnShowUnEqualBytes); PanelDatabaseViewModel = panelDatabaseViewModel; IsFirstDatabase = isFirstDatabase; ByteDescription = byteDescription; }
public void SetShort(ByteDescription byteDescription, int value) { var bytes = BytesHelper.ShortToBytes((short)value); for (int i = 0; i < bytes.Count; i++) { var index = ByteDescriptions.IndexOf(byteDescription); ByteDescriptions[index + i].Value = bytes[i]; } byteDescription.RealValue = value.ToString(); }
public ByteDescription AddBytes(List<byte> bytes, string description = null, bool isReadOnly = false, bool ignoreUnequal = false) { var byteDescriptions = new List<ByteDescription>(); foreach (var b in bytes) { var byteDescription = new ByteDescription() { Value = b, IsReadOnly = isReadOnly, IgnoreUnequal = ignoreUnequal }; byteDescriptions.Add(byteDescription); } var firstByteDescriptions = byteDescriptions[0]; firstByteDescriptions.Description = description; ByteDescriptions.AddRange(byteDescriptions); return firstByteDescriptions; }
public ByteDescription GetTreeRootByteDescription() { var rootByteDescription = new ByteDescription() { Description = BytesDatabase.Name, IsHeader = true }; foreach (var byteDescription in BytesDatabase.ByteDescriptions) { rootByteDescription.Children.Add(byteDescription); } var tableChild = rootByteDescription.Children.FirstOrDefault(); if (tableChild != null) { rootByteDescription.Offset = tableChild.Offset; } else { rootByteDescription.HasNoOffset = true; } return rootByteDescription; }
void CreateEmptyTable() { FirstTable = new TableBase(this); for (int i = 0; i < 256; i++) { FirstTable.BytesDatabase.AddByte(0); } Crc16ByteDescription = FirstTable.BytesDatabase.AddShort(0, "CRC от ROM части базы"); Tables.Add(FirstTable); }
public NonPanelUnequalByteViewModel(NonPanelDatabaseViewModel nonPanelDatabaseViewModel, ByteDescription byteDescription) { ShowUnEqualBytesCommand = new RelayCommand(OnShowUnEqualBytes); NonPanelDatabaseViewModel = nonPanelDatabaseViewModel; ByteDescription = byteDescription; }
public ByteDescription AddReference(ByteDescription byteDescription, string description = null) { var newByteDescription = AddBytes(new List<byte>() { 0, 0, 0 }, description); newByteDescription.AddressReference = byteDescription; return newByteDescription; }