Add motor slider control
This commit is contained in:
@ -44,7 +44,7 @@ namespace pxsim.visuals {
|
||||
}
|
||||
.sim-text.number {
|
||||
font-family: Courier, Lato, Work Sans, PT Serif, Source Serif Pro;
|
||||
font-weight: bold;
|
||||
/*font-weight: bold;*/
|
||||
}
|
||||
.sim-text.inverted {
|
||||
fill:#5A5A5A;
|
||||
@ -62,6 +62,14 @@ namespace pxsim.visuals {
|
||||
fill: gray !important;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Motor slider */
|
||||
.sim-motor-btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
.sim-motor-btn:hover {
|
||||
fill: gray !important;
|
||||
}
|
||||
`;
|
||||
|
||||
const EV3_WIDTH = 99.984346;
|
||||
@ -213,9 +221,12 @@ namespace pxsim.visuals {
|
||||
}
|
||||
case NodeType.MediumMotor:
|
||||
case NodeType.LargeMotor: {
|
||||
// TODO: figure out if the motor is in "input" or "output" mode
|
||||
const state = ev3board().getMotors()[port];
|
||||
view = new MotorReporterControl(this.element, this.defs, state, port);
|
||||
if (state.isInput()) {
|
||||
view = new MotorSliderControl(this.element, this.defs, state, port);
|
||||
} else {
|
||||
view = new MotorReporterControl(this.element, this.defs, state, port);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user