Stiffness() public method

public Stiffness ( double personMassInKg, double extraMass ) : double
personMassInKg double
extraMass double
return double
Ejemplo n.º 1
0
    protected override string [] getLineToStore(System.Object myObject)
    {
        Jump newJump = (Jump)myObject;

        string title = newJump.Type;

        if (newJump.Simulated == Constants.Simulated)
        {
            title += Constants.SimulatedTreeview;
        }

        string [] myData = new String [getColsNum()];
        int       count  = 0;

        //myData[count++] = newJump.Type;
        myData[count++] = title;
        myData[count++] = Util.TrimDecimals(newJump.Tc.ToString(), pDN);
        myData[count++] = Util.TrimDecimals(newJump.Tv.ToString(), pDN);

        //we calculate weightInKg again because can be changed in edit jump, and then treeview is no re-done
        //but we do not calculate again person weight, because if it changes treeview is created again
        //
        //Also this is needed on Add (where personWeight is passed using PersonWeight, but not weightInKg)
        weightInKg = Util.WeightFromPercentToKg(
            Convert.ToDouble(newJump.Weight.ToString()),
            personWeight);

        if (preferences.weightStatsPercent)
        {
            myData[count++] = Util.TrimDecimals(newJump.Weight.ToString(), pDN);
        }
        else
        {
            myData[count++] = Util.TrimDecimals(weightInKg.ToString(), pDN);
        }

        myData[count++] = Util.TrimDecimals(newJump.Fall.ToString(), pDN);
        myData[count++] = Util.TrimDecimals(Util.GetHeightInCentimeters(newJump.Tv.ToString()), pDN);



        if (preferences.showPower)
        {
            //takeoff has no tv. power should not be calculated
            //calculate jumps with tf
            if (newJump.Tv > 0)
            {
                if (newJump.Tc > 0)                     //if it's Dj (has tf, and tc)
                {
                    myData[count++] = Util.TrimDecimals(
                        Util.GetDjPower(newJump.Tc, newJump.Tv, (personWeight + weightInKg), newJump.Fall).ToString(), 1);
                }
                else                                    //it's a normal jump without tc
                {
                    myData[count++] = Util.TrimDecimals(
                        Util.GetPower(newJump.Tv, personWeight, weightInKg).ToString(), 1);
                }
            }
            else
            {
                myData[count++] = "0";
            }
        }
        if (preferences.showStiffness)
        {
            myData[count++] = Convert.ToInt32(newJump.Stiffness(personWeight, weightInKg)).ToString();
        }
        if (preferences.showInitialSpeed)
        {
            myData[count++] = Util.TrimDecimals(Util.GetInitialSpeed(newJump.Tv.ToString(), preferences.metersSecondsPreferred), pDN);
        }
        if (preferences.showAngle)
        {
            myData[count++] = Util.TrimDecimals(newJump.Angle.ToString(), pDN);
        }
        if (preferences.showQIndex)
        {
            myData[count++] = Util.TrimDecimals(Util.GetQIndex(newJump.Tv, newJump.Tc).ToString(), pDN);
        }
        if (preferences.showDjIndex)
        {
            myData[count++] = Util.TrimDecimals(Util.GetDjIndex(newJump.Tv, newJump.Tc).ToString(), pDN);
        }

        myData[count++] = newJump.Description;

        myData[count++] = newJump.UniqueID.ToString();
        return(myData);
    }