示例#1
0
        private void Bpm_Click(object sender, RoutedEventArgs e)
        {
            ANT_heart_rate.clearBsValue();
            ANT_heart_rate.clearBcValue();
            ANT_heart_rate.clearHrValue();
            bool flag = GlobalData.heartChannel == 9;

            if (flag)
            {
                try
                {
                    ANT_heart_rate.hr_Init();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Connect failed with exception: \n" + ex.Message);
                }
                GlobalData.deviceStyle = 2;
                SearchWindow bpm = new SearchWindow();
                bpm.ShowDialog();
            }
            else
            {
                bool flag2 = GlobalData.heartChannel >= 0 && GlobalData.heartChannel < 8;
                if (flag2)
                {
                    ANT_heart_rate.disconnectHr();
                    ANT_heart_rate.clearHrValue();
                    this.Xinlv.Visibility         = Visibility.Collapsed;
                    GlobalData.heartRateequipment = null;
                    XMLHelper.HeartRateDeviceNumberDeleter("HeartRateDeviceNumber");
                }
            }
        }
示例#2
0
        private void Rpm_Click(object sender, RoutedEventArgs e)
        {
            ANT_heart_rate.clearBsValue();
            ANT_heart_rate.clearBcValue();
            ANT_heart_rate.clearHrValue();
            bool flag = GlobalData.cadenceChannel == 9;

            if (flag)
            {
                try
                {
                    ANT_heart_rate.bc_Init();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Connect failed with exception: \n" + ex.Message);
                }
                GlobalData.deviceStyle = 1;
                SearchWindow gp = new SearchWindow();
                gp.ShowDialog();
            }
            else
            {
                bool flag2 = GlobalData.cadenceChannel >= 0 && GlobalData.cadenceChannel < 8;
                if (flag2)
                {
                    ANT_heart_rate.disconnectBc();
                    ANT_heart_rate.clearBcValue();
                    this.TaPin.Visibility       = Visibility.Collapsed;
                    GlobalData.cadenceequipment = null;
                    XMLHelper.CadenceDeviceNumberDeleter("CadenceDeviceNumber");
                }
            }
        }
示例#3
0
        private void General_Click(object sender, RoutedEventArgs e)
        {
            ANT_heart_rate.clearBsValue();
            ANT_heart_rate.clearBcValue();
            ANT_heart_rate.clearHrValue();
            bool flag = GlobalData.speedChannel == 9;

            if (flag)
            {
                try
                {
                    ANT_heart_rate.bs_Init();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Connect failed with exception: \n" + ex.Message);
                }
                GlobalData.deviceStyle = 0;
                SearchWindow gp = new SearchWindow();
                gp.ShowDialog();
            }
            else
            {
                bool flag2 = GlobalData.speedChannel >= 0 && GlobalData.speedChannel < 8;
                if (flag2)
                {
                    ANT_heart_rate.disconnectBs();
                    ANT_heart_rate.clearBsValue();
                    this.PuTong.Visibility    = Visibility.Collapsed;
                    GlobalData.speedequipment = null;
                    XMLHelper.SpeedDeviceNumberDeleter("SpeedDeviceNumber");
                    GlobalData.ANT_Connectflag = false;
                }
            }
        }
示例#4
0
        //internal MediaElement mediaElement1;

        //internal Label closeLabel;

        //internal Label speedBox;

        //internal Label speedBoxUnit;

        //internal Label powerBox;

        //internal Label powerBoxUnit;

        //internal Label distanceBox;

        //internal Label distanceBoxUnit;

        //internal Label energyBox;

        //internal Label energyBoxUnit;

        //internal Label slopeBox;

        //internal Label slopeBoxUnit;

        //internal Label timeBox;

        //internal Label heartBox;

        //internal Label heartBoxUnit;

        //internal Label tramptBox;

        //internal Label tramptBoxUnit;

        //internal Image P_image;

        //internal Label P_distanceBox;

        //internal Image C_image;

        //internal Label C_distanceBox;

        //private bool _contentLoaded;

        public VideoWindow(Video v)
        {
            ANT_heart_rate.clearBsValue();
            ANT_heart_rate.clearBcValue();
            ANT_heart_rate.clearHrValue();
            this.InitializeComponent();
            this.video = v;
            this.ReadSlope(this.video.SlopePath);
            this.Data_Init();
            this.timer_Init();
        }
