Initial board SVG and basic simulator
This commit is contained in:
18
sim/state/buttons.ts
Normal file
18
sim/state/buttons.ts
Normal file
@ -0,0 +1,18 @@
|
||||
namespace pxsim {
|
||||
|
||||
export class EV3ButtonState extends CommonButtonState{
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.buttons = [
|
||||
new CommonButton(DAL.BUTTON_ID_UP),
|
||||
new CommonButton(DAL.BUTTON_ID_ENTER),
|
||||
new CommonButton(DAL.BUTTON_ID_DOWN),
|
||||
new CommonButton(DAL.BUTTON_ID_RIGHT),
|
||||
new CommonButton(DAL.BUTTON_ID_LEFT),
|
||||
new CommonButton(DAL.BUTTON_ID_ESCAPE),
|
||||
new CommonButton(DAL.BUTTON_ID_ALL)
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
9
sim/state/control.ts
Normal file
9
sim/state/control.ts
Normal file
@ -0,0 +1,9 @@
|
||||
/// <reference path="../../libs/core/enums.d.ts"/>
|
||||
|
||||
namespace pxsim.control {
|
||||
|
||||
export function mmap(filename: string, size: number, offset: number): void {
|
||||
|
||||
}
|
||||
|
||||
}
|
19
sim/state/light.ts
Normal file
19
sim/state/light.ts
Normal file
@ -0,0 +1,19 @@
|
||||
namespace pxsim {
|
||||
|
||||
export class EV3LightState {
|
||||
lightPattern: number;
|
||||
|
||||
constructor() {
|
||||
this.lightPattern = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace pxsim.output {
|
||||
|
||||
export function setLights(pattern: number){
|
||||
const lightState = (board() as DalBoard).lightState;
|
||||
lightState.lightPattern = pattern;
|
||||
runtime.queueDisplayUpdate();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user