public Auto(FuelTank fuelTank, Engine engine, Gearbox gearbox, Wheels wheels) { this.fuelTank = fuelTank; this.engine = engine; this.gearbox = gearbox; this.wheels = wheels; }
public async Task <IActionResult> Edit(int id, [Bind("GearboxId,Name")] Gearbox gearbox) { if (id != gearbox.GearboxId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(gearbox); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GearboxExists(gearbox.GearboxId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(gearbox)); }
//ctor public Trainee(DateTime my_LastTest = default(DateTime), int my_id = 01, string my_firstName = "a", string my_lastName = "b" , Gender my_traineeGender = 0, int my_phone = 5, string my_street = "s", int my_buildingNum = 1, string my_city = "tlv", DateTime my_traineeBirth = new DateTime(), kindOfVehicle my_kindOfVehicle = 0, Gearbox my_traineeGearbox = 0, string my_nameOFSchool = "drive", string my_nameOfTeacher = "zeav", int my_numOfLessons = 5, int my_numOfTests = 0) { id = my_id; firstName = my_firstName; lastName = my_lastName; traineeGender = my_traineeGender; phone = my_phone; street = my_street; buildingNum = my_buildingNum; city = my_city; traineeBirth = my_traineeBirth; kindOfVehicle = my_kindOfVehicle; traineeGearbox = my_traineeGearbox; nameOFSchool = my_nameOFSchool; nameOfTeacher = my_nameOfTeacher; numOfLessons = my_numOfLessons; numOfTests = my_numOfTests; if (NumOfTests >= 1) { dateLastTest = my_LastTest; } }
bool Priority; //זכות קדימה public Test(int my_idOftester, int my_idOfTrainee, bool my_signaling, int NumOfTest, string my_note, bool my_parking, DateTime my_date, string my_street, string my_buildingNum, string my_city, Success my_mark, bool my_mirror, bool my_priority, int my_timeOfTest, TypeCar my_testerTypeCar, Gearbox my_gearbox, Success my_passed, bool my_reverse) { NumOfTest = ++BE.Configuration.TestNum; testerId = my_idOftester; traineeId = my_idOfTrainee; date = my_date; TimeOfTest = my_timeOfTest; street = my_street; buildingNum = my_buildingNum; city = my_city; testetTypeCar = my_testerTypeCar; gearbox = my_gearbox; mark = my_mark; priority = my_priority; mirror = my_mirror; reverse = my_reverse; parking = my_parking; signaling = my_signaling; note = my_note; passed = my_passed; }
internal Car(Differential differential, Clutch clutch, Gearbox gearbox, Suspension suspension) { this.differential = differential; this.clutch = clutch; this.gearbox = gearbox; this.suspension = suspension; }
public Trainee(DateTime my_LastTest, int my_id, string my_firstName, string my_lastName , Gender my_traineeGender, int my_phone, string my_street, string my_buildingNum, string my_city, DateTime my_traineeBirth, TypeCar my_traineeTypeCar, Gearbox my_traineeGearbox, School my_nameOFSchool, string my_nameOfTeacher, int my_numOfLessons, int my_numOfTests, string my_Password) { myPassword = my_Password; id = my_id; firstName = my_firstName; lastName = my_lastName; traineeGender = my_traineeGender; phone = my_phone; street = my_street; buildingNum = my_buildingNum; city = my_city; traineeBirth = my_traineeBirth; traineeTypeCar = my_traineeTypeCar; traineeGearbox = my_traineeGearbox; nameOFSchool = my_nameOFSchool; nameOfTeacher = my_nameOfTeacher; numOfLessons = my_numOfLessons; numOfTests = my_numOfTests; if (NumOfTests >= 1) { dateLastTest = my_LastTest; } }
private static Gearbox SetUpGearBox() { var gearBox = new Gearbox(); gearBox.SetMaxDrive(5); return(gearBox); }
public VehicleInformation(string manufacturer, string model, int? year, FuelType fuelType, Gearbox gearbox) { this.Manufacturer = manufacturer; this.Model = model; this.Year = year; this.FuelType = fuelType; this.Gearbox = gearbox; }
private void DoneUpdate_Click(object sender, RoutedEventArgs e) { string id = TraineeUC.person.IdInput.Text; string fname = TraineeUC.person.FirstNameInput.Text; string lname = TraineeUC.person.LastNameInput.Text; Gender gender = (Gender)Enum.Parse(typeof(Gender), TraineeUC.person.GenderInput.Text); DateTime Birthdate = TraineeUC.person.BirthdateInput.SelectedDate.Value; string phone = TraineeUC.person.PhoneNumberInput.Text; int house_number; try { house_number = int.Parse(TraineeUC.person.HouseNumberInput.Text); } catch (Exception) { MessageBox.Show("the house number must contain only digits", "house number error", MessageBoxButton.OK, MessageBoxImage.Error); TraineeUC.person.HouseNumberInput.Text = "number"; return; } Address addrees = new Address(TraineeUC.person.StreetInput.Text, house_number, TraineeUC.person.CityInput.Text); Vehicle speciality = (Vehicle)Enum.Parse(typeof(Vehicle), TraineeUC.SpecialityInput.Text); Gearbox gearbox = (Gearbox)Enum.Parse(typeof(Gearbox), TraineeUC.GearboxInput.Text); string sname = TraineeUC.SchoolNameInput.Text; string tname = TraineeUC.TeacherNameInput.Text; int numlessons; try { numlessons = int.Parse(TraineeUC.LessonsCounterInput.Text); } catch (Exception) { MessageBox.Show("the number lessons must contain only digits", "numer lessons error", MessageBoxButton.OK, MessageBoxImage.Error); TraineeUC.person.HouseNumberInput.Text = "number"; return; } try { Trainee trainee = new Trainee(id, fname, lname, Birthdate, gender, phone, addrees, speciality, gearbox, sname, tname, numlessons); Ibl help = FactoryBL.GetInstance(); help.UpdateTrainee(trainee); bool success = help.UpdateTrainee(trainee); if (success) { MessageBox.Show("the trainee update successfuly"); } else { MessageBox.Show("something went wrong"); } Visibility = Visibility.Collapsed; } catch (Exception exc) { MessageBox.Show(exc.Message, "logic error", MessageBoxButton.OK); } }
/** Contstructor that takes 4 Gearboxes */ public Mecanum(Gearbox m1, Gearbox m2, Gearbox m3, Gearbox m4) { // GroupMotorControllers.Register(m1.GetMaster()); // commented out to compile _1 = m1; _2 = m2; _3 = m3; _4 = m4; }
/** Contstructor that takes 4 Gearboxes */ public Mecanum(Gearbox m1, Gearbox m2, Gearbox m3, Gearbox m4) { _1 = m1; _2 = m2; _3 = m3; _4 = m4; _gearBoxes = new Gearbox[] { _1, _2, _3, _4 }; }
public void WhenSetDriveModeGearboxStateChangedToDrive() { var gearbox = new Gearbox(); var leverAdapter = new LeverAdapter(gearbox); leverAdapter.SetDriveMode(); Assert.AreEqual(gearbox.getState(), 1); }
public void WhenSetNeutralModeGearboxStateChangedToNeutral() { var gearbox = new Gearbox(); var leverAdapter = new LeverAdapter(gearbox); leverAdapter.SetNeutralMode(); Assert.AreEqual(gearbox.getState(), 4); }
//--------------------- Constructors -----------------------------// /** Tank Drive constructor that takes a left gearbox, right gearbox, and side inverted */ public Tank(Gearbox left, Gearbox right, bool leftInvert, bool rightInvert) { _left = left; _right = right; _left.SetInverted(leftInvert); _right.SetInverted(rightInvert); _gearBoxes = new Gearbox[] { _left, _right }; }
public void Geadbox_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { Gearbox gear = sender as Gearbox; DataAccessLayer.DAL_Models.Gearbox dal_gear = uof.Gearboxes.Get(gear.Id); dal_gear.Name = gear.Name; dal_gear.Image = gear.Image; uof.Gearboxes.CreateOrUpdate(dal_gear); uof.SaveChanges(); }
public void Given_Gearboxes_With_Different_Values_When_Comparing_Then_Are_Not_Equal() { var gearbox1 = new Gearbox(6, GearboxType.Automatic); var gearbox2 = new Gearbox(7, GearboxType.Automatic); var gearbox3 = new Gearbox(6, GearboxType.Automatic); var gearbox4 = new Gearbox(6, GearboxType.Manual); Assert.AreNotEqual(gearbox1, gearbox2); Assert.AreNotEqual(gearbox3, gearbox4); }
public int getGearBoxOfTester(Gearbox g) { if (g == 0) { return(0); } else { return(1); } }
public Vehicle(string manufacturer, string model, int year, string registrationNumber, FuelType fuelType, Gearbox gearbox, Status status) { this.Manufacturer = manufacturer; this.Model = model; this.Year = year; this.RegistrationNumber = registrationNumber; this.FuelType = fuelType; this.Gearbox = gearbox; this.Status = status; this.Repairs = new List<Repair>(); }
public Gearbox GenerateGearbox(GearBoxType gearBoxType, int numberOfGears) { var gearbox = new Gearbox() { GearBoxType = gearBoxType, NumberOfGears = numberOfGears, CreatedOn = DateTime.UtcNow }; return(gearbox); }
public async Task <IActionResult> Create([Bind("GearboxId,Name")] Gearbox gearbox) { if (ModelState.IsValid) { _context.Add(gearbox); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(gearbox)); }
public void ModifyGearBox(Gearbox baseClass) { Gearbox gearbox1 = (_ctx.BaseClasses.FirstOrDefault(g => g.Id == baseClass.Id) as Gearbox); gearbox1.Name = (baseClass as Gearbox).Name; gearbox1.Type = (baseClass as Gearbox).Type; gearbox1.Price = (baseClass as Gearbox).Price; gearbox1.Producer = (baseClass as Gearbox).Producer; gearbox1.Quantity = (baseClass as Gearbox).Quantity; _ctx.SaveChanges(); }
public List <Tester> GetAllTestersByGearbox(Gearbox gearbox) { var lst = getTestersList().FindAll(x => x.TesterGearBox == gearbox); List <Tester> GearboxTestrs = new List <Tester>(); foreach (var item in lst) { GearboxTestrs.Add(item); } return(GearboxTestrs); }
public GearboxUI ConvertToGearBoxUI(Gearbox gearbox) { return(new GearboxUI { Id = gearbox.Id, Name = gearbox.Name, Price = gearbox.Price, Producer = gearbox.Producer, Quantity = gearbox.Quantity, Type = gearbox.Type }); }
public Trainee(string id, PersonName name, DateTime birthdate, Gender gender, string mobileNumber, Address address, string password, Vehicle vehicleTypeTraining, Gearbox gearboxTypeTraining, string drivingSchool, PersonName teacherName, uint numberOfDoneLessons, DateTime theLastTest = default) : base(id, name, birthdate, gender, mobileNumber, address, password) { VehicleTypeTraining = vehicleTypeTraining; GearboxTypeTraining = gearboxTypeTraining; DrivingSchool = drivingSchool; TeacherName = teacherName; NumberOfDoneLessons = numberOfDoneLessons; TheLastTest = theLastTest; }
public Tank(IMotorController m1, IMotorController m2, bool leftInvert, bool rightInvert) { /* Create 2 single motor gearboxes */ Gearbox temp1 = new Gearbox(m1); Gearbox temp2 = new Gearbox(m2); _left = temp1; _right = temp2; _left.SetInverted(leftInvert); _right.SetInverted(rightInvert); _gearBoxes = new Gearbox[] { _left, _right }; }
public Vehicle(string manufacturer, string model, int? year, int? horsePower, int? mileage, FuelType fuelType, Gearbox gearbox, Person owner, string color, string comments, string registrationNumber, List<Repair> repairs, Status status = Status.New) : base(manufacturer, model, year, fuelType, gearbox) { this.HorsePower = horsePower; this.Mileage = mileage; this.Owner = owner; this.Color = color; this.Comments = comments; this.RegistrationNumber = registrationNumber; this.Repairs = repairs; this.Status = status; }
public GearboxDTO ConvertTOGearboxDTO(Gearbox gearbox) { GearboxDTO gearboxDTO = new GearboxDTO() { Id = gearbox.Id, Name = gearbox.Name, Price = gearbox.Price, Producer = gearbox.Producer, Quantity = gearbox.Quantity, Type = gearbox.Type }; return(gearboxDTO); }
public void HandleRpmChange(Rpm rpm) { var suggestedAction = Program.GetSuggestedActionFor(Gearbox.CurrentGear, rpm); if (suggestedAction == SuggestedAction.Upshift) { Gearbox.Upshift(); } if (suggestedAction == SuggestedAction.Downshift) { Gearbox.Downshift(); } }
public Gearbox ConvertTOGearbox(GearboxUI gearboxUI) { Gearbox gearbox = new Gearbox() { Id = gearboxUI.Id, Name = gearboxUI.Name, Price = gearboxUI.Price, Producer = gearboxUI.Producer, Quantity = gearboxUI.Quantity, Type = gearboxUI.Type }; return(gearbox); }
private static void SetupSystem(IEventBus eventBus) { _externalSystems = new ExternalSystems(); var externalSystemsAdapter = new ExternalSystemsAdapter(_externalSystems); var gearbox = new Gearbox(); var gearboxAdapter = new GearboxAdapter(gearbox); var automaticGearshifter = new AutomaticGearshifter(gearboxAdapter); eventBus.Attach(new EventLogger()); eventBus.Attach(new EngineEmulator(_externalSystems)); new AntiCorruptionLayerStartup(eventBus, externalSystemsAdapter, gearbox).Start(); new GearshiftStartup(eventBus, automaticGearshifter).Start(); new ProcessesStartup(eventBus, new GearshiftService(new Negotiator(), automaticGearshifter), new EngineCharacteristics(), new KickdownCharacteristics()).Start(); TimeHelper.WaitSeconds(3); }
/** Contstructor that takes 4 SimpleMotorcontrollers */ public Mecanum(IMotorController m1, IMotorController m2, IMotorController m3, IMotorController m4) { //GroupMotorControllers.Register(m1); // commented out to compile /* Creat 4 single motor gearboxes */ Gearbox temp1 = new Gearbox(m1); Gearbox temp2 = new Gearbox(m2); Gearbox temp3 = new Gearbox(m3); Gearbox temp4 = new Gearbox(m4); _1 = temp1; _2 = temp2; _3 = temp3; _4 = temp4; }
public ActionResult GetGearbox() { List <SelectListItem> items = new List <SelectListItem>(); foreach (var model in Enum.GetValues(typeof(Gearbox))) { var name = Gearbox.GetName(typeof(Gearbox), model); items.Add(new SelectListItem() { Text = name, Value = ((int)model).ToString() }); } return(Json(items, JsonRequestBehavior.AllowGet)); }
//--------------------- Constructors -----------------------------// /** Contstructor that takes 4 SimpleMotorcontrollers */ public Mecanum(IMotorController m1, IMotorController m2, IMotorController m3, IMotorController m4) { /* Creat 4 single motor gearboxes */ Gearbox temp1 = new Gearbox(m1); Gearbox temp2 = new Gearbox(m2); Gearbox temp3 = new Gearbox(m3); Gearbox temp4 = new Gearbox(m4); _1 = temp1; _2 = temp2; _3 = temp3; _4 = temp4; _gearBoxes = new Gearbox[] { _1, _2, _3, _4 }; }
/// <summary> /// Constructor /// </summary> public BasicCar(Vector2 position, Vector2 origin, float carRotation, float maxAcc, float maxBrake, float fC, float maxTurn, Texture2D carTexture, Texture2D wheelsTexture, Vector2 leftWheelPos, int maxHealth, World world) { acceleration = 0; speed = 0; gear = Gearbox.D; this.position = position; this.origin = origin; this.carRotation = carRotation; this.maxAcc = maxAcc; this.maxBrake = maxBrake; this.fC = fC; this.maxTurn = maxTurn; this.carTexture = carTexture; this.wheelsTexture = wheelsTexture; this.maxHealth = maxHealth; this.maxSpeed = maxAcc / fC; this.health = maxHealth; // find left wheel offset leftWheelOffset = leftWheelPos - origin; }
/// <summary> /// Shift gearbox! /// </summary> /// <param name="gear">Gear to switch to</param> public void ShiftGear(Gearbox gear) { if (speed != 0) BrakePad(1); else this.gear = gear; }
public void ShiftCarGear(Gearbox gear) { CarDriving.ShiftGear(gear); }