SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
vs_conf.Settings Class Reference

Wrapper for settings JSON. More...

Classes

class  Option
 Key wrapper class. More...
 

Public Member Functions

None __init__ (self, dict[str, str] settings_dict)
 
None load (self, dict[str, str] settings_dict)
 Loads settings dict.
 
None print_settings (self)
 Print the current settings.
 
None unload (self, TextIOBase file)
 Write settings to file.
 

Public Attributes

 settings
 

Static Public Attributes

 FRONT_TEENSY_PORT
 
 getter
 
 BACK_TEENSY_PORT = Option("BACK_TEENSY_PORT", "Port representing the back ecu (COMx)", getter=lambda x: x.upper())
 
 GRAPH_ARG
 
 CORE_MODEL = Option("CORE_MODEL", "Model number of the teensy to compile for", (36, 40, 41), default=41)
 
 LOGGING_OPTION
 
 CORE_SPEED = Option("CORE_SPEED", "Speed at which the CPU will run (MHz)", default="AUTOSET VALUE", advanced=True)
 
 CORE_NAME = Option("CORE_NAME", "Model of the cpu", default="AUTOSET VALUE", advanced=True)
 
 CORE = Option("CORE", "Core folder to compile with", default="AUTOSET VALUE", advanced=True)
 
 BAUDRATE = Option("BAUDRATE", "Baudrate to use with serial", (9600, 19200, 38400, 57600, 115200), default=115200, advanced=True)
 
 USB_SETTING = Option("USB_SETTING", "USB behavior of the core", default="USB_SERIAL", advanced=True)
 
 TOOLCHAIN_OFFSET = Option("TOOLCHAIN_OFFSET", "Offset to the toolchain", default="../TeensyToolchain", advanced=True)
 
 ADDITIONAL_CMAKE_VARS
 
tuple options
 
dict settings [str, str]
 

Detailed Description

Wrapper for settings JSON.

Definition at line 122 of file vs_conf.py.

Constructor & Destructor Documentation

◆ __init__()

None vs_conf.Settings.__init__ (   self,
dict[str, str]  settings_dict 
)

Definition at line 238 of file vs_conf.py.

Member Function Documentation

◆ load()

None vs_conf.Settings.load (   self,
dict[str, str]  settings_dict 
)

Loads settings dict.

Args: settings_dict (dict[str, str]): settings dict

Raises: KeyError: Key is not found in the settings JSON

Definition at line 268 of file vs_conf.py.

◆ print_settings()

None vs_conf.Settings.print_settings (   self)

Print the current settings.

Definition at line 284 of file vs_conf.py.

◆ unload()

None vs_conf.Settings.unload (   self,
TextIOBase  file 
)

Write settings to file.

Args: file (TextIOBase): The file to write to

Definition at line 289 of file vs_conf.py.

Member Data Documentation

◆ ADDITIONAL_CMAKE_VARS

vs_conf.Settings.ADDITIONAL_CMAKE_VARS
static
Initial value:
= Option(
"ADDITIONAL_CMAKE_VARS", "More defines passed to CMake", default="-DCUSTOM_BUILD_PATH_PREFIX:STRING=build/Pre_Build/", advanced=True
)

Definition at line 217 of file vs_conf.py.

◆ BACK_TEENSY_PORT

vs_conf.Settings.BACK_TEENSY_PORT = Option("BACK_TEENSY_PORT", "Port representing the back ecu (COMx)", getter=lambda x: x.upper())
static

Definition at line 193 of file vs_conf.py.

◆ BAUDRATE

vs_conf.Settings.BAUDRATE = Option("BAUDRATE", "Baudrate to use with serial", (9600, 19200, 38400, 57600, 115200), default=115200, advanced=True)
static

Definition at line 214 of file vs_conf.py.

◆ CORE

vs_conf.Settings.CORE = Option("CORE", "Core folder to compile with", default="AUTOSET VALUE", advanced=True)
static

Definition at line 213 of file vs_conf.py.

◆ CORE_MODEL

vs_conf.Settings.CORE_MODEL = Option("CORE_MODEL", "Model number of the teensy to compile for", (36, 40, 41), default=41)
static

Definition at line 202 of file vs_conf.py.

◆ CORE_NAME

vs_conf.Settings.CORE_NAME = Option("CORE_NAME", "Model of the cpu", default="AUTOSET VALUE", advanced=True)
static

Definition at line 212 of file vs_conf.py.

◆ CORE_SPEED

vs_conf.Settings.CORE_SPEED = Option("CORE_SPEED", "Speed at which the CPU will run (MHz)", default="AUTOSET VALUE", advanced=True)
static

Definition at line 211 of file vs_conf.py.

◆ FRONT_TEENSY_PORT

vs_conf.Settings.FRONT_TEENSY_PORT
static

Definition at line 192 of file vs_conf.py.

◆ getter

vs_conf.Settings.getter
static

Definition at line 192 of file vs_conf.py.

◆ GRAPH_ARG

vs_conf.Settings.GRAPH_ARG
static
Initial value:
= Option(
"GRAPH_ARG",
"Enable graphical plotting of data",
("yes", "no"),
lambda x: "yes" if x in ("-g", "yes") else "",
lambda x: "-g" if x == "yes" else "",
default="no",
)

Definition at line 194 of file vs_conf.py.

◆ LOGGING_OPTION

vs_conf.Settings.LOGGING_OPTION
static
Initial value:
= Option(
"LOGGING_OPTION",
"Enable logging",
("yes", "no"),
lambda x: "yes" if x in ("-l${workspaceFolder}\\logs", "yes") else "",
lambda x: "-l${workspaceFolder}\\logs" if x == "yes" else "",
default="yes",
)

Definition at line 203 of file vs_conf.py.

◆ options

tuple vs_conf.Settings.options
static
Initial value:
= (
CORE_MODEL,
FRONT_TEENSY_PORT,
BACK_TEENSY_PORT,
LOGGING_OPTION,
GRAPH_ARG,
CORE_SPEED,
CORE_NAME,
CORE,
BAUDRATE,
USB_SETTING,
TOOLCHAIN_OFFSET,
ADDITIONAL_CMAKE_VARS,
)

Definition at line 221 of file vs_conf.py.

◆ settings [1/2]

dict vs_conf.Settings.settings [str, str]
static

Definition at line 236 of file vs_conf.py.

◆ settings [2/2]

vs_conf.Settings.settings

Definition at line 277 of file vs_conf.py.

◆ TOOLCHAIN_OFFSET

vs_conf.Settings.TOOLCHAIN_OFFSET = Option("TOOLCHAIN_OFFSET", "Offset to the toolchain", default="../TeensyToolchain", advanced=True)
static

Definition at line 216 of file vs_conf.py.

◆ USB_SETTING

vs_conf.Settings.USB_SETTING = Option("USB_SETTING", "USB behavior of the core", default="USB_SERIAL", advanced=True)
static

Definition at line 215 of file vs_conf.py.


The documentation for this class was generated from the following file: