motor slider fixes and fix motor output in vm
This commit is contained in:
parent
dfe84471e8
commit
751ea1494b
@ -303,7 +303,7 @@ namespace motors {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private __setSpeed(speed: number) {
|
private __setSpeed(speed: number) {
|
||||||
const b = mkCmd(this._port, this._regulated ? DAL.opOutputPower : DAL.opOutputSpeed, 1)
|
const b = mkCmd(this._port, this._regulated ? DAL.opOutputSpeed : DAL.opOutputPower, 1)
|
||||||
b.setNumber(NumberFormat.Int8LE, 2, speed)
|
b.setNumber(NumberFormat.Int8LE, 2, speed)
|
||||||
writePWM(b)
|
writePWM(b)
|
||||||
if (speed) {
|
if (speed) {
|
||||||
|
@ -17,7 +17,7 @@ namespace pxsim {
|
|||||||
private speedCmdTime: number;
|
private speedCmdTime: number;
|
||||||
private _synchedMotor: MotorNode; // non-null if synchronized
|
private _synchedMotor: MotorNode; // non-null if synchronized
|
||||||
|
|
||||||
private manualSpeed: number = 0;
|
private manualSpeed: number = undefined;
|
||||||
|
|
||||||
constructor(port: number, large: boolean) {
|
constructor(port: number, large: boolean) {
|
||||||
super(port);
|
super(port);
|
||||||
|
@ -97,6 +97,7 @@ namespace pxsim {
|
|||||||
motors.forEach(motor => motor.stop());
|
motors.forEach(motor => motor.stop());
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
case DAL.opOutputPower:
|
||||||
case DAL.opOutputSpeed: {
|
case DAL.opOutputSpeed: {
|
||||||
// setSpeed
|
// setSpeed
|
||||||
const port = buf.data[1];
|
const port = buf.data[1];
|
||||||
|
@ -55,13 +55,13 @@ namespace pxsim.visuals {
|
|||||||
if (captured && (ev as MouseEvent).clientY != undefined) {
|
if (captured && (ev as MouseEvent).clientY != undefined) {
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
this.updateSliderValue(pt, parent, ev as MouseEvent);
|
this.updateSliderValue(pt, parent, ev as MouseEvent);
|
||||||
this.handleSliderDown();
|
this.handleSliderMove();
|
||||||
}
|
}
|
||||||
}, ev => {
|
}, ev => {
|
||||||
captured = true;
|
captured = true;
|
||||||
if ((ev as MouseEvent).clientY != undefined) {
|
if ((ev as MouseEvent).clientY != undefined) {
|
||||||
this.updateSliderValue(pt, parent, ev as MouseEvent);
|
this.updateSliderValue(pt, parent, ev as MouseEvent);
|
||||||
this.handleSliderMove();
|
this.handleSliderDown();
|
||||||
}
|
}
|
||||||
}, () => {
|
}, () => {
|
||||||
captured = false;
|
captured = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user