コード例 #1
0
      private void AssignDefaults(RobotApplications robotApplication = RobotApplications.repair)
      {
         this.RobotApplication = robotApplication;

         this.TruckBus = new TruckBusParameters();
         this.TruckBus.BusInterface = BusInterfaces.PCIA;
         this.TruckBus.BitRate = 50000;
         this.TruckBus.ConsumerHeartbeatRate = 3000;
         this.TruckBus.ProducerHeartbeatRate = 1000;
         this.TruckBus.ControllerBusId = 80;
         this.TruckBus.ReelMotorBusId = 70;
         this.TruckBus.ReelDigitalBusId = 17;
         this.TruckBus.ReelAnalogBusId = 19;
         this.TruckBus.ReelEncoderBusId = 21;
         this.TruckBus.FeederTopFrontMotorBusId = 64;
         this.TruckBus.FeederTopRearMotorBusId = 65;
         this.TruckBus.FeederBottomFrontMotorBusId = 66;
         this.TruckBus.FeederBottomRearMotorBusId = 67;
         this.TruckBus.FeederEncoderBusId = 22;
         this.TruckBus.GuideLeftMotorBusId = 68;
         this.TruckBus.GuideRightMotorBusId = 69;
         this.TruckBus.LaunchDigitalIoBusId = 16;
         this.TruckBus.LaunchAnalogIoBusId = 18;
         this.TruckBus.GpsBusId = 20;
         this.TruckBus.FrontPumpBusId = 71;
         this.TruckBus.FrontScaleRs232BusId = 96;
         this.TruckBus.RearPumpBusId = 72;
         this.TruckBus.RearScaleRs232BusId = 97;

         this.TruckBus.ControllerTraceMask = 0;
         this.TruckBus.ReelMotorTraceMask = 1;
         this.TruckBus.ReelDigitalTraceMask = 1;
         this.TruckBus.ReelAnalogTraceMask = 1;
         this.TruckBus.ReelEncoderTraceMask = 1;
         this.TruckBus.FeederTopFrontMotorTraceMask = 1;
         this.TruckBus.FeederTopRearMotorTraceMask = 1;
         this.TruckBus.FeederBottomFrontMotorTraceMask = 1;
         this.TruckBus.FeederBottomRearMotorTraceMask = 1;
         this.TruckBus.FeederEncoderTraceMask = 1;
         this.TruckBus.GuideLeftMotorTraceMask = 1;
         this.TruckBus.GuideRightMotorTraceMask = 1;
         this.TruckBus.LaunchDigitalIoTraceMask = 1;
         this.TruckBus.LaunchAnalogIoTraceMask = 1;
         this.TruckBus.GpsTraceMask = 1;
         this.TruckBus.FrontPumpTraceMask = 1;
         this.TruckBus.FrontScaleRs232TraceMask = 1;
         this.TruckBus.RearPumpTraceMask = 1;
         this.TruckBus.RearScaleRs232TraceMask = 1;

         this.JoystickDeadband = 5000;
         this.Latitude = double.NaN;
         this.Longitude = double.NaN;

         this.RobotBus = new RobotBusParameters();
         this.RobotBus.BusInterface = BusInterfaces.PCIB;
         this.RobotBus.BitRate = 50000;
         this.RobotBus.ConsumerHeartbeatRate = 3000;
         this.RobotBus.ProducerHeartbeatRate = 1000;
         this.RobotBus.ControllerBusId = 80;
         this.RobotBus.RobotBodyBusId = 32;
         this.RobotBus.RobotTopFrontWheelBusId = 49;
         this.RobotBus.RobotTopRearWheelBusId = 50;
         this.RobotBus.RobotBottomFrontWheelBusId = 51;
         this.RobotBus.RobotBottomRearWheelBusId = 52;
         this.RobotBus.ControllerTraceMask = 0;
         this.RobotBus.RobotBodyTraceMask = 1;
         this.RobotBus.RobotTopFrontWheelTraceMask = 1;
         this.RobotBus.RobotTopRearWheelTraceMask = 1;
         this.RobotBus.RobotBottomFrontWheelTraceMask = 1;
         this.RobotBus.RobotBottomRearWheelTraceMask = 1;

         this.EnableRobotBus = true;

         this.FrontScale = new DigitalScaleParameters("FrontScale", 1, 9600);
         this.RearScale = new DigitalScaleParameters("RearScale", 2, 9600);

         this.Trace = new IpEndpointParameters("Trace", "127.0.0.1", 10000);
         this.LocationServer = new IpEndpointParameters("LocationServer", "0.0.0.0", 5050);
         
         this.ThicknessSensor = new IpEndpointParameters("ThicknessSensor", "192.168.1.101", 0);
         this.ThicknessConversionUnit = new ValueParameter("ThicknessConversionUnit", "mm", 3, 0, 100, 1, 1, 1);
         
         this.StressSensor = new IpEndpointParameters("StressSensor", "192.168.1.102", 0);
         this.StressConversionUnit = new ValueParameter("StressConversionUnit", "MPa", 3, 0, 100, 1, 1, 1);

         this.NitrogenPressureConversionUnit = new ValueParameter("NitrogenPressureConversionUnit", "PSI", 3, 0, 1000, 1, 100, 100);
         this.NitrogenPressureCaution = new CautionParameter("NitrogenPressureCaution", 450, 425, 375, 350);

         this.RobotTotalCurrentConversionUnit = new ValueParameter("RobotTotalCurrentConversionUnit", "A", 2, 0, 1000, 1, 100, 100);
         this.LaunchTotalCurrentConversionUnit = new ValueParameter("LaunchTotalCurrentConversionUnit", "A", 2, 0, 1000, 1, 100, 100);

         this.GuideExtensionSpeed = new ValueParameter("GuideExtensionSpeed", "RPM", 0, 1, 4500, 1, 1500, 1500);
         this.GuideRetractionSpeed = new ValueParameter("GuideRetractionSpeed", "RPM", 0, 1, 4500, 1, 1500, 1500);
         this.GuideMomentaryButtonAction = true;

         this.ReelDistance = new ValueParameter("ReelDistance", "m", 0, 0, 0, 0, 0, 0);
         this.ReelDistanceScale = new ValueParameter("ReelDistanceScale", "m", 6, 0, 1000, 0, 1, 1);
         this.ReelMotionMode = MovementForwardControls.current;
         this.ReelReverseCurrent = new ValueParameter("ReelReverseCurrent", "A", 1, 0.0, 6.5, 0.1, 5.0, 5.0);
         this.ReelLockCurrent = new ValueParameter("ReelLockCurrent", "A", 1, 0.0, 6.5, 0.1, 2.0, 2.0);
         this.ReelCalibrationDistance = new ValueParameter("ReelCalibrationDistance", "m", 0, 1, 100, 1, 1, 1);
         this.ReelManualCurrent = new ValueParameter("ReelManualCurrent", "A", 1, 0.0, 6.5, 0.1, 5.0, 5.0);
         this.ReelReverseSpeed = new ValueParameter("ReelReverseSpeed", "m/MIN", 1, 0.0, 40.0, 0.1, 20.0, 20.0);
         this.ReelManualSpeed = new ValueParameter("ReelManualSpeed", "m/MIN", 1, 0.0, 40.0, 0.1, 20, 20);
         this.ReelVelocityToRpm = (1000 / 40.0); // 40.0 m/MIN at 1000 RPM

         this.FeederAutomaticTracking = false;
         this.FeederVelocityToRpm = (4000 / 12.05992); // 12.05992 m/MIN at 4000 RPM
         this.FeederTrackingCalibration = new ValueParameter("FeederTrackingCalibration", "%", 1, -100, 100, 0.1, 50, 50);
         this.FeederMaxSpeed = new ValueParameter("FeederMaxSpeed", "m/MIN", 2, 0, 12.05992, 1, 12, 12);
         this.FeederLowSpeedScale = new ValueParameter("FeederLowSpeedScale", "%", 0, 1, 100, 1, 30, 30);
         this.FeederLockCurrent = new ValueParameter("FeederLockCurrent", "A", 1, 0.0, 6.5, 0.1, 2.0, 2.0);
         this.FeederCurrentPer1kRPM = new ValueParameter("FeederCurrentPer1kRPM", "A", 1, 0.1, 3.0, 0.1, 0.8, 0.8);
         this.FeederManualSpeed = new ValueParameter("FeederManualSpeed", "m/MIN", 2, 0, 12.05992, 1, 7, 7);
         this.FeederCurrentCaution = new CautionParameter("FeederCurrentCaution", 6.0, 5.0, 0.0, 0.0);

         this.TopFrontFeederMotor = new FeederMotorParameters();
         this.SetFeederMotorDefaults(ref this.TopFrontFeederMotor, "TopFront", false, false);

         this.TopRearFeederMotor = new FeederMotorParameters();
         this.SetFeederMotorDefaults(ref this.TopRearFeederMotor, "TopRear", false, false);

         this.BottomFrontFeederMotor = new FeederMotorParameters();
         this.SetFeederMotorDefaults(ref this.BottomFrontFeederMotor, "BottomFront", true, true);

         this.BottomRearFeederMotor = new FeederMotorParameters();
         this.SetFeederMotorDefaults(ref this.BottomRearFeederMotor, "BottomRear", true, true);


         this.MovementMotorLockCurrent = new ValueParameter("MovementMotorLockCurrent", "A", 1, 0.1, 3.0, 0.1, 1.0, 1.0);
         this.MovementMotorMaxCurrent = new ValueParameter("MovementMotorMaxCurrent", "A", 1, 0.1, 3.0, 0.1, 3.0, 3.0);
         this.MovementMotorMaxSpeed = new ValueParameter("MovementMotorMaxSpeed", "m/MIN", 2, 0, 10, 1, 3.5, 3.5);
         this.MovementMotorCurrentPer1kRPM = new ValueParameter("MovementMotorCurrentPer1kRPM", "A", 1, 0.1, 3.0, 0.1, 1.0, 1.0);
         this.MovementMotorLowSpeedScale = new ValueParameter("MovementMotorLowSpeedScale", "%", 0, 1, 100, 1, 30, 30);
         this.MovementMotorManualJogDistance = new ValueParameter("MovementMotorManualJogDistance", "mm", 0, 1, 100, 1, 1, 1);
         this.MovementMotorManualMoveSpeed = new ValueParameter("MovementMotorManualMoveSpeed", "m/MIN", 2, 0, 10, 1, 2, 2);
         this.MovementMotorVelocityToRpm = (40000.0/19.04); // 19.04m/MIN at 40000 RPM, (0.476mm/(motor revolution)

         this.TopFrontMovementMotor = new MovementMotorParameters();
         this.SetMovementMotorDefaults(ref this.TopFrontMovementMotor, "TopFront", MovementForwardControls.velocity, MovementForwardControls.velocity, MovementForwardControls.velocity, MovementForwardControls.current);

         this.TopRearMovementMotor = new MovementMotorParameters();
         this.SetMovementMotorDefaults(ref this.TopRearMovementMotor, "TopRear", MovementForwardControls.velocity, MovementForwardControls.velocity, MovementForwardControls.velocity, MovementForwardControls.current);

         this.BottomFrontMovementMotor = new MovementMotorParameters();
         this.SetMovementMotorDefaults(ref this.BottomFrontMovementMotor, "BottomFront", MovementForwardControls.velocity, MovementForwardControls.velocity, MovementForwardControls.current, MovementForwardControls.current);

         this.BottomRearMovementMotor = new MovementMotorParameters();
         this.SetMovementMotorDefaults(ref this.BottomRearMovementMotor, "BottomRear", MovementForwardControls.velocity, MovementForwardControls.velocity, MovementForwardControls.current, MovementForwardControls.current);

         this.MovementCurrentCaution = new CautionParameter("MovementCurrentCaution", 15.0, 10.0, 0.0, 0.0);
         this.MovementTemperatureCaution = new CautionParameter("MovementTemperatureCaution", 130.0, 100.0, 0.0, 0.0);

         this.FrontToolSelected = true;

         this.FrontDrill = new DrillParameters();
         this.SetDrillDefaults(ref this.FrontDrill, "Front");

         this.RearDrill = new DrillParameters();
         this.SetDrillDefaults(ref this.RearDrill, "Rear");


         this.FrontPump = new PumpParameters();
         this.SetPumpDefaults(ref this.FrontPump);

         this.RearPump = new PumpParameters();
         this.SetPumpDefaults(ref this.RearPump);


         this.Osd = new OsdParameters();
         this.SetOsdDefaults(ref this.Osd);


         this.robotLightLevels = new ValueParameter[12];
         for (int i = 0; i < this.robotLightLevels.Length; i++)
         {
            ValueParameter value = new ValueParameter();
            this.SetLightDefaults(ref value);
            value.Name = "RobotLightLevel_" + (i + 1).ToString();
            this.robotLightLevels[i] = value;
         }

         this.launchLightLevels = new ValueParameter[4];
         for (int i = 0; i < this.launchLightLevels.Length; i++)
         {
            ValueParameter value = new ValueParameter();
            this.SetLightDefaults(ref value);
            value.Name = "LaunchLightLevel_" + (i + 1).ToString();
            this.launchLightLevels[i] = value;
         }
      }
