public void SetFeederMode(FeederModes mode)
 {
    this.feederModeSetPoint = mode;
 }
      private void InitializeValues()
      {
         this.busReady = false;
         this.busStatus = null;
         this.busReceiveQueue.Clear();
         this.deviceResetQueue.Clear();
         
         this.reelMotor.NodeId = (byte)ParameterAccessor.Instance.TruckBus.ReelMotorBusId;
         this.reelDigitalIo.NodeId = (byte)ParameterAccessor.Instance.TruckBus.ReelDigitalBusId;
         this.reelAnalogIo.NodeId = (byte)ParameterAccessor.Instance.TruckBus.ReelAnalogBusId;
         this.reelEncoder.NodeId = (byte)ParameterAccessor.Instance.TruckBus.ReelEncoderBusId;
         this.feederTopFrontMotor.NodeId = (byte)ParameterAccessor.Instance.TruckBus.FeederTopFrontMotorBusId;
         this.feederTopRearMotor.NodeId = (byte)ParameterAccessor.Instance.TruckBus.FeederTopRearMotorBusId;
         this.feederBottomFrontMotor.NodeId = (byte)ParameterAccessor.Instance.TruckBus.FeederBottomFrontMotorBusId;
         this.feederBottomRearMotor.NodeId = (byte)ParameterAccessor.Instance.TruckBus.FeederBottomRearMotorBusId;
         this.feederEncoder.NodeId = (byte)ParameterAccessor.Instance.TruckBus.FeederEncoderBusId;
         this.guideLeftMotor.NodeId = (byte)ParameterAccessor.Instance.TruckBus.GuideLeftMotorBusId;
         this.guideRightMotor.NodeId = (byte)ParameterAccessor.Instance.TruckBus.GuideRightMotorBusId;
         this.launchDigitalIo.NodeId = (byte)ParameterAccessor.Instance.TruckBus.LaunchDigitalIoBusId;
         this.launchAnalogIo.NodeId = (byte)ParameterAccessor.Instance.TruckBus.LaunchAnalogIoBusId;
         this.gps.NodeId = (byte)ParameterAccessor.Instance.TruckBus.GpsBusId;

         if (RobotApplications.repair == ParameterAccessor.Instance.RobotApplication)
         {
            this.frontPumpMotor.NodeId = (byte)ParameterAccessor.Instance.TruckBus.FrontPumpBusId;
            this.frontScaleRs232.NodeId = (byte)ParameterAccessor.Instance.TruckBus.FrontScaleRs232BusId;

            this.rearPumpMotor.NodeId = (byte)ParameterAccessor.Instance.TruckBus.RearPumpBusId;
            this.rearScaleRs232.NodeId = (byte)ParameterAccessor.Instance.TruckBus.RearScaleRs232BusId;
         }

         this.TraceMask = ParameterAccessor.Instance.TruckBus.ControllerTraceMask;
         this.reelMotor.TraceMask = ParameterAccessor.Instance.TruckBus.ReelMotorTraceMask;
         this.reelDigitalIo.TraceMask = ParameterAccessor.Instance.TruckBus.ReelDigitalTraceMask;
         this.reelAnalogIo.TraceMask = ParameterAccessor.Instance.TruckBus.ReelAnalogTraceMask;
         this.reelEncoder.TraceMask = ParameterAccessor.Instance.TruckBus.ReelEncoderTraceMask;
         this.feederTopFrontMotor.TraceMask = ParameterAccessor.Instance.TruckBus.FeederTopFrontMotorTraceMask;
         this.feederTopRearMotor.TraceMask = ParameterAccessor.Instance.TruckBus.FeederTopRearMotorTraceMask;
         this.feederBottomFrontMotor.TraceMask = ParameterAccessor.Instance.TruckBus.FeederBottomFrontMotorTraceMask;
         this.feederBottomRearMotor.TraceMask = ParameterAccessor.Instance.TruckBus.FeederBottomRearMotorTraceMask;
         this.feederEncoder.TraceMask = ParameterAccessor.Instance.TruckBus.FeederEncoderTraceMask;
         this.guideLeftMotor.TraceMask = ParameterAccessor.Instance.TruckBus.GuideLeftMotorTraceMask;
         this.guideRightMotor.TraceMask = ParameterAccessor.Instance.TruckBus.GuideRightMotorTraceMask;
         this.launchDigitalIo.TraceMask = ParameterAccessor.Instance.TruckBus.LaunchDigitalIoTraceMask;
         this.launchAnalogIo.TraceMask = ParameterAccessor.Instance.TruckBus.LaunchAnalogIoTraceMask;
         this.gps.TraceMask = ParameterAccessor.Instance.TruckBus.GpsTraceMask;

         if (RobotApplications.repair == ParameterAccessor.Instance.RobotApplication)
         {
            this.frontPumpMotor.TraceMask = ParameterAccessor.Instance.TruckBus.FrontPumpTraceMask;
            this.frontScaleRs232.TraceMask = ParameterAccessor.Instance.TruckBus.FrontScaleRs232TraceMask;

            this.rearPumpMotor.TraceMask = ParameterAccessor.Instance.TruckBus.RearPumpTraceMask;
            this.rearScaleRs232.TraceMask = ParameterAccessor.Instance.TruckBus.RearScaleRs232TraceMask;
         }


         this.InitializeReel();

         this.reelModeSetPoint = ReelModes.off;
         this.reelNonManualModeSetPoint = this.reelModeSetPoint;
         this.reelManualCurrentSetPoint = 0;
         this.reelTotalStart = 0;
         this.reelTripStart = 0;


         this.InitializeFeeder();

         this.feederModeSetPoint = FeederModes.off;
         this.feederVelocitySetPoint = 0;


         this.InitializeGuide();
         this.InitializeLaunchTube();
         this.InitializeGps();

         if (RobotApplications.repair == ParameterAccessor.Instance.RobotApplication)
         {
            this.InitializePumps();
            this.InitializeRs232Scales();
         }
      }
