public AbstractWheel(int size, bool isWide)
 {
     this._size   = size;
     this._isWide = isWide;
     _spokes      = new Spokes();
     _bearings    = new Bearings();
 }
示例#2
0
 public AbstractWheel(int size, bool isWide)
 {
     this._size   = size;
     this._IsWide = isWide;
     _spokes      = new Spokes();   //added new 3-5-19 Visitor Design Pattern
     _bearings    = new Bearings(); //added new 3-5-19  Visitor Design Pattern
 }
示例#3
0
        public void AddBearing(string data)
        {
            Type   Type        = enumChecker(data.Substring(18, 4));
            double Width       = Convert.ToDouble(data.Substring(25, 5));
            double XCoord      = Convert.ToDouble(data.Substring(39, 6));
            double YCoord      = Convert.ToDouble(data.Substring(51, 6));
            int    BearingType = Convert.ToInt32(data.Substring(64, 2));
            string WallSpecies = data.Substring(73);

            Bearings.Add(new Bearing(jointCount, Width, XCoord, YCoord, BearingType, WallSpecies));
            AddJointToBearing(data);
        }
    public override void Setup()
    {
        m_Bearings = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>().bearings;
        m_Bearings.EnableXYZVelocityParticles = true;

        m_Graph = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>().graphVector3;
        if (m_Graph != null)
        {
            m_Graph.gameObject.SetActive(true);
            m_Graph.SetActive(DeviceUnderTest, FeatureUsageUnderTest.As <Vector3>(), 0.2f);
        }
    }
示例#5
0
    public override void Setup()
    {
        DeviceTestManager TestManager = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>();

        // Set up visualizer
        m_Visualizer = Object.Instantiate(TestManager.TrackedDeviceVisualizerPointerPrefab);
        m_Visualizer.transform.SetParent(TestManager.XRRig.transform);
        TrackedDevice Device = m_Visualizer.GetComponent <TrackedDevice>();

        Device.device = DeviceUnderTest;
        //Device.rotationUsage = FeatureUsageUnderTest.As<Quaternion>();

        m_Visualizer.transform.localPosition = Vector3.forward;

        Quaternion checkIfRotationIsPresent;

        if (DeviceUnderTest.TryGetFeatureValue(CommonUsages.deviceRotation, out checkIfRotationIsPresent))
        {
            Device.rotationUsage = CommonUsages.deviceRotation;
        }
        else if (DeviceUnderTest.TryGetFeatureValue(CommonUsages.colorCameraRotation, out checkIfRotationIsPresent))
        {
            Device.rotationUsage = CommonUsages.colorCameraRotation;
        }
        Vector3 checkIfPositionIsPresent;

        if (DeviceUnderTest.TryGetFeatureValue(CommonUsages.devicePosition, out checkIfPositionIsPresent))
        {
            Device.positionUsage = CommonUsages.devicePosition;
        }
        else if (DeviceUnderTest.TryGetFeatureValue(CommonUsages.colorCameraPosition, out checkIfPositionIsPresent))
        {
            Device.positionUsage = CommonUsages.colorCameraPosition;
        }

        // Set up bearings
        m_Bearings = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>().bearings;
        if (m_Bearings != null)
        {
            m_Bearings.EnableAngularAcceleration(DeviceUnderTest, FeatureUsageUnderTest.As <Vector3>());
        }

        m_Graph = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>().graphVector3;
        if (m_Graph != null)
        {
            m_Graph.gameObject.SetActive(true);
            m_Graph.SetActive(DeviceUnderTest, FeatureUsageUnderTest.As <Vector3>(), 10f);
        }
    }
