Skip to content
This repository was archived by the owner on Dec 23, 2021. It is now read-only.

Swap broken picture when there is no images #280

Merged
merged 79 commits into from
Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
120d670
initial clue research
andreamah Mar 10, 2020
2d10c6e
text api ok
andreamah Mar 11, 2020
40153d5
more organized text api
andreamah Mar 11, 2020
a5c4c30
Initialize clue
xnkevinnguyen Mar 11, 2020
54b8240
added connection to frontend
andreamah Mar 11, 2020
97017a5
Pass base 64 message
xnkevinnguyen Mar 11, 2020
0376620
minor modifications and renaming
andreamah Mar 11, 2020
775fcfc
Update simulator state on new message
xnkevinnguyen Mar 11, 2020
0c8cc4a
Merge remote-tracking branch 'origin/users/t-anmah/initial-clue-work'…
xnkevinnguyen Mar 11, 2020
6f66d98
Comment unused code
xnkevinnguyen Mar 11, 2020
8832cc9
Styling the clue device
xnkevinnguyen Mar 11, 2020
2038f67
display shape progress
andreamah Mar 11, 2020
913b3ed
Update process user code to import clue
xnkevinnguyen Mar 12, 2020
0be56f5
neopixel implemented
andreamah Mar 12, 2020
24500fd
Merge branch 'dev' into users/t-anmah/initial-clue-work
andreamah Mar 12, 2020
a0c0028
gulpfile bug and adjusted requirements
andreamah Mar 12, 2020
8056df6
resolved merge conflicts
andreamah Mar 13, 2020
4cf8aec
merge conflicts for gulpfile
andreamah Mar 13, 2020
085618c
tweaks on current lib before testing
andreamah Mar 13, 2020
7ad9be3
restructure displayio
andreamah Mar 13, 2020
580f152
finished displayio tests
andreamah Mar 14, 2020
4b7bcf1
some testing on display shapes
andreamah Mar 14, 2020
d5e97d2
finsihed more test cases and refined display text scaling
andreamah Mar 16, 2020
0f49ef0
refined tests again, added clue test
andreamah Mar 16, 2020
bdda01e
formatting
andreamah Mar 16, 2020
05dc409
Merge branch 'dev' into users/t-anmah/initial-clue-work
andreamah Mar 16, 2020
e2d7b63
neopixel re-org
andreamah Mar 16, 2020
eb57889
img folder
andreamah Mar 17, 2020
06d820e
formatting
andreamah Mar 17, 2020
f410c45
minor changes to isolate display group
andreamah Mar 17, 2020
9de83bf
arranged pip install for reused code and re-did setup process for it
andreamah Mar 17, 2020
520fec4
revert settings.json
andreamah Mar 17, 2020
0ec5989
removed unecessary whitespace diffs
andreamah Mar 17, 2020
8e10f8b
corrected whitespace diffs again
andreamah Mar 17, 2020
4ee7fa0
more whitespace correction
andreamah Mar 17, 2020
8d90c02
reorganizaion before docs
andreamah Mar 17, 2020
15b607f
digitalio comment
andreamah Mar 17, 2020
0dd9ca6
resolve merge conflicts
andreamah Mar 18, 2020
46cfd56
docs and neopixel integration
andreamah Mar 18, 2020
392d59d
fixed bitmap font pkg
andreamah Mar 18, 2020
2837e3d
can't render image
andreamah Mar 18, 2020
3fcdd67
working backend-frontend screen
andreamah Mar 19, 2020
1a885f7
Merge branch 'dev' into users/t-anmah/clue-frontend-backend-integration
andreamah Mar 19, 2020
cec273c
added board module
andreamah Mar 19, 2020
e0e3428
formatting
andreamah Mar 19, 2020
43d789c
group fix
andreamah Mar 19, 2020
c21bc15
made neopixel lib work on cpx and clue
andreamah Mar 19, 2020
1e928af
resolved merge conflicts
andreamah Mar 19, 2020
a9d009c
formatting and more comments
andreamah Mar 19, 2020
176f3e1
restructuring for testing
andreamah Mar 20, 2020
b1846f0
fixed some comm error
andreamah Mar 20, 2020
0d4a549
changed the way neopixel is sent to frontend clue
andreamah Mar 20, 2020
d98a649
cleaned up tile_grid and added threading
andreamah Mar 23, 2020
af71bef
removed test fn
andreamah Mar 23, 2020
6f957a3
overflow fix
andreamah Mar 23, 2020
e4a575d
Rename correctly components
xnkevinnguyen Mar 23, 2020
f72c49e
Additional refactoring
xnkevinnguyen Mar 23, 2020
b8101e7
performance improvements
andreamah Mar 24, 2020
c0c4730
Merge branch 'users/t-anmah/clue-frontend-backend-integration' of htt…
andreamah Mar 24, 2020
2ac63de
Remove unused imports
xnkevinnguyen Mar 24, 2020
526c434
Add LB
xnkevinnguyen Mar 24, 2020
c90fa9e
merge conflicts resolved
andreamah Mar 24, 2020
764ff2c
Merge branch 'users/t-anmah/clue-frontend-backend-integration' of htt…
andreamah Mar 24, 2020
60ff2ab
resolved test fail
andreamah Mar 24, 2020
dbb2faf
Add clue svg
xnkevinnguyen Mar 25, 2020
2f1b2d4
Merge branch 'users/t-anmah/clue-frontend-backend-integration' of htt…
xnkevinnguyen Mar 25, 2020
2f895b7
Remove wrong telemetry and toolbar for now
xnkevinnguyen Mar 25, 2020
ab552d8
Remove unecessary comments
xnkevinnguyen Mar 25, 2020
ea0ab9a
pr feedback
andreamah Mar 25, 2020
40aa1d0
revert settings.json
andreamah Mar 25, 2020
0dca97a
add newline to settings json
andreamah Mar 25, 2020
46cd2ab
Fix borders for clue
xnkevinnguyen Mar 25, 2020
e37f2a8
added todo
andreamah Mar 25, 2020
b467990
Default clue image
xnkevinnguyen Mar 26, 2020
a35ac6e
Merge branch 'users/t-anmah/clue-frontend-backend-integration' of htt…
xnkevinnguyen Mar 26, 2020
f6d14e1
Default black on clue load
xnkevinnguyen Mar 27, 2020
e594543
Update with dev
xnkevinnguyen Mar 27, 2020
9674126
fix merge conflicts
xnkevinnguyen Mar 27, 2020
d2ce028
Remove unused imports
xnkevinnguyen Mar 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/view/components/clue/ClueSimulator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
// DEVICE_LIST_KEY,
CONSTANTS,
WEBVIEW_MESSAGES,
DEFAULT_IMG_CLUE,
} from "../../constants";
import PlayLogo from "../../svgs/play_svg";
import StopLogo from "../../svgs/stop_svg";
Expand All @@ -13,7 +14,7 @@ import { BUTTONS_KEYS, ClueImage } from "./ClueImage";