コード例 #2
0
      private void WriteDrillParameters(XmlWriter writer, DrillParameters drillParameters)
      {
         writer.WriteStartElement("Drill");

         this.WriteElement(writer, "Location", drillParameters.Location);

         this.WriteValueParameters(writer, drillParameters.Acceleration);
         this.WriteValueParameters(writer, drillParameters.ErrorLimit);
         this.WriteValueParameters(writer, drillParameters.ProportionalControlConstant);
         this.WriteValueParameters(writer, drillParameters.IntegralControlConstant);
         this.WriteValueParameters(writer, drillParameters.DerivativeControlConstant);

         this.WriteValueParameters(writer, drillParameters.RotationSpeed);
         this.WriteValueParameters(writer, drillParameters.SearchSpeed);
         this.WriteValueParameters(writer, drillParameters.TravelSpeed);
         this.WriteValueParameters(writer, drillParameters.CuttingSpeed);

         this.WriteElement(writer, "SpeedToVelocityCount", drillParameters.SpeedToVelocityCount);

         this.WriteElement(writer, "AutoOrign", drillParameters.AutoOrign);
         this.WriteElement(writer, "PeckMode", drillParameters.PeckMode);
         this.WriteElement(writer, "PositionRetract", drillParameters.PositionRetract);

         this.WriteValueParameters(writer, drillParameters.CuttingDepth);
         this.WriteValueParameters(writer, drillParameters.CuttingIncrement);
         this.WriteValueParameters(writer, drillParameters.RetractDistance);
         this.WriteValueParameters(writer, drillParameters.RetractPosition);

         this.WriteValueParameters(writer, drillParameters.ExtendedDistance);

         writer.WriteEndElement();
      }