示例#5
0
        private void Centerbutton_Click(object sender, RoutedEventArgs e)
        {
            bool flag = this.listView.SelectedItem == null;

            if (flag)
            {
                ANT_heart_rate.closeChannels();
                base.Close();
            }
            else
            {
                SearchData rd    = this.listView.SelectedItem as SearchData;
                bool       flag2 = rd == null;
                if (!flag2)
                {
                    int    channel = Convert.ToInt32(rd.Channel);
                    string name    = Convert.ToString(rd.Name);
                    switch (GlobalData.deviceStyle)
                    {
                    case 0:
                    {
                        GlobalData.speedChannel    = channel;
                        GlobalData.ANT_Connectflag = true;
                        GlobalData.speedequipment  = name;
                        XMLHelper.SpeedDeviceNumberFile("SpeedDeviceNumber");
                        bool flag3 = SearchWindow.sudu != null;
                        if (flag3)
                        {
                            SearchWindow.sudu();
                        }
                        break;
                    }

                    case 1:
                    {
                        GlobalData.cadenceChannel   = channel;
                        GlobalData.cadenceequipment = name;
                        XMLHelper.CadenceDeviceNumberFile("CadenceDeviceNumber");
                        bool flag4 = SearchWindow.tapin != null;
                        if (flag4)
                        {
                            SearchWindow.tapin();
                        }
                        break;
                    }

                    case 2:
                    {
                        GlobalData.heartChannel       = channel;
                        GlobalData.heartRateequipment = name;
                        XMLHelper.HeartRateDeviceNumberFile("HeartRateDeviceNumber");
                        bool flag5 = SearchWindow.xinlv != null;
                        if (flag5)
                        {
                            SearchWindow.xinlv();
                        }
                        break;
                    }
                    }
                    ANT_heart_rate.closeChannels();
                    base.Close();
                }
            }
        }
示例#6
0
        public MainWindow()
        {
            this.InitializeComponent();
            Device.Init();
            GlobalData.Init();
            this.rejisterPage     = new Uri("Other\\RejisterPage.xaml", UriKind.Relative);
            this.devivePage       = new Uri("Other\\DevicePage.xaml", UriKind.Relative);
            this.recordPage       = new Uri("Other\\RecordPage.xaml", UriKind.Relative);
            this.settingPage      = new Uri("Other\\SettingPage.xaml", UriKind.Relative);
            this.noraml_training  = new Uri("Trainings\\NormalPage.xaml", UriKind.Relative);
            this.video_training   = new Uri("Trainings\\VideoPage.xaml", UriKind.Relative);
            this.unity3D_training = new Uri("Trainings\\U3Dpage.xaml", UriKind.Relative);
            this.ButtonChoosed(this.prepageIndex, this.pageIndex);
            XMLHelper.Init();
            GlobalData.language = XMLHelper.getLanguage();
            MultiLanguage.Init(GlobalData.language);
            this.languageInit();
            base.DataContext       = this;
            GlobalData.mainWindow  = this;
            RejisterPage.username += new RejisterPage.RegisterW(this.Username);
            bool flag = GlobalData.speedChannel == 9 && GlobalData.ANT_Deviceflag;

            if (flag)
            {
                bool flag2 = XMLHelper.SpeedDeviceNumberGetNum() > 0;
                if (flag2)
                {
                    string SpeedDevice = XMLHelper.SpeedDeviceNumberReader("SpeedDeviceNumber", 0);
                    bool   flag3       = SpeedDevice != null;
                    if (flag3)
                    {
                        GlobalData.speedequipment = SpeedDevice;
                        string[] sArray = SpeedDevice.Split(new char[]
                        {
                            ':'
                        });
                        string SpeedDevice2 = sArray[1];
                        ANT_heart_rate.antBinding(SpeedDevice2, null, null);
                        bool aNT_Deviceflag = GlobalData.ANT_Deviceflag;
                        if (!aNT_Deviceflag)
                        {
                            return;
                        }
                        GlobalData.ANT_Connectflag = true;
                    }
                }
            }
            bool flag4 = GlobalData.cadenceChannel == 9 && GlobalData.ANT_Deviceflag;

            if (flag4)
            {
                bool flag5 = XMLHelper.CadenceDeviceNumberGetNum() > 0;
                if (flag5)
                {
                    string CadenceDevice = XMLHelper.CadenceDeviceNumberReader("CadenceDeviceNumber", 0);
                    bool   flag6         = CadenceDevice != null;
                    if (flag6)
                    {
                        string[] sArray2 = CadenceDevice.Split(new char[]
                        {
                            ':'
                        });
                        string CadenceDevice2 = sArray2[1];
                        ANT_heart_rate.antBinding(null, CadenceDevice2, null);
                        bool aNT_Deviceflag2 = GlobalData.ANT_Deviceflag;
                        if (!aNT_Deviceflag2)
                        {
                            return;
                        }
                        GlobalData.cadenceequipment = CadenceDevice;
                    }
                }
            }
            bool flag7 = GlobalData.heartChannel == 9 && GlobalData.ANT_Deviceflag;

            if (flag7)
            {
                bool flag8 = XMLHelper.HeartRateDeviceNumberGetNum() > 0;
                if (flag8)
                {
                    string HeartRateDevice = XMLHelper.HeartRateDeviceNumberReader("HeartRateDeviceNumber", 0);
                    bool   flag9           = HeartRateDevice != null;
                    if (flag9)
                    {
                        string[] sArray3 = HeartRateDevice.Split(new char[]
                        {
                            ':'
                        });
                        string HeartRateDevice2 = sArray3[1];
                        ANT_heart_rate.antBinding(null, null, HeartRateDevice2);
                        bool aNT_Deviceflag3 = GlobalData.ANT_Deviceflag;
                        if (aNT_Deviceflag3)
                        {
                            GlobalData.heartRateequipment = HeartRateDevice;
                        }
                    }
                }
            }
        }