const DEFAULT_CLUE_STATE: IClueState = {
buttons: { button_a: false, button_b: false },
displayMessage: "",
displayMessage: DEFAULT_IMG_CLUE,
};

interface IState {
Expand Down Expand Up @@ -66,6 +67,10 @@ export class ClueSimulator extends React.Component<any, IState> {
this.setState({
play_button: !this.state.play_button,
running_file: newRunningFile,
clue: {
...this.state.clue,
displayMessage: DEFAULT_IMG_CLUE,
},
});
break;
case "visible-editors":
Expand Down
9 changes: 1 addition & 8 deletions src/view/components/clue/Clue_svg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT license.

import * as React from "react";
import { DEFAULT_IMG_CLUE } from "../../constants";
import "../../styles/Clue.css";
export interface IRefObject {
[key: string]: React.RefObject<SVGRectElement>;
Expand Down Expand Up @@ -33,7 +32,6 @@ export class ClueSvg extends React.Component<IProps, {}> {
}
componentDidMount() {
this.updateDisplay();
this.setDefaultDisplay();
}
componentDidUpdate() {
this.updateDisplay();
Expand Down Expand Up @@ -944,16 +942,11 @@ export class ClueSvg extends React.Component<IProps, {}> {
);
}
private updateDisplay() {
if (this.displayRef.current) {
if (this.displayRef.current && this.props.displayImage) {
this.displayRef.current.setAttribute(
"href",
`data:image/png;base64,${this.props.displayImage}`
);
}
}
private setDefaultDisplay() {
if (this.displayRef.current) {
this.displayRef.current.setAttribute("href", DEFAULT_IMG_CLUE);
}
}
}
2 changes: 1 addition & 1 deletion src/view/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export enum WEBVIEW_TYPES {
SIMULATOR = "simulator",
GETTING_STARTED = "getting_started",
}
export const DEFAULT_IMG_CLUE = `data:image/png;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAEBAQEBAQEBA
export const DEFAULT_IMG_CLUE = `/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAEBAQEBAQEBA
QEBAQEBAQICAQEBAQMCAgICAwMEBAMDAwMEBAYFBAQFBAMDBQcFBQYGBgYGBAUHBwcGBwYGBgb/2wBDAQEBAQEBAQMCAgMGBAMEB
gYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgb/wAARCAJYAlgDASIAAhEBAxEB/8QAHwAAA
QUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0Kxw
Expand Down