public void Building() { while (Active) { if (Orders > 0 && StoreRacks.Count > 0) { Orders--; StoreRackBuild = StoreRacks.Dequeue(); //Thread.Sleep(timeBuilding*1000); /*Thread threadBuild1 = new Thread(new ThreadStart(Build)); * threadBuild1.Start();*/ Journal_Info JIo = new Journal_Info(id); Console.WriteLine("АЙДИШНИК " + id); id++; JIo.IdRack = StoreRackBuild.IdRack; JIo.TEv = TypeEvents.OutBuild; JIo.TimeEvent = DateTime.Now; JIo.typeSender = TypeSender.StoreRack; StoreRackBuilded(JIo); if (builded != null) { builded($"{StoreRackBuild.ToString()} OUT BUILD, BEGIN CHECK"); } Thread threadBuild = new Thread(new ThreadStart(CheckStoreRack)); threadBuild.Start(); } } if (builded != null) { builded("END BUILDED"); } }
public void CheckStoreRack() { SToreRack storeRack = StoreRackBuild; Journal_Info JInf = new Journal_Info(id); JInf.TEv = TypeEvents.InCheck; Console.WriteLine("АЙДИШНИК " + id); id++; JInf.typeSender = TypeSender.StoreRack; JInf.IdRack = storeRack.IdRack; if (StoreRackBuilded != null) //если оно не пустое { StoreRackBuilded(JInf); } if (storeRack.Name != "") { Journal_Info JIo = new Journal_Info(id); JIo.TEv = TypeEvents.OutCheck; Console.WriteLine("АЙДИШНИК " + id); JIo.typeSender = TypeSender.StoreRack; id++; JIo.IdRack = storeRack.IdRack; // JIo.TimeEvent = DateTime.Now; if (StoreRackBuilded != null) { StoreRackBuilded(JIo); } if (builded != null) { builded($"{storeRack.ToString()} OUT CHECK"); } } else { Journal_Info JIo1 = new Journal_Info(id); JIo1.IdRack = storeRack.IdRack; Console.WriteLine("АЙДИШНИК " + id); JIo1.typeSender = TypeSender.StoreRack; id++; JIo1.TEv = TypeEvents.ErrorCheck; JIo1.TimeEvent = DateTime.Now; StoreRackBuilded(JIo1); if (builded != null) { builded($"{storeRack.ToString()} ERROR CHECK"); } } }
public void AddStoreRack(SToreRack current) { StoreRacks.Enqueue(current); Journal_Info JI = new Journal_Info(id); JI.TEv = TypeEvents.InBuild; Console.WriteLine("АЙДИШНИК " + id); JI.typeSender = TypeSender.StoreRack; id++; JI.IdRack = current.IdRack; JI.TimeEvent = DateTime.Now; if (StoreRackBuilded != null) { StoreRackBuilded(JI); } if (builded != null) { builded($"{current.ToString()} IN BUILD"); } }
public void Build() { Journal_Info JIo = new Journal_Info(id); Console.WriteLine("АЙДИШНИК " + id); id++; JIo.IdRack = StoreRackBuild.IdRack; JIo.TEv = TypeEvents.OutBuild; JIo.TimeEvent = DateTime.Now; JIo.typeSender = TypeSender.StoreRack; StoreRackBuilded(JIo); if (builded != null) { builded($"{StoreRackBuild.ToString()} OUT BUILD, BEGIN CHECK"); } Thread threadBuild = new Thread(new ThreadStart(CheckStoreRack)); threadBuild.Start(); }
public void OnEventStoreRack(Journal_Info JI) { journals.Add(JI); }