Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
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();
     //立即更新到服务器
 }