//METHODS\\ public SalesRepClass getFreeRep(ECallType callType) { if (callType == ECallType.stereo) { foreach (SalesRepClass item in stereoRep) { if (item.isFree == true) { //If there is a free stereo rep, return them. return(item); } } } if (callType == ECallType.other) { foreach (SalesRepClass item in otherRep) { if (item.isFree == true) { //If there is a free other rep, return them. return(item); } } } //If couldnt find free rep return(null); }
/// <summary> /// Finds the appropriate queue and returns if it is empty /// </summary> public bool IsQueueEmpty(ECallType callType) { // Get the queue for the call type Queue queue = simulatorQueues.Find(q => q.CallType == callType); return(queue.IsEmpty); }
public CCallRecord(ECallType type, string number, DateTime time, TimeSpan duration) { this._Type = type; this._Number = number; this._Time = time; this._Duration = duration; }
public Entity GetFirstInQueue(ECallType callType) { // Gets the queue for the call type Queue queue = simulatorQueues.Find(q => q.CallType == callType); return(queue.GetFirstInQueue()); }
/// <summary> /// Returns the data in a queue based on the calltyped /// </summary> public List <string[]> GetEntityDataInQueue(ECallType callType) { // Get the queue for the call type Queue queue = simulatorQueues.Find(q => q.CallType == callType); return(queue.GetEntityDataInQueue()); }
public Entity GetFirstInQueue(ECallType callType) { // Gets the queue for the call type Queue queue = simulatorQueues.Find(q => q.CallType == callType); return queue.GetFirstInQueue(); }
//CONSTRUCTOR\\ public EntityClass(int entityID, ECallType callType) { this.callType = callType; this.entityID = entityID; startQTime = 0; startSystemTime = 0; endQTime = 0; endSystemTime = 0; }
public ECallData(string subject, string sender, string comment, ECallType type = ECallType.Auto) { Id = null; Created = DateTime.Now; Subject = subject; Sender = sender; Comment = comment; // id nélkül csak automata lehet a típus Type = Id is null ? ECallType.Auto : type; }
private CCallRecord findRecord(string number, ECallType type) { foreach (CCallRecord item in _callList) { if ((item.Number == number) && (item.Type == type)) { return(item); } } return(null); }
///////////////////////////////////////////////////////////////////////////////////// public void addCall(ECallType type, string number, string name, DateTime time, TimeSpan duration) { int delta = (int)duration.TotalSeconds; CCallRecord record = new CCallRecord(); // todo:::extract name from number record.Name = name; record.Number = number; record.Duration = duration; record.Type = type; record.Time = time; addRecord(record); }
//////////////////////////////////////////////////////////////////////////////////////////// public Stack <CCallRecord> getList(ECallType type) { Stack <CCallRecord> tempList = new Stack <CCallRecord>(); foreach (CCallRecord item in _callList) { if ((item.Type == type) || (type == ECallType.EAll)) { tempList.Push(item); } } return(tempList); }
public static string GetCallType(ECallType type) { switch (type) { case ECallType.EDialed: return("Dialed Call"); case ECallType.EMissed: return("EMissed Call"); case ECallType.EReceived: return("Received Call"); case ECallType.EUndefined: return("Undefined Call"); default: return(""); } }
public void deleteRecord(string number, ECallType type) { CCallRecord[] tmplist = _callList.ToArray(); List<CCallRecord> list = new List<CCallRecord>(tmplist); list.Reverse(); _callList.Clear(); foreach (CCallRecord item in list) { if ((item.Number == number) && (item.Type == type)) { continue; } _callList.Push(item); } }
public List <CCallRecord> getList(ECallType type) { try { if (CallRecords == null) { LoadRecords(); } switch (type) { case ECallType.EAll: return(getList()); default: return(CallRecords.FindAll(r => r.Type == type)); } } catch { return(new List <CCallRecord>()); } }
public List <CCallRecord> SearchList(ECallType type, Predicate <CCallRecord> match) { try { if (CallRecords == null) { LoadRecords(); } switch (type) { case ECallType.EAll: return(CallRecords.FindAll(match)); default: return(CallRecords.FindAll(r => (r.Type == type) && match(r))); } } catch { return(new List <CCallRecord>()); } }
public CCallRecord SearchOneRecord(ECallType type, Predicate <CCallRecord> match) { try { if (CallRecords == null) { LoadRecords(); } switch (type) { case ECallType.EAll: return(CallRecords.Find(match)); default: return(CallRecords.Find(r => (r.Type == type) && match(r))); } } catch { return(null); } }
public void deleteRecord(string number, ECallType type) { CCallRecord[] tmplist = _callList.ToArray(); List <CCallRecord> list = new List <CCallRecord>(tmplist); list.Reverse(); _callList.Clear(); foreach (CCallRecord item in list) { if ((item.Number == number) && (item.Type == type)) { continue; } _callList.Push(item); } }
//GET THE NEXT WAITING ENTITY IN THE QUEUE public EntityClass getEntityWaiting(ECallType callType) { EntityClass nextEntity = null; if (callType == ECallType.stereo) //If the call is stereo { //If there is someone waiting if (stereoWaiting.Count > 0) { nextEntity = stereoWaiting.Dequeue(); } } else { if (otherWaiting.Count > 0) { nextEntity = otherWaiting.Dequeue(); } } return(nextEntity); }
public void addCall(ECallType type, string number, string name, DateTime time, TimeSpan duration) { try { CCallRecord record = new CCallRecord(type, number, time, duration); record.Id = ++MaxRecordId; record.OnDataChanged += new DataChanged(record_OnDataChanged); if (CallRecords != null) { CallRecords.Insert(0, record); } SaveRecord(record); RiseEvent(OnRecordAdded, record); List <CCallRecord> records = getList(type); if (records.Count > MaxRecordsCount) { deleteRecord(records[records.Count - 1].Id); } } catch { } }
//////////////////////////////////////////////////////////////////////////////////////////// public Stack<CCallRecord> getList(ECallType type) { Stack<CCallRecord> tempList = new Stack<CCallRecord>(); foreach (CCallRecord item in _callList) { if ((item.Type == type)||(type == ECallType.EAll)) { tempList.Push(item); } } return tempList; }
private CCallRecord findRecord(string number, ECallType type) { foreach (CCallRecord item in _callList) { if ((item.Number == number)&&(item.Type == type)) { return item; } } return null; }
/// <summary> /// Returns true if the call type queue has no entities waiting /// </summary> public bool IsQueueEmpty(ECallType calltype) { return(queueManager.IsQueueEmpty(calltype)); }
public Stack<CCallRecord> getList(ECallType type) { return null;}
/// <summary> /// Computes all call compleation stats /// </summary> private void completions(ECallType? callType) { // Update statistics of every enitiy leaving system Global.CallCompletion++; // Update individual completions switch (callType) { case ECallType.OTHER: Global.CallCompletionType1++; break; case ECallType.CAR_STEREO: Global.CallCompletionType2++; break; } }
/// <summary> /// Finds the appropriate queue and returns if it is empty /// </summary> public bool IsQueueEmpty(ECallType callType) { // Get the queue for the call type Queue queue = simulatorQueues.Find(q => q.CallType == callType); return queue.IsEmpty; }
public Resource(ECallType callType) { this.CallType = callType; this.IsFree = true; }
public void addCall(ECallType type, string number, string name, System.DateTime time, System.TimeSpan duration) { }
public Stack<CCallRecord> getList(ECallType type) { return null; }
/// <summary> /// Pops the first in the queue /// </summary> public Entity GetFirstInQueue(ECallType calltype) { return(queueManager.GetFirstInQueue(calltype)); }
/// <summary> /// Return the event time depending on callType /// </summary> public int NextEventTime(ECallType? callType) { switch (callType) { case ECallType.CAR_STEREO: return DelayCarStereo; case ECallType.OTHER: return DelayOther; default: return DelayAtSwitch; } }
public Queue(ECallType callType) { this.callType = callType; this.entityQueue = new List <Entity>(); }
public Queue(ECallType callType) { this.callType = callType; this.entityQueue = new List<Entity>(); }
/// <summary> /// Computes the average number of entities that waited /// </summary> private void averageNumberWaiting(ECallType? callType) { // Running average of entities waiting Global.WaitCount++; Global.AverageNumberWaiting += computeAverage(Global.WaitCount, Global.AverageNumberWaiting, count); switch (callType) { case ECallType.CAR_STEREO: Global.WaitCountType2++; Global.AverageNumberWaitingType2 += computeAverage(Global.WaitCountType2, Global.AverageNumberWaitingType2, count); break; case ECallType.OTHER: Global.WaitCountType1++; Global.AverageNumberWaitingType1 += computeAverage(Global.WaitCountType1, Global.AverageNumberWaitingType1, count); break; } }
/// <summary> /// Gets a formatted list of data from the queue /// </summary> public List <string[]> GetQueueEntityData(ECallType callType) { return(queueManager.GetEntityDataInQueue(callType)); }
/// <summary> /// Pops the first in the queue /// </summary> public Entity GetFirstInQueue(ECallType calltype) { return queueManager.GetFirstInQueue(calltype); }
/// <summary> /// Gets a formatted list of data from the queue /// </summary> public List<string[]> GetQueueEntityData(ECallType callType) { return queueManager.GetEntityDataInQueue(callType); }
/// <summary> /// Returns the data in a queue based on the calltyped /// </summary> public List<string[]> GetEntityDataInQueue(ECallType callType) { // Get the queue for the call type Queue queue = simulatorQueues.Find(q => q.CallType == callType); return queue.GetEntityDataInQueue(); }
/// <summary> /// Returns true if the call type queue has no entities waiting /// </summary> public bool IsQueueEmpty(ECallType calltype) { return queueManager.IsQueueEmpty(calltype); }
/// <summary> /// Returns the next available resource /// </summary> public Resource NextAvailableResource(ECallType? calltype) { // Specific calltype and resource must be free else will return null return resources.Find(r => (r.CallType == calltype && r.IsFree == true)); }
//CONSTRUCTOR\\ public SalesRepClass(ECallType repType) { this.isFree = false; this.repType = repType; }
/// <summary> /// If the entity is waiting over 1 min, can be set by user /// </summary> private void excessiveWaiting(ECallType? callType, int waitTime) { // Work out if call had an excessive wait time if (waitTime > Global.ExcessiveWaitTime) { Global.ExcessiveWaitCount++; switch (callType) { case ECallType.CAR_STEREO: Global.ExcessiveWaitCountType2++; break; case ECallType.OTHER: Global.ExcessiveWaitCountType1++; break; } } }