//Detect the Globalsat (protocol) device
        public override GlobalsatProtocol Device()
        {
            GlobalsatProtocol       gdevice = null;
            FitnessDevice_Globalsat gfdev   = this.FitnessDevice;

            if (gfdev != null)
            {
                gdevice = gfdev.Device();
            }
            return(gdevice);
        }
Exemple #2
0
 public GlobalsatPacket2(FitnessDevice_Globalsat device) : base(device)
 {
 }
 public Gb580Packet(FitnessDevice_Globalsat device) : base(device)
 {
 }
 public Gh625XTPacket(FitnessDevice_Globalsat device) : base(device)
 {
 }
Exemple #5
0
 public GlobalsatPacket(FitnessDevice_Globalsat device)
 {
     this.FitnessDevice = device;
 }
        public DeviceConfigurationDlg(FitnessDevice_Globalsat fitnessDevice, bool detect)
        {
            InitializeComponent();

            this.fitnessDevice = fitnessDevice;
            Text = CommonResources.Text.Devices.ConfigurationDialog_Title;
            this.chkImportDistance.Text               = Properties.Resources.DeviceConfigurationDlg_chkImportDistance;
            this.chkImportOnlyNew.Text                = Properties.Resources.DeviceConfigurationDlg_chkImportOnlyNew_Text;
            this.optDetectPausesOff.Text              = CommonResources.Text.LabelNone;
            this.optDetectPausesFromSpeed.Text        = Properties.Resources.DeviceConfigurationDlg_optDetectPausesFromSpeed;
            this.optDetectPausesFromSpeedCadence.Text = Properties.Resources.DeviceConfigurationDlg_optDetectPausesFromSpeedCadence;
            labelHoursOffset.Text = CommonResources.Text.Devices.ConfigurationDialog_HoursOffsetLabel_Text;
            btnOk.Text            = CommonResources.Text.ActionOk;
            btnCancel.Text        = CommonResources.Text.ActionCancel;

            if (Plugin.Instance.Application != null)
            {
                ThemeChanged(Plugin.Instance.Application.VisualTheme);
            }

            txtHoursOffset.Validated += new EventHandler(TxtHoursOffset_Validated);
            btnOk.Click     += new EventHandler(BtnOk_Click);
            btnCancel.Click += new EventHandler(BtnCancel_Click);
            this.chkImportOnlyNew.Checked  = this.fitnessDevice.configInfo.ImportOnlyNew;
            this.chkImportDistance.Checked = this.fitnessDevice.configInfo.ImportSpeedDistanceTrack;
            switch (this.fitnessDevice.configInfo.DetectPauses)
            {
            case 1:
                //detect pause from speed
                this.optDetectPausesFromSpeed.Checked = true;
                break;

            case 2:
                //detect pause from speed and cadance track
                this.optDetectPausesFromSpeedCadence.Checked = true;
                break;

            case 0:
            default:
                //no pause detect
                this.optDetectPausesOff.Checked = true;
                break;
            }
            this.txtHoursOffset.Text      = this.fitnessDevice.configInfo.HoursAdjustment.ToString();
            this.buttonDetect.CenterImage = ZoneFiveSoftware.Common.Visuals.CommonResources.Images.Refresh16;
            this.buttonDetect.Text        = "";// ZoneFiveSoftware.Common.Visuals.CommonResources.Text.ActionRefresh;
            this.labelDetect.Text         = "";
            if (detect)
            {
                this.VisibleChanged += DeviceConfigurationDlg_VisibleChanged;
            }

            this.buttonDelete.CenterImage     = ZoneFiveSoftware.Common.Visuals.CommonResources.Images.Delete16;
            this.buttonDelete.Text            = "";
            this.dateTimePickerOldest.Visible = false;
            GlobalsatProtocol device = this.fitnessDevice.Device();

            if (device is GlobalsatProtocol2)
            {
                //this.labelRemainingTime.Text = "Click to get remaining time";
                LabelRemainingTime_Click();
                this.labelDelete.Text = Properties.Resources.DeviceConfigurationDlg_DeleteAllActivities;
                DateTime oldest = DateTime.Now - TimeSpan.FromDays(31);
                this.dateTimePickerOldest.Value = oldest;
            }
            else
            {
                this.labelRemainingTime.Visible = false;
                this.buttonDelete.Visible       = false;
                this.labelDelete.Visible        = false;
                if (fitnessDevice is FitnessDevice_GH561)
                {
                    this.labelHoursOffset.Visible    = false;
                    this.txtHoursOffset.Visible      = false;
                    this.chkImportOnlyNew.Visible    = false;
                    this.chkImportDistance.Visible   = false;
                    this.groupBoxPauseDetect.Visible = false;
                }
            }
            //Device Configuration
            this.buttonImportDeviceConfig.LeftImage = CommonResources.Images.Import16;
            this.buttonExportDeviceConfig.LeftImage = CommonResources.Images.Export16;

            this.buttonImportDeviceConfig.Text = Properties.Resources.UI_Settings_ImportConfigButton_Text;
            this.buttonExportDeviceConfig.Text = Properties.Resources.UI_Settings_ExportConfigButton_Text;
            this.labelStatus.Text = "";

            this.groupBoxDeviceConfig.Text = Properties.Resources.UI_Settings_DeviceConfiguration_Title;

            //Screen capture
            if (fitnessDevice is FitnessDevice_GB1000)
            {
                groupBoxScreenCapture.Enabled = false;
            }
            this.buttonCaptureScreen.CenterImage = CommonResources.Images.Refresh16;
            this.buttonSave.CenterImage          = CommonResources.Images.Save16;

            this.buttonSave.Enabled = false;
            this.pictureBox1.Left   = buttonCaptureScreen.Right + 8;
        }
 public DeviceConfigurationDlg(FitnessDevice_Globalsat fitnessDevice) :
     this(fitnessDevice, false)
 {
 }
