Commit 1361ffbb authored by *Kim's avatar *Kim 🦎

Updates

parent 8d7ca6a8
......@@ -6,6 +6,8 @@ const appRoot = require('app-root-path').toString();
liblouis.enableOnDemandTableLoading(path.join(appRoot, 'node_modules', 'liblouis-build', 'tables'));
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = true;
ipc.on('ready', ({ sender: render }) => {
Display.prototype._write = Display.prototype.write;
......
<!doctype html>
<title>Kymera Simulator</title>
<div class="untranslated"></div>
<div class="translated"></div>
<div id="untranslated"></div>
<div id="translated"></div>
<div class="display">
<div id="gpio-0"></div> <div id="gpio-3"></div>
......@@ -11,5 +12,11 @@
<div id="gpio-6"></div> <div id="gpio-7"></div>
</div>
<div class="buttons">
<button id="btn-0">0</button>
<button id="btn-1">1</button>
<button id="btn-2">2</button>
</div>
<script src="sim.js"></script>
<link rel="stylesheet" href="sim.css">
#untranslated {
font-family: monospace;
}
#translated {
font-size: 2em;
}
.display {
width: 60px;
float: right;
}
.display [id*=gpio] {
......
......@@ -4,8 +4,8 @@ const $ = q => document.querySelector(q);
ipc.send('ready');
ipc.on('Display#write', (event, { untranslated, translated }) => {
$('.untranslated').innerText = untranslated;
$('.translated').innerText = translated;
$('#untranslated').innerText = untranslated;
$('#translated').innerText = translated;
});
ipc.on('GPIO:0', (event, bit) => $('#gpio-0').className = bit ? 'active' : '');
......@@ -16,3 +16,7 @@ ipc.on('GPIO:4', (event, bit) => $('#gpio-4').className = bit ? 'active' : '');
ipc.on('GPIO:5', (event, bit) => $('#gpio-5').className = bit ? 'active' : '');
ipc.on('GPIO:6', (event, bit) => $('#gpio-6').className = bit ? 'active' : '');
ipc.on('GPIO:7', (event, bit) => $('#gpio-7').className = bit ? 'active' : '');
$('#btn-0').addEventListener('click', () => ipc.send('BTN:0'));
$('#btn-1').addEventListener('click', () => ipc.send('BTN:1'));
$('#btn-2').addEventListener('click', () => ipc.send('BTN:2'));
const { Kymera, Display } = require('@kymera/core');
pins=(0 1 6 2 3 18 19 11)
#!/bin/sh
pins=(0 1 6 2 3 18 19 11)
omega2-ctrl gpiomux set spi_cs1 gpio
for pin in $pins; do
fast-gpio set-output $pin
fast-gpio set $pin 0
done
......@@ -16,7 +16,8 @@
"app-root-path": "^2.1.0",
"electron": "^3.0.9",
"liblouis": "^0.4.0",
"onoff": "^3.2.2"
"onoff": "^3.2.2",
"zepto": "github:madrobby/zepto"
},
"devDependencies": {
"chai": "^4.2.0",
......@@ -27,5 +28,8 @@
"nodemon": "^1.18.6",
"selenium-webdriver": "^4.0.0-alpha.1",
"spectron": "^5.0.0"
},
"resolutions": {
"liblouis-build": "3.2.0-rc"
}
}
......@@ -6,3 +6,5 @@ For more information, see [the main Kymera repo][About]
[About]: https://gitlab.com/chameleoid/kymera/about
[Kymera Website]: https://kymera.tech
![](./screenshots/simulator.png)
......@@ -17,9 +17,12 @@
coreutils ? pkgs.coreutils,
glibc ? pkgs.glibc,
glibc32 ? pkgs.pkgsi686Linux.glibc,
node ? pkgs.nodejs-10_x,
}:
let
fhs-init = writeScript "fhs-init" ''
#! ${stdenv.shell}
cd $FHS_PWD
......@@ -40,25 +43,30 @@ let
ln -s $out/lib${if is64bit then "64" else "32"} $out/lib
'';
};
in
mkShell rec {
buildInputs = with pkgs;
atomEnv.packages ++
[
libuv
v8
gtk3-x11
at-spi2-atk
nodejs-8_x
(yarn.override { nodejs = nodejs-8_x; })
];
shellHook = ''
export PATH="$PWD/node_modules/.bin/:$PATH"
export NODE_ENV=development
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${makeLibraryPath buildInputs}
export FHS_PWD=$PWD
export CXXFLAGS=-I${pkgs.nodejs-8_x}/include/node
exec ${chrootenv} ${fhs-init}
'';
}
mkShell rec {
buildInputs = with pkgs;
atomEnv.packages ++
[
libuv
v8
gtk3-x11
at-spi2-atk
node
(yarn.override { nodejs = node; })
gitlab-runner
];
shellHook = ''
export PATH="$PWD/node_modules/.bin/:$PATH"
export NODE_ENV=development
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${makeLibraryPath buildInputs}
export FHS_PWD=$PWD
export CXXFLAGS=-I${pkgs.nodejs-10_x}/include/node
exec ${chrootenv}/bin/chrootenv ${fhs-init}
'';
}
......@@ -1669,7 +1669,7 @@ [email protected]^1.0.0:
dependencies:
readable-stream "^2.0.5"
[email protected]*:
liblouis-b[email protected]*, [email protected]:
version "3.2.0-rc"
resolved "https://registry.yarnpkg.com/liblouis-build/-/liblouis-build-3.2.0-rc.tgz#77489c398ea5232878a2bd27ffa359499e056a75"
integrity sha1-d0icOY6lIyh4or0n/6NZSZ4FanU=
......@@ -3275,6 +3275,10 @@ [email protected]:
dependencies:
fd-slicer "~1.0.1"
"[email protected]:madrobby/zepto":
version "1.2.0"
resolved "https://codeload.github.com/madrobby/zepto/tar.gz/3172e92dd80f91f177def1068beadd98a3c026e3"
[email protected]^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/zip-stream/-/zip-stream-1.2.0.tgz#a8bc45f4c1b49699c6b90198baacaacdbcd4ba04"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment