public NOTX(string parameters) : base(2) { var size = byte.Parse(parameters); IOGroups.Add(Input, new SchemeIOGroup(size, IO.Input)); IOGroups.Add(Output, new SchemeIOGroup(size, IO.Output)); IOGroups[Output].IOArray.SetAll(true); }
public void AddIOGroup(UIIOGroupBuildInfo ioGroupBuildInfo) { var ioGroupContainer = new IOGroupContainer(ioGroupBuildInfo, Self); IOGroups.Add(ioGroupContainer.BuildInfo.BuildString.Name, ioGroupContainer.IOGroup); IOGroupsInfo.Add(ioGroupContainer); ioGroupContainer.Design = SchemeDesigner.Instance.CreateSelfIOGroupDesign(ioGroupContainer); }
public void DeleteIOGroup(IOGroupContainer container) { var removedLinks = new List <LinkContainer>(); switch (container.IOGroup.IO) { case IO.Input: Self.SourceThisLinks.Where(x => x.BuildInfo.SourceGroupName == container.BuildInfo.BuildString.Name).ForEach(x => { if (removedLinks.Contains(x)) { return; } removedLinks.Add(x); x.Link.RemoveLink(); x.Design.DestroyThis(); x.TargetScheme.TargetThisLinks.Remove(x); Links.Remove(x); }); removedLinks.ForEach(x => Self.SourceThisLinks.Remove(x)); break; case IO.Output: Self.TargetThisLinks.Where(x => x.BuildInfo.TargetGroupName == container.BuildInfo.BuildString.Name).ForEach((x) => { if (removedLinks.Contains(x)) { return; } x.Link.RemoveLink(); x.Design.DestroyThis(); x.SourceScheme.SourceThisLinks.Remove(x); Links.Remove(x); }); removedLinks.ForEach(x => Self.TargetThisLinks.Remove(x)); break; } removedLinks.Clear(); (container.Design as IOSelfIOGroupDesign).DestroyThis(); IOGroups.Remove(container.BuildInfo.BuildString.Name); IOGroupsInfo.Remove(container); }
public RAMX(string parameters) : base(4) { var sizes = parameters.Split(' '); var valueSize = byte.Parse(sizes[0]); var addressSize = byte.Parse(sizes[1]); var valuesTotal = Extensions.Pow(2, addressSize); var totalSize = valuesTotal * valueSize; if (totalSize > MaxSize) { throw new UnityException("Превышен максимальный размер RAM"); } IOGroups.Add(Input, new SchemeIOGroup(valueSize, IO.Input)); IOGroups.Add(Address, new SchemeIOGroup(addressSize, IO.Input)); IOGroups.Add(Load, new SchemeIOGroup(1, IO.Input)); IOGroups.Add(Output, new SchemeIOGroup(valueSize, IO.Output)); CycleManager.Instance.Tick += OnTick; mRam = new BitArray[valuesTotal]; for (int i = 0; i < valuesTotal; i++) { mRam[i] = new BitArray(valueSize); } }
public SimulationStop(bool enabled) : base(1) { IOGroups.Add(Input, new SchemeIOGroup(1, IO.Input)); CycleManager.Instance.Tick += OnTick; Enabled = enabled; }
public DFF() : base(2) { IOGroups.Add(Input, new SchemeIOGroup(1, IO.Input)); IOGroups.Add(Output, new SchemeIOGroup(1, IO.Output)); CycleManager.Instance.Tick += OnTick; }
public NumberDisplay(Parameters parameters) : base(1) { mSchemeParameters = parameters; IOGroups.Add(Input, new SchemeIOGroup(mSchemeParameters.Size, IO.Input)); }
public IntConst(int value) : base(1) { IOGroups.Add(Output, new SchemeIOGroup(32, IO.Output)); Number = value; }
public CONST() : base(1) { IOGroups.Add(Output, new SchemeIOGroup(1, IO.Output)); IOGroups[Output].IOArray[0] = true; }
public NAND() : base(2) { IOGroups.Add(Input, new SchemeIOGroup(2, IO.Input)); IOGroups.Add(Output, new SchemeIOGroup(1, IO.Output)); IOGroups[Output].IOArray[0] = true; }