public bool NextStep(ref c_WorkingStep cNextStep, ref Queue <c_WorkingStep> QueueOfNextSteps) { bool bFound = false; UpdateListOfWorkingSchedules(); // hier wird der Regenerationspfad aktualisiert while (m_dStep < m_dHighestStep) // Sollte es keine Arbeitsschritte mehr geben wird die Schleife abgebrochen { m_dStep = m_dStep + 1; foreach (c_WorkingStep Step in m_ListOfWorkingSteps) { if (Step.m_dWorkingStep == m_dStep) { QueueOfNextSteps.Enqueue(Step); cNextStep = Step; bFound = true; } } if (bFound) // Wenn Aktionen für den Schritt gefunden wurden wird die letzte gefundene in cNextStep geschrieben { break; } } return(bFound); // keine Aktion gefunden }
public bool CheckForVirtActionInStep(ref c_WorkingStep cNextStep)// { return(true); }
private bool AutoActionUpdate() { c_WorkingStep cNextStep = new c_WorkingStep(); Queue <c_WorkingStep> QueueOfNextSteps = new Queue <c_WorkingStep>(); Stack <c_Action> ReverseStackOfActions = new Stack <c_Action>(); if (m_cWorkingScheduleHandler.IsEmpty()) { if (m_cWorkingSchedule.NextSteps(ref QueueOfNextSteps)) { c_Cell cCell = new c_Cell(); foreach (c_WorkingStep Step in QueueOfNextSteps) { if (Step.m_sAction == "pickup") { if (!m_cCellArea.SearchWPInCells(Step.m_iWorkpiece, ref cCell)) { m_cWorkingSchedule.SetStepCountBack(); m_cWorkingScheduleHandler.ClearStackOfActions(); return(false); } if (!cCell.Idle) { m_cWorkingSchedule.SetStepCountBack(); m_cWorkingScheduleHandler.ClearStackOfActions(); return(false); } c_Action cNewAction = new c_Action(); cNewAction.m_sWPID = m_cMHS.GetStorage().GetStorageIDOfPlace(Step.m_iWorkpiece); cNewAction.m_iWPPlace = Step.m_iWorkpiece; cNewAction.m_sCell = Step.m_sCell; cNewAction.m_eActionType = eAction.GetFromCell; // Aktion in den Stack zur Abarbeitung pushen ReverseStackOfActions.Push(cNewAction); //m_cWorkingScheduleHandler.PushAction(cNewAction); } if (Step.m_sAction == "put") { if (!m_cCellArea.GetCellOfName(Step.m_sCell, ref cCell)) { m_cWorkingSchedule.SetStepCountBack(); m_cWorkingScheduleHandler.ClearStackOfActions(); return(false); } if (!cCell.Idle) { m_cWorkingSchedule.SetStepCountBack(); m_cWorkingScheduleHandler.ClearStackOfActions(); return(false); } c_Action cNewAction = new c_Action(); cNewAction.m_sWPID = m_cMHS.GetStorage().GetStorageIDOfPlace(Step.m_iWorkpiece); cNewAction.m_iWPPlace = Step.m_iWorkpiece; cNewAction.m_sCell = Step.m_sCell; cNewAction.m_eActionType = eAction.PutToCell; // Aktion in den Stack zur Abarbeitung pushen ReverseStackOfActions.Push(cNewAction); // m_cWorkingScheduleHandler.PushAction(cNewAction); } } } } foreach (c_Action Action in ReverseStackOfActions) { m_cWorkingScheduleHandler.PushAction(Action); } return(true); }