コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();

            for (int i = 0; i < 20; i++)
            {
                WrapPanel wrapPanel = new WrapPanel();
                Label     label     = new Label();
                label.Content = "Test" + i.ToString();

                TextBox textBox = new TextBox();
                textBox.Width = 100;

                wrapPanel.Children.Add(label);
                wrapPanel.Children.Add(textBox);
                stk_Panel.Children.Add(wrapPanel);
            }

            Page16 page16 = new Page16(0x19, 0x66, 0x63, 0x03, 0xFF, 3, 4);
            Page25 page25 = new Page25(0x7A, 0x49, 0x32, 0x06, 0x00, 0x33);

            simulationBike = new SimulationBike(this);
            simulationBike.AddPageSimualtion(page16, 10, 250);
            simulationBike.AddPageSimualtion(page25, 10, 250);

            //Page16 page = new Page16(0x19, 0x66, 0x63, 0x03, 0xFF, 3, 4);
            //Page16 page = new Page16(0x19, 0x68, 0x63, 0x02, 0xFF, 3, 4);
            //Page16 page = new Page16(0x19, 0x66, 0x63, 0x03, 0xFF, 0x34);
            //Page25 page = new Page25(0x7A, 0x49, 0x32, 0x06, 0x00, 0x33);
            //BikeMessage message = new BikeMessage(page);
            //txb_Messages.Text = BitConverter.ToString(message.GetBytes());
        }
コード例 #2
0
        public override Page SimulateNewPage(double variance, Random random)
        {
            Page16 page = new Page16(this.equipmentTypeBitField,
                                     RandomWithVariance(random, this.elapsedTime, variance),
                                     (byte)(this.distanceTraveled + variance),
                                     RandomWithVariance(random, this.speedMSB, variance),
                                     RandomWithVariance(random, this.heartrate, variance),
                                     this.capabillitiesBitField, this.feStateBitField);

            return(page);
        }