private void buttonDetect_Click(object sender, EventArgs e)
        {
            //Always Generic device here
            FitnessDevice_GsSport  device = new FitnessDevice_GsSport();
            DeviceConfigurationDlg d      = new DeviceConfigurationDlg(device, true);

            d.ShowDialog();
            //Retrieve detect information, without query device again
            this.labelDetect.Text = device.Detect(false);
        }
Esempio n. 2
0
        public bool Import(string configurationInfo, IJobMonitor monitor, IImportResults importResults)
        {
            bool result = false;

            this.configInfo.Parse(configurationInfo);
            bool generic = this is FitnessDevice_GsSport;

            //import for specific device - Importjob must be implemented
            monitor.PercentComplete = 0;

            try
            {
                if (generic)
                {
                    //Always retry to reimport (other use create new device at each use, but device kept at import)
                    FitnessDevice_GsSport dev = (this as FitnessDevice_GsSport);
                    dev.DetectionAttempted = false;
                }
                else
                {
                    //Only change status message for non generic
                    monitor.StatusText = CommonResources.Text.Devices.ImportJob_Status_OpeningDevice;
                }

                if (this.Device() != null)
                {
                    string cfgDesc = ConfiguredDescription(configurationInfo);
                    if (generic)
                    {
                        cfgDesc += " - " + this.Device().devId;
                    }
                    ImportJob job = this.Device().ImportJob(cfgDesc, monitor, importResults);
                    if (job == null)
                    {
                        string devId = this.Device().devId;
                        if (string.IsNullOrEmpty(devId))
                        {
                            devId = this.Name;
                        }
                        monitor.ErrorText = "Import not supported for " + devId;
                        result            = false;
                    }
                    else
                    {
                        result = job.Import();
                    }
                }
            }
            catch (NotImplementedException)
            {
                monitor.ErrorText = ZoneFiveSoftware.SportTracks.Device.Globalsat.Properties.Resources.Device_Unsupported;
                result            = false;
            }
            return(result);
        }
Esempio n. 3
0
 public GenericDevice(FitnessDevice_GsSport fitnessDevice)
     : base(fitnessDevice)
 {
 }