コード例 #3
0
      private void ReadData(string filePath)
      {
         try
         {
            using (XmlReader reader = XmlReader.Create(filePath))
            {
               bool result = true;

               #region Drill Read
               {
                  for (; result;)
                  {
                     result = reader.Read();

                     if (reader.IsStartElement())
                     {
                        switch (reader.Name)
                        {
                           case "TruckBus":
                           {
                              TruckBusParameters truckBusParameters = this.ReadTruckBusParameters(reader);

                              if (null != truckBusParameters)
                              {
                                 this.TruckBus = truckBusParameters;
                              }

                              break;
                           }
                           case "RobotBus":
                           {
                              RobotBusParameters robotBusParameters = this.ReadRobotBusParameters(reader);

                              if (null != robotBusParameters)
                              {
                                 this.RobotBus = robotBusParameters;
                              }

                              break;
                           }
                           case "IpEndpoint":
                           {
                              IpEndpointParameters ipEndpointParameters = this.ReadIpEndpoint(reader);

                              if (null != ipEndpointParameters)
                              {
                                 switch (ipEndpointParameters.Name)
                                 {
                                    case "Trace":
                                    {
                                       this.Trace = ipEndpointParameters;
                                       break;
                                    }
                                    case "LocationServer":
                                    {
                                       this.LocationServer = ipEndpointParameters;
                                       break;
                                    }
                                    case "ThicknessSensor":
                                    {
                                       this.ThicknessSensor = ipEndpointParameters;
                                       break;
                                    }
                                    case "StressSensor":
                                    {
                                       this.StressSensor = ipEndpointParameters;
                                       break;
                                    }
                                 }
                              }

                              break;
                           }
                           case "DigitalScale":
                           {
                              DigitalScaleParameters digitalScaleParameters = this.ReadDigitalScaleParameters(reader);

                              if (null != digitalScaleParameters)
                              {
                                 switch (digitalScaleParameters.Location)
                                 {
                                    case "FrontScale":
                                    {
                                       this.FrontScale = digitalScaleParameters;
                                       break;
                                    }
                                    case "RearScale":
                                    {
                                       this.RearScale = digitalScaleParameters;
                                       break;
                                    }
                                 }
                              }

                              break;
                           }
                           case "Caution":
                           {
                              CautionParameter cautionParameter = this.ReadCautionParameters(reader);

                              if (null != cautionParameter)
                              {
                                 switch (cautionParameter.Name)
                                 {
                                    case "NitrogenPressureCaution":
                                    {
                                       this.NitrogenPressureCaution = cautionParameter;
                                       break;
                                    }
                                    case "FeederCurrentCaution":
                                    {
                                       this.FeederCurrentCaution = cautionParameter;
                                       break;
                                    }
                                    case "MovementCurrentCaution":
                                    {
                                       this.MovementCurrentCaution = cautionParameter;
                                       break;
                                    }
                                    case "MovementTemperatureCaution":
                                    {
                                       this.MovementTemperatureCaution = cautionParameter;
                                       break;
                                    }
                                 }
                              }

                              break;
                           }
                           case "Value":
                           {
                              ValueParameter valueParameter = this.ReadValueParameters(reader);

                              if (null != valueParameter)
                              {
                                 switch (valueParameter.Name)
                                 {
                                    case "ThicknessConversionUnit":
                                    {
                                       this.ThicknessConversionUnit = valueParameter;
                                       break;
                                    }
                                    case "StressConversionUnit":
                                    {
                                       this.StressConversionUnit = valueParameter;
                                       break;
                                    }
                                    case "NitrogenPressureConversionUnit":
                                    {
                                       this.NitrogenPressureConversionUnit = valueParameter;
                                       break;
                                    }
                                    case "RobotTotalCurrentConversionUnit":
                                    {
                                       this.RobotTotalCurrentConversionUnit = valueParameter;
                                       break;
                                    }
                                    case "LaunchTotalCurrentConversionUnit":
                                    {
                                       this.LaunchTotalCurrentConversionUnit = valueParameter;
                                       break;
                                    }
                                    case "GuideExtensionSpeed":
                                    {
                                       this.GuideExtensionSpeed = valueParameter;
                                       break;
                                    }
                                    case "GuideRetractionSpeed":
                                    {
                                       this.GuideRetractionSpeed = valueParameter;
                                       break;
                                    }
                                    case "ReelDistance":
                                    {
                                       this.ReelDistance = valueParameter;
                                       break;
                                    }
                                    case "ReelDistanceScale":
                                    {
                                       this.ReelDistanceScale = valueParameter;
                                       break;
                                    }
                                    case "ReelReverseCurrent":
                                    {
                                       this.ReelReverseCurrent = valueParameter;
                                       break;
                                    }
                                    case "ReelLockCurrent":
                                    {
                                       this.ReelLockCurrent = valueParameter;
                                       break;
                                    }
                                    case "ReelCalibrationDistance":
                                    {
                                       this.ReelCalibrationDistance = valueParameter;
                                       break;
                                    }
                                    case "ReelManualCurrent":
                                    {
                                       this.ReelManualCurrent = valueParameter;
                                       break;
                                    }
                                    case "ReelReverseSpeed":
                                    {
                                       this.ReelReverseSpeed = valueParameter;
                                       break;
                                    }
                                    case "ReelManualSpeed":
                                    {
                                       this.ReelManualSpeed = valueParameter;
                                       break;
                                    }                                       
                                    case "FeederTrackingCalibration":
                                    {
                                       this.FeederTrackingCalibration = valueParameter;
                                       break;
                                    }
                                    case "FeederMaxSpeed":
                                    {
                                       this.FeederMaxSpeed = valueParameter; 
                                       break;
                                    }
                                    case "FeederLowSpeedScale":
                                    {
                                       this.FeederLowSpeedScale = valueParameter;
                                       break;
                                    }
                                    case "FeederLockCurrent":
                                    {
                                       this.FeederLockCurrent = valueParameter; 
                                       break;
                                    }
                                    case "FeederCurrentPer1kRPM":
                                    {
                                       this.FeederCurrentPer1kRPM = valueParameter; 
                                       break;
                                    }
                                    case "FeederManualSpeed":
                                    {
                                       this.FeederManualSpeed = valueParameter;
                                       break;
                                    }
                                    case "MovementMotorLockCurrent":
                                    {
                                       this.MovementMotorLockCurrent = valueParameter;
                                       break;
                                    }
                                    case "MovementMotorMaxCurrent":
                                    {
                                       this.MovementMotorMaxCurrent = valueParameter;
                                       break;
                                    }
                                    case "MovementMotorMaxSpeed":
                                    {
                                       this.MovementMotorMaxSpeed = valueParameter;
                                       break;
                                    }
                                    case "MovementMotorCurrentPer1kRPM":
                                    {
                                       this.MovementMotorCurrentPer1kRPM = valueParameter;
                                       break;
                                    }
                                    case "MovementMotorLowSpeedScale":
                                    {
                                       this.MovementMotorLowSpeedScale = valueParameter;
                                       break;
                                    }
                                    case "MovementMotorManualJogDistance":
                                    {
                                       this.MovementMotorManualJogDistance = valueParameter;
                                       break;
                                    }
                                    case "MovementMotorManualMoveSpeed":
                                    {
                                       this.MovementMotorManualMoveSpeed = valueParameter;
                                       break;
                                    }
                                 }
                              }
                              
                              break;
                           }
                           case "RobotApplication":
                           {
                              this.RobotApplication = ReadRobotApplication(reader);
                              break;
                           }
                           case "EnableRobotBus":
                           {
                              this.EnableRobotBus = this.ReadBool(reader);
                              break;
                           }
                           case "JoystickDeadband":
                           {
                              this.JoystickDeadband = this.ReadInt(reader);
                              break;
                           }
                           case "Latitude":
                           {
                              this.Latitude = this.ReadDouble(reader);
                              break;
                           }
                           case "Longitude":
                           {
                              this.Longitude = this.ReadDouble(reader);
                              break;
                           }
                           case "GuideMomentaryButtonAction":
                           {
                              this.ReadElement(reader, ref this.GuideMomentaryButtonAction);
                              break;
                           }
                           case "ReelMotionMode":
                           {
                              this.ReelMotionMode = this.ReadMotorForwardControl(reader);
                              break;
                           }
                           case "ReelVelocityToRpm":
                           {
                              this.ReelVelocityToRpm = this.ReadDouble(reader);
                              break;
                           }
                           case "FeederAutomaticTracking":
                           {
                              this.ReadElement(reader, ref this.FeederAutomaticTracking);
                              break;
                           }
                           case "FeederVelocityToRpm":
                           {
                              this.FeederVelocityToRpm = this.ReadDouble(reader);
                              break;
                           }
                           case "FeederMotor":
                           {
                              FeederMotorParameters feederMotorParameters = this.ReadFeederMotorParameters(reader);

                              if (null != feederMotorParameters)
                              {
                                 switch (feederMotorParameters.Location)
                                 {
                                    case "TopFront":
                                    {
                                       this.TopFrontFeederMotor = feederMotorParameters;
                                       break;
                                    }
                                    case "TopRear":
                                    {
                                       this.TopRearFeederMotor = feederMotorParameters;
                                       break;
                                    }
                                    case "BottomFront":
                                    {
                                       this.BottomFrontFeederMotor = feederMotorParameters;
                                       break;
                                    }
                                    case "BottomRear":
                                    {
                                       this.BottomRearFeederMotor = feederMotorParameters;
                                       break;
                                    }
                                 }
                              }

                              break;
                           }
                           case "MovementMotor":
                           {
                              MovementMotorParameters movementMotorParameters = this.ReadMovementMotorParameters(reader);

                              if (null != movementMotorParameters)
                              {
                                 switch (movementMotorParameters.Location)
                                 {
                                    case "TopFront":
                                    {
                                       this.TopFrontMovementMotor = movementMotorParameters;
                                       break;
                                    }
                                    case "TopRear":
                                    {
                                       this.TopRearMovementMotor = movementMotorParameters;
                                       break;
                                    }
                                    case "BottomFront":
                                    {
                                       this.BottomFrontMovementMotor = movementMotorParameters;
                                       break;
                                    }
                                    case "BottomRear":
                                    {
                                       this.BottomRearMovementMotor = movementMotorParameters;
                                       break;
                                    }
                                 }
                              }

                              break;
                           }
                           case "MovementMotorVelocityToRpm":
                           {
                              this.MovementMotorVelocityToRpm = this.ReadDouble(reader);
                              break;
                           }
                           case "FrontToolSelected":
                           {
                              this.FrontToolSelected = this.ReadBool(reader);
                              break;
                           }
                           case "Drill":
                           {
                              DrillParameters drillParameters = this.ReadDrillParameters(reader);

                              if (null != drillParameters)
                              {
                                 switch (drillParameters.Location)
                                 {
                                    case "Front":
                                    {
                                       this.FrontDrill = drillParameters;
                                       break;
                                    }
                                    case "Rear":
                                    {
                                       this.RearDrill = drillParameters;
                                       break;
                                    }
                                 }
                              }

                              break;
                           }
                           case "Pump":
                           {
                              PumpParameters pumpParameters = this.ReadPumpParameters(reader);

                              if (null != pumpParameters)
                              {
                                 switch (pumpParameters.Location)
                                 {
                                    case "Front":
                                    {
                                       this.FrontPump = pumpParameters;
                                       break;
                                    }
                                    case "Rear":
                                    {
                                       this.RearPump = pumpParameters;
                                       break;
                                    }
                                 }
                              }
                              
                              break;
                           }
                           case "Osd":
                           {
                              OsdParameters osdParameters = this.ReadOsdParameters(reader);

                              if (null != osdParameters)
                              {
                                 this.Osd = osdParameters;
                              }
                              
                              break;
                           }
                           case "Lights":
                           {
                              this.ReadLightParameters(reader);
                              break;
                           }
                        }
                     }
                     else
                     {
#if false
                        switch (reader.Name)
                        {
                           case "Drills":
                           {
                              break;
                           }
                           case "Drill":
                           {
                              break;
                           }
                        }
#endif
                     }
                  }
               }
               #endregion

               reader.Close();
               reader.Dispose();
            }
         }
         catch { }
      }
