Documentação do módulo[ver] [editar] [histórico] [purgar]


Descrição editar

Este Módulo tem funções auxiliares para criar infocaixas. Ver {{Info/Central}}

Uso editar

Outra documentação:

local general = require "Module:Infobox/Funções"
local localdata = require "Module:Infobox/Localdata"
local wikidata = require "Module:Infobox/Wikidata"
local power = require "Module:Infobox/Funções/Central elétrica"

local function title(icon, style, subtitleparam, subtitlequery)
    return {
        type = 'title',
        value = function()
            return localdata['nome']
                or wikidata.getLabel(localdata.item) and mw.language.getContentLanguage():ucfirst( wikidata.getLabel(localdata.item) )
                or mw.title.getCurrentTitle().text
        end,
        subtitle = function() return localdata[subtitleparam] end,
        wikidatasubtitle = subtitlequery,
        icon = icon,
        style = style,
    }
end

return {
    maincolor = '#B4B9C3',
    parts = {
        title(),
        general.mainimage('!Artigos de sociedade sem imagens', 'Padrao 2.svg'),
        {type = 'table', title = 'Administração', rows = {
            power.adminlocation(),
            general.coordenadas(),
            {type = 'row',
                label = 'Proprietário',
                plurallabel = 'Proprietários',
                value = function ( localdata )
                    return localdata[ 'proprietário' ]
                end,
                wikidata = {property = 'P127', atdate = "today", showdate = true, sorttype = 'inverted', precision = 'year', showqualifiers = "P1107", qualiftargetunit = 'percent'}
            },
            power.operador(),
            {type = 'row', label = 'Construção', value = 'ano de construção', property = 'P571'},
            {
                type = 'row',
                label = 'Entrada em serviço',
                value = function ( localdata )
                    return localdata[ 'entrada em serviço' ]
                end,
                property = 'P729'
            },
            {
                type = 'row',
                label = 'Saída de serviço',
                value = function ( localdata )
                    return localdata[ 'saída de serviço' ]
                end,
                property = 'P730'
            },
            {type = 'row', label = 'Início desmantelamento', value = 'data desmantelamemto'},
            {type = 'row', label = 'Fim de desmantelamento', value = 'date desmantelamento'},
            {
                type = 'row',
                label = 'Estatuto',
                value = function ( localdata )
                    return localdata[ "estatuto" ]
                end,
                wikidata = {property = 'P5817', defaultlink = '-'}
            },
            {
                type = 'row',
                label = 'Direção',
                value = function ( localdata )
                    return localdata[ "diretor" ] or localdata[ "diretora" ]
                end,
                property = 'P1037'
            },
            {
                type = 'row',
                label = 'Efetivos',
                value =    function()
                    if (not localdata['efetivo']) then
                        return nil
                    end
                    local n = localdata['efetivo']
                    if tonumber(n) then
                        n = formatnum(n)
                    end
                    local dat = localdata['data efetivo']
                    return linguistic.conj({n, linguistic.inparentheses(dat)}, " ")
                    end,
                    wikidata = {property = 'P1128', sorttype = 'chronological', rank = 'valid', showdate = true, conjtype = '<br />'}
            },
        }},
        {type = 'table', title = 'Características', rows = {
            {type = 'row', label = 'Nome (em língual local)', value = 'nome local', property = 'P1705'},
            {
                type = 'row',
                label = "Tipo de instalação",
                value = function ( localdata )
                    return localdata[ "tipo de instalação" ] or localdata[ "tipo" ]
                end,
                wikidata = {property = 'P31', targetvalue = {'Q2298412','Q1003207','Q285927','Q194356','Q50687555','Q1357601','Q50688182','Q49833','Q15911738','Q3068975','Q25509593','Q1411996','Q2308605','Q200297','Q1434958','Q6558431','Q53951823','Q2944640','Q3498533','Q261604','Q1427536','Q61867910','Q1601458','Q900729','Q864553','Q64447720','Q30565277','Q134447','Q13416228','Q1534713','Q339353','Q40326351','Q810924'}}
                -- 'Q2298412' : centrale électrique solaire, 'Q1003207' : centrale solaire photovoltaïque, 'Q285927' : centrale solaire thermodynamique
                -- 'Q194356' : parc éolien, 'Q50687555' : parc éolien terrestre, 'Q1357601' : parc éolien en mer, 'Q50688182' : parc éolien flotant, 'Q49833' : éolienne,
                -- 'Q15911738' : centrale hydroélectrique, 'Q3068975' : ferme à vagues, 'Q25509593' : centrale marémotrice, 'Q1411996' : centrale hydroélectrique au fil de l'eau, 'Q2308605' : centrale hydroélectrique de lac,
                -- 'Q200297' : centrale thermique, 'Q1434958' : centrale à énergie fossile, 'Q6558431' : centrale au charbon, 'Q53951823' : centrale au lignite, 'Q2944640' : centrale électrique au gaz, 'Q3498533' : centrale électrique au gaz naturel, 'Q261604' : centrale électrique au pétrole, 'Q1427536' : centrale à turbine à gaz
                -- 'Q61867910' : centrale de cogénération, 'Q1601458' : centrale de cogénération chaleur et électricité, 'Q900729' : centrale à cycle combiné, 'Q864553' : centrale de cogénération chaleur et électricité à la biomasse, 'Q64447720' : centrale électrique et usine de dessalement intégrée,
                -- 'Q30565277' : centrale géothermique, 'Q134447' : centrale nucléaire, 'Q13416228' : incinérateur de déchets, 'Q1534713' : navire-centrale,
                -- 'Q339353' : centrale de pompage-turbinage, 'Q40326351' : centrale de stockage, 'Q810924' : centrale de stockage par batterie
            },
            {
                type = 'row',
                label = 'Energia utilizada',
                value = function ( localdata )
                    return localdata[ "energia" ]
                end,
                property = 'P618'
            },
            {
                type = 'row',
                label = 'Tecnologia',
                value = function ( localdata )
                    return localdata[ "tecnologia" ]
                end,
            },
            {type = 'row',
                label = 'Fornecedores de reator',
                value = function ( localdata )
                    return localdata[ "fornecedores de reator" ] or localdata[ "fornecedores" ]
                end,
            },
            {type = 'row',
                label = 'Tipo de reatores',
                value = function ( localdata )
                    return localdata[ "tipo reator" ]
                end,
            },
            {type = 'row', label = 'Reatores ativos', value = 'reatores ativos'},
            {
                type = 'row',
                label = 'Número de poços geotérmicos',
                value = function ( localdata )
                    return localdata[ "poços geotérmicos" ]
                end,
            },
            {
                type = 'row',
                label = 'Profundidade máxima de poços',
                value = function ( localdata )
                    return localdata[ "profundidade poços" ]                end,
            },
            {
                type = 'row',
                label = 'Número de turbinas',
                value = function ( localdata )
                    return localdata[ "turbina" ]
                end,
            },
            {
                type = 'row',
                label = 'Tipo de turbina',
                value = function ( localdata )
                    return localdata[ "tipo turbina" ]
                end,
            },
            {
                type = 'row',
                label = "Número de eólicas",
                value = function ( localdata )
                    return localdata[ "eólicas" ]
                end,
            },
            {
                type = 'row',
                label = "Tipo de eólicas",
                value = function ( localdata )
                    return localdata[ "tipo eólicas" ]
                end,
            },
            {type = 'row',
                label = 'Superfície',
                value = function ( localdata )
                    return localdata[ "surperfície" ]
                end,
                property = 'P2046'
            },
            {
                type = 'row',
                label = 'Superfícies fotovoltaica',
                value = function ( localdata )
                    return localdata[ "sol surperfície" ]
                end,
            },
            {
                type = 'row',
                label = 'Potência instalada',
                value = function ( localdata )
                    return localdata[ "potência instalada" ] or localdata[ "capacidade" ] or localdata[ "potência nominal" ]
                end,
                wikidata = {property = 'P2109', showlink = true}
            },
                    {
                type = 'row',
                label = 'Potência térmica instalada',
                value = function ( localdata )
                    return localdata[ "potência térmica instalada" ]
                end,
            },
        }},
        {type = 'table', title = 'Produção elétrica', rows = {
            {
                type = 'row',
                label = 'Produção anual',
                value = function ( localdata )
                    return localdata[ "produção" ] or localdata[ "produção anual elétrica" ]
                end,
                wikidata = {property = 'P4131', showdate = 'true', numval = 1, sorttype = "inverted", showlink = true}
            },
            {
                type = 'row',
                label = 'Produção média',
                value = function ( localdata )
                    return localdata[ "produção média" ]
                end,
            },
            {type = 'row', label = 'Produção total', value = 'produção total'},
            power.fatorcarga(),
            power.densidadepotencia(),
            {
                type = 'row',
                label = 'Emissões atmosférica',
                value = function ( localdata )
                    return localdata[ "emissões" ]
                end,
            },
        }},
        {type = 'table', separator = true, rows = {
            {
                type = 'row',
                label = 'Fonte frio',
                value = function ( localdata )
                    return localdata[ 'fonte frio' ]
                end,
            },
            {type = 'row', label = 'Arquiteto', value = 'arquiteto', property = 'P84'},
            {type = 'row', label = 'Custo', value = 'custo', property = 'P2130'},
            {type = 'row', label = 'Website', value = 'url', property = 'P856'},
        }},
        general.geoloc({default_zoom=7, maptype='relief'})
    }
}