Módulo:Infobox/Farol

Permanently protected module
Origem: Wikipédia, a enciclopédia livre.
Documentação do módulo[ver] [editar] [histórico] [purgar]

Descrição

Este módulo implementa a predefinição {{Info/Farol}}

Uso

Outra documentação:

local localdata = require "Módulo:Infobox/Localdata"
local building = require "Módulo:Infobox/Funções/Edifício"
local lighthouse = require "Módulo:Infobox/Funções"
local convert = require "Módulo:Conversão"

       
local function alcance()
    local value = function(localdata)
        local quilometro = localdata['alcance_luz']
    if quilometro then
           return quilometro .. ' [[Milha náutica|milhas náuticas]]'
        end 
    end
  
    return {type = 'row', label = 'Alcance luz', value = value,
            wikidata = {property = 'P2929', targetunit = 'nautica', conjtype = 'comma', rounding = '1', showqualifiers = {'P462'}}}
end

local function lampada()
    local value = function(localdata)
        local wat = localdata['lâmpada']
    if wat then
           return wat .. ' [[watt|W]]'
        end 
    end
    return {type = 'row', label = 'Lâmpada', value = value }
end

return
    {
    maincolor = '#A8D2FF',
    parts =
        {
        lighthouse.title('mapa'),
        lighthouse.mainimage(),
        building.geoloc({marker = 'lighthouse', default_zoom=14, markercolor = '#990000'}),
        {type = 'table', rows = {
        {type = 'row', label = 'Número internacional', value = 'num_internacional'},
        {type = 'row', label = 'Número nacional', value = 'n_nacional'}
        }},
        {type = 'table', title = "Localização", rows = {
            building.coordenadas(),
            building.onshoreof(),
            building.island(),
            building.adminlocation(),
            {type = 'row', label = 'Localização', value = 'localização'},
            {type = 'row', label = 'Altitude', value = function ( localdata )
            return convert.displayvalue( localdata['altitude'], 'm', {showunit = 'short'} ) end,
            wikidata = {property = 'P2044', targetunit = 'metro', conjtype = ' ou ', rounding = '0', numval = '2'}},
            building.protectedarea(),
            },
        },
        {type = 'table', title = "História", rows = {
            building.creator(),
            building.construction(),
            building.opening(),
            {type = 'row', label = 'Entrada em serviço', value = 'entrada em serviço', property = 'P729'},
            {type = 'row', label = 'Eletrificação', value = 'eletrificação', wikidata = {property = 'P793', targetvalue = 'Q1076056', showonlyqualifier = 'P585'} },
            {type = 'row', label = 'Telefarol', value = 'telefarol'},
            {type = 'row', label = 'Automatização', value = {'automatização', 'automatizado_desde'}, wikidata = {property = 'P793', targetvalue = 'Q24410992', showonlyqualifier = 'P585'}},
            {type = 'row', label = 'Desabitado', value = 'desabitado_desde' },
            {type = 'row', label = 'Refletor de radar', value = 'radar' },
            {type = 'row', label = 'Motores de rotação', value = 'motores_rotação' },
            {type = 'row', label = 'Trocador de lâmpadas', value = 'trocador_lampadas' },
            {type = 'row', label = 'Aparência', value = 'aparencia'},
            {type = 'row', label = 'Desativação', value = 'desativação', property = 'P730'},
            building.protection(),
            {type = 'row', label = 'Guardas', value = 'habitado'},
            {type = 'row', label = 'Visitantes', value = 'visitável'},
            },
        },
        {type = 'table', title = "Arquitetura", rows = {
--                  {type = 'row', label = 'Altura', value = function ( localdata )
--            return convert.displayvalue( localdata['altura'], 'metro', {showunit = 'short'} ) end,
--            wikidata =  {property = 'P2048', targetunit = 'm', excludequalifier = {'P518', 'P794', 'P2923'}, excludequalifiervalue = {'Q24192182', 'Q131214','Q852590', 'Q83180'}, statementformat = function(statement)
--            return inclexcl(statement, {targetunit = 'metro', rounding = '1'}) end}},
            building.dimensions(),
            building.shape(),
            building.material(),
            --{type = 'row', label = 'Cimentos', value = 'cimentos' },
            {type = 'row', label = 'Desenho', value = 'desenho' },
            {type = 'row', label = 'Observações', value = 'observações' },
            {type = 'row', label = 'Altura focal', value = function ( localdata )
            return convert.displayvalue( localdata['altura_focal'], 'm', {showunit = 'short'} ) end, wikidata = {property = 'P2923', targetunit = 'metro', conjtype = ' ou ', rounding = '1', numval = '2'} },
            {type = 'row', label = 'Plano de iluminação marítima de', value = 'ano_plano_de_iluminação' },
            {type = 'row', label = 'Classificação', value = {'ordem_classificação', 'ordem_clasificação'}},
            {type = 'row', label = 'Autor do projeto', value = 'projetado_por' },
            {type = 'row', label = 'Direção facultativa', value = 'direção_facultativa' },
            {type = 'row', label = 'Arquiteto', value = 'arquiteto' },
            {type = 'row', label = 'Construtor', value = 'construido_por' },
           
            {type = 'row', label = 'Plano de iluminação marítima de', value = 'ano_plano_de_iluminação' },
           
            {type = 'row', label = 'Elevação', value = 'elevação', property = 'P2044'},
            {type = 'row', label = 'Marches', value = 'marches', wikidata = {property = 'P2670', targetvalue = 'Q3289701', showonlyqualifier = 'P1114'} },
            building.material(),
            building.colour(),
            },
        },
        {type = 'table', title = "Equipamento", rows = {
            {type = 'row', label = 'Ótica original', value = 'ótica_original'},
            {type = 'row', label = 'Ótica', value = {'óptica', 'ótica'}},
            {type = 'row', label = 'Lanterna', value = 'lanterna' },
            lampada,
            {type = 'row', label = 'Intensidade luminosa', value = 'intensidade luminosa', property = 'P3041'},
            {type = 'row', label = 'Quadro de comandos', value = 'quadro_commandos' },
            {type = 'row', label = 'Telefarol', value = 'telefarol' },
            {type = 'row', label = 'Energia solar', value = 'energia_solar' },
            {type = 'row', label = 'Rede', value = 'rede' },
            {type = 'row', label = 'Gás', value = 'gas' },
            {type = 'row', label = 'Grupo elétrico', value = 'grupo_elet' },
            {type = 'row', label = 'Baterias', value = 'baterias' },
            {type = 'row', label = 'Carregador', value = 'carregador' },
            {type = 'row', label = 'Fases', value = 'ciclo'},
            alcance,
            {type = 'row', label = '[[Luz característica]]', value = {'feixo', 'luz', 'características'}, property = 'P1030'},
            {type = 'row', label = 'Aviso sonoro', value = 'aviso sonoro'},
            {type = 'row', label = 'Delimitação de sectores', value = 'delimitação_sectores'},
            {type = 'row', label = '[[Radar Racon|Racon]]', value = 'Racon', property = 'P3994'},
            },
        },
        {type = 'table', title = "Identificadores", rows = {
            {type = 'row', label = '№ Faróis de Portugal', value = {'num_portugal', 'n_portugal'}, wikidata = {property = "P4423"}},
            {type = 'row', label = '№ [[Instituto Hidrográfico do Reino Unido#Listas de Luzes do Almirantado|internacional]]', value = {'admiralty', 'n_UKHO'}, property = 'P3562'},
            {type = 'row', label = '№ da [[Sociedade de Radioamadores de Faróis|ARLHS]]', value = {'n_ARLHS', 'arlhs'}, wikidata = {property = "P2980", urlpattern="http://wlol.arlhs.com/lighthouse/$1.html"}},
            {type = 'row', label = '№ [[GeoNames]]', value = 'geonames', property = 'P1566'},
            {type = 'row', label = '№ da [[Agência Nacional de Informação Geoespacial|NGA]]', value = {'n_NGA', 'NGA'}, property = 'P3563'},
            {type = 'row', label = 'Dansk Fyrliste', value = 'Dansk Fyrliste', property = 'P4038'},
            {type = 'row', label = '[[Guarda Costeira do Canadá|GCC]]', value = 'GCC', property = 'P3920'},
            {type = 'row', label = 'Online List of Lights', value = 'online', wikidata = {property = "P3223", urlpattern="http://listoflights.org/leuchtfeuer/detail?id=$1"}},
            {type = 'row', label = 'Marinha Militar Italiana', value = 'Marina militare', wikidata = {property = "P3863", urlpattern="http://www.marina.difesa.it/cosa-facciamo/fari/Pagine/$1.aspx"}},
            {type = 'row', label = '[[MarineTraffic]]', value = 'MarineTraffic', wikidata = {property = "P3601", urlpattern="http://www.marinetraffic.com/fr/ais/details/lights/$1/"}},
            {type = 'row', label = 'Norsk fyrliste', value = 'Norsk fyrliste', property = 'P4055'},
            {type = 'row', label = '[[Guarda Costeira dos Estados Unidos|USCG]]', value = 'USCG', property = 'P3723'},
            {type = 'row', label = 'Vitaskrá', value = 'Vitaskrá', property = 'P3993'},
            },
        },
    }
}