示例#6
0
        public void UpdateInfo(ScannedRobotEvent evnt, Coordinates robotPostion, double robotHeadings)
        {
            Bearings.AddNew(evnt.BearingRadians);
            Distance.AddNew(evnt.Distance);
            Energy.AddNew(evnt.Energy);
            Heading.AddNew(evnt.HeadingRadians);
            Velocity.AddNew(evnt.Velocity);
            Time.AddNew(evnt.Time);

            OriginAngle.AddNew(Utils.NormalRelativeAngle(robotHeadings + Bearings.GetCurrent()));

            double y = Distance.GetCurrent() * Math.Cos(OriginAngle.GetCurrent());
            double x = Distance.GetCurrent() * Math.Sin(OriginAngle.GetCurrent());

            Position.AddNew(robotPostion + new Coordinates(x, y));
        }
示例#7
0
        public void AddBearing(string data)
        {
            int    BearingNumber           = Convert.ToInt32(data.Substring(6, 2));
            double VerticalReactionNumber  = Convert.ToDouble(data.Substring(16, 8));
            double VerticalAllowableNumber = Convert.ToDouble(data.Substring(26, 9));
            double HorizontalNumber        = Convert.ToDouble(data.Substring(37, 13));
            double MomentNumber            = Convert.ToDouble(data.Substring(52, 5));
            double?XLocation = null;
            double?YLocation = null;

            //this conditional is because in some cases, X and Y Location don't appear
            //should ask Nathan about this
            if (data.Count() > 58)
            {
                XLocation = Convert.ToDouble(data.Substring(65, 9));
                YLocation = Convert.ToDouble(data.Substring(76));
            }
            Bearings.Add(new BearingCase(BearingNumber, VerticalReactionNumber, VerticalAllowableNumber, HorizontalNumber, MomentNumber, XLocation, YLocation));
        }
示例#8
0
 public Position(int x, int y, Bearings bearing)
 {
     X       = x;
     Y       = y;
     Bearing = bearing;
 }
示例#9
0
 public override void Setup()
 {
     m_Bearings = GameObject.FindGameObjectWithTag("Facilitator").GetComponent <DeviceTestManager>().bearings;
     m_Bearings.EnableAngularVelocityOrbit(DeviceUnderTest, FeatureUsageUnderTest.As <Vector3>());
 }
示例#10
0
 public void Visit(Bearings bearings)
 {
     _bearingCount++;
 }
示例#11
0
 //替换模板轴承部分参数
 private void ReplaceBearings(Bearings bearings)
 {
     _content = _content.Replace("<param>BearingAxialStiffness</param>", bearings.AxisalStiffness.ToString());
     _content = _content.Replace("<param>BearingStartingMoment</param>", bearings.StartingMoment.ToString());
 }
 public LightCycle(Spiral spiral, Direction leaveOriginDirection = null, Rotation rotation = Rotation.Right)
 {
     Spiral = spiral;
     Bearings = new Bearings(leaveOriginDirection ?? Direction.RIGHT, spiral.Origin);
     NextValue = 0;
     Rotation = rotation;
 }
示例#13
0
 //替换模板轴承部分参数
 public void ReplaceBearings(Bearings bearings)
 {
     content = content.Replace("<param>BearingAxialStiffness</param>", bearings.AxisalStiffness.ToString());
     content = content.Replace("<param>BearingStartingMoment</param>", bearings.StartingMoment.ToString());
 }
