From c83949de1ae56fbc3d76f843b34d182c08d10df7 Mon Sep 17 00:00:00 2001 From: shubhankarsharma00 Date: Fri, 12 Jun 2020 16:16:31 +0530 Subject: [PATCH 1/3] keyboard not working --- .eslintrc.js | 17 + index.html | 17 +- jest.config.js | 1 + jest.setup.js | 21 + package-lock.json | 642 +++++ package.json | 1 + src/app.js | 29 +- src/arrayHelpers.js | 23 +- src/backgroundArea.js | 17 +- src/canvas2svg.js | 843 +++--- src/canvasApi.js | 418 +-- src/circuit.js | 422 +-- src/circuitElement.js | 472 ++-- src/combinationalAnalysis.js | 279 ++ src/data.js | 25 + src/data/backupCircuit.js | 63 + src/data/load.js | 210 ++ src/data/project.js | 138 + src/data/save.js | 332 +++ src/data/saveImage.js | 44 + src/data/undo.js | 44 + src/dec-bin-hex.js | 58 + src/embed.js | 73 + src/embedListeners.js | 245 ++ src/engine.js | 670 +++-- src/eventQueue.js | 51 +- src/events.js | 293 +++ src/layout/layoutBuffer.js | 61 + src/layout/layoutNode.js | 103 + src/layoutMode.js | 388 +++ src/listeners.js | 588 +++-- src/minimap.js | 117 + src/module.js | 4033 ----------------------------- src/modules.js | 154 ++ src/modules/ALU.js | 188 ++ src/modules/Adder.js | 99 + src/modules/AndGate.js | 147 ++ src/modules/Arrow.js | 78 + src/modules/BitSelector.js | 139 + src/modules/Buffer.js | 115 + src/modules/Button.js | 117 + src/modules/ConstantVal.js | 179 ++ src/modules/ControlledInverter.js | 111 + src/modules/Counter.js | 122 + src/modules/Decoder.js | 158 ++ src/modules/Demultiplexer.js | 163 ++ src/modules/DigitalLed.js | 128 + src/modules/Flag.js | 187 ++ src/modules/Ground.js | 120 + src/modules/HexDisplay.js | 155 ++ src/modules/Input.js | 194 ++ src/modules/LSB.js | 132 + src/modules/MSB.js | 126 + src/modules/Multiplexer.js | 186 ++ src/modules/NandGate.js | 144 + src/modules/NorGate.js | 143 + src/modules/NotGate.js | 94 + src/modules/OrGate.js | 142 + src/modules/Output.js | 179 ++ src/modules/Power.js | 127 + src/modules/PriorityEncoder.js | 165 ++ src/modules/RGBLed.js | 122 + src/modules/RGBLedMatrix.js | 330 +++ src/modules/Random.js | 107 + src/modules/Rectangle.js | 146 ++ src/modules/Rom.js | 202 ++ src/modules/SevenSegDisplay.js | 116 + src/modules/SixteenSegDisplay.js | 131 + src/modules/Splitter.js | 230 ++ src/modules/SquareRGBLed.js | 154 ++ src/modules/Stepper.js | 99 + src/modules/Text.js | 144 + src/modules/TriState.js | 116 + src/modules/Tunnel.js | 255 ++ src/modules/TwoComplement.js | 89 + src/modules/VariableLed.js | 100 + src/modules/XnorGate.js | 147 ++ src/modules/XorGate.js | 145 ++ src/node.js | 647 ++--- src/plotArea.js | 237 +- src/quinMcCluskey.js | 218 ++ src/restrictedElementDiv.js | 24 +- src/sequential.js | 24 + src/sequential/Clock.js | 83 + src/sequential/DflipFlop.js | 142 + src/sequential/Dlatch.js | 119 + src/sequential/EEPROM.js | 68 + src/sequential/JKflipFlop.js | 146 ++ src/sequential/Keyboard.js | 182 ++ src/sequential/RAM.js | 204 ++ src/sequential/Rom.js | 201 ++ src/sequential/SRflipFlop.js | 128 + src/sequential/TTY.js | 187 ++ src/sequential/TflipFlop.js | 153 ++ src/setup.js | 174 ++ src/simulationArea.js | 77 +- src/subcircuit.js | 458 ++++ src/testbench.js | 3 + src/testbench/ForceGate.js | 88 + src/testbench/testbenchInput.js | 291 +++ src/testbench/testbenchOutput.js | 232 ++ src/utils.js | 127 +- src/ux.js | 403 ++- src/wire.js | 137 +- test/examples/fulladder.json | 788 ++++++ test/gates/gates.test.js | 39 + test/listenertest.test.js | 39 + test/load.test.js | 16 + test/sample.test.js | 28 +- test/save.test.js | 20 + test/subcircuit.test.js | 31 + webpack.config.js | 7 + 112 files changed, 16644 insertions(+), 6440 deletions(-) create mode 100644 .eslintrc.js create mode 100644 jest.setup.js create mode 100755 src/combinationalAnalysis.js create mode 100755 src/data.js create mode 100755 src/data/backupCircuit.js create mode 100755 src/data/load.js create mode 100755 src/data/project.js create mode 100755 src/data/save.js create mode 100755 src/data/saveImage.js create mode 100755 src/data/undo.js create mode 100644 src/dec-bin-hex.js create mode 100644 src/embed.js create mode 100644 src/embedListeners.js create mode 100755 src/events.js create mode 100755 src/layout/layoutBuffer.js create mode 100755 src/layout/layoutNode.js create mode 100755 src/layoutMode.js create mode 100755 src/minimap.js delete mode 100644 src/module.js create mode 100755 src/modules.js create mode 100755 src/modules/ALU.js create mode 100755 src/modules/Adder.js create mode 100755 src/modules/AndGate.js create mode 100755 src/modules/Arrow.js create mode 100755 src/modules/BitSelector.js create mode 100755 src/modules/Buffer.js create mode 100755 src/modules/Button.js create mode 100755 src/modules/ConstantVal.js create mode 100755 src/modules/ControlledInverter.js create mode 100644 src/modules/Counter.js create mode 100755 src/modules/Decoder.js create mode 100755 src/modules/Demultiplexer.js create mode 100755 src/modules/DigitalLed.js create mode 100755 src/modules/Flag.js create mode 100755 src/modules/Ground.js create mode 100755 src/modules/HexDisplay.js create mode 100755 src/modules/Input.js create mode 100755 src/modules/LSB.js create mode 100755 src/modules/MSB.js create mode 100755 src/modules/Multiplexer.js create mode 100755 src/modules/NandGate.js create mode 100755 src/modules/NorGate.js create mode 100755 src/modules/NotGate.js create mode 100755 src/modules/OrGate.js create mode 100755 src/modules/Output.js create mode 100755 src/modules/Power.js create mode 100755 src/modules/PriorityEncoder.js create mode 100755 src/modules/RGBLed.js create mode 100644 src/modules/RGBLedMatrix.js create mode 100644 src/modules/Random.js create mode 100755 src/modules/Rectangle.js create mode 100755 src/modules/Rom.js create mode 100755 src/modules/SevenSegDisplay.js create mode 100755 src/modules/SixteenSegDisplay.js create mode 100755 src/modules/Splitter.js create mode 100755 src/modules/SquareRGBLed.js create mode 100755 src/modules/Stepper.js create mode 100755 src/modules/Text.js create mode 100755 src/modules/TriState.js create mode 100755 src/modules/Tunnel.js create mode 100755 src/modules/TwoComplement.js create mode 100755 src/modules/VariableLed.js create mode 100755 src/modules/XnorGate.js create mode 100755 src/modules/XorGate.js create mode 100644 src/quinMcCluskey.js create mode 100644 src/sequential.js create mode 100644 src/sequential/Clock.js create mode 100644 src/sequential/DflipFlop.js create mode 100644 src/sequential/Dlatch.js create mode 100644 src/sequential/EEPROM.js create mode 100644 src/sequential/JKflipFlop.js create mode 100644 src/sequential/Keyboard.js create mode 100644 src/sequential/RAM.js create mode 100755 src/sequential/Rom.js create mode 100644 src/sequential/SRflipFlop.js create mode 100644 src/sequential/TTY.js create mode 100644 src/sequential/TflipFlop.js create mode 100755 src/setup.js create mode 100755 src/subcircuit.js create mode 100644 src/testbench.js create mode 100755 src/testbench/ForceGate.js create mode 100644 src/testbench/testbenchInput.js create mode 100644 src/testbench/testbenchOutput.js create mode 100644 test/examples/fulladder.json create mode 100644 test/gates/gates.test.js create mode 100644 test/listenertest.test.js create mode 100644 test/load.test.js create mode 100644 test/save.test.js create mode 100644 test/subcircuit.test.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..e85c39b --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,17 @@ +module.exports = { + "env": { + "browser": true, + "es6": true + }, + "extends": "eslint:recommended", + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 11, + "sourceType": "module" + }, + "rules": { + } +}; diff --git a/index.html b/index.html index c99cecb..8d6facd 100644 --- a/index.html +++ b/index.html @@ -5,9 +5,9 @@