static void Main(string[] args) { string jPath = args[0]; string jText = System.IO.File.ReadAllText(jPath); JsonCollection jColl = JsonConvert.DeserializeObject <JsonCollection>(jText); //JsonSettings jSettings = JsonConvert.DeserializeObject<JsonSettings>(jText); double?breakDist = 0.0; double?refLatitude = 0.0; double?refLongitude = 0.0; double?refElevation = 0.0; //foreach(JsonSettings json in jColl.JsonSettings) //{ // string eingabe = json.fileName; // string ausgabe = json.destFileName; // MessageBox.Show(eingabe); // MessageBox.Show(eingabe); //} var conn = new ConnectionInterface(); foreach (JsonSettings jSettings in jColl.JsonSettings) { conn.mapProcess(jSettings, breakDist, refLatitude, refLongitude, refElevation); } }
private void AddConnection(Component component, ConnectionInterface connectionInterface) { if (component != null) { connections.Add(component, connectionInterface); } }
private List <VideoCard> GetTestVideoCards() { var midTower = new PCItemType() { Name = "ATX Mid Tower" }; var videoCards = new List <VideoCard>(); var conInterface1 = new ConnectionInterface() { Name = "PCIe x16" }; var conInterface2 = new ConnectionInterface() { Name = "PCIe x16" }; videoCards.Add(new VideoCard() { Name = "MSI VENTUS XS OC", Chipset = "GeForce GTX 1660", MemorySize = 6, CoreSpeed = 1530, BoostSpeed = 1830, Price = 189.99M, Interface = conInterface1 }); videoCards.Add(new VideoCard() { Name = "Asus ROG Strix Gaming OC", Chipset = "GeForce RTX 2080 Ti", MemorySize = 11, CoreSpeed = 1665, BoostSpeed = 1830, Price = 1229.99M, Interface = conInterface2 }); return(videoCards); }
public string PersonalToString() { return("Amount: " + Amount.ToString() + " \n" + "Type: " + Type.ToString() + " \n" + "FormFactor: " + FormFactor.ToString() + " \n" + "ShpindelSpeed: " + ShpindelSpeed.ToString() + " \n" + "AverageFoundingSpeed: " + FormFactor.ToString() + " \n" + "ConnectionInterface: " + ConnectionInterface.ToString()); }
public bool HasFreeConnectionInterface(ConnectionInterface connectionInterface) { if (!HasConnectionInterface(connectionInterface)) { return(false); } bool interfaceIsFree = connections.All(x => x.Value != connectionInterface); return(interfaceIsFree); }
public Component TryToConnect(Component target, ConnectionInterface connectionInterface) { ConnectionEstablisher targetEstablisher = target.Establisher; if (HasFreeConnectionInterface(connectionInterface) && targetEstablisher.HasFreeConnectionInterface(connectionInterface)) { targetEstablisher.AddConnection(belongs, connectionInterface); AddConnection(target, connectionInterface); return(target); } return(null); }
private VideoCard GetVideoCard() { var conInterface2 = new ConnectionInterface() { Name = "PCIe x16" }; return(new VideoCard() { Name = "Asus ROG Strix Gaming OC", Chipset = "GeForce RTX 2080 Ti", MemorySize = 11, CoreSpeed = 1665, BoostSpeed = 1830, Price = 1229.99M, Interface = conInterface2 }); }
private void CreateVideoCards() { var conInterface1 = new ConnectionInterface() { Name = "PCIe x16" }; var conInterface2 = new ConnectionInterface() { Name = "PCIe x16" }; var conInterface3 = new ConnectionInterface() { Name = "PCIe x16" }; var conInterface4 = new ConnectionInterface() { Name = "PCIe x16" }; var conInterface5 = new ConnectionInterface() { Name = "PCIe x16" }; var conInterface6 = new ConnectionInterface() { Name = "PCIe x16" }; this.videoCardService.Create(new VideoCard() { Name = "MSI VENTUS XS OC", Chipset = "GeForce GTX 1660", MemorySize = 6, CoreSpeed = 1530, BoostSpeed = 1830, Price = 189.99M, Interface = conInterface1, ImageSrc = "~/images/VideoCard/0174f5005fe9f34decdf2d379bfe7221.256p.jpg" }); this.videoCardService.Create(new VideoCard() { Name = "Asus ROG Strix Gaming OC", Chipset = "GeForce RTX 2080 Ti", MemorySize = 11, CoreSpeed = 1665, BoostSpeed = 1830, Price = 1229.99M, Interface = conInterface2, ImageSrc = "~/images/VideoCard/1b6084a197c46a295eb03b6ed062eda2.256p.jpg" }); this.videoCardService.Create(new VideoCard() { Name = "NVIDIA 900-1G180-2515-000", Chipset = "GeForce RTX 20700 SUPER", MemorySize = 8, CoreSpeed = 1770, BoostSpeed = 1830, Price = 499.99M, Interface = conInterface3, ImageSrc = "~/images/VideoCard/41bcSvsQDtL.jpg" }); this.videoCardService.Create(new VideoCard() { Name = "XFX GTS XXX ED", Chipset = "GeForce GTX 1660 Ti", MemorySize = 6, CoreSpeed = 1530, BoostSpeed = 1830, Price = 274.99M, Interface = conInterface4, ImageSrc = "~/images/VideoCard/51LasfmJYL.jpg" }); this.videoCardService.Create(new VideoCard() { Name = "Gigabyte GAMING OC", Chipset = "Radeon RX 580", MemorySize = 8, CoreSpeed = 1366, BoostSpeed = 1386, Price = 159.99M, Interface = conInterface5, ImageSrc = "~/images/VideoCard/7a8d66854d65f497aca573e84772d861.256p.jpg" }); this.videoCardService.Create(new VideoCard() { Name = "EVGA SC ULTRA GAMING", Chipset = "Radeon RX 5700 XT", MemorySize = 6, CoreSpeed = 1650, BoostSpeed = 1905, Price = 406.99M, Interface = conInterface6, ImageSrc = "~/images/VideoCard/85bc273ac4645d65c47fc646b940da9c.256p.jpg" }); }
private void backgroundWorkerIFC_DoWork(object sender, DoWorkEventArgs e) { //BackgroundWorker workerSender = sender as BackgroundWorker; //// get a node list from agrument passed to RunWorkerAsync //XmlNodeList node = e.Argument as XmlNodeList; //for (int i = 0; i < node.Count; i++) //{ // textBox2.Text = node[i].InnerText; // workerSender.ReportProgress(node.Count / i); //} ConnectionInterface conInt = new ConnectionInterface(); conInt.mapProcess(this.jSettings); }
static void Main(string[] args) { string jPath = args[0]; string jText = System.IO.File.ReadAllText(jPath); JsonCollection jColl = JsonConvert.DeserializeObject <JsonCollection>(jText); double?breakDist = 0.0; double?refLatitude = 0.0; double?refLongitude = 0.0; double?refElevation = 0.0; var conn = new ConnectionInterface(); foreach (JsonSettings jSettings in jColl.JsonSettings) { conn.mapProcess(jSettings, breakDist, refLatitude, refLongitude, refElevation); } }
private Storage GetStorage() { var formFactor25 = new FormFactor() { Name = "M2" }; var ssd = new PCItemType() { Name = "SSD" }; var conInterface = new ConnectionInterface() { Name = "SATA 6 GB/s" }; return(new Storage() { Name = "Samsung 860 Evo", Capacity = "1TB", Cache = 1024, FormFactor = formFactor25, Interface = conInterface, Type = ssd, Price = 149.99M }); }
private List <Storage> GetTestStorages() { var storages = new List <Storage>(); var formFactor35 = new FormFactor() { Name = "3.5" }; var conInterface = new ConnectionInterface() { Name = "SATA 6 GB/s" }; var hdd = new PCItemType() { Name = "7200RPM" }; storages.Add(new Storage() { Name = "Western Digital Caviar Blue", Capacity = "1TB", Cache = 64, FormFactor = formFactor35, Interface = conInterface, Type = hdd, Price = 44.08M }); var formFactor25 = new FormFactor() { Name = "M2" }; var ssd = new PCItemType() { Name = "SSD" }; conInterface = new ConnectionInterface() { Name = "SATA 6 GB/s" }; storages.Add(new Storage() { Name = "Samsung 860 Evo", Capacity = "1TB", Cache = 1024, FormFactor = formFactor25, Interface = conInterface, Type = ssd, Price = 149.99M }); return(storages); }
public PlayerRepo() { this.connection = new Connection(); }
private void CreateStorages() { var formFactor35 = new FormFactor() { Name = "3.5" }; var conInterface = new ConnectionInterface() { Name = "SATA 6 GB/s" }; var hdd = new PCItemType() { Name = "7200RPM" }; this.storageService.Create(new Storage() { Name = "Western Digital Caviar Blue", Capacity = "1TB", Cache = 64, FormFactor = formFactor35, Interface = conInterface, Type = hdd, Price = 44.08M, ImageSrc = "~/images/Storage/09a31f32abb3daaf5ed9b849bd60e675.256p (1).jpg" }); var formFactor25 = new FormFactor() { Name = "M2" }; var ssd = new PCItemType() { Name = "SSD" }; conInterface = new ConnectionInterface() { Name = "SATA 6 GB/s" }; this.storageService.Create(new Storage() { Name = "Samsung 860 Evo", Capacity = "1TB", Cache = 1024, FormFactor = formFactor25, Interface = conInterface, Type = ssd, Price = 149.99M, ImageSrc = "~/images/Storage/09a31f32abb3daaf5ed9b849bd60e675.256p.jpg" }); formFactor25 = new FormFactor() { Name = "M2" }; ssd = new PCItemType() { Name = "SSD" }; conInterface = new ConnectionInterface() { Name = "SATA 6 GB/s" }; this.storageService.Create(new Storage() { Name = "Smasung 970 Evo", Capacity = "250GB", Cache = 64, FormFactor = formFactor25, Interface = conInterface, Type = ssd, Price = 87.99M, ImageSrc = "~/images/Storage/41qR7C253KL.jpg" }); formFactor25 = new FormFactor() { Name = "M2" }; ssd = new PCItemType() { Name = "SSD" }; conInterface = new ConnectionInterface() { Name = "SATA 6 GB/s" }; this.storageService.Create(new Storage() { Name = "Samsung 860 QVO", Capacity = "500GB", Cache = 64, FormFactor = formFactor25, Interface = conInterface, Type = ssd, Price = 49.99M, ImageSrc = "~/images/Storage/41UKoJx2tZL.jpg" }); formFactor25 = new FormFactor() { Name = "M2" }; ssd = new PCItemType() { Name = "SSD" }; conInterface = new ConnectionInterface() { Name = "SATA 6 GB/s" }; this.storageService.Create(new Storage() { Name = "Kingston A400", Capacity = "480GB", Cache = 64, FormFactor = formFactor25, Interface = conInterface, Type = ssd, Price = 168.99M, ImageSrc = "~/images/Storage/72ac6b04347d22c2592029d4a49bc5ed.256p.jpg" }); formFactor25 = new FormFactor() { Name = "M2" }; ssd = new PCItemType() { Name = "SSD" }; conInterface = new ConnectionInterface() { Name = "SATA 6 GB/s" }; this.storageService.Create(new Storage() { Name = "Intel 660p Series", Capacity = "2TB", Cache = 64, FormFactor = formFactor25, Interface = conInterface, Type = ssd, Price = 79.98M, ImageSrc = "~/images/Storage/c7b5b7dacbecdcdd0e073b761193eef6.256p.jpg" }); }
public WeaponRepo() { this.connection = new Connection(); }
//Init constructor public UserRepo(ConnectionInterface connection) { this.connection = connection; }
public BountyRepo() { this.connection = new Connection(); }
//Init constructor public MessageRepo(ConnectionInterface connection, IReactionRepo reactionRepo) { this.connection = connection; this.reactionRepo = reactionRepo; }
public bool HasConnectionInterface(ConnectionInterface connectionInterface) { return(belongs.GetModel().ConnectionInterfacePool.FindConnectionInterface(connectionInterface) != null); }
//Init constructor public CorporationRepo(ConnectionInterface connection) { this.connection = connection; }
//Init constructor public FunRepo(ConnectionInterface connection) { this.connection = connection; }
public ConnectionInterface FindConnectionInterface(ConnectionInterface connectionInterface) { return(_connections.Find(x => x == connectionInterface)); }
public QuestRepo() { this.connection = new Connection(); }
/** * Add a connection to the resolver. * * @param string $name * @param \Illuminate\Database\ConnectionInterface $connection * @return void */ public void addConnection(string name, ConnectionInterface connection) { this._connections[name] = connection; }
public static void Main(string[] args) { //примеры работы с моделью. ConnectionInterface sata = new ConnectionInterface("Sata-1"); ConnectionInterface pciExpress = new ConnectionInterface("PCI-Express"); ConnectionInterface powerPin = new ConnectionInterface("PowerPin"); ConnectionInterface socket = new ConnectionInterface("AM4"); MotherboardModel motherboardModel = new MotherboardModel("B450", 2, new List <ConnectionInterface>() { sata, pciExpress, powerPin, socket }, Socket.AM4, FormFactor.MiniATx); HardDriveModel hddModel = new HardDriveModel("mega hdd", 4, new List <ConnectionInterface>() { sata, powerPin }, 7200); PowerSupplyModel powerSupplyModel = new PowerSupplyModel("PS-8000", 55, new List <ConnectionInterface>() { powerPin, powerPin, powerPin }, 600); ProcessorModel processorModel = new ProcessorModel("3600x", 6, new List <ConnectionInterface>() { socket }, 6); MotherBoard mother = new MotherBoard(motherboardModel); MotherBoard anotherMother = new MotherBoard(motherboardModel); Processor processor = new Processor(processorModel); PowerSupply powerSupply = new PowerSupply(powerSupplyModel); HardDrive hardDrive = new HardDrive(hddModel); mother.Establisher.TryToConnect(processor, socket); mother.Establisher.TryToConnect(hardDrive, sata); mother.Establisher.TryToConnect(powerSupply, powerPin); hardDrive.Establisher.TryToConnect(powerSupply, powerPin); Hardware hardware = new Hardware(mother); ComputerSystem system = new ComputerSystem(); hardDrive.InstallSystem(system); //Включение и перезагрузка. Включать можно только через Hardware. Выключать и рестарат через Hardware и ComputerSystem.(like IRL) Computer computer = new Computer(hardware); ComputerSystem loadedSystem = computer.Hardware.TryToTurnOn(); loadedSystem.Restart(); //Продажа компьютеров ShopCatalog catalog = new ShopCatalog(); catalog.AddLot(new Lot(computer.Hardware, 100, 2)); Lot wantToBuy = catalog.FindSuitable(x => x.Cost < 150 && x.Item is Hardware).First(); Hardware boughtHardware = (Hardware)catalog.Buy(wantToBuy); Computer boughtComputer = new Computer(boughtHardware); //Замена материнской платы boughtComputer.Hardware.TryToReplaceComponent(mother, anotherMother); //Установка приложения в компьютерном классе Application trojan = new Application(new byte[228]); List <Computer> installedComputers = new List <Computer>() { boughtComputer }; ComputerClass computerClass = new ComputerClass(installedComputers); computerClass.InstallApplicationOnEach(trojan); computerClass.Command(x => x.System?.Execute(trojan.BinaryCode)); // сбор металлолома MetalCollector collector = new MetalCollector(); collector.Collect(boughtComputer); }
//Init constructor public SoftwareRepo(ConnectionInterface connection) { this.connection = connection; }