コード例 #4
0
      private DrillParameters ReadDrillParameters(XmlReader reader)
      {
         DrillParameters result = new DrillParameters();
         bool readResult = true;

         this.SetDrillDefaults(ref result, "");
        
         for (; readResult; )
         {
            readResult = reader.Read();

            if (reader.IsStartElement())
            {
               switch (reader.Name)
               {
                  case "Location":
                  {
                     result.Location = this.ReadString(reader);
                     break;
                  }
                  case "AutoOrign":
                  {
                     result.AutoOrign = this.ReadBool(reader);
                     break;
                  }
                  case "PeckMode":
                  {
                     result.PeckMode = this.ReadBool(reader);
                     break;
                  }
                  case "PositionRetract":
                  {
                     result.PositionRetract = this.ReadBool(reader);
                     break;
                  }
                  case "SpeedToVelocityCount":
                  {
                     result.SpeedToVelocityCount = this.ReadDouble(reader);
                     break;
                  }
                  case "Value":
                  {
                     ValueParameter valueParameters = this.ReadValueParameters(reader);

                     if (null != valueParameters)
                     {
                        switch (valueParameters.Name)
                        {
                           case "Acceleration":
                           {
                              result.Acceleration = valueParameters;
                              break;
                           }
                           case "ErrorLimit":
                           {
                              result.ErrorLimit = valueParameters;
                              break;
                           }
                           case "ProportionalControlConstant":
                           {
                              result.ProportionalControlConstant = valueParameters;
                              break;
                           }
                           case "IntegralControlConstant":
                           {
                              result.IntegralControlConstant = valueParameters;
                              break;
                           }
                           case "DerivativeControlConstant":
                           {
                              result.DerivativeControlConstant = valueParameters;
                              break;
                           }
                           case "RotationSpeed":
                           {
                              result.RotationSpeed = valueParameters;
                              break;
                           }
                           case "SearchSpeed":
                           {
                              result.SearchSpeed = valueParameters;
                              break;
                           }
                           case "TravelSpeed":
                           {
                              result.TravelSpeed = valueParameters;
                              break;
                           }
                           case "CuttingSpeed":
                           {
                              result.CuttingSpeed = valueParameters;
                              break;
                           }
                           case "CuttingDepth":
                           {
                              result.CuttingDepth = valueParameters;
                              break;
                           }
                           case "CuttingIncrement":
                           {
                              result.CuttingIncrement = valueParameters;
                              break;
                           }
                           case "RetractDistance":
                           {
                              result.RetractDistance = valueParameters;
                              break;
                           }
                           case "RetractPosition":
                           {
                              result.RetractPosition = valueParameters;
                              break;
                           }
                           case "ExtendedDistance":
                           {
                              result.ExtendedDistance = valueParameters;
                              break;
                           }
                        }
                     }

                     break;
                  }
               }
            }
            else
            {
               if ("Drill" == reader.Name)
               {
                  break;
               }
            }
         }

         return (result);
      }
