示例#1
0
        public static WingateResult Test(string patient, int low, int high)
        {
            Random r = new Random();
            WingateResult result = new WingateResult();
            result.Patient = patient;
            result.AnaerobicCapacity = r.Next(low,high);
            result.AnaerobicFatique = r.Next(low, high);
            result.LowestPower = r.Next(low, high);
            result.PeakPower = r.Next(low, high);
            result.RelativePeakPower = result.PeakPower/80.0;
            result.TestDateTime = DateTime.Now;
            List<Value> list = new List<Value>();
            for (int i = 0; i < 30; i++)
            {
                Value v = new Value();
                v.Pulse = (uint)(80 + (i/low));
                v.Speed = (uint)(20+i/r.Next(low, high));
                v.Distance = (uint)(i*v.Speed);
                list.Add(v);
            }
            result.Values = list;

            return result;
        }
示例#2
0
 ///<summary>
 ///Writes the data from a Value into the Dictionary
 ///</summary>
 public void writeBikeData(Client client, Value values)
 {
     if (allClients.ContainsKey(client.userName))
     {
         allClients[client.userName].Add(DateTime.Now, values);
     }
     else
     {
         Dictionary<DateTime, Value> clientData = new Dictionary<DateTime, Value>();
         clientData.Add(DateTime.Now, values);
         allClients.Add(client.userName, clientData);
     }
 }
示例#3
0
 public void setVal(Kettler_X7_Lib.Objects.Value val)
 {
     lastValue = val;
 }
示例#4
0
 ///<summary>
 ///Forward client data to servermodel.
 ///</summary>
 public void writeToModel(Client client, Value values)
 {
     serverModel.writeBikeData(client, values);
 }