Módulo:Infobox/Telescópio

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


Módulo de suporte de infocaixas

Ver também


local building = require "Módulo:Infobox/Funções/Edifício"
local general = require "Módulo:Infobox/Funções"
local wd = require "Módulo:Infobox/Wikidata"
local item = require "Módulo:Infobox/Localdata".item
local localdata = require "Módulo:Infobox/Localdata"

return {
    maincolor = '#E6E3CF',
    parts = {
        general.title('espacial'),
        general.logo(),
        building.mainimage(),
        {type = 'table', title = 'Informações gerais', rows = {
            {type = 'row', label = 'Status', value = 'status'},
            {type = 'row', label = 'Nomes alternativos', value = {'nomes alt.', 'nomes_alternativos', 'nome_alternativo', 'nome alt'}},
            {type = 'row', label = 'Organização', value = 'organização', property = 'P1268'},
        {type = 'row', label = 'Origem do nome', value = {'nomeado_de', 'namedafter'}, property = 'P138'},
            {
                type = 'row',
                label = 'Observatório',
                value = 'observatório',
                wikidata = {
                    property = 'P361', -- exibe o valor de P361 se for uma instância de observatório
                    condition = function(claim)
                        local v = wd.getMainId(claim)
                        return wd.isInstance('Q62832', v, 2)                  
                        end,
                }
            },
            building.operator(),
            {
                type = 'row',
                label = 'Tipo de telescópio',
                value = 'tipo',
                wikidata = {
                    property = 'P31',
                    labelformat = function(id) -- não repetir o telescópio, mas talvez nem sempre seja uma boa ideia ?
                        local label = mw.wikibase.label(id)
                        return mw.ustring.gsub(label, "telescópio ", "")
                    end
                }
            },
            building.construction(),
            building.opening(),
            {type= 'row', label = 'Veículo de lançamento', value = 'veículo/missão'},
            {type= 'row', label = 'Local de lançamento', value = {'local_lanç.', 'local lanç'}},
            {type= 'row', label = 'N° NSSDC', value = {'nssdc', 'NSSDC'}},
            {type= 'row', label = 'Massa', value = 'massa' },
            building.renovation(),
            building.closure(),
            building.demolition(),
            {type = 'row', label = 'Substituído', value = 'substituído', property = 'P1365'},
            {type = 'row', label = 'Substituído por', value = 'substituído por', property = 'P1366' },
            building.website(),
            }
        },
        {type = 'table', title = 'Dados técnicos', rows = {
            {
            type = 'row',
            label = 'Diâmetro',
            value = 'diâmetro',
            wikidata = {
                property = 'P2386',
                targetunit = 'm',
                excludequalifier = {'P518'},
                excludequalifiervalue = {'Q1395645', 'Q29531156'} -- exclui espelhos secundários e terciários
                }
            },
            {
            type = 'row',
            label = 'Diâmetro secundário',
            value = 'diâmetro secundário',      
            wikidata = {
                property = 'P2386',
                targetunit = 'm',
                qualifier = 'P518',
                qualifiervalue = {'Q1395645'}
                }
            },
            {
            type = 'row',
            label = 'Diâmetro terciário',
            value = 'diâmetro terciário',      
            wikidata = {
                property = 'P2386',
                qualifier = 'P518',
                targetunit = 'm',
                qualifiervalue = {'Q29531156'}
                }
            },
            {
            type = 'row',
            label = '[[Poder de resolução|Resolução]]',
            value = 'resolução angular',      
            wikidata = {
                property = 'P3439',
                }
            },
            {
            type = 'row',
            label = '[[Distância focal]]',
            value = 'distância_focal',      
            wikidata = {
                property = 'P2151',
                }
            },
            {
            type = 'row',
            label = '[[Comprimento de onda]]',
            value = {'largura_onda', 'comprimento_onda'},      
            wikidata = function()
                local minlength = wd.formatAndCat{entity = item, property = 'P3738', showunit = "-", linkback = '-'}
                local maxlength = wd.formatAndCat{entity = item, property = 'P3737'}
                if (minlength and maxlength) then
                    return minlength .. ' - ' .. maxlength
                elseif maxlength then
                    return "até " .. maxlength
                elseif minlength then
                    return "a partir de ".. minlength -- integrar no módulo: Linguística ?
                end
                return wd.formatAndCat{entity = item, property = 'P2808', targetunit = 'nanometer'}
                end
            },
            {
            type = 'row',
            label = '[[:en:Telescope mount|Base da montagem]]',
            value = 'mounting',      
            wikidata = {
                property = 'P2670',
                showonlyqualifier = {'P31'},
                targetvalue = 'Q1205231',
                labelformat = function(id) -- evitar de repetir  "Monte"
                    local label = mw.wikibase.label(id)
                    return mw.ustring.gsub(label, "montagem ", "")
                    end
                }
            },
        {type = 'row', label = 'Cobertura', value = 'dome', property = 'P3158'},
            {
            type = 'row',
            label = 'Área de alcance',
            value = 'área',      
            wikidata = {
                property = 'P2046',
                }
            },
        -- {type = 'row', label = 'NRHP', value = 'commons', property = 'P373'},
            {type = 'row', label = function() return localdata['instrumento_1_nome'] or 'Instrumento1' end, value = 'instrumento_1_características'},
            {type = 'row', label = function() return localdata['instrumento_2_nome'] or 'Instrumento2' end, value = 'instrumento_2_características'},
            {type = 'row', label = function() return localdata['instrumento_3_nome'] or 'Instrumento3' end, value = 'instrumento_3_características'},
            {type = 'row', label = function() return localdata['instrumento_4_nome'] or 'Instrumento4' end, value = 'instrumento_4_características'},
            {type = 'row', label = function() return localdata['instrumento_5_nome'] or 'Instrumento5' end, value = 'instrumento_5_características'},
            {type = 'row', label = function() return localdata['instrumento_6_nome'] or 'Instrumento6' end, value = 'instrumento_6_características'},
         },
        },
        {type = 'table', title = 'Geografia', rows = {  
            {type = 'row', label = 'Tempo de observação disponível', value = 'tempo de observação disponível', wikidata = {property = 'P3891', showunit = 'long'}},
            building.elevation(),
            {type = 'row', label = 'Localização atual', value = 'local', property = 'P706'}, -- posição geográfica, útil em locais isolados, mas para melhor integrar linguisticamente com "administração"
            building.historicalregion(),
            building.mountainrange(),
            building.adminlocation(),
            building.protectedarea(),
            building.coordenadas(),
            }
        },
        building.geoloc(),
}
}