コード例 #5
0
      private void SetDrillDefaults(ref DrillParameters drillParameters, string location)
      {
         drillParameters.Location = location;

         drillParameters.Acceleration = new ValueParameter("Acceleration", "", 0, 0, 4294967295, 100, 2560, 2560);
         drillParameters.ErrorLimit = new ValueParameter("ErrorLimit", "", 0, 0, 65535, 1, 3000, 3000);
         drillParameters.ProportionalControlConstant = new ValueParameter("ProportionalControlConstant", "", 0, 0, 4294967295, 1, 0, 0);
         drillParameters.IntegralControlConstant = new ValueParameter("IntegralControlConstant", "", 0, 0, 4294967295, 1, 0, 0);
         drillParameters.DerivativeControlConstant = new ValueParameter("DerivativeControlConstant", "", 0, 0, 4294967295, 1, 0, 0);

         drillParameters.RotationSpeed = new ValueParameter("RotationSpeed", "RPM", 0, 0, 5500, 100, 0, 0);
         drillParameters.SearchSpeed = new ValueParameter("SearchSpeed", "mm/MIN", 1, 1, 190.5, 1, 30, 30);
         drillParameters.TravelSpeed = new ValueParameter("TravelSpeed", "mm/MIN", 1, 1, 190.5, 1, 60, 60); ;
         drillParameters.CuttingSpeed = new ValueParameter("CuttingSpeed", "mm/MIN", 1, 1, 190.5, 1, 15, 15); ;

         drillParameters.SpeedToVelocityCount = 32176;
       
         drillParameters.AutoOrign = false;
         drillParameters.PeckMode = false;
         drillParameters.PositionRetract = false;

         drillParameters.CuttingDepth = new ValueParameter("CuttingDepth", "mm", 1, 1, 63.5, 0.1, 18, 18); ;
         drillParameters.CuttingIncrement = new ValueParameter("CuttingIncrement", "mm", 1, 1, 63.5, 1, 2, 2); ;
         drillParameters.RetractDistance = new ValueParameter("RetractDistance", "mm", 1, 1, 63.5, 0.1, 5, 5); ;
         drillParameters.RetractPosition = new ValueParameter("RetractPosition", "mm", 1, 1, 63.5, 0.1, 0, 0); ;

         drillParameters.ExtendedDistance = new ValueParameter("ExtendedDistance", "mm", 1, 0, 63.5, 0.1, 0, 0); ;
      }
