コード例 #1
0
ファイル: FECCommander.cs プロジェクト: tosyu/SimCycling
        private void SendTrackResistance(float grade)
        {
            UInt16 gradeToTransmit;

            if (!useAsModel)
            {
                var boundedGrade = Math.Min(Math.Max(grade, minSimulatedGrade), maxSimulatedGrade);
                gradeToTransmit = Consts.ConvertGrade(boundedGrade);
            }
            else
            {
                gradeToTransmit = Consts.ConvertGrade(grade);
            }

            var command = new ControlTrackResistancePage
            {
                Grade = gradeToTransmit
            };

            simulator.SendTrackResistance(command);
        }