コード例 #1
0
      public MovementForwardControls GetMovementForwardControl(MovementMotorParameters parameters, MovementForwardModes mode)
      {
         MovementForwardControls result = MovementForwardControls.velocity;

         if (MovementForwardModes.normalAxial == mode)
         {
            result = parameters.AxialMode;
         }
         else if (MovementForwardModes.circumferential == mode)
         {
            result = parameters.CircumferentialMode;
         }
         else if (MovementForwardModes.cornerAxial == mode)
         {
            result = parameters.CornerAxialMode;
         }
         else if (MovementForwardModes.launchAxial == mode)
         {
            result = parameters.LaunchAxialMode;
         }

         return (result);
      }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: OakdaleDaddy/ULC-build
      private void MovementManaulDisplayButton_Click(object sender, EventArgs e)
      {
         this.movementNonManualMode = NicBotComm.Instance.GetMovementMode();
         this.movementNonManualForwardMode = NicBotComm.Instance.GetMovementForwardMode();

         if (MovementForwardModes.normalAxial == this.movementNonManualForwardMode)
         {
            NicBotComm.Instance.SetMovementForwardMode(MovementForwardModes.normalAxial);
         }
         else
         {
            NicBotComm.Instance.SetMovementForwardMode(MovementForwardModes.circumferential);
         }

         NicBotComm.Instance.SetMovementMode(MovementModes.move);
            
         this.MovementManulPanel.Left = this.MovementMainPanel.Left;
         this.MovementManulPanel.Top = this.GetAbsoluteTop(this.MovementOffButton);
         this.MovementManulPanel.Visible = true;

         this.UpdateMovementControls();
      }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: OakdaleDaddy/ULC-build
      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;
      }
コード例 #4
0
      public void SetMovementForwardMode(MovementForwardModes mode)
      {
         if (mode == MovementForwardModes.circumferential)
         {
            this.movementWheelModeChangeRequest = MovementWheelModes.circumferential;
         }
         else
         {
            this.movementWheelModeChangeRequest = MovementWheelModes.axial;
         }

         this.movementForwardMode = mode;
      }
コード例 #5
0
      private void InitializeValues()
      {
         this.busReady = false;
         this.busStatus = null;
         this.busReceiveQueue.Clear();
         this.deviceResetQueue.Clear();

         this.robotBody.NodeId = (byte)ParameterAccessor.Instance.RobotBus.RobotBodyBusId;
         this.robotTopFrontWheel.NodeId = (byte)ParameterAccessor.Instance.RobotBus.RobotTopFrontWheelBusId;
         this.robotTopRearWheel.NodeId = (byte)ParameterAccessor.Instance.RobotBus.RobotTopRearWheelBusId;
         this.robotBottomFrontWheel.NodeId = (byte)ParameterAccessor.Instance.RobotBus.RobotBottomFrontWheelBusId;
         this.robotBottomRearWheel.NodeId = (byte)ParameterAccessor.Instance.RobotBus.RobotBottomRearWheelBusId;

         this.TraceMask = ParameterAccessor.Instance.RobotBus.ControllerTraceMask;
         this.robotBody.TraceMask = ParameterAccessor.Instance.RobotBus.RobotBodyTraceMask;
         this.robotTopFrontWheel.TraceMask = ParameterAccessor.Instance.RobotBus.RobotTopFrontWheelTraceMask;
         this.robotTopRearWheel.TraceMask = ParameterAccessor.Instance.RobotBus.RobotTopRearWheelTraceMask;
         this.robotBottomFrontWheel.TraceMask = ParameterAccessor.Instance.RobotBus.RobotBottomFrontWheelTraceMask;
         this.robotBottomRearWheel.TraceMask = ParameterAccessor.Instance.RobotBus.RobotBottomRearWheelTraceMask;

         this.InitializeRobotBody();

         this.movementMode = MovementModes.off;
         this.movementForwardMode = MovementForwardModes.normalAxial;
         this.movementWheelModeChangeRequest = MovementWheelModes.neither;
         this.movementWheelModeActual = MovementWheelModes.neither;
         this.movementTopFrontWheelStatus.Initialize();
         this.movementTopRearWheelStatus.Initialize();
         this.movementBottomFrontWheelStatus.Initialize();
         this.movementBottomRearWheelStatus.Initialize();

         this.drillFrontRotationSetPoint = 0;
         this.drillRearRotationSetPoint = 0;
         this.drillFrontIndexSetPoint = 0;
         this.drillRearIndexSetPoint = 0;
         this.drillFrontLaserSetPoint = false;
         this.drillRearLaserSetPoint = false;

         this.cameraA = CameraLocations.robotFrontUpperBack;
         this.cameraB = CameraLocations.robotLowerBack;
         this.videoASetPoint = 0;
         this.videoBSetPoint = 0;

         for (int i = 0; i < this.cameraLightLevelSetPoints.Length; i++)
         {
            this.cameraLightLevelSetPoints[i] = 0;
         }
      }
コード例 #6
0
ファイル: NicBotComm.cs プロジェクト: OakdaleDaddy/ULC-build
 public void SetMovementForwardMode(MovementForwardModes mode)
 {
    RobotCommBus.Instance.SetMovementForwardMode(mode);
 }