Exemple #1
0
 internal Accelerometer(LPF2Hub hub, int port, LPF2DeviceType type) : base(hub, port, type)
 {
     Mode = MODE_ACCEL;
 }
Exemple #2
0
 internal Light(LPF2Hub hub, int port) : base(hub, port, LPF2DeviceType.LIGHT)
 {
 }
Exemple #3
0
 internal AbsoluteMotor(LPF2Hub hub, int port, LPF2DeviceType type) : base(hub, port, type)
 {
     Mode = MODE_ABSOLUTE;
 }
Exemple #4
0
 internal HubLED(LPF2Hub hub, int port) : base(hub, port, LPF2DeviceType.HUB_LED)
 {
     Mode = MODE_COLOR;
 }
Exemple #5
0
 internal VoltageSensor(LPF2Hub hub, int port) : base(hub, port, LPF2DeviceType.VOLTAGE_SENSOR)
 {
     Mode = MODE_VOLTAGE;
 }
Exemple #6
0
 internal GyroSensor(LPF2Hub hub, int port, LPF2DeviceType type) : base(hub, port, type)
 {
     Mode = MODE_GYRO;
 }
Exemple #7
0
 internal TachoMotor(LPF2Hub hub, int port, LPF2DeviceType type) : base(hub, port, type)
 {
     Mode = MODE_ROTATION;
 }
Exemple #8
0
 internal ColorDistanceSensor(LPF2Hub hub, int port) : base(hub, port, LPF2DeviceType.COLOR_DISTANCE_SENSOR)
 {
     Mode = MODE_COLOR_AND_DISTANCE;
 }
Exemple #9
0
 internal MoveHubTiltSensor(LPF2Hub hub, int port) : base(hub, port, LPF2DeviceType.MOVE_HUB_TILT_SENSOR)
 {
 }
Exemple #10
0
 internal TechnicMediumHubAccelerometer(LPF2Hub hub, int port) : base(hub, port,
                                                                      LPF2DeviceType.TECHNIC_MEDIUM_HUB_ACCELEROMETER)
 {
 }
 internal TechnicMediumHubGyroSensor(LPF2Hub hub, int port) : base(hub, port,
                                                                   LPF2DeviceType.TECHNIC_MEDIUM_HUB_GYRO_SENSOR)
 {
 }
Exemple #12
0
 internal CurrentSensor(LPF2Hub hub, int port) : base(hub, port, LPF2DeviceType.CURRENT_SENSOR)
 {
 }
 internal TechnicLargeLinearMotor(LPF2Hub hub, int port) : base(hub, port, LPF2DeviceType.TECHNIC_LARGE_LINEAR_MOTOR)
 {
 }
Exemple #14
0
 public MoveHubMediumLinearMotor(LPF2Hub hub, int port)
     : base(hub, port, LPF2DeviceType.MOVE_HUB_MEDIUM_LINEAR_MOTOR)
 {
 }
Exemple #15
0
        // Factory
        internal static LPF2Device?CreateInstance(LPF2Hub hub, LPF2DeviceType type, int portId)
        {
            Log.Debug($"Creating LPF2Device(type={type}, port={portId})...");
            switch (type)
            {
            // case LPF2DeviceType.UNKNOWN:
            //     break;
            case LPF2DeviceType.SIMPLE_MEDIUM_LINEAR_MOTOR:
                break;

            case LPF2DeviceType.TRAIN_MOTOR:
                break;

            case LPF2DeviceType.LIGHT:
                return(new Light(hub, portId));

            case LPF2DeviceType.VOLTAGE_SENSOR:
                return(new VoltageSensor(hub, portId));

            case LPF2DeviceType.CURRENT_SENSOR:
                return(new CurrentSensor(hub, portId));

            case LPF2DeviceType.PIEZO_BUZZER:
                break;

            case LPF2DeviceType.HUB_LED:
                return(new HubLED(hub, portId));

            case LPF2DeviceType.TILT_SENSOR:
                break;

            case LPF2DeviceType.MOTION_SENSOR:
                break;

            case LPF2DeviceType.COLOR_DISTANCE_SENSOR:
                return(new ColorDistanceSensor(hub, portId));

            case LPF2DeviceType.MEDIUM_LINEAR_MOTOR:
                return(new MediumLinearMotor(hub, portId));

            case LPF2DeviceType.MOVE_HUB_MEDIUM_LINEAR_MOTOR:
                return(new MoveHubMediumLinearMotor(hub, portId));

            case LPF2DeviceType.MOVE_HUB_TILT_SENSOR:
                return(new MoveHubTiltSensor(hub, portId));

            case LPF2DeviceType.DUPLO_TRAIN_BASE_MOTOR:
                break;

            case LPF2DeviceType.DUPLO_TRAIN_BASE_SPEAKER:
                break;

            case LPF2DeviceType.DUPLO_TRAIN_BASE_COLOR_SENSOR:
                break;

            case LPF2DeviceType.DUPLO_TRAIN_BASE_SPEEDOMETER:
                break;

            case LPF2DeviceType.TECHNIC_LARGE_LINEAR_MOTOR:
                return(new TechnicLargeLinearMotor(hub, portId));

            case LPF2DeviceType.TECHNIC_XLARGE_LINEAR_MOTOR:
                return(new TechnicXLargeLinearMotor(hub, portId));

            case LPF2DeviceType.TECHNIC_MEDIUM_ANGULAR_MOTOR:
                break;

            case LPF2DeviceType.TECHNIC_LARGE_ANGULAR_MOTOR:
                break;

            case LPF2DeviceType.TECHNIC_MEDIUM_HUB_GESTURE_SENSOR:
                break;

            case LPF2DeviceType.REMOTE_CONTROL_BUTTON:
                break;

            case LPF2DeviceType.REMOTE_CONTROL_RSSI:
                break;

            case LPF2DeviceType.TECHNIC_MEDIUM_HUB_ACCELEROMETER:
                return(new TechnicMediumHubAccelerometer(hub, portId));

            case LPF2DeviceType.TECHNIC_MEDIUM_HUB_GYRO_SENSOR:
                return(new TechnicMediumHubGyroSensor(hub, portId));

            case LPF2DeviceType.TECHNIC_MEDIUM_HUB_TILT_SENSOR:
                return(new TechnicMediumHubTiltSensor(hub, portId));

            case LPF2DeviceType.TECHNIC_MEDIUM_HUB_TEMPERATURE_SENSOR:
                break;

            case LPF2DeviceType.TECHNIC_COLOR_SENSOR:
                break;

            case LPF2DeviceType.TECHNIC_DISTANCE_SENSOR:
                break;

            case LPF2DeviceType.TECHNIC_FORCE_SENSOR:
                break;

            default:
                Log.Warning("Unknown device.");
                break;
            }

            return(null);
        }
Exemple #16
0
 internal TiltSensor(LPF2Hub hub, int port, LPF2DeviceType type) : base(hub, port, type)
 {
     Mode = MODE_TILT;
 }
Exemple #17
0
 internal LPF2Device(LPF2Hub hub, int port, LPF2DeviceType type)
 {
     Hub  = hub;
     Port = port;
     Type = type;
 }
Exemple #18
0
 internal TechnicMediumHubTiltSensor(LPF2Hub hub, int port) : base(hub, port,
                                                                   LPF2DeviceType.TECHNIC_MEDIUM_HUB_TILT_SENSOR)
 {
     Mode = MODE_TILT;
 }
Exemple #19
0
 internal BasicMotor(LPF2Hub hub, int port, LPF2DeviceType type) : base(hub, port, type)
 {
 }