Exemple #3
0
      private void ProcessStarting()
      {
         string versionString = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
         this.VersionLabel.Text = versionString;

         ParameterAccessor.Instance.Read(Application.ExecutablePath);
         this.traceListener.SetDestination(ParameterAccessor.Instance.Trace.Address, ParameterAccessor.Instance.Trace.Port);
         Tracer.WriteHigh(TraceGroup.GUI, null, "starting");

         if (RobotApplications.repair == ParameterAccessor.Instance.RobotApplication)
         {
            this.TitleLabel.Text = "  CIRRIS XR";

            this.FrontSealantReserviorPanel.Visible = true;
            this.RearSealantReserviorPanel.Visible = true;

            this.DrillMainPanel.Visible = true;

            this.InspectionPanel.Top = this.DrillMainPanel.Top;
            this.InspectionPanel.Left = this.DrillMainPanel.Left;
            this.InspectionPanel.Visible = false;

            ParameterAccessor.Instance.FrontDrill.ExtendedDistance.OperationalValue = 0;
            ParameterAccessor.Instance.FrontDrill.RotationSpeed.OperationalValue = 0;
            ParameterAccessor.Instance.RearDrill.ExtendedDistance.OperationalValue = 0;
            ParameterAccessor.Instance.RearDrill.RotationSpeed.OperationalValue = 0;

            this.RobotCamera6Button.Visible = true;
            this.RobotCamera11Button.Visible = true;

            this.RobotCamera2Button.Text = "RFF DRILL";
            this.RobotCamera6Button.Text = "FFF DRILL";
            this.RobotCamera10Button.Text = "LOWER FORWARD";
            this.RobotCamera9Button.Text = "RRF DRILL";
            this.RobotCamera11Button.Text = "FRF DRILL";
            this.RobotCamera12Button.Text = "LOWER BACK";

            this.RobotCamera2Button.Camera = CameraLocations.robotRffDrill;
            this.RobotCamera6Button.Camera = CameraLocations.robotFffDrill;
            this.RobotCamera10Button.Camera = CameraLocations.robotLowerForward;
            this.RobotCamera9Button.Camera = CameraLocations.robotRrfDrill;
            this.RobotCamera11Button.Camera = CameraLocations.robotFrfDrill;
            this.RobotCamera12Button.Camera = CameraLocations.robotLowerBack;
         }

         if (RobotApplications.inspect == ParameterAccessor.Instance.RobotApplication)
         {
            this.TitleLabel.Text = "  CIRRIS XI";

            this.FrontSealantReserviorPanel.Visible = false;
            this.RearSealantReserviorPanel.Visible = false;

            this.DrillMainPanel.Visible = false;
            this.DrillManualPanel.Visible = false;
            this.SealantMainPanel.Visible = false;
            this.SealantManualPanel.Visible = false;

            this.BodyDrillButton.Text = "";
            this.BodyDrillButton.Enabled = false;

            this.InspectionPanel.Top = this.DrillMainPanel.Top;
            this.InspectionPanel.Left = this.DrillMainPanel.Left;
            this.InspectionPanel.Visible = true;

            this.RobotCamera6Button.Visible = false;
            this.RobotCamera11Button.Visible = false;

            this.RobotCamera2Button.Text = "LOWER BACK";
            this.RobotCamera10Button.Text = "LOWER FORWARD";
            this.RobotCamera9Button.Text = "SENSOR ARM";
            this.RobotCamera12Button.Text = "SENSOR BAY";

            this.RobotCamera2Button.Camera = CameraLocations.robotLowerBack;
            this.RobotCamera10Button.Camera = CameraLocations.robotLowerForward;
            this.RobotCamera9Button.Camera = CameraLocations.robotSensorArm;
            this.RobotCamera12Button.Camera = CameraLocations.robotSensorBay;
         }

         this.indicatorFlasher = false;

         this.feederFastSelected = true;
         this.feederPreviousRequest = 0;
         this.feederNonManualMode = FeederModes.off;
         this.FeederSpeedToggleButton.OptionASelected = this.feederFastSelected;
         this.FeederManualPanel.Visible = false;
         this.FeederManulDisplayButton.Text = "SHOW MANUAL";
         this.FeederSpeedToggleButton.Visible = true;
         this.FeederSpeedValueButton.ValueText = this.GetValueText(ParameterAccessor.Instance.FeederManualSpeed);
         this.UpdateFeederControls();

         this.ReelCalibrateToButton.ValueText = this.GetValueText(ParameterAccessor.Instance.ReelCalibrationDistance);
         this.ReelManualCalibrateToButton.ValueText = this.GetValueText(ParameterAccessor.Instance.ReelCalibrationDistance);
         this.ReelCalibrateToButton.Enabled = false;
         this.ReelShowManualButton.Enabled = true;
         this.ReelManualDirectionToggleButton.OptionASelected = true;
         this.ReelManualDirectionToggleButton.Enabled = true;
         this.ReelSetupButton.Enabled = true;
         this.ReelManualSetupButton.Enabled = true;
         this.ReelManualHideButton.Enabled = true;
         this.UpdateReelControls();

         this.ReelManualPanel.Visible = false;
         
         if (MovementForwardControls.current == ParameterAccessor.Instance.ReelMotionMode)
         {
            this.ReelManualValueTextPanel.ValueText = this.GetValueText(ParameterAccessor.Instance.ReelManualCurrent);
            this.ReelManualDirectionToggleButton.Text = "TORQUE DIRECTION";
            this.ReelValuePromptLabel.Text = "SET CURRENT";
         }
         else
         {
            this.ReelManualValueTextPanel.ValueText = this.GetValueText(ParameterAccessor.Instance.ReelManualSpeed);
            this.ReelManualDirectionToggleButton.Text = "SPEED DIRECTION";
            this.ReelValuePromptLabel.Text = "SET SPEED";
         }

         this.movementFastSelected = true;
         this.movementNonManualMode = MovementModes.off;
         this.movementNonManualForwardMode = MovementForwardModes.normalAxial;
         this.MotorManualJogDistanceValueButton.ValueText = this.GetValueText(ParameterAccessor.Instance.MovementMotorManualJogDistance);
         this.MotorManualMoveSpeedValueButton.ValueText = this.GetValueText(ParameterAccessor.Instance.MovementMotorManualMoveSpeed);
         this.MovementSpeedToggleButton.OptionASelected = this.movementFastSelected;
         this.MovementManulPanel.Visible = false;
         this.MovementManaulDisplayButton.Text = "SHOW MANUAL";
         this.MovementSpeedToggleButton.Visible = true;
         this.UpdateMovementControls();

         #region Drill/Sealant Controls

         if (RobotApplications.repair == ParameterAccessor.Instance.RobotApplication)
         {
            this.toolLocation = (false != ParameterAccessor.Instance.FrontToolSelected) ? ToolLocations.front : ToolLocations.rear;
            this.SetDrillSelection(this.toolLocation);
            this.DrillManulDisplayButton.Text = "SHOW MANUAL";
            this.DrillMainPanel.Visible = true;
            this.DrillManualPanel.Visible = false;
            this.drillManualVisible = false;
            this.drillManualActivated = false;

            NicBotComm.Instance.SetPumpSpeed(this.toolLocation, 0);
            this.SealantManulDisplayButton.Text = "SHOW MANUAL";
            this.SealantMainPanel.Visible = false;
            this.SealantManualPanel.Visible = false;
            this.pumpManualVisible = false;
            this.pumpManualActivated = false;
            this.SealantManualModeToggleButton.OptionASelected = false;

            this.DrillMainPanel.Focus();
         }

         #endregion

         #region Sensor Controls

         if (RobotApplications.inspect == ParameterAccessor.Instance.RobotApplication)
         {
            this.sensorThicknessPending = false;
            this.newThicknessReading = false;
            this.sensorStressPending = false;
            this.newStressReading = false;
            this.sensorDirection = Directions.north;

            double latitude = ParameterAccessor.Instance.Latitude;
            if (double.IsNaN(latitude) == false)
            {
               this.SensorLatitudeTextPanel.ValueText = latitude.ToString("N4");
            }
            else
            {
               this.SensorLatitudeTextPanel.ValueText = "---";
            }

            double longitude = ParameterAccessor.Instance.Longitude;
            if (double.IsNaN(longitude) == false)
            {
               this.SensorLongitudeTextPanel.ValueText = longitude.ToString("N4");
            }
            else
            {
               this.SensorLongitudeTextPanel.ValueText = "---";
            }

            this.SensorDirectionTextPanel.ValueText = this.sensorDirection.ToString().ToUpper();
            this.SensorDirectionTextPanel.BackColor = Color.FromArgb(51, 51, 51);
            this.SensorDirectionTextPanel.Enabled = true;

            this.SensorDisplacementTextPanel.ValueText = "---";
            this.SensorGpsDateTextPanel.ValueText = "---";
            this.SensorGpsTimeTextPanel.ValueText = "---";

            this.SensorThicknessAcquireButton.Enabled = true;
            this.SensorThicknessReadingTextPanel.ValueText = "";

            this.SensorStressAcquireButton.Enabled = true;
            this.SensorStressReadingTextPanel.ValueText = "";

            if (0 != ParameterAccessor.Instance.LocationServer.Port)
            {
               LocationServer.Instance.Start(ParameterAccessor.Instance.LocationServer.Address, ParameterAccessor.Instance.LocationServer.Port);
            }
         }

         #endregion

         #region Camera Controls 

         this.RobotCamera1Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera1Button.Camera);
         this.RobotCamera2Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera2Button.Camera);
         this.RobotCamera3Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera3Button.Camera);
         this.RobotCamera4Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera4Button.Camera);
         this.RobotCamera5Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera5Button.Camera);
         this.RobotCamera6Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera6Button.Camera);
         this.RobotCamera7Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera7Button.Camera);
         this.RobotCamera8Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera8Button.Camera);
         this.RobotCamera9Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera9Button.Camera);
         this.RobotCamera10Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera10Button.Camera);
         this.RobotCamera11Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera11Button.Camera);
         this.RobotCamera12Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.RobotCamera12Button.Camera);
         this.LaunchCamera1Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.LaunchCamera1Button.Camera);
         this.LaunchCamera2Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.LaunchCamera2Button.Camera);
         this.LaunchCamera3Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.LaunchCamera3Button.Camera);
         this.LaunchCamera4Button.CenterLevel = (int)ParameterAccessor.Instance.GetLightLevel(this.LaunchCamera4Button.Camera);

         this.ClearCameraSelects(this.RobotCamera1Button);
         this.ClearCameraSelects(this.RobotCamera2Button);
         this.ClearCameraSelects(this.RobotCamera3Button);
         this.ClearCameraSelects(this.RobotCamera4Button);
         this.ClearCameraSelects(this.RobotCamera5Button);
         this.ClearCameraSelects(this.RobotCamera6Button);
         this.ClearCameraSelects(this.RobotCamera7Button);
         this.ClearCameraSelects(this.RobotCamera8Button);
         this.ClearCameraSelects(this.RobotCamera9Button);
         this.ClearCameraSelects(this.RobotCamera10Button);
         this.ClearCameraSelects(this.RobotCamera11Button);
         this.ClearCameraSelects(this.RobotCamera12Button);
         this.ClearCameraSelects(this.LaunchCamera1Button);
         this.ClearCameraSelects(this.LaunchCamera2Button);
         this.ClearCameraSelects(this.LaunchCamera3Button);
         this.ClearCameraSelects(this.LaunchCamera4Button);

         this.cameraSelectMode = CameraSelectModes.none;
         this.UpdateCameraHoldEnable();
         this.UpdateCameraSelectorColor();

         this.selectedLaunchCameraButton = null;
         this.selectedRobotCameraAButton = null;
         this.selectedRobotCameraBButton = null;

         this.UpdateCameraHoldEnable();

         #endregion

         NicBotComm.Instance.Start();

         ParameterAccessor.Instance.FrontDrill.ExtendedDistance.OperationalValue = ParameterAccessor.Instance.FrontDrill.ExtendedDistance.MinimumValue; // todo remove
         ParameterAccessor.Instance.FrontDrill.RotationSpeed.OperationalValue = ParameterAccessor.Instance.FrontDrill.RotationSpeed.MinimumValue; // todo remove
         ParameterAccessor.Instance.RearDrill.ExtendedDistance.OperationalValue = ParameterAccessor.Instance.RearDrill.ExtendedDistance.MinimumValue; // todo remove
         ParameterAccessor.Instance.RearDrill.RotationSpeed.OperationalValue = ParameterAccessor.Instance.RearDrill.RotationSpeed.MinimumValue; // todo remove

         this.SystemStatusTextBox.Text = "starting";
         this.SystemStatusTextBox.BackColor = Color.Yellow;

         this.UpdateTimer.Interval = 100;
         this.Process = this.ProcessWaitComm;
      }
