Esempio n. 1
0
			public void Write(IO.EndianWriter stream)
			{
				Compiler comp = stream.Owner as Compiler;
				Import import = comp.OwnerState.Importer as Import;

				int real_count = import.Groups.Count;
				stream.Write("dynamic tag groups", false);
				stream.Write((short)DataArray.MaxValue);
				stream.Write((short)Item.Size);
				stream.Write(true);
				stream.Write(true);
				stream.Write((short)0);
				MiscGroups.data.Write(stream);
				stream.Write((short)real_count);//stream.Write((short)Datums.Count);
				stream.Write((short)real_count);//stream.Write((short)Datums.Count);
				stream.Write(real_count);
				stream.WritePointer(stream.PositionUnsigned + 4);

				#region Write tag group datums
				foreach (Import.TagGroup tg in import.Groups.Values)
				{
					stream.Write((short)0); // Header
					stream.Write((short)0); // Flags
					comp.AddLocationFixup(tg.Name, stream, false);
					stream.Write((int)0);
				}
				#endregion

				#region Write null datums
				Item i = new Item();
				int count = DataArray.MaxValue - real_count;
				for (int x = 0; x < count; x++)
					i.Write(stream);
				#endregion
			}
Esempio n. 2
0
			public void Write(IO.EndianWriter stream)
			{
				Compiler comp = stream.Owner as Compiler;
				Import import = comp.OwnerState.Importer as Import;

				short real_count = (short)import.Groups.Count;
				var next_index = new DatumIndex((ushort)real_count,
					0); // note that this default value isn't ideal
				stream.Write("dynamic tag groups", false);
				stream.Write(DataArray.MaxValue);
				stream.Write(Item.Size);
				stream.Write((byte)0); // alignment bit
				stream.Write(true); // is valid
				stream.Write((short)0); // flags
				MiscGroups.data.Write(stream);
				stream.Write(uint.MinValue); // allocator
				stream.Write((int)0); // bit vector next index
				stream.Write(Datums.Count); // bit vector length
				stream.Write(Datums.Count); // actual count
				next_index.Write(stream); // next index
				stream.WritePointer(stream.PositionUnsigned + 8);
				stream.Write((int)0); // bit vector pointer

				#region Write tag group datums
				foreach (Import.TagGroup tg in import.Groups.Values)
				{
					stream.Write((short)0); // Header
					stream.Write((short)0); // Flags
					comp.AddLocationFixup(tg.Name, stream, false);
					stream.Write((int)0);
				}
				#endregion

				#region Write null datums
				Item i = new Item();
				int count = DataArray.MaxValue - real_count;
				for (int x = 0; x < count; x++)
					i.Write(stream);
				#endregion
			}
Esempio n. 3
0
 private void reloadCurrentItem(Item item)
 {
     currentItem = new Item(item.Write());
     CB_Item.SelectedValue = (int)item.ID;
     TB_Flag1.Text = item.Flag1.ToString("X2");
     TB_Flag2.Text = item.Flag2.ToString("X2");
 }