Skip to content

Resolve "Create method to adjust the units of the project"

Lucas POLO-LOPEZ requested to merge 23-method-adjust-units into develop

Closes #23 (closed)

setUnits(self, leng: str = "mm", freq: str = "GHz", time: str = "s", temp: str = "Kelvin")

vba = (
    'With Units\n' +
    '.SetUnit "Length", "{}"\n'.format(leng) +
    '.SetUnit "Temperature", "{}"\n'.format(temp) +
    '.SetUnit "Voltage", "V"\n' +
    '.SetUnit "Current", "A"\n' +
    '.SetUnit "Resistance", "Ohm"\n' +
    '.SetUnit "Conductance", "S"\n' +
    '.SetUnit "Capacitance", "pF"\n' +
    '.SetUnit "Inductance", "nH"\n' +
    '.SetUnit "Frequency", "{}"\n'.format(freq) +
    '.SetUnit "Time", "{}"\n'.format(time) +
    '.SetResultUnit "frequency", "frequency", ""\n' +
    'End With'
    )
	
self.__MWS._FlagAsMethod("AddToHistory")
self.__MWS.AddToHistory("SetUnits", vba)
Edited by Lucas POLO-LOPEZ

Merge request reports

Loading