/// <summary> /// handle response send by ctc gui with end block /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _ctcGui_RoutingToolResponse(object sender, RoutingToolEventArgs e) { if (e.Block != null) { _endBlock = e.Block; if (SubmitRoute != null) { //TODO - populate list of block inbetween current and dest string line; if (_startBlock.Line.CompareTo("Red") == 0) { line = "Red"; } else { line = "Green"; } IBlock[] b = _env.TrackModel.requestPath(_startBlock.BlockID, _endBlock.BlockID, line); List <IBlock> routeBlocks = b.ToList <IBlock>(); IRoute r = new Route(RouteTypes.PointRoute, _endBlock, -1, routeBlocks); SubmitRoute(this, new RoutingToolEventArgs(r, null)); } } }
private void Rt_SubmitRoute(object sender, RoutingToolEventArgs e) { IRoute r = e.Route; if (_routeToolMode == RoutingMode.Dispatch) { //dispatch train request _ctcOffice.dispatchTrainRequest(r); MessageBox.Show("Routing Selection Complete (Dispatch). Sending Request"); //close routing tool if (_routeTool != null) { _routeTool.ParentForm.Close(); } } else if (_routeToolMode == RoutingMode.Update) { //assign route request _ctcOffice.assignTrainRouteRequest( _lastRightClickContainer.Train.TrainID, _lastRightClickContainer.Block.TrackCirID, r, _lastRightClickContainer.Block ); MessageBox.Show("Routing Selection Complete. Sending Request"); //close routing tool if (_routeTool != null) { _routeTool.ParentForm.Close(); } } }
/// <summary> /// handle response send by ctc gui with end block /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void _ctcGui_RoutingToolResponse(object sender, RoutingToolEventArgs e) { if (e.Block != null) { _endBlock = e.Block; if (SubmitRoute != null) { //TODO - populate list of block inbetween current and dest string line; if (_startBlock.Line.CompareTo("Red") == 0) { line = "Red"; } else { line = "Green"; } IBlock[] b = _env.TrackModel.requestPath(_startBlock.BlockID, _endBlock.BlockID, line); List<IBlock> routeBlocks = b.ToList<IBlock>(); IRoute r = new Route(RouteTypes.PointRoute, _endBlock, -1, routeBlocks); SubmitRoute(this, new RoutingToolEventArgs(r,null)); } } }
private void Rt_SubmitRoute(object sender, RoutingToolEventArgs e) { IRoute r = e.Route; if (_routeToolMode == RoutingMode.Dispatch) { //dispatch train request _ctcOffice.dispatchTrainRequest(r); MessageBox.Show("Routing Selection Complete (Dispatch). Sending Request"); //close routing tool if (_routeTool != null) { _routeTool.ParentForm.Close(); } } else if (_routeToolMode == RoutingMode.Update) { //assign route request _ctcOffice.assignTrainRouteRequest( _lastRightClickContainer.Train.TrainID, _lastRightClickContainer.Block.TrackCirID, r, _lastRightClickContainer.Block ); MessageBox.Show("Routing Selection Complete. Sending Request"); //close routing tool if (_routeTool != null) { _routeTool.ParentForm.Close(); } } }