Exemplo n.º 1
0
        public void AddMotorAndFillWithDetails(eTypeOfVeichle i_TypeOfVeichile, string i_LicenceID, string i_VehicleModel, float i_EngineCurrentEnergy, List <Tire> i_Tires, eLiecenceType i_LicenceType, int i_EngineCapacity)
        {
            switch (i_TypeOfVeichile)
            {
            case eTypeOfVeichle.FuelMotorCycle:
            case eTypeOfVeichle.ElectricMotorCycle:
                if (Vehicles == null)
                {
                    Vehicles = new List <Vehicle>();
                }

                if (Motors == null)
                {
                    Motors = new List <MotorBike>();
                }

                MotorBike motor = VeichileFactory.CreateMotorBike(i_TypeOfVeichile);
                motor.LicenceID            = i_LicenceID;
                motor.Model                = i_VehicleModel;
                motor.Engine.CurrentEnergy = i_EngineCurrentEnergy;
                motor.Tires                = i_Tires;
                motor.LiecenceType         = i_LicenceType;
                motor.EngineCapacity       = i_EngineCapacity;
                Motors.Add(motor);
                Vehicles.Add(motor);
                break;
            }
        }
 protected ELLDeviceBaseViewModel(ELLDevicesViewModel owner, string deviceName, ELLBaseDevice device, int motorCount)
 {
     Owner           = owner;
     _device         = device;
     _deviceName     = deviceName;
     _fullDeviceName = string.Format("{0}:{1}", deviceName, _device.Address);
     for (int i = 0; i < motorCount; i++)
     {
         Motors.Add(new ELLMotorViewModel(owner, device, (char)('1' + i)));
     }
     _units      = _device.DeviceInfo.Units;
     Description = _device.DeviceInfo.Description();
 }
Exemplo n.º 3
0
 private void Add(object value)
 {
     if (DevicesIsSelected == true)
     {
         SelectedDevice = new DeviceDiagnoseClass()
         {
             Name = "新建设备"
         };
         Devices.Add(SelectedDevice);
     }
     else if (ShaftsIsSelected == true)
     {
         SelectedShaft = new ShaftClass()
         {
             Name = "新建轴"
         };
         Shafts.Add(SelectedShaft);
     }
     else if (BearingsIsSelected == true)
     {
         SelectedBearing = new BearingClass()
         {
             Name = "新建轴承"
         };
         Bearings.Add(SelectedBearing);
     }
     else if (BeltsIsSelected == true)
     {
         SelectedBelt = new BeltClass()
         {
             Name = "新建皮带"
         };
         Belts.Add(SelectedBelt);
     }
     else if (GearsIsSelected == true)
     {
         SelectedGear = new GearClass()
         {
             Name = "新建齿轮"
         };
         Gears.Add(SelectedGear);
     }
     else if (ImpellersIsSelected == true)
     {
         SelectedImpeller = new ImpellerClass()
         {
             Name = "新建叶轮"
         };
         Impellers.Add(SelectedImpeller);
     }
     else if (MotorsIsSelected == true)
     {
         SelectedMotor = new MotorClass()
         {
             Name = "新建电机"
         };
         Motors.Add(SelectedMotor);
     }
     ShowWin();
     //立即更新到服务器
 }