Add large and medium motor speed labels (#480)

* Add large and medium motor speed labels

* Support dual motor labels.
This commit is contained in:
Sam El-Husseini
2018-04-10 11:50:58 -07:00
committed by GitHub
parent 8398c8efdb
commit 379a6a26be
6 changed files with 43 additions and 4 deletions

View File

@ -24,7 +24,9 @@ namespace pxsim.visuals {
} else if (this.syncedLabelG) {
this.syncedLabelG.parentNode.removeChild(this.syncedLabelG);
}
this.setMotorLabel(motorState.getSpeed(), true);
}
this.setMotorLabel(motorState.getSpeed());
}
private showSyncedLabel(motorNode: MotorNode, syncedMotor: MotorNode) {
@ -55,5 +57,11 @@ namespace pxsim.visuals {
getWiringRatio() {
return 0.37;
}
protected positionMotorLabel() {
const hasSyncedLabel = this.syncedMotor;
this.motorLabelGroup.setAttribute('transform', `translate(${hasSyncedLabel ? '15 35' : '25 15'})`);
this.motorLabel.style.fontSize = '13px';
}
}
}