///todo если не пустая, то добывляем событие в кассу, касса запломбирована завкой, по окончанию работы заявка отправляется в очередь ///todo законченных, а касса идет искать заявку в очередь, если в очереди нет заявки такого типа, то ждет тик. ///todo Если очередб переполнена, то заявка попадает в массив пропущенных заявок void ServicesGenerate() { timertime = double.Parse(TimerTime.Text); double instance = 1000 * timertime / int.Parse(TimeInterval.Text); time1 = Convert.ToInt32(int.Parse(timeXCHG.Text) * instance); time2 = Convert.ToInt32(int.Parse(timeCARD.Text) * instance); time3 = Convert.ToInt32(int.Parse(timeCRED.Text) * instance); time4 = Convert.ToInt32(int.Parse(timeACNT.Text) * instance); m1[0] = new ServiceMachineTypeFirst(1, time1, time2); m1[1] = new ServiceMachineTypeFirst(2, time1, time2); m1[2] = new ServiceMachineTypeFirst(3, time1, time2); m2[0] = new ServiceMachineTypeSecond(4, time3, time4); m2[1] = new ServiceMachineTypeSecond(5, time3, time4); interval = new TimeSpan(0, int.Parse(TimeInterval.Text), 0); }
void CheckServiceMachineTypeSecond(ServiceMachineTypeSecond m, TextBlock block) { block.Background = Brushes.Green; block.Text = "Open!"; Request temp = new Request(-1); int i = 0; if (i == 0) { temp = this.reqlist.Find(RequestType.CRED); if (temp.ID != -1) { i++; } } if (i == 0) { temp = this.reqlist.Find(RequestType.ACNT); if (temp.ID != -1) { i++; } } if (i == 1) { block.Text = temp.Type.ToString(); block.Background = Brushes.Red; temp.TimeStarted = this.BeginTime; m.MethodOfTypeRequest(temp); if (temp.Type == RequestType.CRED) { temp.TimeFinalized = this.BeginTime + TimeSpan.FromMinutes(Convert.ToInt32(int.Parse(timeCRED.Text))); this.credcomplete++; } if (temp.Type == RequestType.ACNT) { temp.TimeFinalized = this.BeginTime + TimeSpan.FromMinutes(Convert.ToInt32(int.Parse(timeACNT.Text))); this.acntcomplete++; } temp.MachineID = m.ID; temp.RequestState = RequestStateType.Finalized; this.reqcomplete.Add(temp); this.fcomplete++; } }