Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
klues committed Jan 30, 2024
2 parents a640b3f + b4d7149 commit 95b4c38
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ To adjust settings on your assistive device, please:
## Run WebGUI locally
To run the WebGUIs locally you need to download this repository and start a local webserver to serve the data. Do the following steps:
1. Clone the repository with `git clone https://github.com/asterics/Addon-Bluetooth-WebGUI.git`
2. Install any local webserver, e.g. [http-server from npm](https://www.npmjs.com/package/http-server) with `npm install --global http-server`
2. Install any local webserver, e.g. [http-server from npm](https://www.npmjs.com/package/http-server) with `npm install --global http-server` (or Python: `python3 -m http.server 8080`)
3. Start the local webserver to serve documents from the webgui folder e.g. with `cd Addon-Bluetooth-WebGUI/webgui` and starting `http-server` in this directory
4. Open `http://localhost:8080/index_fm.htm` or `http://localhost:8080/index_fabi.htm` in your browser

Expand All @@ -44,4 +44,4 @@ This project here has two purposes:
* We will use it as landing page for this site (GitHub pages)
* All build files for building the ESP32 based Bluetooth and WebGUI addon are located here

If you are interested in flashing/updating your ESP32 addon for FABI/FLipMouse, please go to this repository's page: [Addon-Bluetooth-WebGUI](https://github.com/asterics/Addon-Bluetooth-WebGUI)
If you are interested in flashing/updating your ESP32 addon for FABI/FLipMouse, please go to this repository's page: [Addon-Bluetooth-WebGUI](https://github.com/asterics/Addon-Bluetooth-WebGUI)
3 changes: 2 additions & 1 deletion webgui/js_fabi/constantsFabi.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ C.HELP_BASE_URL = 'https://github.com/asterics/FABI/blob/master/Documentation/Us

C.USB_DEVICE_FILTERS = [
{usbVendorId: 0x2341, usbProductId: 0x8037}, // Arduino Pro Micro
{usbVendorId: 0x2E8A, usbProductId: 0xF10A} // RaspberryPi PicoW
{usbVendorId: 0x2E8A, usbProductId: 0xF10A}, // RaspberryPi PicoW
{usbVendorId: 0x239A, usbProductId: 0xCAFE} // RaspberryPi PicoW - Adafruit TinyUSB Stack
];

C.VIEWS = [{
Expand Down
17 changes: 13 additions & 4 deletions webgui/js_fabi/ui/views/TabVisualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ class TabVisualization extends Component {
super(props);

TabVisualization.instance = this;
TabVisualization.BTN_NAMES = ["1", "2", "3", "4", "5", "6", "7", "8", null, "Sip // Ansaugen", "Puff // Pusten"];
TabVisualization.BTN_NAMES_LONGPRESS = ["1", "2", "3", "4", "5", "6", null, null, null, "Sip // Ansaugen", "Puff // Pusten"];
if (ATDevice.isMajorVersion(3)) {
TabVisualization.BTN_NAMES = ["1", "2", "3", "4", "5", "Sip // Ansaugen", "Puff // Pusten"];
} else {
TabVisualization.BTN_NAMES = ["1", "2", "3", "4", "5", "6", "7", "8", null, "Sip // Ansaugen", "Puff // Pusten"];
TabVisualization.BTN_NAMES_LONGPRESS = ["1", "2", "3", "4", "5", "6", null, null, null, "Sip // Ansaugen", "Puff // Pusten"];
}
this.setState({
liveData: {}
})
Expand All @@ -30,7 +34,12 @@ class TabVisualization extends Component {
let circleRadius = Math.min(70, window.innerWidth / 7);
let fontStyle = `text-align: center; line-height: ${circleRadius}px; font-size: 30px`;
let longpressActive = ATDevice.getConfig(C.AT_CMD_THRESHOLD_LONGPRESS) > 0;
let btnNames = longpressActive ? TabVisualization.BTN_NAMES_LONGPRESS : TabVisualization.BTN_NAMES;
let btnNames;
if (ATDevice.isMajorVersion(3)) {
btnNames = TabVisualization.BTN_NAMES;
} else {
btnNames = longpressActive ? TabVisualization.BTN_NAMES_LONGPRESS : TabVisualization.BTN_NAMES;
}
let longPressStates = longpressActive ? data.LIVE_BUTTONS.slice(6, 9) : [];
return html`<h2 id="tabVisHeader" style="margin-bottom: 1em">${L.translate('Visualization of current button state // Visualisierung aktueller Button-Status')}</h2>
<div aria-hidden="true" style="display: flex; flex-wrap: wrap;">
Expand Down Expand Up @@ -59,4 +68,4 @@ TabVisualization.valueHandler = function (data) {
})
};

export {TabVisualization};
export {TabVisualization};

0 comments on commit 95b4c38

Please sign in to comment.