//-------------------------------------------------- public Factory(TimeWork timeWork) { this.TimeWork = timeWork; helpedLines = new MyLine[15]; GenerateEndMachines = new Machine[2]; MyTechnoLines = new ObservableCollection <TechnoLine>(); TimeGenerate = 3; CountOfDoneDetail = 0; CountOfGeneratedDetail = 0; initsializeLine(); initsializeFactory(); MayWork = true; }
public TechnoLine(int[,] kord, int numberLine, TimeWork timeWork, Random rand) { MayWork = true; this.rand = rand; this.timeWork = timeWork; NumberLine = numberLine; Machines = new Machine[4]; Machines[0] = new Machine(kord[0, 0], kord[1, 0], timeWork, 1, NumberLine, rand); Machines[1] = new Machine(kord[0, 1], kord[1, 1], timeWork, 2, NumberLine, rand); Machines[2] = new Machine(kord[0, 2], kord[1, 2], timeWork, 3, NumberLine, rand); Machines[3] = new Machine(kord[0, 3], kord[1, 3], timeWork, 4, NumberLine, rand); for (int i = 0; i < 4; i++) { Machines[i].eventRefresh += eventExecute; } }
public void initsialize(double timeScheduled, int[] timeGenerate, int[,] timeWorkOnTypeMachine) { tbResults.Clear(); button.IsEnabled = false; timeWork = new TimeWork((int)(timeScheduled * 1000), timeGenerate, timeWorkOnTypeMachine); timeWork.TimeActual = 0; factory = new Factory(timeWork); factory.startWork(); ListResults.Clear(); factory.eventRefresh += refreshEventMethod; for (int i = 0; i < factory.MyTechnoLines.Count; i++) { factory.MyTechnoLines[i].eventRefresh += refreshEventMethod; } }
public Machine(int x, int y, TimeWork timeWork, int numberMachine, int numberLine, Random rand) { MayWork = true; TimeQueue = 0; randomTimeWork = rand; this.timeWork = timeWork; X = x; Y = y; Color = Brushes.Gray; NumberLine = numberLine; NumberMachine = numberMachine; Queue = 0; MaxSizeQueue = 0; if (numberMachine != 0) { SumTimeWork = 0; } SumDetail = 0; }