async run(){

        let mcuSelectSection = document.createElement('div'); 
        mcuSelectSection.id = this.id;
        mcuSelectSection.classList.add('dirSerlector');

        let mcuSelectLabel = document.createElement('label');
        mcuSelectLabel.id = this.id + 'Label';
        mcuSelectLabel.setAttribute('for', this.id + 'Field');
        mcuSelectLabel.innerHTML = 'Mcu:';
        mcuSelectSection.appendChild(mcuSelectLabel);  

        let mcuSelectField = document.createElement('select');
        mcuSelectField.id = this.id + 'Field';
        for (var i = 0; i < this.contents.length; i++){
            let option = document.createElement('option');
            option.value = i;
            option.text = this.contents[i].name;
            mcuSelectField.appendChild(option);
        }
        mcuSelectSection.appendChild(mcuSelectField);

        let mcuSelectButton = document.createElement('button');
        mcuSelectButton.id = this.id + 'Button';
        mcuSelectButton.innerHTML = 'Select';
        mcuSelectSection.appendChild(mcuSelectButton);

        document.getElementById(this.parentId).appendChild(mcuSelectSection);

        // wait for the user to choose and lock stuff down
        await new Promise(r=>mcuSelectButton.addEventListener('click', r, {once:true}));

        let selectedMcuName = mcuSelectField.options[mcuSelectField.selectedIndex].text;
        let selectedMcuId = mcuSelectField.value;

        mcuSelectField.remove();
        mcuSelectButton.remove();

        let mcuSelectName = document.createElement('span');
        mcuSelectName.id = this.id + 'Name';
        mcuSelectName.innerHTML = selectedMcuName;
        mcuSelectSection.appendChild(mcuSelectName);

        // get the fields needed to instantiate the mcu object
        let path = this.contents[selectedMcuId].path;
        let replacementsPath = this.contents[selectedMcuId].replacementsPath;
        let template = this.contents[selectedMcuId].template;
        return {'path':path, 'replacementsPath': replacementsPath, 'template':template};
    }
/**
     * The method generates the interface for a user to select what mcu they want to use
     * 
     * @returns {Mcu} an mcu object that's instantiated but not loaded
     */
The method generates the interface for a user to select what mcu they want to use

@returns {Mcu} an mcu object that's instantiated but not loaded
The method generates the interface for a user to select what mcu they want to use @returns { Mcu } an mcu object that ' s instantiated but not loaded
async run(){
        let mcuSelectSection = document.createElement('div'); 
        mcuSelectSection.id = this.id;
        mcuSelectSection.classList.add('dirSerlector');
        let mcuSelectLabel = document.createElement('label');
        mcuSelectLabel.id = this.id + 'Label';
        mcuSelectLabel.setAttribute('for', this.id + 'Field');
        mcuSelectLabel.innerHTML = 'Mcu:';
        mcuSelectSection.appendChild(mcuSelectLabel);  
        let mcuSelectField = document.createElement('select');
        mcuSelectField.id = this.id + 'Field';
        for (var i = 0; i < this.contents.length; i++){
            let option = document.createElement('option');
            option.value = i;
            option.text = this.contents[i].name;
            mcuSelectField.appendChild(option);
        }
        mcuSelectSection.appendChild(mcuSelectField);
        let mcuSelectButton = document.createElement('button');
        mcuSelectButton.id = this.id + 'Button';
        mcuSelectButton.innerHTML = 'Select';
        mcuSelectSection.appendChild(mcuSelectButton);
        document.getElementById(this.parentId).appendChild(mcuSelectSection);
        await new Promise(r=>mcuSelectButton.addEventListener('click', r, {once:true}));
        let selectedMcuName = mcuSelectField.options[mcuSelectField.selectedIndex].text;
        let selectedMcuId = mcuSelectField.value;
        mcuSelectField.remove();
        mcuSelectButton.remove();
        let mcuSelectName = document.createElement('span');
        mcuSelectName.id = this.id + 'Name';
        mcuSelectName.innerHTML = selectedMcuName;
        mcuSelectSection.appendChild(mcuSelectName);
        let path = this.contents[selectedMcuId].path;
        let replacementsPath = this.contents[selectedMcuId].replacementsPath;
        let template = this.contents[selectedMcuId].template;
        return {'path':path, 'replacementsPath': replacementsPath, 'template':template};
    }
async run ( ) { let mcuSelectSection = document . createElement ( 'div' ) ; mcuSelectSection . id = this . id ; mcuSelectSection . classList . add ( 'dirSerlector' ) ; let mcuSelectLabel = document . createElement ( 'label' ) ; mcuSelectLabel . id = this . id + 'Label' ; mcuSelectLabel . setAttribute ( 'for' , this . id + 'Field' ) ; mcuSelectLabel . innerHTML = 'Mcu:' ; mcuSelectSection . appendChild ( mcuSelectLabel ) ; let mcuSelectField = document . createElement ( 'select' ) ; mcuSelectField . id = this . id + 'Field' ; for ( var i = 0 ; i < this . contents . length ; i ++ ) { let option = document . createElement ( 'option' ) ; option . value = i ; option . text = this . contents [ i ] . name ; mcuSelectField . appendChild ( option ) ; } mcuSelectSection . appendChild ( mcuSelectField ) ; let mcuSelectButton = document . createElement ( 'button' ) ; mcuSelectButton . id = this . id + 'Button' ; mcuSelectButton . innerHTML = 'Select' ; mcuSelectSection . appendChild ( mcuSelectButton ) ; document . getElementById ( this . parentId ) . appendChild ( mcuSelectSection ) ; await new Promise ( r => mcuSelectButton . addEventListener ( 'click' , r , { once : true } ) ) ; let selectedMcuName = mcuSelectField . options [ mcuSelectField . selectedIndex ] . text ; let selectedMcuId = mcuSelectField . value ; mcuSelectField . remove ( ) ; mcuSelectButton . remove ( ) ; let mcuSelectName = document . createElement ( 'span' ) ; mcuSelectName . id = this . id + 'Name' ; mcuSelectName . innerHTML = selectedMcuName ; mcuSelectSection . appendChild ( mcuSelectName ) ; let path = this . contents [ selectedMcuId ] . path ; let replacementsPath = this . contents [ selectedMcuId ] . replacementsPath ; let template = this . contents [ selectedMcuId ] . template ; return { 'path' : path , 'replacementsPath' : replacementsPath , 'template' : template } ; }
The method generates the interface for a user to select what mcu they want to use
The method generates the interface for a user to select what mcu they want to use
// wait for the user to choose and lock stuff down // get the fields needed to instantiate the mcu object