示例#14
0
        private async void Delete(object value)
        {
#if XBAP
            MessageBoxResult result = MessageBox.Show("确定要删除?", "删除", MessageBoxButton.OK, MessageBoxImage.Warning);
#else
            MessageBoxResult result = Xceed.Wpf.Toolkit.MessageBox.Show("确定要删除?", "删除", MessageBoxButton.OKCancel, MessageBoxImage.Warning);
#endif
            if (result == MessageBoxResult.OK)
            {
                if (DevicesIsSelected == true)
                {
                    T_DeviceDiagnose t_model = DeviceDiagnoseClass.ConvertToDB(SelectedDevice);
                    if (t_model.id != -1)
                    {
                        await _databaseComponent.Delete <T_DeviceDiagnose>(ServerIP, t_model.id);
                    }
                    Devices.Remove(SelectedDevice);
                }
                else if (ShaftsIsSelected == true)
                {
                    T_Shaft t_model = ShaftClass.ConvertToDB(SelectedShaft);
                    if (t_model.id != -1)
                    {
                        await _databaseComponent.Delete <T_Shaft>(ServerIP, t_model.id);
                    }
                    Shafts.Remove(SelectedShaft);
                }
                else if (BearingsIsSelected == true)
                {
                    T_Bearing t_model = BearingClass.ConvertToDB(SelectedBearing);
                    if (t_model.id != -1)
                    {
                        await _databaseComponent.Delete <T_Bearing>(ServerIP, t_model.id);
                    }
                    Bearings.Remove(SelectedBearing);
                }
                else if (BeltsIsSelected == true)
                {
                    Belts.Remove(SelectedBelt);
                    T_Belt t_model = BeltClass.ConvertToDB(SelectedBelt);
                    if (t_model.id != -1)
                    {
                        await _databaseComponent.Delete <T_Belt>(ServerIP, t_model.id);
                    }
                }
                else if (GearsIsSelected == true)
                {
                    T_Gear t_model = GearClass.ConvertToDB(SelectedGear);
                    if (t_model.id != -1)
                    {
                        await _databaseComponent.Delete <T_Gear>(ServerIP, t_model.id);
                    }
                    Gears.Remove(SelectedGear);
                }
                else if (ImpellersIsSelected == true)
                {
                    T_Impeller t_model = ImpellerClass.ConvertToDB(SelectedImpeller);
                    if (t_model.id != -1)
                    {
                        await _databaseComponent.Delete <T_Impeller>(ServerIP, t_model.id);
                    }
                    Impellers.Remove(SelectedImpeller);
                }
                else if (MotorsIsSelected == true)
                {
                    T_Motor t_model = MotorClass.ConvertToDB(SelectedMotor);
                    if (t_model.id != -1)
                    {
                        await _databaseComponent.Delete <T_Motor>(ServerIP, t_model.id);
                    }
                    Motors.Remove(SelectedMotor);
                }
            }
        }
示例#15
0
 private void Add(object value)
 {
     if (DevicesIsSelected == true)
     {
         SelectedDevice = new DeviceDiagnoseClass()
         {
             Name = "新建设备"
         };
         Devices.Add(SelectedDevice);
     }
     else if (ShaftsIsSelected == true)
     {
         SelectedShaft = new ShaftClass()
         {
             Name = "新建轴"
         };
         Shafts.Add(SelectedShaft);
     }
     else if (BearingsIsSelected == true)
     {
         SelectedBearing = new BearingClass()
         {
             Name = "新建轴承"
         };
         Bearings.Add(SelectedBearing);
     }
     else if (BeltsIsSelected == true)
     {
         SelectedBelt = new BeltClass()
         {
             Name = "新建皮带"
         };
         Belts.Add(SelectedBelt);
     }
     else if (GearsIsSelected == true)
     {
         SelectedGear = new GearClass()
         {
             Name = "新建齿轮"
         };
         Gears.Add(SelectedGear);
     }
     else if (ImpellersIsSelected == true)
     {
         SelectedImpeller = new ImpellerClass()
         {
             Name = "新建叶轮"
         };
         Impellers.Add(SelectedImpeller);
     }
     else if (MotorsIsSelected == true)
     {
         SelectedMotor = new MotorClass()
         {
             Name = "新建电机"
         };
         Motors.Add(SelectedMotor);
     }
     ShowWin();
     //立即更新到服务器
 }
示例#16
0
 //替换模板轴承部分参数
 public void ReplaceBearings(Bearings bearings)
 {
     content = content.Replace("<param>BearingAxialStiffness</param>", bearings.AxisalStiffness.ToString());
     content = content.Replace("<param>BearingStartingMoment</param>", bearings.StartingMoment.ToString());
 }