Module:MOS mode degrees: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
Todo; to distinguish this from mos modes and to follow with current usage of mos mode names, this template will no longer display mode names and mos modes will be used for displaying names |
||
| Line 4: | Line 4: | ||
local yesno = require("Module:Yesno") | local yesno = require("Module:Yesno") | ||
local p = {} | local p = {} | ||
-- TODO | |||
-- - Split off modmos mode degrees as a separate template | |||
-- Global variables for cell colors | -- Global variables for cell colors | ||
| Line 53: | Line 56: | ||
-- Create a table of a mos's degrees | -- Create a table of a mos's degrees | ||
-- If a step pattern is provided, it's assumed to be that of a modmos | -- If a step pattern is provided, it's assumed to be that of a modmos | ||
function p._mos_mode_degrees(input_mos, mos_prefix | function p._mos_mode_degrees(input_mos, mos_prefix, is_collapsed, step_pattern) | ||
local is_true_mos = step_pattern == nil | local is_true_mos = step_pattern == nil | ||
local input_mos = input_mos or mos.new(5, 2) | local input_mos = input_mos or mos.new(5, 2) | ||
local mos_prefix = mos_prefix or "mos" | local mos_prefix = mos_prefix or "mos" | ||
local is_collapsed = is_collapsed == true | local is_collapsed = is_collapsed == true | ||
-- Get the modes as strings and step vectors | -- Get the modes as strings and step vectors | ||
| Line 88: | Line 87: | ||
udps = tamnams.mos_mode_udps(input_mos) | udps = tamnams.mos_mode_udps(input_mos) | ||
cpos = tamnams.mos_mode_cpos(input_mos) | cpos = tamnams.mos_mode_cpos(input_mos) | ||
else | else | ||
-- Modmos udps require a mosabbrev; this is forced to be "m" since some | -- Modmos udps require a mosabbrev; this is forced to be "m" since some | ||
| Line 112: | Line 102: | ||
end | end | ||
table.insert(cpos, i) | table.insert(cpos, i) | ||
end | end | ||
end | end | ||
| Line 143: | Line 120: | ||
.. "!! rowspan=\"2\" | Rotational<br>Order " | .. "!! rowspan=\"2\" | Rotational<br>Order " | ||
.. "!! rowspan=\"2\" | Step<br>Pattern" | .. "!! rowspan=\"2\" | Step<br>Pattern" | ||
-- Add header for scale degrees | -- Add header for scale degrees | ||
| Line 167: | Line 139: | ||
-- Add brightness order (as UDP), rotational order, and step pattern | -- Add brightness order (as UDP), rotational order, and step pattern | ||
.. string.format("| %s || %s || %s", udps[i], cpos[i], step_patterns[i]) | .. string.format("| %s || %s || %s", udps[i], cpos[i], step_patterns[i]) | ||
-- Add scale degrees with cell coloring | -- Add scale degrees with cell coloring | ||
for j = 1, #step_matrices[i] do | for j = 1, #step_matrices[i] do | ||
| Line 319: | Line 286: | ||
local result = "" | local result = "" | ||
if step_pattern == "" then | if step_pattern == "" then | ||
result = p._mos_mode_degrees(input_mos, mos_prefix | result = p._mos_mode_degrees(input_mos, mos_prefix, is_collapsed) | ||
--elseif #step_pattern == input_mos.nL + input_mos.ns then | --elseif #step_pattern == input_mos.nL + input_mos.ns then | ||
else | else | ||
result = p._mos_mode_degrees(input_mos, mos_prefix | result = p._mos_mode_degrees(input_mos, mos_prefix, is_collapsed, step_pattern) | ||
end | end | ||