Exemplo n.º 1
0
        public ESPxxGDBStubSettingsEditor(ESPxxGDBStubSettingsBase settings, KnownInterfaceInstance context, IBSPConfiguratorHost host, bool esp32Mode)
        {
            _Context = context;
            _Host    = host;
            IsESP32  = esp32Mode;
            Settings = settings;
            if (Settings == null)
            {
                if (esp32Mode)
                {
                    Settings = new ESP32GDBStubSettings();
                }
                else
                {
                    Settings = new ESP8266GDBStubSettings();
                }
            }

            if (context.COMPortNumber.HasValue)
            {
                Settings.COMPort          = "COM" + context.COMPortNumber;
                COMPortSelectorVisibility = Visibility.Collapsed;
            }

            if (Settings.FLASHResources != null)
            {
                foreach (var r in Settings.FLASHResources)
                {
                    FLASHResources.Add(r);
                }
            }
            FLASHResources.CollectionChanged += (s, e) => { Settings.FLASHResources = FLASHResources.ToArray(); OnSettingsChanged(); };
        }
Exemplo n.º 2
0
        public ESPxxGDBStubSettingsEditor(ESPxxGDBStubSettingsBase settings, KnownInterfaceInstance context, IBSPConfiguratorHost host, bool esp32Mode)
        {
            _Context = context;
            _Host    = host;
            IsESP32  = esp32Mode;
            Settings = settings;
            if (Settings == null)
            {
                if (esp32Mode)
                {
                    Settings = new ESP32GDBStubSettings();
                }
                else
                {
                    Settings = new ESP8266GDBStubSettings();
                }
            }

            if (context.COMPortNumber.HasValue)
            {
                Settings.COMPort          = "COM" + context.COMPortNumber;
                COMPortSelectorVisibility = Visibility.Collapsed;
            }
            else if (host.AdvancedModeContext is IExternallyProgrammableProjectDebugContext ectx)
            {
                ExternalCOMPortSelectionHint = ectx.ExternalProgrammingOptionHint;
                if (ExternalCOMPortSelectionHint != null)
                {
                    COMPortSelectorVisibility = DirectFLASHProgrammingOptionVisibility = Visibility.Collapsed;
                }
            }

            if (Settings.FLASHResources != null)
            {
                foreach (var r in Settings.FLASHResources)
                {
                    FLASHResources.Add(r);
                }
            }
            FLASHResources.CollectionChanged += (s, e) => { Settings.FLASHResources = FLASHResources.ToArray(); OnSettingsChanged(); };
        }