コード例 #6
0
      private void DrillAutoSetupForm_Shown(object sender, EventArgs e)
      {
         if (null == this.FrontDrillParameters)
         {
            this.FrontDrillParameters = new DrillParameters();
         }

         if (null == this.RearDrillParameters)
         {
            this.RearDrillParameters = new DrillParameters();
         }

         if (ToolLocations.front == this.DrillLocation)
         {
            this.selectedDrill = this.FrontDrillParameters;
         }
         else
         {
            this.selectedDrill = this.RearDrillParameters;
         }

         this.SetTitleText();
         this.DrillSelectToggleButton.OptionASelected = (ToolLocations.front == this.DrillLocation);
      }
コード例 #7
0
ファイル: MainForm.cs プロジェクト: OakdaleDaddy/ULC-build
      private void SetDrillSelection(ToolLocations location)
      {
         if (ToolLocations.front == location)
         {
            this.selectedDrill = ParameterAccessor.Instance.FrontDrill;
         }
         else
         {
            this.selectedDrill = ParameterAccessor.Instance.RearDrill;
         }

         this.DrillSelectionLabel.Text = (ToolLocations.front == location) ? "FRONT DRILL SELECTED" : "REAR DRILL SELECTED";

         if (false != this.selectedDrill.PeckMode)
         {
            this.DrillModeLabel.Text = "PECK";
            this.DrillModeLabel.Font = new Font(this.DrillModeLabel.Font.Name, 12f, this.DrillModeLabel.Font.Style);
         }
         else
         {
            this.DrillModeLabel.Text = "CONTINUOUS";
            this.DrillModeLabel.Font = new Font(this.DrillModeLabel.Font.Name, 8.25f, this.DrillModeLabel.Font.Style);
         }

         this.DrillLaserLightButton.OptionASelected = NicBotComm.Instance.GetLaserSight(location);

         //this.DrillExtendedSetPointValuePanel.ValueText = this.GetValueText(this.selectedDrill.ExtendedDistance);
         this.DrillRotaionSetPointSpeedValuePanel.ValueText = this.GetValueText(this.selectedDrill.RotationSpeed);
      }