public UserPanel(
     IMotherboard motherboard,
     IWashProgramFactory programFactory)
 {
     _motherboard    = motherboard;
     _programFactory = programFactory;
 }
 public IPc GetPc(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
 {
     return new Pc(cpu, hardDrives, motherboard);
 }
 public Server(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
     : base(cpu, hardDrives, motherboard)
 {
 }
 public WashTunnel(
     IMotherboard motherboard,
     IWashStepNotifier notifier)
 {
     _motherboard = motherboard;
     _state       = new FreeState(this, notifier);
 }
 public IServer GetServer(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
 {
     return new Server(cpu, hardDrives, motherboard);
 }
Beispiel #6
0
        public void LoadData([NotNull] IMotherboard motherboard, [NotNull] ITool tool, IBios selectedBios = null)
        {
            _motherboard = motherboard ?? throw new ArgumentNullException(nameof(motherboard));;
            _tool        = tool ?? throw new ArgumentNullException(nameof(tool));

            txtMotherboard.Text            = motherboard.Name;
            txtMotherboardVersion.Text     = motherboard.Version;
            txtMotherboardDescription.Text = motherboard.Description;
            txtTool.Text        = tool.Name;
            txtToolVersion.Text = tool.Version;

            {
                BiosRowData[] bioses = _model
                                       .Bioses
                                       .Where(x => x.MotherboardIds.Contains(motherboard.Id))
                                       .OrderBy(x => x.Name)
                                       .Select(x => new BiosRowData(x))
                                       .ToArray();
                ddlBioses.Items.Clear();
                ddlBioses.Items.AddRange(bioses);

                if (selectedBios == null)
                {
                    ddlBioses.SelectedItem = bioses.FirstOrDefault();
                }
                else
                {
                    ddlBioses.SelectedItem = bioses.First(x => x.Source.Equals(selectedBios));
                }
            }
        }
 public CentralProcessingUnit(byte numberOfCores, byte numberOfBits, IMotherboard motherboard)
 {
     this.numberOfBits  = numberOfBits;
     this.NumberOfCores = numberOfCores;
     this.MotherBoard   = motherboard;
     this.random        = new Random();
 }
 public Laptop(IMotherboard motherboard, Cpu cpu, HardDriveComponent hardDrive, LaptopBattery laptopBattery)
 {
     this.Motherboard = motherboard;
     this.Cpu = cpu;
     this.HardDrive = hardDrive;
     this.LaptopBattery = laptopBattery;
 }
 public CentralProcessingUnit(byte numberOfCores, byte numberOfBits, IMotherboard motherboard)
 {
     this.numberOfBits = numberOfBits;
     this.NumberOfCores = numberOfCores;
     this.MotherBoard = motherboard;
     this.random = new Random();
 }
Beispiel #10
0
        public void Dump([NotNull] IMotherboard motherboard, [NotNull] ITool tool, bool autoExecuteScript)
        {
            if (motherboard == null)
            {
                throw new ArgumentNullException(nameof(motherboard));
            }
            if (tool == null)
            {
                throw new ArgumentNullException(nameof(tool));
            }

            string   path         = GetTempFolderPath();
            FileInfo toolFi       = new FileInfo(tool.FileName);
            FileInfo tempBatFi    = new FileInfo(Path.Combine(path, "dump.bat"));
            string   dumpFileName = $"{motherboard.Id}-{DateTime.Now:yyyyMMdd-HHmmss}.rom";

            ZipFile.ExtractToDirectory(toolFi.FullName, path);

            using TextWriter writer = new StreamWriter(tempBatFi.FullName);

            WriteScriptHeader(motherboard, tool, writer);
            writer.WriteLine(string.Format(tool.DumpCommand, dumpFileName));
            WriteScriptFooter(writer);

            ProcessStart(path);

            if (autoExecuteScript)
            {
                ProcessStart(tempBatFi.FullName);
            }
        }
Beispiel #11
0
        public void Flash([NotNull] IMotherboard motherboard, [NotNull] IBios bios, [NotNull] ITool tool, bool autoExecuteScript)
        {
            if (motherboard == null)
            {
                throw new ArgumentNullException(nameof(motherboard));
            }
            if (bios == null)
            {
                throw new ArgumentNullException(nameof(bios));
            }
            if (tool == null)
            {
                throw new ArgumentNullException(nameof(tool));
            }

            string   path          = GetTempFolderPath();
            FileInfo toolFi        = new FileInfo(tool.FileName);
            FileInfo tempBatFi     = new FileInfo(Path.Combine(path, "flash.bat"));
            string   flashFileName = Path.GetFileNameWithoutExtension(bios.FileName);

            ZipFile.ExtractToDirectory(toolFi.FullName, path);
            ZipFile.ExtractToDirectory(bios.FileName, path); using TextWriter writer = new StreamWriter(tempBatFi.FullName);

            WriteScriptHeader(motherboard, bios, tool, writer);
            writer.WriteLine(string.Format(tool.FlashCommand, flashFileName));
            WriteScriptFooter(writer);

            ProcessStart(path);

            if (autoExecuteScript)
            {
                ProcessStart(tempBatFi.FullName);
            }
        }
Beispiel #12
0
 public void PowerOnAndInitBios(IMotherboard motherboard)
 {
     PowerSupply.Start();
     ComputerBoxFan.Start();
     motherboard.Start();
     motherboard.Bios.Start(motherboard);
     Console.WriteLine("***** Turned on Computer ******");
 }
Beispiel #13
0
 protected Computer(ICPU cpu, IRAM ram, IVideoCard videoCard, RAID hardDriveRaid, IMotherboard motherBoard)
 {
     this.cpu = cpu;
     this.ram = ram;
     this.videoCard = videoCard;
     this.hardDriveRaid = hardDriveRaid;
     this.motherBoard = motherBoard;
 }
 protected Computer(CentralProcessingUnit cpu, RandomAcessMemory ram, IEnumerable<HardDriver> hardDrives, IVideoCard videoCard, IMotherboard motherBoard)
 {
     this.CentralProcessingUnit = cpu;
     this.RandomAcessMemory = ram;
     this.HardDrives = hardDrives;
     this.VideoCard = videoCard;
     this.MotherBoard = motherBoard;
 }
 public ILaptop GetLaptop(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard,
     ILaptopBattery battery)
 {
     return new Laptop(cpu, hardDrives, motherboard, battery);
 }
Beispiel #16
0
 protected Computer(ICPU cpu, IRAM ram, IVideoCard videoCard, RAID hardDriveRaid, IMotherboard motherBoard)
 {
     this.cpu           = cpu;
     this.ram           = ram;
     this.videoCard     = videoCard;
     this.hardDriveRaid = hardDriveRaid;
     this.motherBoard   = motherBoard;
 }
Beispiel #17
0
 public Computer(ICPU cPU, IVGA vGA = null, IMotherboard motherboard = null, RAM rAM = null, PSU pSU = null)
 {
     CPU         = cPU;
     VGA         = vGA;
     Motherboard = motherboard;
     RAM         = rAM;
     PSU         = pSU;
 }
Beispiel #18
0
 public Cpu(byte numberOfCores, byte numberOfBits, IMotherboard motherboard, Random random)
 {
     // TODO: validate.
     this.numberOfBits = numberOfBits;
     this.NumberOfCores = numberOfCores;
     this.motherboard = motherboard;
     this.Random = random;
 }
 public SmartWashTunnel(
     IWashTunnel washTunnel,
     IMotherboard motherboard,
     IDirtinessSensor sensor)
 {
     _washTunnel  = washTunnel;
     _motherboard = motherboard;
     _sensor      = sensor;
 }
 public Laptop(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard,
     ILaptopBattery battery)
     : base(cpu, hardDrives, motherboard)
 {
     this.Battery = battery;
 }
Beispiel #21
0
 public Computer(ComputerType type, IMotherboard motherboard, Cpu cpu, Ram ram, IEnumerable<HardDrive> hardDrives, IVideoCard videoCard)
 {
     // TODO: validate
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     this.VideoCard = videoCard;
     this.Motherboard = motherboard;
 }
Beispiel #22
0
        public void LoadData(IMotherboard motherboard)
        {
            Motherboard = new MotherboardRowData(motherboard ?? throw new ArgumentNullException(nameof(motherboard)));

            picMotherboard.ImageLocation = Motherboard.Images.FirstOrDefault()?.Url;
            txtId.Text          = Motherboard.Id;
            txtName.Text        = Motherboard.Name;
            txtBrand.Text       = Motherboard.Brand;
            txtModel.Text       = Motherboard.Model;
            txtVersion.Text     = Motherboard.Version;
            txtTags.Text        = Motherboard.TagsString;
            txtDescription.Text = Motherboard.Description;

            {
                List <ITool> tools = _model.Tools.Where(x => motherboard.ToolIds.Contains(x.Id)).ToList();

                flpTools.Controls.Clear();

                foreach (ITool item in tools)
                {
                    ITool     tool = item;
                    LinkLabel lbl  = new LinkLabel()
                    {
                        Text     = tool.Name,
                        AutoSize = true,
                        Anchor   = AnchorStyles.Left | AnchorStyles.Right
                    };

                    flpTools.Controls.Add(lbl);

                    lbl.Click += (s, a) =>
                    {
                        ToolSelected?.Invoke(this, tool);
                    };
                }
            }

            grdImages.DataSource = motherboard.Images.Select(x => new
            {
                x.Name,
                x.Url,
                Image = new Bitmap(x.Url)
            }).ToList();
            grdImages.AutoResizeColumns();

            grdBioses.DataSource = new GenericBindingList <BiosRowData>
                                   (
                _model
                .Bioses
                .Where(x => x.MotherboardIds.Contains(motherboard.Id))
                .Select(x => new BiosRowData(x))
                                   );
            grdBioses.AutoResizeColumns();

            grdLinks.DataSource = motherboard.Links;
            grdLinks.AutoResizeColumns();
        }
Beispiel #23
0
        public Computer(Cpu cpu, Ram ram, IStorageDevice storage, VideoCard videoCard)
        {
            this.CPU = cpu;
            this.Ram = ram;
            this.StorageDevice = storage;
            this.VideoCard = videoCard;

            this.motherboard = new Motherboard(this.CPU, this.Ram, VideoCard);
        }
 public Computer(
     ICpu cpu,
     IEnumerable<IHardDrive> hardDrives,
     IMotherboard motherboard)
 {
     this.Cpu = cpu;
     this.HardDrives = hardDrives;
     this.Motherboard = motherboard;
 }
Beispiel #25
0
        internal Computer(IRam ram, ICpu cpu, IEnumerable <IHardDrive> drives, IVideoCard videoCard)
        {
            this.Ram       = ram;
            this.Cpu       = cpu;
            this.Drives    = drives;
            this.VideoCard = videoCard;

            this.motherboard = new Motherboard(ram, cpu, videoCard);
        }
Beispiel #26
0
        public void Start(IMotherboard element)
        {
            Console.WriteLine("***** Turned on BIOS ******");
            PrintBiosVersion();

            element.CpuFan.Start();
            element.Cpu.Start();
            element.Ram.Start();
            element.SolidStateDrive.Start();
            element.Gpu.Start();
            element.Gpu.InitializeProcessingUnit();
        }
Beispiel #27
0
 public Computer(
     IProcessor <T> Cpu,
     IMotherboard <T> Board,
     IPrimaryMemory <T> Ram,
     ISecondaryMemory <T> Harddrive
     )
 {
     _cpu       = Cpu;
     _board     = Board;
     _ram       = Ram;
     _harddrive = Harddrive;
 }
Beispiel #28
0
        private void WriteScriptHeader(IMotherboard motherboard, IBios bios, ITool tool, TextWriter writer)
        {
            writer.WriteLine("@echo off");
            writer.WriteLine($":: {nameof(Mi899)} - {DateTime.Now:yyyy.MM.dd} {DateTime.Now:HH:mm:ss}");
            writer.WriteLine($":: Motherboard: {motherboard.Name} {motherboard.Version}");

            if (bios != null)
            {
                writer.WriteLine($":: BIOS: {bios.Name}");
            }

            writer.WriteLine($":: Tool: {tool.Name} {tool.Version}");
            writer.WriteLine();
            writer.WriteLine("cd /d %~dp0");
        }
Beispiel #29
0
 public AbstractComputer(ComputerType type, CPU cpu, RAM ram, IEnumerable<HardDrive> hardDrives, VideoCard videoCard, IBattery battery, IMotherboard motherBoard)
 {
     this.MachineType = type;
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     //// TODO: BUG was here
     ////if (type != ComputerType.LAPTOP && type != ComputerType.PC)
     ////{
     ////    VideoCard.IsMonochrome = true;
     ////}
     this.VideoCard = videoCard;
     this.Battery = battery;
     this.Motherboard = motherBoard;
 }
 public Computer
 (
     IMotherboard motherboard,
     IRam ram,
     IGraphicsCard graphicsCard,
     IHardDiskDrive hdd,
     ICPU cpu
 )
 {
     this.motherboard  = motherboard;
     this.ram          = ram;
     this.graphicsCard = graphicsCard;
     this.hdd          = hdd;
     this.cpu          = cpu;
 }
Beispiel #31
0
        public IBios AddBiosFromFile([NotNull] IMotherboard motherboard, [NotNull] string fileName)
        {
            if (motherboard == null)
            {
                throw new ArgumentNullException(nameof(motherboard));
            }
            if (fileName == null)
            {
                throw new ArgumentNullException(nameof(fileName));
            }

            FileInfo fi = new FileInfo(fileName);

            if (!fi.Exists)
            {
                throw new FileNotFoundException("File not found", fi.FullName);
            }

            Bios oldBios = _bioses.FirstOrDefault(x => fi.FullName.Equals(x.FileName, StringComparison.OrdinalIgnoreCase));
            Bios newBios = new Bios()
            {
                Name        = fi.Name,
                FileName    = fi.FullName,
                IsZipped    = false,
                Description = "User selected file",
                Properties  = new Dictionary <string, string>()
                {
                    { "Path", fi.FullName }
                },
                MotherboardIds = new string[] { motherboard.Id },
                Chipsets       = new string[0]
            };

            if (oldBios != null)
            {
                _bioses.Remove(oldBios);
            }

            _bioses.Add(newBios);

            return(newBios);
        }
Beispiel #32
0
 public Laptop(CentralProcessingUnit cpu, RandomAcessMemory ram, IEnumerable<HardDriver> hardDrives, IVideoCard videoCard, IMotherboard motherBoard, LaptopBattery battery)
     : base(cpu, ram, hardDrives, videoCard, motherBoard)
 {
     this.LaptopBattery = battery;
 }
Beispiel #33
0
 public void AttachTo(IMotherboard motherboard)
 {
     this.Motherboard = motherboard;
 }
Beispiel #34
0
 public Laptop(Cpu cpu, StorageProvider storageProvider, IMotherboard motherboard, LaptopBattery battery)
     : base(cpu, storageProvider, motherboard)
 {
     this.Battery = battery;
 }
Beispiel #35
0
 private void WriteScriptHeader(IMotherboard motherboard, ITool tool, TextWriter writer)
 {
     WriteScriptHeader(motherboard, null, tool, writer);
 }
Beispiel #36
0
 public Laptop(IMotherboard motherboard, ILaptopBattery battery)
 {
     this.motherboard = motherboard;
     this.battery     = battery;
 }
Beispiel #37
0
 public Laptop(ICPU cpu, IRAM ram, IVideoCard videoCard, RAID hardDriveRaid, IMotherboard motherBoard, IBattery battery)
     : base(cpu, ram, videoCard, hardDriveRaid, motherBoard)
 {
     this.battery = battery;
 }
Beispiel #38
0
 public LaptopComputer(IMotherboard motherboard, Cpu cpu, Ram ram, IEnumerable<HardDrive> hardDrives, IVideoCard videoCard, LaptopBattery battery)
     : base(ComputerType.LAPTOP, motherboard, cpu, ram, hardDrives, videoCard)
 {
     this.battery = battery;
 }
 public Computer(ICpu cpu, IMotherboard motherboard)
 {
     this.Cpu = cpu;
     this.Motherboard = motherboard;
 }
Beispiel #40
0
 public Cpu128(byte numOfCores, IMotherboard motherboard)
     : base(numOfCores, motherboard)
 {
 }
Beispiel #41
0
 public Cpu(byte numberOfCores, CpuType numberOfBits, IMotherboard motherboard) 
 {
     this.numberOfBits = (byte)numberOfBits;
     this.NumberOfCores = numberOfCores;
     this.motherboard = motherboard;
 }
Beispiel #42
0
 public Laptop(AbstractComputer.ComputerType type, CPU cpu, RAM ram, IEnumerable<HardDrive> hardDrives, VideoCard videoCard, IBattery battery, IMotherboard motherBoard)
     : base(type, cpu, ram, hardDrives, videoCard, battery, motherBoard)
 {
 }
Beispiel #43
0
 public Cpu(CpuStrategy cpuStrategy, byte numberOfCores, IMotherboard motherBoeard)
 {
     this.cpuStrategy = cpuStrategy;
     this.NumberOfCores = numberOfCores;
     this.motherBoeard = motherBoeard;
 }
Beispiel #44
0
 public PersonalComputer(Cpu cpu, StorageProvider storageProvider, IMotherboard motherboard)
     : base(cpu, storageProvider, motherboard)
 {
 }
Beispiel #45
0
 public ServerComputer(IMotherboard motherboard, Cpu cpu, Ram ram, IEnumerable<HardDrive> hardDrives, IVideoCard videoCard)
     : base(ComputerType.SERVER, motherboard, cpu, ram, hardDrives, videoCard)
     {
     }
Beispiel #46
0
 public Laptop(ICpu cpu, IMotherboard motherboard, HardDriver hardDrive, ILaptopBattery battery)
     : base(cpu, motherboard)
 {
     this.Battery   = battery;
     this.hardDrive = hardDrive;
 }
 public MotherboardRepo(IMotherboard motherboardContext)
 {
     Context = motherboardContext;
 }
Beispiel #48
0
 public Cpu128Bit(byte numberOfCores, IMotherboard motherboard, Random random)
     : base(numberOfCores, 128, motherboard, random)
 {
 }
 public Laptop(ICpu cpu, IMotherboard motherboard, HardDriver hardDrive, ILaptopBattery battery)
     : base(cpu, motherboard)
 {
     this.Battery = battery;
     this.hardDrive = hardDrive;
 }
Beispiel #50
0
 public PC(ICPU cpu, IRAM ram, IVideoCard videoCard, RAID hardDriveRaid, IMotherboard motherBoard) 
     : base(cpu, ram, videoCard, hardDriveRaid, motherBoard)
 {
 }
Beispiel #51
0
 public PC(ICPU cpu, IRAM ram, IVideoCard videoCard, RAID hardDriveRaid, IMotherboard motherBoard)
     : base(cpu, ram, videoCard, hardDriveRaid, motherBoard)
 {
 }
Beispiel #52
0
 public Computer(ICpu cpu, IMotherboard motherboard)
 {
     this.Cpu         = cpu;
     this.Motherboard = motherboard;
 }
 public Server(IMotherboard motherboard, Cpu cpu, HardDriveComponent hardDrive)
 {
     this.Motherboard = motherboard;
     this.Cpu = cpu;
     this.HardDrive = hardDrive;
 }
 public CpuTests(IMotherboardMoq motherboardMock)
 {
     this.motherboard = motherboardMock.MotherboardData;
 }
 internal Cpu(byte numberOfCores, byte numberOfBits, IMotherboard motherboard)
 {
     this.NumberOfCores = numberOfCores;
     this.numberOfBits = numberOfBits;
     this.motherboard = motherboard;
 }
Beispiel #56
0
 protected Computer(CentralProcessingUnit cpu, RandomAcessMemory ram, IEnumerable <HardDriver> hardDrives, IVideoCard videoCard, IMotherboard motherBoard)
 {
     this.CentralProcessingUnit = cpu;
     this.RandomAcessMemory     = ram;
     this.HardDrives            = hardDrives;
     this.VideoCard             = videoCard;
     this.MotherBoard           = motherBoard;
 }
Beispiel #57
0
 public Laptop(CentralProcessingUnit cpu, RandomAcessMemory ram, IEnumerable <HardDriver> hardDrives, IVideoCard videoCard, IMotherboard motherBoard, LaptopBattery battery)
     : base(cpu, ram, hardDrives, videoCard, motherBoard)
 {
     this.LaptopBattery = battery;
 }
Beispiel #58
0
 public CPU(byte numberOfCores, byte numberOfBits, IMotherboard motherboard) 
 {
     this.numberOfBits = numberOfBits;         
     this.NumberOfCores = numberOfCores;
     this.motherboard = motherboard;
 }
Beispiel #59
0
 public Cpu64Bit(byte numberOfCores, IMotherboard motherboard, Random random)
     : base(numberOfCores, 64, motherboard, random)
 {
 }