예제 #1
0
파일: Program.cs 프로젝트: rvnijnatten/IP2
        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
파일: Wingate.cs 프로젝트: rvnijnatten/IP2
 public Packet packIt()
 {
     packet = new Packet();
     packet.Flag = Packet.PacketFlag.PACKETFLAG_WINGATE_RESULT;
     WingateResult result = new WingateResult();
     result.AnaerobicCapacity = anaerobicCapacity;
     result.AnaerobicFatique = anaerobicFatique;
     result.LowestPower = lowestPower;
     result.Patient = patientName;
     result.PeakPower = peakPower;
     result.RelativePeakPower = relativePeakPower;
     result.Values = valueList;
     packet.Data = result;
     networkClient.routeToServer(packet);
     return packet;
 }