diff --git a/Assets/Scripts/Description/Helpers/ChipTypeHelper.cs b/Assets/Scripts/Description/Helpers/ChipTypeHelper.cs index 4964d076..244e313b 100644 --- a/Assets/Scripts/Description/Helpers/ChipTypeHelper.cs +++ b/Assets/Scripts/Description/Helpers/ChipTypeHelper.cs @@ -30,6 +30,7 @@ public static class ChipTypeHelper { ChipType.DisplayDot, "DOT DISPLAY" }, { ChipType.SevenSegmentDisplay, "7-SEGMENT" }, { ChipType.DisplayLED, "LED" }, + { ChipType.FourteenSegmentDisplay, "14-Segment Display" }, // ---- Not really chips (but convenient to treat them as such anyway) ---- diff --git a/Assets/Scripts/Description/Types/SubTypes/ChipTypes.cs b/Assets/Scripts/Description/Types/SubTypes/ChipTypes.cs index 5b9d9ce7..8bcc04a0 100644 --- a/Assets/Scripts/Description/Types/SubTypes/ChipTypes.cs +++ b/Assets/Scripts/Description/Types/SubTypes/ChipTypes.cs @@ -19,6 +19,7 @@ public enum ChipType DisplayRGB, DisplayDot, DisplayLED, + FourteenSegmentDisplay, // ---- Merge / Split ---- Merge_1To4Bit, diff --git a/Assets/Scripts/Game/Interaction/UndoController.cs.meta b/Assets/Scripts/Game/Interaction/UndoController.cs.meta index 3c25111c..44704a98 100644 --- a/Assets/Scripts/Game/Interaction/UndoController.cs.meta +++ b/Assets/Scripts/Game/Interaction/UndoController.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: bb865751ca8914b4bb6a84288f0bc068 \ No newline at end of file +guid: bb865751ca8914b4bb6a84288f0bc068 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Game/Project/BuiltinChipCreator.cs b/Assets/Scripts/Game/Project/BuiltinChipCreator.cs index 1bf17b7f..4d3dfff7 100644 --- a/Assets/Scripts/Game/Project/BuiltinChipCreator.cs +++ b/Assets/Scripts/Game/Project/BuiltinChipCreator.cs @@ -43,6 +43,7 @@ public static ChipDescription[] CreateAllBuiltinChipDescriptions() CreateDisplayRGB(), CreateDisplayDot(), CreateDisplayLED(), + CreateFourteenSegmentDisplay(), // ---- Bus ---- CreateBus(PinBitCount.Bit1), CreateBusTerminus(PinBitCount.Bit1), @@ -202,7 +203,45 @@ static ChipDescription CreateDisplay7Seg() return CreateBuiltinChipDescription(ChipType.SevenSegmentDisplay, size, col, inputPins, null, displays, true); } - static ChipDescription CreateDisplayRGB() + static ChipDescription CreateFourteenSegmentDisplay() + { + PinDescription[] inputPins = + { + CreatePinDescription("A", 0), + CreatePinDescription("B", 1), + CreatePinDescription("C", 2), + CreatePinDescription("D", 3), + CreatePinDescription("E", 4), + CreatePinDescription("F", 5), + CreatePinDescription("G", 6), + CreatePinDescription("H", 7), + CreatePinDescription("I", 8), + CreatePinDescription("J", 9), + CreatePinDescription("K", 10), + CreatePinDescription("L", 11), + CreatePinDescription("M", 12), + CreatePinDescription("N", 13), + CreatePinDescription("COL", 14) + }; + + Color col = new(0.1f, 0.1f, 0.1f); + float height = SubChipInstance.MinChipHeightForPins(inputPins, null); + Vector2 size = new(GridSize * 13, height); + float displayWidth = (float)((size.x * 1.5) - (GridSize * 2)); + + DisplayDescription[] displays = + { + new() + { + Position = Vector2.right * PinRadius / 3 * 0, + Scale = displayWidth, + SubChipID = -1 + } + }; + return CreateBuiltinChipDescription(ChipType.FourteenSegmentDisplay, size, col, inputPins, null, displays, true); + } + + static ChipDescription CreateDisplayRGB() { float height = GridSize * 21; float width = height; diff --git a/Assets/Scripts/Graphics/UI/Menus/PulseEditMenu.cs.meta b/Assets/Scripts/Graphics/UI/Menus/PulseEditMenu.cs.meta index 969aa1e2..a920ecf9 100644 --- a/Assets/Scripts/Graphics/UI/Menus/PulseEditMenu.cs.meta +++ b/Assets/Scripts/Graphics/UI/Menus/PulseEditMenu.cs.meta @@ -1,2 +1,11 @@ fileFormatVersion: 2 -guid: 20b616e4d4e05224caee5477888fe68d \ No newline at end of file +guid: 20b616e4d4e05224caee5477888fe68d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Graphics/World/DevSceneDrawer.cs b/Assets/Scripts/Graphics/World/DevSceneDrawer.cs index 8765a06c..93a6322e 100644 --- a/Assets/Scripts/Graphics/World/DevSceneDrawer.cs +++ b/Assets/Scripts/Graphics/World/DevSceneDrawer.cs @@ -421,7 +421,30 @@ public static Bounds2D DrawDisplay(DisplayInstance display, Vector2 posParent, f int G = (simActive && sim.InputPins[6].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[6] ? DisplayHighlightState : DisplayOffState) + colOffset; bounds = DrawDisplay_SevenSegment(posWorld, scaleWorld, A, B, C, D, E, F, G); } - else if (display.DisplayType == ChipType.DisplayRGB) + else if (display.DisplayType is ChipType.FourteenSegmentDisplay) + { + bool simActive = sim != null; + bool hoverActive = rootChip.ChipType == ChipType.SevenSegmentDisplay; + PinInstance pin = InteractionState.PinUnderMouse; + int colOffset = simActive && sim.InputPins[14].FirstBitHigh ? 3 : 0; + + int A = (simActive && sim.InputPins[0].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[0] ? DisplayHighlightState : DisplayOffState) + colOffset; + int B = (simActive && sim.InputPins[1].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[1] ? DisplayHighlightState : DisplayOffState) + colOffset; + int C = (simActive && sim.InputPins[2].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[2] ? DisplayHighlightState : DisplayOffState) + colOffset; + int D = (simActive && sim.InputPins[3].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[3] ? DisplayHighlightState : DisplayOffState) + colOffset; + int E = (simActive && sim.InputPins[4].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[4] ? DisplayHighlightState : DisplayOffState) + colOffset; + int F = (simActive && sim.InputPins[5].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[5] ? DisplayHighlightState : DisplayOffState) + colOffset; + int G = (simActive && sim.InputPins[6].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[6] ? DisplayHighlightState : DisplayOffState) + colOffset; + int H = (simActive && sim.InputPins[7].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[7] ? DisplayHighlightState : DisplayOffState) + colOffset; + int I = (simActive && sim.InputPins[8].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[8] ? DisplayHighlightState : DisplayOffState) + colOffset; + int J = (simActive && sim.InputPins[9].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[9] ? DisplayHighlightState : DisplayOffState) + colOffset; + int K = (simActive && sim.InputPins[10].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[10] ? DisplayHighlightState : DisplayOffState) + colOffset; + int L = (simActive && sim.InputPins[11].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[11] ? DisplayHighlightState : DisplayOffState) + colOffset; + int M = (simActive && sim.InputPins[12].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[12] ? DisplayHighlightState : DisplayOffState) + colOffset; + int N = (simActive && sim.InputPins[13].FirstBitHigh ? DisplayOnState : hoverActive && pin == rootChip.AllPins[13] ? DisplayHighlightState : DisplayOffState) + colOffset; + bounds = DrawDisplay_FourteenSegment(posWorld, scaleWorld, A, B, C, D, E, F, G, H, I, J, K, L, M, N); + } + else if (display.DisplayType == ChipType.DisplayRGB) { bounds = DrawDisplay_RGB(posWorld, scaleWorld, sim); } @@ -567,7 +590,62 @@ public static Bounds2D DrawDisplay_SevenSegment(Vector2 centre, float scale, int return Bounds2D.CreateFromCentreAndSize(centre, boundsSize); } - public static Bounds2D DrawDisplay_DisplayLED(Vector2 centre, float scale, bool isOn) + public static Bounds2D DrawDisplay_FourteenSegment(Vector2 centre, float scale, int A, int B, int C, int D, int E, int F, int G, int H, int I, int J, int K, int L, int M, int N) + { + const float targetHeightAspect = 1.75f; + const float segmentThicknessFac = 0.165f; + const float segmentVerticalSpacingFac = 0.07f; + const float displayInsetFac = 0.2f; + + float boundsWidth = scale; + float boundsHeight = boundsWidth * targetHeightAspect; + float segmentThickness = scale * segmentThicknessFac; + + // Width of horizontal segments + float segmentWidth = boundsWidth - segmentThickness - scale * displayInsetFac; + // Distance between the centres of the bottom-most and top-most segments + float segmentRegionHeight = boundsHeight - segmentThickness - scale * displayInsetFac; + // Height of the vertical segments + float segmentHeight = segmentRegionHeight / 2 - scale * segmentVerticalSpacingFac; + + Vector2 segmentSizeVertical = new(segmentThickness / 2, segmentHeight); + Vector2 segmentSizeHorizontal = new(segmentWidth, segmentThickness / 2); + Vector2 segmentSizeDiagonal = new(segmentThickness / 2, (float)Math.Sqrt(((segmentSizeHorizontal.x) * (segmentSizeHorizontal.x)) + ((segmentSizeVertical.y) * (segmentSizeVertical.y)))); + Vector2 offsetX = Vector2.right * segmentWidth / 2; + Vector2 offsetY = Vector2.up * segmentRegionHeight / 4; + + Color[] cols = ActiveTheme.SevenSegCols; + + // Draw bounds + Vector2 boundsSize = new(boundsWidth, boundsHeight); + Draw.Quad(centre, boundsSize, Color.black); + + // Draw horizontal segments + Draw.Diamond(centre - (offsetX / 2), new Vector2(segmentWidth / 2, segmentThickness / 2), cols[G]); // mid left + Draw.Diamond(centre + (offsetX / 2), new Vector2(segmentWidth / 2, segmentThickness / 2), cols[H]); // mid right + + Draw.Diamond(centre + Vector2.up * segmentRegionHeight / 2, segmentSizeHorizontal, cols[A]); // top + Draw.Diamond(centre - Vector2.up * segmentRegionHeight / 2, segmentSizeHorizontal, cols[D]); // bottom + + // Draw vertical segments + Draw.Diamond(centre - offsetX + offsetY, segmentSizeVertical, cols[F]); // left top + Draw.Diamond(centre - offsetX - offsetY, segmentSizeVertical, cols[E]); // left bottom + Draw.Diamond(centre + offsetX + offsetY, segmentSizeVertical, cols[B]); // right top + Draw.Diamond(centre + offsetX - offsetY, segmentSizeVertical, cols[C]); // right bottom + + Draw.Diamond(centre + offsetY, segmentSizeVertical, cols[I]); // mid top + Draw.Diamond(centre - offsetY, segmentSizeVertical, cols[J]); // mid bottom + + //Draw Diagonal Segments + Draw.Line(centre + new Vector2(-.5f, 1.3f), centre + new Vector2(-.1f, .13f), segmentThickness / 5, cols[K]); + Draw.Line(centre + new Vector2(.5f, 1.3f), centre + new Vector2(.1f, .13f), segmentThickness / 5, cols[L]); + Draw.Line(centre + new Vector2(.5f, -1.3f), centre + new Vector2(.1f, -.13f), segmentThickness / 5, cols[M]); + Draw.Line(centre + new Vector2(-.5f, -1.3f), centre + new Vector2(-.1f, -.13f), segmentThickness / 5, cols[N]); + + return Bounds2D.CreateFromCentreAndSize(centre, boundsSize); + } + + public static Bounds2D DrawDisplay_DisplayLED(Vector2 centre, float scale, bool isOn) { const float pixelSizeT = 0.975f; float pixelSize = scale; diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index b62ca8b2..84a44409 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -1,10 +1,11 @@ { "dependencies": { "com.unity.ext.nunit": { - "version": "2.0.5", + "version": "1.0.6", "depth": 1, - "source": "builtin", - "dependencies": {} + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" }, "com.unity.ide.rider": { "version": "3.0.36", @@ -41,14 +42,15 @@ "url": "https://packages.unity.com" }, "com.unity.test-framework": { - "version": "1.5.1", + "version": "1.1.33", "depth": 1, - "source": "builtin", + "source": "registry", "dependencies": { - "com.unity.ext.nunit": "2.0.3", + "com.unity.ext.nunit": "1.0.6", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0" - } + }, + "url": "https://packages.unity.com" }, "com.unity.toolchain.win-x86_64-linux-x86_64": { "version": "2.0.10", diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index 8678d93f..37f39b7b 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1,2 @@ -m_EditorVersion: 6000.0.46f1 -m_EditorVersionWithRevision: 6000.0.46f1 (fb93bc360d3a) +m_EditorVersion: 2022.3.11f1 +m_EditorVersionWithRevision: 2022.3.11f1 (d00248457e15) diff --git a/TestData/Projects/MainTest/Chips/Test 14 Display.json b/TestData/Projects/MainTest/Chips/Test 14 Display.json new file mode 100644 index 00000000..94a61b1d --- /dev/null +++ b/TestData/Projects/MainTest/Chips/Test 14 Display.json @@ -0,0 +1,336 @@ +{ + "Name": "Test 14 Display", + "NameLocation": 2, + "ChipType": 0, + "Size": { + "x": 2.47918, + "y": 4.125 + }, + "Colour": { + "r": 0.2667728, + "g": 0.6422038, + "b": 0.785164833, + "a": 1 + }, + "InputPins":[ + { + "Name":"IN", + "ID":1778688768, + "Position":{ + "x":-5.95584, + "y":0.30442 + }, + "BitCount":8, + "Colour":0, + "ValueDisplayMode":0 + }, + { + "Name":"IN", + "ID":505112086, + "Position":{ + "x":-5.95584, + "y":-0.21308 + }, + "BitCount":8, + "Colour":0, + "ValueDisplayMode":0 + }, + { + "Name":"COL", + "ID":688928865, + "Position":{ + "x":-5.875, + "y":-2.4375 + }, + "BitCount":1, + "Colour":3, + "ValueDisplayMode":0 + } + ], + "OutputPins":[], + "SubChips":[ + { + "Name":"14-Segment Display", + "ID":1127587912, + "Label":"", + "Position":{ + "x":0.37855, + "y":0.06309 + }, + "OutputPinColourInfo":[], + "InternalData":null + }, + { + "Name":"8-1BIT", + "ID":964085604, + "Label":"", + "Position":{ + "x":-2.2082, + "y":1.35647 + }, + "OutputPinColourInfo":[{"PinColour":0,"PinID":1},{"PinColour":0,"PinID":2},{"PinColour":0,"PinID":3},{"PinColour":0,"PinID":4},{"PinColour":0,"PinID":5},{"PinColour":0,"PinID":6},{"PinColour":0,"PinID":7},{"PinColour":0,"PinID":8}], + "InternalData":null + }, + { + "Name":"8-1BIT", + "ID":1586568697, + "Label":"", + "Position":{ + "x":-2.2082, + "y":-0.77353 + }, + "OutputPinColourInfo":[{"PinColour":0,"PinID":1},{"PinColour":0,"PinID":2},{"PinColour":0,"PinID":3},{"PinColour":0,"PinID":4},{"PinColour":0,"PinID":5},{"PinColour":0,"PinID":6},{"PinColour":0,"PinID":7},{"PinColour":0,"PinID":8}], + "InternalData":null + } + ], + "Wires":[ + { + "SourcePinAddress":{ + "PinID":1, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":0, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":2, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":1, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":3, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":2, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":4, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":3, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":5, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":4, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":6, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":5, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":7, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":6, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":8, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":7, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":1, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":8, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":2, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":9, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":3, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":10, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":4, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":11, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":5, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":12, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":6, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":13, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":0, + "PinOwnerID":1778688768 + }, + "TargetPinAddress":{ + "PinID":0, + "PinOwnerID":964085604 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":0, + "PinOwnerID":505112086 + }, + "TargetPinAddress":{ + "PinID":0, + "PinOwnerID":1586568697 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":0, + "PinOwnerID":688928865 + }, + "TargetPinAddress":{ + "PinID":14, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":-0.73186,"y":-2.4375},{"x":-0.73186,"y":-1.66877},{"x":0.0,"y":0.0}] + } + ], + "Displays":[ + { + "SubChipID":1127587912, + "Position":{ + "x":0.0003, + "y":0.02344 + }, + "Scale":1.0 + } + ] +} \ No newline at end of file diff --git a/TestData/Projects/MainTest/Deleted Chips/Test 14 Display.json b/TestData/Projects/MainTest/Deleted Chips/Test 14 Display.json new file mode 100644 index 00000000..94a61b1d --- /dev/null +++ b/TestData/Projects/MainTest/Deleted Chips/Test 14 Display.json @@ -0,0 +1,336 @@ +{ + "Name": "Test 14 Display", + "NameLocation": 2, + "ChipType": 0, + "Size": { + "x": 2.47918, + "y": 4.125 + }, + "Colour": { + "r": 0.2667728, + "g": 0.6422038, + "b": 0.785164833, + "a": 1 + }, + "InputPins":[ + { + "Name":"IN", + "ID":1778688768, + "Position":{ + "x":-5.95584, + "y":0.30442 + }, + "BitCount":8, + "Colour":0, + "ValueDisplayMode":0 + }, + { + "Name":"IN", + "ID":505112086, + "Position":{ + "x":-5.95584, + "y":-0.21308 + }, + "BitCount":8, + "Colour":0, + "ValueDisplayMode":0 + }, + { + "Name":"COL", + "ID":688928865, + "Position":{ + "x":-5.875, + "y":-2.4375 + }, + "BitCount":1, + "Colour":3, + "ValueDisplayMode":0 + } + ], + "OutputPins":[], + "SubChips":[ + { + "Name":"14-Segment Display", + "ID":1127587912, + "Label":"", + "Position":{ + "x":0.37855, + "y":0.06309 + }, + "OutputPinColourInfo":[], + "InternalData":null + }, + { + "Name":"8-1BIT", + "ID":964085604, + "Label":"", + "Position":{ + "x":-2.2082, + "y":1.35647 + }, + "OutputPinColourInfo":[{"PinColour":0,"PinID":1},{"PinColour":0,"PinID":2},{"PinColour":0,"PinID":3},{"PinColour":0,"PinID":4},{"PinColour":0,"PinID":5},{"PinColour":0,"PinID":6},{"PinColour":0,"PinID":7},{"PinColour":0,"PinID":8}], + "InternalData":null + }, + { + "Name":"8-1BIT", + "ID":1586568697, + "Label":"", + "Position":{ + "x":-2.2082, + "y":-0.77353 + }, + "OutputPinColourInfo":[{"PinColour":0,"PinID":1},{"PinColour":0,"PinID":2},{"PinColour":0,"PinID":3},{"PinColour":0,"PinID":4},{"PinColour":0,"PinID":5},{"PinColour":0,"PinID":6},{"PinColour":0,"PinID":7},{"PinColour":0,"PinID":8}], + "InternalData":null + } + ], + "Wires":[ + { + "SourcePinAddress":{ + "PinID":1, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":0, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":2, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":1, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":3, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":2, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":4, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":3, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":5, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":4, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":6, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":5, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":7, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":6, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":8, + "PinOwnerID":964085604 + }, + "TargetPinAddress":{ + "PinID":7, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":1, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":8, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":2, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":9, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":3, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":10, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":4, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":11, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":5, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":12, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":6, + "PinOwnerID":1586568697 + }, + "TargetPinAddress":{ + "PinID":13, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":0, + "PinOwnerID":1778688768 + }, + "TargetPinAddress":{ + "PinID":0, + "PinOwnerID":964085604 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":0, + "PinOwnerID":505112086 + }, + "TargetPinAddress":{ + "PinID":0, + "PinOwnerID":1586568697 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":0.0,"y":0.0}] + }, + { + "SourcePinAddress":{ + "PinID":0, + "PinOwnerID":688928865 + }, + "TargetPinAddress":{ + "PinID":14, + "PinOwnerID":1127587912 + }, + "ConnectionType":0, + "ConnectedWireIndex":-1, + "ConnectedWireSegmentIndex":-1, + "Points":[{"x":0.0,"y":0.0},{"x":-0.73186,"y":-2.4375},{"x":-0.73186,"y":-1.66877},{"x":0.0,"y":0.0}] + } + ], + "Displays":[ + { + "SubChipID":1127587912, + "Position":{ + "x":0.0003, + "y":0.02344 + }, + "Scale":1.0 + } + ] +} \ No newline at end of file diff --git a/TestData/Projects/MainTest/ProjectDescription.json b/TestData/Projects/MainTest/ProjectDescription.json index 4516ae1a..4cfffc1d 100644 --- a/TestData/Projects/MainTest/ProjectDescription.json +++ b/TestData/Projects/MainTest/ProjectDescription.json @@ -2,8 +2,8 @@ "ProjectName": "MainTest", "DLSVersion_LastSaved": "2.1.4", "DLSVersion_EarliestCompatible": "2.0.0", - "CreationTime": "2025-03-14T18:23:30.404+01:00", - "LastSaveTime": "2025-04-25T17:44:29.842+02:00", + "CreationTime": "2025-03-14T13:23:30.404-04:00", + "LastSaveTime": "2025-04-28T18:34:10.931-04:00", "Prefs_MainPinNamesDisplayMode": 2, "Prefs_ChipPinNamesDisplayMode": 1, "Prefs_GridDisplayMode": 1, @@ -91,6 +91,14 @@ { "Name":"#", "IsCollection":false + }, + { + "Name":"14-Segment Display", + "IsCollection":false + }, + { + "Name":"OTHER", + "IsCollection":true } ], "ChipCollections":[ @@ -124,6 +132,11 @@ "IsToggledOpen":false, "Name":"MEMORY" }, + { + "Chips":["PULSE","TEST MergeSplit","14-Segment Display","#"], + "IsToggledOpen":true, + "Name":"OTHER" + }, { "Chips":["D-LATCH","FLIP-FLOP","OR-8","MEM-1","NOT-8","AND(8,1)","MUX-8","PC","BUF-8","ALU-8","DECODE-3","AND-3","CONTROL UNIT","TOGGLE","FLAGS","DISP-7","demo","7-SEGMENT DRIVER","DABBLE","LSB","LSHIFT-8","DOUBLE DABBLE","ALU","BUS BUFFER","MEM-256","REGISTER-8","XNOR","EQUALS-8","ADDER-4","DECODER-2","ADDER-8","ADDER","MEM-16","REGISTER-1","AND-8","RAM-256×8 (async)","ROM 256×16"], "IsToggledOpen":false, @@ -133,11 +146,6 @@ "Chips":["WIP2","RAM-sync"], "IsToggledOpen":false, "Name":"TEST" - }, - { - "Chips":["PULSE","TEST MergeSplit"], - "IsToggledOpen":true, - "Name":"OTHER" } ] } \ No newline at end of file