Module:Infobox/Centrale
Apparence
[voir] [modifier] [historique] [purger]
Cette page définit un module d'infobox. Pour les conseils sur l'usage de ce module, voyez Modèle:Infobox Centrale.
La documentation de ce module est générée par le modèle {{Documentation module}}.
Elle est incluse depuis la page Modèle:Documentation module d'infobox. Veuillez placer les catégories sur cette page-là.
Les éditeurs peuvent travailler dans le bac à sable (modifier).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
local general = require "Module:Infobox/Fonctions"
local localdata = require "Module:Infobox/Localdata"
local wikidata = require "Module:Wikidata"
local power = require "Module:Infobox/Fonctions/Centrale électrique"
local function title(icon, style, subtitleparam, subtitlequery)
return {
type = 'title',
value = function()
return localdata['nom'] or localdata['Nom']
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
local function mainimage(args, defaultimage)
if type( args ) ~= 'table' then
args = { cat = args, defaultimage = defaultimage }
end
return {
type = 'images',
imageparameters = {'image', 'Photo'},
defaultimages = args.defaultimage,
defaultimagelink = 'Aide:Insérer une image',
sizeparameter = 'taille image',
uprightparameter = 'upright',
defaultupright = args.upright,
defaultsize = args.size,
maintenancecat = args.cat or 'Article à illustrer',
captionparameter = {'légende', 'Légende'},
altparameter = args.altparameter or 'alternative image',
defaultalt = args.alt,
defaultimagealt = args.defaultimagealt,
wikidata = args.wikidata or {property = {'P18'}},
numval = 1,
}
end
return {
maincolor = '#B4B9C3',
parts = {
title(),
mainimage(),
{type = 'table', title = 'Administration', rows = {
power.adminlocation(),
general.coordinates(),
{type = 'row', label = 'Propriétaire', value = 'Propriétaire', property = 'P127'},
power.operateur(),
{type = 'row', label = 'Date de construction', value = 'année de construction', property = 'P571'},
{
type = 'row',
label = 'Date de mise en service',
value = function ( localdata )
return localdata[ 'Mis en service' ] or localdata[ 'date de mise en service' ]
end,
property = 'P729'
},
{
type = 'row',
label = 'Date de fermeture',
value = function ( localdata )
return localdata[ 'Fermeture' ] or localdata[ 'date de fermeture' ]
end,
property = 'P582'
},
{
type = 'row',
label = 'Statut',
value = function ( localdata )
return localdata[ "statut" ] or localdata[ "Statut" ]
end,
},
{type = 'row', label = 'Direction', value = 'directeur', property = 'P1037'},
{type = 'row', label = 'Effectifs', value = 'Effectifs', property = 'P1128'},
}},
{type = 'table', title = 'Caractéristiques', rows = {
{type = 'row', label = 'Nom (en langue locale)', value = 'nom_po', property = 'P1705'},
{
type = 'row',
label = "Type d'installations",
value = 'Type',
wikidata = {property = 'P31', targetvalue = {'Q1003207','Q3068975','Q30565277','Q194356','Q50687555','Q1357601','Q50688182','Q49833','Q200297','Q15911738','Q40326351','Q2298412','Q134447'}}
},
{type = 'row', label = 'Énergie utilisée', value = 'Énergie', property = 'P618'},
{type = 'row', label = 'Technologie', value = 'Technologie'},
{type = 'row',
label = 'Fournisseurs des réacteurs',
value = function ( localdata )
return localdata[ "fournisseur réacteur" ] or localdata[ "fournisseurs" ]
end,
},
{type = 'row',
label = 'Type de reacteurs',
value = function ( localdata )
return localdata[ "type réacteur" ] or localdata[ "type" ]
end,
},
{type = 'row', label = 'Réacteurs actifs', value = 'réacteurs actifs'},
{type = 'row', label = 'Nombre de puits géothermiques', value = 'Géo puit'},
{type = 'row', label = 'Profondeur maximale des puits', value = 'Géo profondeur'},
{type = 'row', label = 'Nombre de turbines', value = 'Turbine'},
{type = 'row', label = 'Type de turbine', value = 'Type turbine'},
{type = 'row', label = "Nombre d'éoliennes", value = 'Éoliennes'},
{type = 'row', label = "Type d'éoliennes", value = 'Type éoliennes'},
{type = 'row', label = 'Superficie', value = 'Surface', property = 'P2046'},
{type = 'row', label = 'Surface photovoltaïque', value = 'Sol surface'},
{
type = 'row',
label = 'Puissance installée',
value = function ( localdata )
return localdata[ "puissance_installée" ] or localdata[ "Capacité" ] or localdata[ "puissance nominale" ]
end,
wikidata = {property = 'P2109', showlink = true}
},
{
type = 'row',
label = 'Puissance thermique installée',
value = function ( localdata )
return localdata[ "puissance_thermique_installée" ] or localdata[ "Capacité_t" ]
end,
},
}},
{type = 'table', title = 'Production d’électricité', rows = {
{
type = 'row',
label = 'Production annuelle',
value = function ( localdata )
return localdata[ "Production" ] or localdata[ "Production annuelle d'électricité" ]
end,
wikidata = {property = 'P4131', showdate = 'true', numval = 1, sorttype = "inverted", showlink = true}
},
{type = 'row', label = 'Production moyenne', value = 'Production moyenne'},
{type = 'row', label = 'Production totale', value = 'production totale'},
power.facteurcharge(),
power.densitepuissance(),
{type = 'row', label = 'Émissions atmosphériques', value = 'Émissions'},
}},
{type = 'table', separator = true, rows = {
{
type = 'row',
label = 'Source froide',
value = function ( localdata )
return localdata[ 'Source froide' ] or localdata[ 'source froide' ]
end,
},
{type = 'row', label = 'Architecte', value = 'architecte', property = 'P84'},
{type = 'row', label = 'Coût', value = 'coût', property = 'P2130'},
{type = 'row', label = 'Site web', value = 'url', property = 'P856'},
}},
general.geoloc({default_zoom=9, maptype='relief'})
}
}