Exemple #8
0
 public GhDeviceBase(FitnessDevice_Globalsat fitnessDevice)
 {
     this.FitnessDevice = fitnessDevice;
 }
Exemple #9
0
        public string Detect(bool query)
        {
            string identification = "Detection Error";

            try
            {
                if (!query || this.Device().Open())
                {
                    FitnessDevice_Globalsat cmpFitness = this;
                    if (this is FitnessDevice_GsSport)
                    {
                        cmpFitness = (this as FitnessDevice_GsSport).FitnessDevice;
                    }

                    //devId and lastDevId should not be null
                    if (cmpFitness.configInfo.AllowedIds == null || cmpFitness.configInfo.AllowedIds.Count == 0)
                    {
                        identification = cmpFitness.Device().devId + " (Globalsat Generic)";
                    }
                    else
                    {
                        bool found = false;
                        foreach (string s in cmpFitness.configInfo.AllowedIds)
                        {
                            if (cmpFitness.Device().devId.Equals(s))
                            {
                                found          = true;
                                identification = cmpFitness.Device().devId;
                                break;
                            }
                        }
                        if (!found)
                        {
                            identification = cmpFitness.Device().devId + " (" + cmpFitness.Name + " Compatible)";
                        }
                    }
                    IList <string> s2 = this.configInfo.GetLastValidComPorts();
                    if (s2 != null && s2.Count > 0)
                    {
                        identification += " on " + s2[0];
                    }
                }
                else
                {
                    identification = this.Device().lastDevId + " (" + ZoneFiveSoftware.Common.Visuals.CommonResources.Text.Devices.ImportJob_Status_CouldNotOpenDeviceError + ")";
                }
            }
            catch (Exception e)
            {
                identification = Properties.Resources.Device_OpenDevice_Error + " (Detect)" + e;
            }
            finally
            {
                if (this.Device() != null)
                {
                    //this.Device().DataRecieved Should not be handled here
                    this.Device().Close();
                }
            }
            return(identification);
        }
Exemple #10
0
 public GlobalsatProtocol2(FitnessDevice_Globalsat fitnessDevice) : base(fitnessDevice)
 {
 }