Module:AVDevice: Difference between revisions

Major update: Add semantic queries for structured inputs, outputs, voltage ranges, archival links; add TV system and power spec display (via update-page on MediaWiki MCP Server)
Fix semantic query parameter names to use short labels (count, signal, connector, location) (via update-page on MediaWiki MCP Server)
Line 209: Line 209:


-- Connectivity section - query structured inputs and outputs
-- Connectivity section - query structured inputs and outputs
local inputsQueryWikitext =
local inputsCountWikitext =
'{{#ask:\n' ..
'{{#ask:\n' ..
' [[Has AV device::' .. fullPageName .. ']]\n' ..
' [[Has AV device::' .. fullPageName .. ']]\n' ..
' [[Has video signal format::+]]\n' ..
' [[Has video signal format::+]]\n' ..
' |?Has input label=Label\n' ..
' |?Has video signal format=Signal\n' ..
' |?Has connector type=Connector\n' ..
' |?Has input count=Count\n' ..
' |?Has input location=Location\n' ..
' |?Has audio type=Audio\n' ..
' |format=count\n' ..
' |format=count\n' ..
'}}'
'}}'
local inputCount = frame:preprocess(inputsQueryWikitext)
local inputCount = frame:preprocess(inputsCountWikitext)
local hasInputs = inputCount and tonumber(trim(inputCount)) and tonumber(trim(inputCount)) > 0
local hasInputs = inputCount and tonumber(trim(inputCount)) and tonumber(trim(inputCount)) > 0


local outputsQueryWikitext =
local outputsCountWikitext =
'{{#ask:\n' ..
'{{#ask:\n' ..
' [[Has AV device::' .. fullPageName .. ']]\n' ..
' [[Has AV device::' .. fullPageName .. ']]\n' ..
Line 230: Line 224:
' |format=count\n' ..
' |format=count\n' ..
'}}'
'}}'
local outputCount = frame:preprocess(outputsQueryWikitext)
local outputCount = frame:preprocess(outputsCountWikitext)
local hasOutputs = outputCount and tonumber(trim(outputCount)) and tonumber(trim(outputCount)) > 0
local hasOutputs = outputCount and tonumber(trim(outputCount)) and tonumber(trim(outputCount)) > 0


Line 241: Line 235:
' [[Has AV device::' .. fullPageName .. ']]\n' ..
' [[Has AV device::' .. fullPageName .. ']]\n' ..
' [[Has video signal format::+]]\n' ..
' [[Has video signal format::+]]\n' ..
' |?Has input count=\n' ..
' |?Has input count=count\n' ..
' |?Has video signal format=\n' ..
' |?Has video signal format=signal\n' ..
' |?Has connector type=\n' ..
' |?Has connector type=connector\n' ..
' |?Has input location=\n' ..
' |?Has input location=location\n' ..
' |format=template\n' ..
' |format=template\n' ..
' |template=AV device input row\n' ..
' |template=AV device input row\n' ..
Line 261: Line 255:
' [[Has AV device::' .. fullPageName .. ']]\n' ..
' [[Has AV device::' .. fullPageName .. ']]\n' ..
' [[Has output signal format::+]]\n' ..
' [[Has output signal format::+]]\n' ..
' |?Has output count=\n' ..
' |?Has output count=count\n' ..
' |?Has output signal format=\n' ..
' |?Has output signal format=signal\n' ..
' |?Has output connector=\n' ..
' |?Has output connector=connector\n' ..
' |?Has output location=\n' ..
' |?Has output location=location\n' ..
' |format=template\n' ..
' |format=template\n' ..
' |template=AV device output row\n' ..
' |template=AV device output row\n' ..
Line 305: Line 299:
' [[Has AV device::' .. pageName .. ']]\n' ..
' [[Has AV device::' .. pageName .. ']]\n' ..
' [[Voltage min::+]]\n' ..
' [[Voltage min::+]]\n' ..
' |?Voltage min\n' ..
' |?Voltage min=vmin\n' ..
' |?Voltage max\n' ..
' |?Voltage max=vmax\n' ..
' |format=template\n' ..
' |format=template\n' ..
' |template=AV device voltage row\n' ..
' |template=AV device voltage row\n' ..
Line 343: Line 337:


-- Archival Links section - query AV link subobjects
-- Archival Links section - query AV link subobjects
local linksQueryWikitext =
local linksCountWikitext =
'{{#ask:\n' ..
'{{#ask:\n' ..
' [[AV device::' .. fullPageName .. ']]\n' ..
' [[AV device::' .. fullPageName .. ']]\n' ..
' [[Model link URL::+]]\n' ..
' [[Model link URL::+]]\n' ..
' |?Model link type\n' ..
' |?Model link source\n' ..
' |?Model link URL\n' ..
' |format=count\n' ..
' |format=count\n' ..
'}}'
'}}'
local linkCount = frame:preprocess(linksQueryWikitext)
local linkCount = frame:preprocess(linksCountWikitext)
local hasLinks = linkCount and tonumber(trim(linkCount)) and tonumber(trim(linkCount)) > 0
local hasLinks = linkCount and tonumber(trim(linkCount)) and tonumber(trim(linkCount)) > 0


Line 362: Line 353:
' [[AV device::' .. fullPageName .. ']]\n' ..
' [[AV device::' .. fullPageName .. ']]\n' ..
' [[Model link URL::+]]\n' ..
' [[Model link URL::+]]\n' ..
' |?Model link type\n' ..
' |?Model link type=type\n' ..
' |?Model link source\n' ..
' |?Model link source=source\n' ..
' |?Model link URL\n' ..
' |?Model link URL=url\n' ..
' |format=template\n' ..
' |format=template\n' ..
' |template=AV device link row\n' ..
' |template=AV device link row\n' ..
MediaWiki Appliance - Powered by TurnKey Linux