Change to always show the sensor controls. (#526)

This commit is contained in:
Sam El-Husseini
2018-04-16 11:50:12 -07:00
committed by Peli de Halleux
parent 03add213d9
commit 3c96cfcc0a
9 changed files with 36 additions and 9 deletions

View File

@ -1,7 +1,7 @@
/// <reference path="./moduleView.ts" />
/// <reference path="./sensorView.ts" />
namespace pxsim.visuals {
export class ColorSensorView extends ModuleView implements LayoutElement {
export class ColorSensorView extends SensorView implements LayoutElement {
private control: ColorGridControl;

View File

@ -1,7 +1,7 @@
/// <reference path="./moduleView.ts" />
/// <reference path="./sensorView.ts" />
namespace pxsim.visuals {
export class GyroSensorView extends ModuleView implements LayoutElement {
export class GyroSensorView extends SensorView implements LayoutElement {
constructor(port: number) {
super(GYRO_SVG, "gyro", NodeType.GyroSensor, port);

View File

@ -1,7 +1,7 @@
/// <reference path="./moduleView.ts" />
namespace pxsim.visuals {
export class InfraredView extends ModuleView implements LayoutElement {
export class InfraredView extends SensorView implements LayoutElement {
constructor(port: number) {
super(INFRARED_SVG, "infrared", NodeType.InfraredSensor, port);

View File

@ -0,0 +1,19 @@
/// <reference path="./moduleView.ts" />
namespace pxsim.visuals {
export abstract class SensorView extends ModuleView implements LayoutElement {
constructor(xml: string, prefix: string, id: NodeType, port: NodeType) {
super(xml, prefix, id, port);
}
public getSelected() {
return true;
}
public hasClose() {
return false;
}
}
}

View File

@ -1,7 +1,7 @@
/// <reference path="./moduleView.ts" />
/// <reference path="./sensorView.ts" />
namespace pxsim.visuals {
export class UltrasonicSensorView extends ModuleView implements LayoutElement {
export class UltrasonicSensorView extends SensorView implements LayoutElement {
constructor(port: number) {
super(ULTRASONIC_SVG, "ultrasonic", NodeType.UltrasonicSensor, port);