Module:CRTModel: Difference between revisions
Add TV Systems section to infobox displaying AV system and Tuner system (via update-page on MediaWiki MCP Server) |
Add Scan Range section to infobox displaying horizontal and vertical scan rates (via update-page on MediaWiki MCP Server) |
||
| Line 97: | Line 97: | ||
local av_system = trim(args.av_system) | local av_system = trim(args.av_system) | ||
local tuner_system = trim(args.tuner_system) | local tuner_system = trim(args.tuner_system) | ||
-- Scan range | |||
local h_scan_min = trim(args.h_scan_min) | |||
local h_scan_max = trim(args.h_scan_max) | |||
local v_scan_min = trim(args.v_scan_min) | |||
local v_scan_max = trim(args.v_scan_max) | |||
-- Use frame:extensionTag to create a proper <style> tag that won't be escaped | -- Use frame:extensionTag to create a proper <style> tag that won't be escaped | ||
| Line 308: | Line 314: | ||
addRow(container, 'Tuner', table.concat(systems, ', '), true) | addRow(container, 'Tuner', table.concat(systems, ', '), true) | ||
end | end | ||
end | |||
end | |||
-- Scan Range section: show if we have any scan range specs | |||
if h_scan_min or h_scan_max or v_scan_min or v_scan_max then | |||
addSectionRow(container, 'Scan Range') | |||
-- Horizontal scan row | |||
if h_scan_min or h_scan_max then | |||
local hDisplay | |||
if h_scan_min and h_scan_max then | |||
if h_scan_min == h_scan_max then | |||
-- Single frequency (e.g., "15.7 kHz") | |||
hDisplay = h_scan_min .. ' kHz' | |||
else | |||
-- Range (e.g., "15–100 kHz") | |||
hDisplay = h_scan_min .. '–' .. h_scan_max .. ' kHz' | |||
end | |||
elseif h_scan_min then | |||
hDisplay = h_scan_min .. ' kHz' | |||
else | |||
hDisplay = h_scan_max .. ' kHz' | |||
end | |||
addRow(container, 'Horizontal', hDisplay, false) | |||
end | |||
-- Vertical scan row | |||
if v_scan_min or v_scan_max then | |||
local vDisplay | |||
if v_scan_min and v_scan_max then | |||
if v_scan_min == v_scan_max then | |||
-- Single frequency (e.g., "60 Hz") | |||
vDisplay = v_scan_min .. ' Hz' | |||
else | |||
-- Range (e.g., "50–160 Hz") | |||
vDisplay = v_scan_min .. '–' .. v_scan_max .. ' Hz' | |||
end | |||
elseif v_scan_min then | |||
vDisplay = v_scan_min .. ' Hz' | |||
else | |||
vDisplay = v_scan_max .. ' Hz' | |||
end | |||
addRow(container, 'Vertical', vDisplay, false) | |||
end | end | ||
end | end | ||