added tty_monochrome parameter to OS-Version and hardware definition

TEXTCOLOR is automatically blacklised now
This commit is contained in:
Alexander Weber 2018-03-16 08:38:42 +01:00
parent db3f07edd9
commit d3367fd4db
3 changed files with 14 additions and 4 deletions

2
API.md
View File

@ -9,6 +9,7 @@
- `hwdef.custom_launcer` - optional - custom launcher name
- `hwdef.os_version` - optional - Set OS version. ('1.10', '3.31' or '6.33') By default the latest version is used
- `hwdef.tty_style` - optional - override CS-BOS console textcolor
- `hwdef.tty_monochrome` - Old computer with monochrome CRT screen
- `hwdef.custom_theme` - optional - custom initial theme name
- `hwdef.hw_capabilities` = { "hdd", "floppy", "usb", "net", "liveboot" } Table with hardware capabilities. Default is all, if nothing set
- `hwdef.node_defs` - A list for node definitions for each variant. with hw_state parameter for OS-initialization
@ -77,6 +78,7 @@
`version_string`
`blacklist_commands` CS-BOS interpreter
`tty_style` CS-BOS Console color. Supported GREEN, AMBER, WHITE
`tty_monochrome` CS-BOS Console is monochrome, no color change supported
`min_scrollback_size` CS-BOS Buffer
`max_scrollback_size` CS-BOS Buffer
`custom_launcher` Custom launcher for OS (can be overriden on node level)

View File

@ -130,7 +130,7 @@ end
local function initialize_data(data, sdata, mtos, sysos)
if mtos.os_attr.blacklist_commands.TEXTCOLOR then
if mtos.os_attr.tty_monochrome then
data.tty = mtos.os_attr.tty_style
else
data.tty = sdata.tty or data.tty or mtos.os_attr.tty_style

View File

@ -8,7 +8,8 @@ local os_version_attr = {
tty_style = 'AMBER',
custom_launcher = "cs-bos_launcher",
custom_theme = "Amber Shell",
blacklist_commands = { TEXTCOLOR = true, EXIT = true },
blacklist_commands = { EXIT = true },
tty_monochrome = true,
min_scrollback_size = 20,
max_scrollback_size = 34,
},
@ -18,7 +19,8 @@ local os_version_attr = {
tty_style = 'GREEN',
custom_launcher = "cs-bos_launcher",
custom_theme = "Green Shell",
blacklist_commands = { TEXTCOLOR = true, EXIT = true },
blacklist_commands = { EXIT = true },
tty_monochrome = true,
min_scrollback_size = 25,
max_scrollback_size = 100,
},
@ -130,11 +132,17 @@ function os_class:set_theme(theme)
end
function os_class:get_os_attr()
local os_attr = os_version_attr.default
local os_attr = table.copy(os_version_attr.default)
if self.hwdef.os_version then
os_attr = table.copy(os_version_attr[self.hwdef.os_version])
end
os_attr.tty_style = self.hwdef.tty_style or os_attr.tty_style
if self.hwdef.tty_monochrome ~= nil then
os_attr.tty_monochrome = self.hwdef.tty_monochrome
end
if os_attr.tty_monochrome then
os_attr.blacklist_commands.TEXTCOLOR = true
end
return os_attr
end