private void LoadResultsViewer(RouteStationProcess process) { StationResultsViewerForm form = new StationResultsViewerForm(process); form.StartPosition = FormStartPosition.CenterParent; form.ShowDialog(); }
private void LoadUnitForProcess() { if (m_item == null) { return; } if (ItemIsOnHold(m_item)) { return; } if (!ItemHasServiceCommodity(m_item)) { return; } if (m_item.CurrentProcess != null) { m_process = m_item.CurrentProcess; LoadEditors(m_process.Station); LoadTaskController(m_item.CurrentProcess); LoadPartsUsed(m_item.LotId); SetupCancelButtonStateController(m_process); return; } Scout.Core.UserInteraction.Dialog.ShowMessage( "This unit is not currently on a process route", UserMessageType.Warning); }
public void MoveUnitToExistingStation(RouteStationProcess process) { InventoryItem item = process.Item; item.CurrentProcess = process; item.ChangeDomain(process.Station.Station.Domain); }
private void UnHookListeners(RouteStationProcess process) { if (process != null) { process.RepairComponentAdded -= process_RepairComponentAdded; } }
public StationResultsViewerForm(RouteStationProcess process) { InitializeComponent(); m_process = process; Bind(); LoadResults(); LoadFailures(); }
public void EndProcess(RouteStationProcess process) { if (new EndProcessValidator(process).Validated()) { process.RoutingEnabled = false; process.Item.CurrentProcess = null; } }
void processHistoryGrid_DoubleClick(object sender, EventArgs e) { RouteStationProcess process = processHistoryView.GetFocusedRow() as RouteStationProcess; if (process != null) { LoadResultsViewer(process); } }
public void MonitorProcess(RouteStationProcess process) { if (m_process != null) { UnHookListeners(m_process); } m_process = process; HookListeners(m_process); }
private void Init() { m_session = Scout.Core.Data.GetUnitOfWork(); m_item = null; m_process = null; m_routeStation = null; tasksGrid.DataSource = null; inspectionsGrid.DataSource = null; ClearEditors(); snText.Focus(); }
private void SetupCancelButtonStateController(RouteStationProcess process) { m_cancelControlStateController = new ControlStateController <RouteStationProcess>(cancelButton, process); m_cancelControlStateController .AddDisableCondition((p) => p.HasNewMaterialsConsumed()); m_cancelControlStateController .AddDisableCondition((p) => p.HasReversedMaterialsConsumed()); m_cancelControlStateController.SetState(process); }
public void when_the_first_failure_is_added_to_the_collection_it_is_set_to_the_fp_error_code() { RouteStationProcess process = Xpo.CreateXPObject <RouteStationProcess>(); InventoryItem item = Xpo.CreateXPObject <InventoryItem>(); process.Item = item; ServiceCode serviceCode = Xpo.CreateXPObject <ServiceCode>(); RouteStationFailure firstFailure; firstFailure = process.AddFailure(serviceCode, "test"); Assert.That(firstFailure.IsFpErrorCode); }
public MethodResult ConvertProgram (RouteStationProcess process, string newProgram, string reason) { // Create conversion record ShopfloorProgramConversion c = new ShopfloorProgramConversion(); Dictionary <string, object> inputParams = new Dictionary <string, object>(2); inputParams.Add("Reason", reason); inputParams.Add("NewProgram", newProgram); return(c.Execute(process, inputParams)); }
private void LoadTaskController(RouteStationProcess process) { if (m_taskController != null) { m_taskController.Dispose(); m_taskController = null; m_taskModel = null; } tasksGrid.DataSource = null; inspectionsGrid.DataSource = null; m_taskModel = new StationTaskModel(process); m_taskController = new StationTaskController(m_taskModel, this); }
public void MoveUnitToNextStation(RouteStationProcess process) { InventoryItem item = process.Item; ServiceRoute route = process.Station.ServiceRoute; Scout.Core.Service <ITransactionService>().CreateTransaction("STATIONTRANS", item, process.Station.FullLocation, process.NextStation. FullLocation, "Unit was moved to the next station.", ""); RouteStationProcess newProcess = route.CreateRouteStationProcess(process.NextStation, item); newProcess.PrevProcess = process; item.CurrentProcess = newProcess; item.ChangeDomain(process.NextStation.Station.Domain); }
public bool ProcessStation(RouteStationProcess process) { RemoveBlankStepResults(process); if (!new RouteStationProcessValidator(process).Validated()) { return(false); } if (process.StationOutcome == null) { return(true); } // Get the station outcome transition if it exists. StationOutcomeTransition transition = process.Station.GetOutcomeTransitionFor(process.StationOutcome); if ( !new StationOutcomeTransitionValidator(transition, process). Validated()) { return(false); } // Move the unit to the next station if defined. if (process.NextStation != null) { MoveUnitToNextStation(process); } // End the process if a transition was determined and the transition is defined // as the end of a process else if (transition != null && transition.EndProcessRoute) { EndProcess(process); } ProcessStationConditions(process); return(true); }
public void ProcessStationConditions(RouteStationProcess process) { // Get the station conditions IEnumerable <IActionSpecification <RouteStationProcess> > conditions = ShopfloorRepository.GetShopfloorConditions(process); // Check condition and execute action foreach (IActionSpecification <RouteStationProcess> c in conditions) { if (c.IsSatisfiedBy(process)) { c.ExecuteAction(); string msg = c.Message.Message; if (!string.IsNullOrEmpty(msg)) { Scout.Core.UserInteraction.Dialog.ShowMessage(msg, UserMessageType.Information); } } } }
//[Test] public void when_the_fp_error_code_is_deleted_it_should_be_reset_to_the_first_fail_code() { RouteStationProcess process = Xpo.CreateXPObject <RouteStationProcess>(); InventoryItem item = Xpo.CreateXPObject <InventoryItem>(); process.Item = item; ServiceCode firstCode = Xpo.CreateXPObject <ServiceCode>(); process.AddFailure(firstCode, "first"); ServiceCode secondCode = Xpo.CreateXPObject <ServiceCode>(); process.AddFailure(secondCode, "delete_me"); //process.ChangeFpErrorCode(1); process.AllProcessFailures.Remove(process.Failures[1]); Assert.That(process.Failures[0].IsFpErrorCode); }
public void RemoveBlankStepResults(RouteStationProcess process) { IUnitOfWork uow = process.Session; for (int i = 0; i < process.Results.Count; i++) { RouteStationResult result = process.Results[i]; if (string.IsNullOrEmpty(result.Result)) { process.Results.Remove(result); result.Process = null; if (uow != null) { uow.Delete(result, false); } RemoveBlankStepResults(process); } } Scout.Core.Data.Save(uow); }
public void the_fp_error_code_should_be_allowed_to_change_to_a_different_fail_code() { RouteStationProcess process = Xpo.CreateXPObject <RouteStationProcess>(); InventoryItem item = Xpo.CreateXPObject <InventoryItem>(); process.Item = item; ServiceCode firstCode = Xpo.CreateXPObject <ServiceCode>(); RouteStationFailure firstFailure; firstFailure = process.AddFailure(firstCode, "first"); Assert.That(firstFailure.IsFpErrorCode, "The first failure was not set to the fp error code!"); ServiceCode secondCode = Xpo.CreateXPObject <ServiceCode>(); RouteStationFailure shouldBeFpFailure; shouldBeFpFailure = process.AddFailure(secondCode, "should_be_fp"); process.ChangeFpErrorCodeOwner(shouldBeFpFailure); Assert.That(shouldBeFpFailure.IsFpErrorCode, "Changing of the fp error code did not succeed!"); Assert.That(firstFailure.IsFpErrorCode == false, "The previous fp error code owner was not relieved!"); }
public void MoveUnitToNewStation(RouteStationProcess process, RouteStation station) { InventoryItem item = process.Item; ServiceRoute route = process.Station.ServiceRoute; Scout.Core.Service <ITransactionService>().CreateTransaction("STATIONTRANS", item, process.Station.FullLocation, station.FullLocation, "Unit was manually moved to a new station.", ""); if (item.CurrentProcess != null) { item.CurrentProcess.PrevProcess = item.CurrentProcess; } RouteStationProcess newProcess = route.CreateRouteStationProcess(station, item); item.CurrentProcess = newProcess; item.ChangeDomain(newProcess.Station.Station.Domain); }
private void HookListeners(RouteStationProcess process) { process.RepairComponentAdded += process_RepairComponentAdded; }
public ICollection <RouteStation> GetRouteStationsFromProcess( RouteStationProcess process) { return(RoutingRepository.GetRouteStationsFromProcess(process)); }
public StationInspectionTaskModel(RouteStationProcess process) { m_process = process; }
public void process_validator_fails_when_there_are_invalid_steps() { PartAttributesHeader header = Xpo.CreateXPObject <PartAttributesHeader>(); PartAttributeValues values = Xpo.CreateXPObject <PartAttributeValues>(); header.Attr1 = "Firmware"; header.Attr2 = "ASR"; values.Header = header; values.Attr1 = "E36X"; values.Attr2 = "A03"; // Create step1 with Firmware validation RouteStationStep step1 = Xpo.CreateXPObject <RouteStationStep>(); step1.DisplayPrompt = "Firmware"; step1.ValidationType = StepResultValidationType.Firmware; // Create step2 with MSR validation RouteStationStep step2 = Xpo.CreateXPObject <RouteStationStep>(); step2.DisplayPrompt = "Current Revision"; step2.ValidationType = StepResultValidationType.MinimumShippableRevision; // Create step3 with OpenText validation RouteStationStep step3 = Xpo.CreateXPObject <RouteStationStep>(); step3.DisplayPrompt = "Step3"; step3.ValidationType = StepResultValidationType.OpenText; // Create a test part with dummy attributes Part part = Xpo.CreateXPObject <Part>(); // Set the parts attributes to the fake attributes we created. part.Attributes = values; // Create Firmware step result RouteStationResult result1 = Xpo.CreateXPObject <RouteStationResult>(); result1.Step = step1; result1.Result = "E36X"; // Create the MSR step result RouteStationResult result2 = Xpo.CreateXPObject <RouteStationResult>(); result2.Step = step2; result2.Result = "A04"; // Create the OpenText step result RouteStationResult result3 = Xpo.CreateXPObject <RouteStationResult>(); result3.Step = step3; result3.Result = "i can type whatever i want to"; // Create a station process SCENARIO RouteStationProcess process = Xpo.CreateXPObject <RouteStationProcess>(); // Create a fake inventory item InventoryItem item = Xpo.CreateXPObject <InventoryItem>(); // Set the inventory part to the attribute part we've created. item.Part = part; // Set the process inventory item to the fake inventory item we've created. process.Item = item; // Add the results to the process process.Results.Add(result1); process.Results.Add(result2); process.Results.Add(result3); // Generate a fake process outcome StationOutcome outcome = Xpo.CreateXPObject <StationOutcome>(); outcome.Label = "PASS"; // Assign the outcome to our fake process process.StationOutcome = outcome; // Validate the process RouteStationProcessValidator validator = new RouteStationProcessValidator(process); Assert.IsFalse(validator.Validated()); }
public StationOutcomeTransitionValidator(StationOutcomeTransition transition, RouteStationProcess process) { m_transition = transition; m_process = process; }