Exemple #4
0
      private void FeederManulDisplayButton_Click(object sender, EventArgs e)
      {
         if (false == this.FeederManualPanel.Visible)
         {
            this.feederNonManualMode = NicBotComm.Instance.GetFeederMode();

            this.FeederManualPanel.Left = this.FeederMainPanel.Left;
            this.FeederManualPanel.Top = this.GetAbsoluteTop(this.FeederOffButton);
            this.FeederManualPanel.Visible = true;

            this.FeederManulDisplayButton.Text = "HIDE MANUAL";
         }
         else
         {
            this.FeederManualPanel.Visible = false;
            this.FeederManulDisplayButton.Text = "SHOW MANUAL";

            if (this.GetAutomaticFeederTracking() != false)
            {
               MovementModes movementMode = NicBotComm.Instance.GetMovementMode();

               if (MovementModes.off == movementMode)
               {
                  NicBotComm.Instance.SetFeederMode(FeederModes.off);
               }
               else if (MovementModes.move == movementMode)
               {
                  NicBotComm.Instance.SetFeederMode(FeederModes.move);
               }
               else if (MovementModes.locked == movementMode)
               {
                  NicBotComm.Instance.SetFeederMode(FeederModes.locked);
               }
            }
         }

         this.UpdateFeederControls();
      }
Exemple #5
0
 public void SetFeederMode(FeederModes mode)
 {
    TruckCommBus.Instance.SetFeederMode(mode);
 }