Esempio n. 1
0
        public LinkerSettingsFormViewModel(IProject project) : base("Linker", project)
        {
            try
            {
                try
                {
                    settings = STM32GCCToolchain.GetSettings(project).LinkSettings;
                }
                catch (Exception e)
                {
                    Model.ToolchainSettings.STM32ToolchainSettings = new STM32ToolchainSettings();
                }
            }
            catch (Exception e)
            {
                Model.ToolchainSettings.STM32ToolchainSettings = new STM32ToolchainSettings();
                settings = Model.ToolchainSettings.STM32ToolchainSettings.LinkSettings;
            }

            if (settings == null)
            {
                settings = new LinkSettings();
            }


            useMemoryLayout       = settings.UseMemoryLayout;
            discardUnusedSections = settings.DiscardUnusedSections;
            notUseStandardStartup = settings.NotUseStandardStartupFiles;
            linkedLibraries       = new ObservableCollection <string>(settings.LinkedLibraries);
            inRom1Start           = string.Format("0x{0:X8}", settings.InRom1Start);
            inRom1Size            = string.Format("0x{0:X8}", settings.InRom1Size);
            inRom2Start           = string.Format("0x{0:X8}", settings.InRom2Start);
            inRom2Size            = string.Format("0x{0:X8}", settings.InRom2Size);
            inRam1Start           = string.Format("0x{0:X8}", settings.InRam1Start);
            inRam1Size            = string.Format("0x{0:X8}", settings.InRam1Size);
            inRam2Start           = string.Format("0x{0:X8}", settings.InRam2Start);
            inRam2Size            = string.Format("0x{0:X8}", settings.InRam2Size);
            scatterFile           = settings.ScatterFile;
            miscOptions           = settings.MiscLinkerArguments;
            librarySelectedIndex  = (int)settings.Library;

            //AddLinkedLibraryCommand = new RoutingCommand(AddLinkedLibrary);
            //RemoveLinkedLibraryCommand = new RoutingCommand(RemoveLinkedLibrary);
            //BrowseScatterFileCommand = new RoutingCommand(BrowseScatterFile);
            //EditScatterFileCommand = new RoutingCommand(EditScatterFile);

            UpdateLinkerString();
        }
 public ArmGCCLinkTemplate(LinkSettings linkSettings)
 {
     this.linkSettings = linkSettings;
 }