new power terminal added
This commit is contained in:
parent
5146d50d4b
commit
7e40b18cf1
@ -33,6 +33,16 @@ function techage.set_activeformspec(pos, player)
|
||||
end
|
||||
end
|
||||
|
||||
function techage.reset_activeformspec(pos, player)
|
||||
local name = player and player:get_player_name()
|
||||
if name then
|
||||
if ActivePlayer[name] then
|
||||
ActiveFormspecs[ActivePlayer[name]] = nil
|
||||
ActivePlayer[name] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
if ActivePlayer[name] then
|
||||
|
@ -22,7 +22,7 @@ local Networks = {} -- cache for networks
|
||||
|
||||
techage.networks = {} -- name space
|
||||
|
||||
local MAX_NUM_NODES = 500
|
||||
local MAX_NUM_NODES = 1000
|
||||
local BEST_BEFORE = 5 * 60 -- 5 minutes
|
||||
local Route = {} -- Used to determine the already passed nodes while walking
|
||||
local NumNodes = 0
|
||||
@ -343,3 +343,5 @@ end
|
||||
-- Get node tubelib2 connections as table of outdirs
|
||||
-- techage.networks.get_node_connections(pos, net_name)
|
||||
techage.networks.get_node_connections = get_node_connections
|
||||
|
||||
techage.networks.MAX_NUM_NODES = MAX_NUM_NODES
|
||||
|
@ -238,5 +238,3 @@ minetest.register_craft({
|
||||
{"default:wood", "techage:iron_ingot", "basic_materials:steel_bar"},
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
@ -574,12 +574,12 @@ techage.manual_DE.aText = {
|
||||
"\n"..
|
||||
"\n"..
|
||||
"\n",
|
||||
"Hat bis zu vier Arme und erlaubt damit\\, Strom in bis zu 6 Richtungen weiter zu verteilen.\n"..
|
||||
"Hat bis zu vier Arme und erlaubt damit\\, Strom in bis zu 6 Richtungen weiter zu verteilen. \n"..
|
||||
"Der Strommastkopf schützt Stromleitungen und Masten in einem Radius von 8 m.\n"..
|
||||
"\n"..
|
||||
"\n"..
|
||||
"\n",
|
||||
"Dieser Strommastkopf hat nur 2 Arme und wird für die Überlandleitungen genutzt. \n"..
|
||||
"Dieser Strommastkopf hat zwei feste Arme und wird für die Überlandleitungen genutzt. Er kann aber auch Strom nach unten und oben weiterleiten.\n"..
|
||||
"Der Strommastkopf schützt Stromleitungen und Masten in einem Radius von 8 m.\n"..
|
||||
"\n"..
|
||||
"\n"..
|
||||
@ -609,10 +609,11 @@ techage.manual_DE.aText = {
|
||||
"\n"..
|
||||
"\n"..
|
||||
"\n",
|
||||
"Das Strom-Terminal muss mit dem Stromnetz verbunden werden. Es zeigt Daten aus dem Stromnetz an wie:\n"..
|
||||
"Das Strom-Terminal muss mit dem Stromnetz verbunden werden. Es zeigt Daten aus dem Stromnetz an.\n"..
|
||||
"\n"..
|
||||
" - Anzahl und Leistung der verschiedenen Generatoren und Akkus (aktuell/maximal)\n"..
|
||||
" - Anzahl der Netzwerk-Blöcke (max. 1000)\n"..
|
||||
"In der oberen Hälfte werden nur die Daten eines ausgewählten Typs ausgegeben. Wird als Typ bspw. \"Kraftwerk\" gewählt\\, so werden nur die Daten von Öl- und Kohlekraftwerken gesammelt und ausgegeben. Links werden die Daten von Generatoren (Stromabgabe) und rechts die Daten von Energiespeichern (Stromaufnahme) ausgegeben. Beim Akkublocks bspw. wird beides ausgegeben\\, da der Akku Strom aufnehmen und abgeben kann.\n"..
|
||||
"\n"..
|
||||
"In der unteren Hälfte werden die Daten aller Generatoren und Speichersystemen des ganzen Stromnetzen zusammengefasst ausgegeben.\n"..
|
||||
"\n"..
|
||||
"\n"..
|
||||
"\n",
|
||||
@ -983,7 +984,7 @@ techage.manual_DE.aText = {
|
||||
"\n"..
|
||||
"Der Strom muss vom Rotor-Block durch den Mast nach unten geführt werden. Dazu zuerst die Stromleitung nach oben ziehen und das Stromkabel dann mit TA4 Säulenblöcke \"verputzen\". Unten kann eine Arbeitsplattform errichtet werden. Der Plan rechts zeigt den Aufbau im oberen Teil.\n"..
|
||||
"\n"..
|
||||
"Die Windkraftanlage liefert eine Leistung von 80 ku\\, aber dies nur 8 Stunden am Tag (siehe oben).\n"..
|
||||
"Die Windkraftanlage liefert eine Leistung von 70 ku\\, aber dies nur 8 Stunden am Tag (siehe oben).\n"..
|
||||
"\n"..
|
||||
"\n"..
|
||||
"\n",
|
||||
@ -1024,7 +1025,7 @@ techage.manual_DE.aText = {
|
||||
"\n"..
|
||||
"Solarmodule liefern Gleichspannung\\, welcher nicht direkt in das Stromnetz eingespeist werden kann. Daher müssen zuerst die Solareinheiten über das rote Kabel mit dem Wechselrichter verbunden werden. Dieser besteht aus zwei Blöcken\\, einen für das rote Kabel zu den Solarmodulen (DC) und einen für das graue Stromkabel ins Stromnetz (AC).\n"..
|
||||
"\n"..
|
||||
"Der Kartenbereich\\, wo die Solaranlage steht\\, muss komplett geladen sein. Es empfiehlt sich daher\\, zuerst einen Forceload Block zu setzen\\, und dann innerhalb dieses Bereiches die Module zu platzieren.\n"..
|
||||
"Der Kartenbereich\\, wo die Solaranlage steht\\, muss komplett geladen sein. Die gilt auch für die direkte Position über dem Solarmodul\\, denn dort wird regelmäßig die Lichtstärke gemessen. Es empfiehlt sich daher\\, zuerst einen Forceload Block zu setzen\\, und dann innerhalb dieses Bereiches die Module zu platzieren.\n"..
|
||||
"\n"..
|
||||
"\n"..
|
||||
"\n",
|
||||
|
@ -194,12 +194,12 @@ local net_def = {
|
||||
sides = {F = 1, B = 1},
|
||||
ntype = "con2",
|
||||
nominal = PWR_PERF,
|
||||
on_power = on_power,
|
||||
on_nopower = on_nopower,
|
||||
},
|
||||
pipe2 = {
|
||||
sides = {L = 1, R = 1},
|
||||
ntype = "con1",
|
||||
on_power = on_power,
|
||||
on_nopower = on_nopower,
|
||||
},
|
||||
}
|
||||
|
||||
|
1
init.lua
1
init.lua
@ -59,6 +59,7 @@ else
|
||||
dofile(MP.."/power/electric_cable.lua")
|
||||
dofile(MP.."/power/junctionbox.lua")
|
||||
dofile(MP.."/power/power_terminal.lua")
|
||||
dofile(MP.."/power/power_terminal2.lua")
|
||||
dofile(MP.."/power/powerswitchbox.lua")
|
||||
dofile(MP.."/power/powerswitch.lua")
|
||||
dofile(MP.."/power/protection.lua")
|
||||
|
@ -1,6 +1,7 @@
|
||||
# textdomain: techage
|
||||
|
||||
#### TA3 Terminal ####@n@nSend commands to your machines@nand output text messages from your@nmachines to the Terminal.@n@nCommand syntax:@n cmd <num> <cmnd>@n@nexample: cmd 181 on@n<num> is the number of the node to which the command is sent@n'on' is the command to turn machines/nodes on@nFurther commands can be retrieved by clicking on@nmachines/nodes with the Techage Info Tool.@n@nLocal commands:@n- clear @= clear screen@n- help @= this message@n- pub @= switch to public use@n- priv @= switch to private use@nTo program a user button with a command:@n set <button-num> <button-text> <command>@ne.g. 'set 1 ON cmd 123 on'@n=
|
||||
Accu Box=Akkublock
|
||||
Active:=Aktiv:
|
||||
All nodes:=Alle Blöcke:
|
||||
Allow to dig/place Techage power lines nearby power poles=Erlaubt TODO
|
||||
@ -34,6 +35,7 @@ Build derrick=Errichte Ölturm
|
||||
Compressed Gravel=Komprimiertes Kies
|
||||
Consum. 1=Konsum. 1
|
||||
Consum. 2=Konsum. 2
|
||||
Current power:=Aktueller Verbrauch:
|
||||
Depth=Tiefe
|
||||
Digging depth=Grabungstiefe
|
||||
Dirt with Ash=Erde mit Asche
|
||||
@ -46,6 +48,8 @@ Ele Power Source=Ele Kraftquelle
|
||||
Electricity=Strom
|
||||
Electrolyzer=Eletrolyseur
|
||||
Electronic Fab=Elektronikfabrik
|
||||
Energy storage=Engergiespeicher
|
||||
Energy stored:=Energie gespeichert
|
||||
Enter=Eingeben
|
||||
Epoxide Resin=Epoxidharz
|
||||
Epoxide Resin Barrel=Epoxidharz Fass
|
||||
@ -58,12 +62,14 @@ Flywheel=Schwungrad
|
||||
Force order of filter items=Erzwinge Reihenfolge
|
||||
Fuel Cell=Brennstoffzelle
|
||||
Fuel Menu=Brennstoff Menü
|
||||
Fuel cell=Brennstoffzelle
|
||||
Furnace Top=Ofenoberteil
|
||||
Gas Cylinder Large=Gasflasche groß
|
||||
Gas Cylinder Small=Gasflasche klein
|
||||
Genera. 1=Genera. 1
|
||||
Genera. 2=Genera. 2
|
||||
Generator=Generator
|
||||
Generators=Generatoren
|
||||
Gibbsite Powder=Gibbsit Pulver
|
||||
Gravel Rinser=Kiesspüler
|
||||
Gravel Sieve=Kiessieb
|
||||
@ -77,6 +83,7 @@ Hydrogen Cylinder Small=Wasserstoffflasche klein
|
||||
In use:=In Benutzung:
|
||||
Insert destination node number(s)=Gebe Zielnummer(n) ein
|
||||
Insert door/gate block number(s)=Gebe Tür-/Tornummer(n) ein
|
||||
Intake=Stromaufnahme
|
||||
Inverter=Wechselrichter
|
||||
Leave Powder=Laub Pulver
|
||||
Liquid Filler=Einfülltrichter
|
||||
@ -87,6 +94,7 @@ Load=Ladung
|
||||
Lye=Lauge
|
||||
Lye Barrel=Lauge Fass
|
||||
Lye Canister=Lauge Kanister
|
||||
Maximum power:=Maximalstrom:
|
||||
Melting Guide=Schmelzführer
|
||||
Melting Pot active (heat@==Schmelztiegel aktiv (Hitze@=
|
||||
Melting Pot inactive (heat@==Schmelztiegel inaktiv (Hitze@=
|
||||
@ -103,11 +111,14 @@ Needle Powder=Nadel Pulver
|
||||
Network Data=Netzwerkdaten
|
||||
No network or active generator available!=Kein Stromnetz oder aktiver Generator verfügbar
|
||||
No plan available=Kein Plan verfügar
|
||||
No power grid or running generator!=Kein Stromnetz oder Generator verfügbar!
|
||||
No wind at this altitude!=Kein Wind auf dieser Höhe
|
||||
Node number to send the events to=Knotennummer zum Senden der Events
|
||||
Node numbers to read the states from=Knotennummern zum Lesen der Zustände
|
||||
Node owner=Blockbesitzer
|
||||
Number blocks:=Anzahl Blöcke:
|
||||
Number of all nodes=Anzahl aller Blöcke
|
||||
Number of power grid blocks=Anzahl der Stromnetz Blöcke
|
||||
Oil=Öl
|
||||
Oil Drill Box=Ölbohrkiste
|
||||
Oil Pumpjack=Ölpumpe
|
||||
@ -116,6 +127,7 @@ Oil Tank=Öltank
|
||||
Oil amount=Ölmenge
|
||||
Optionally configure@nthe pusher with one item=Der Schieber kann optional@nmit einem Gegenstand@nkonfiguriert werden
|
||||
Outp=Ergeb.
|
||||
Output=Stromabgabe
|
||||
Plan=Plan
|
||||
Plastic Granules=Plastikgranulat
|
||||
Position=Position
|
||||
@ -123,6 +135,8 @@ Position temperature=Positionstemperatur
|
||||
Power AC=Wechselstrom
|
||||
Power DC=Gleichstrom
|
||||
Power Source=Stromquelle
|
||||
Power grid total=Stromnetz gesammt
|
||||
Power station=Kraftwerk
|
||||
Priv missing=Rechte fehlen
|
||||
Propane Cylinder Large=Propangasflasche groß
|
||||
Propane Cylinder Small=Propangasflasche klein
|
||||
@ -141,14 +155,17 @@ Remove derrick=Entferne Ölturm
|
||||
Rinsing=Waschen
|
||||
River Water Barrel=Flusswasserfass
|
||||
Save=Speichern
|
||||
Select type=Wähle Typ
|
||||
Send an event if state is equal or larget than=Senden ein Event wenn Status größer oder gleich als
|
||||
Send signal if nodes have been:=Sende ein Signal falls Blöcke:
|
||||
Show all forceload blocks in a 64x64x64 range=Zeige alle Forceload Blöcke im Umkreis von 64x64x64 Blöcken
|
||||
Sieved Basalt Gravel=Basaltkies gesiebt
|
||||
Sieved Gravel=Gesiebtes Kies
|
||||
Solar system=Solaranlage
|
||||
Start level=Startebene
|
||||
Start level @= 0@nmeans the same level@nas the quarry is placed=Startebene @= 0@nbedeutet gleiche Ebene@nwie der Steinbrecher
|
||||
Steam Power Source=Dampfenergiequelle
|
||||
Storage systems=Speichersysteme
|
||||
Store=Speichern
|
||||
Switched to private use!=Zur privaten Nutzung umgeschaltet
|
||||
Switched to public use!=Zur öffentlichen Nutzung umgeschaltet
|
||||
@ -250,6 +267,7 @@ TA3 Player Detector=TA3 Spieler Detektor
|
||||
TA3 Power Station Firebox=TA3 Kraftwerks-Feuerbox
|
||||
TA3 Power Station Oil Burner=TA3 Kraftwerks-Ölbrenner
|
||||
TA3 Power Terminal=TA3 Strom Terminal
|
||||
TA3 Power Terminal Old=TA3 Strom Terminal Alt
|
||||
TA3 Propane=TA3 Propan
|
||||
TA3 Protected Chest=TA3 Gesicherte Kiste
|
||||
TA3 Pump=TA3 Pumpe
|
||||
@ -337,10 +355,13 @@ The wind turbines are too close together!=Die Windkraftanlagen stehen zu eng bei
|
||||
Thermal=Wärme
|
||||
Time=Zeit
|
||||
Tiny Generator=Kleingenerator
|
||||
Tiny generator=Kleingenerator
|
||||
To add fuel punch@nthis block@nwith a fuel container=Um Brennstoff nachzufüllen,@nschlage mit einem Kraftstoffbehälter@nauf den Block
|
||||
To add liquids punch@nthe tank@nwith a liquid container=Um Flüssigkeit nachzufüllen,@nschlage mit einem Flüssigkeitsbehälter@nauf den Block
|
||||
To add water punch@nthe boiler@nwith a water bucket=Um Wasser nachzufüllen,@nschlage mit einem Wassereimer@nauf den Block
|
||||
To many blocks in the power grid!=Zu viele Blöcke im Stromnetz!
|
||||
Turned on:=Eingeschaltet:
|
||||
Type=Typ
|
||||
Update=Update
|
||||
Usmium Nuggets=Usmium Nuggets
|
||||
Usmium Powder=Usmium Pulver
|
||||
@ -349,6 +370,7 @@ Water=Wasser
|
||||
Water Barrel=Wasserfass
|
||||
Water Boiler=Wasserboiler
|
||||
Water Pump=Wasserpumpe
|
||||
Wind turbine=Windkraftanlage
|
||||
[Bucket] Lava can only be placed below sea level!=Lava kann nur unterhalb der Meerehöhe platziert werden!
|
||||
[TA4 Wind Turbine]=[TA4 Windkraftanlage]
|
||||
[TA] Area is protected!=[TA] Bereich ist geschützt
|
||||
|
@ -1,4 +1,5 @@
|
||||
#### TA3 Terminal ####@n@nSend commands to your machines@nand output text messages from your@nmachines to the Terminal.@n@nCommand syntax:@n cmd <num> <cmnd>@n@nexample: cmd 181 on@n<num> is the number of the node to which the command is sent@n'on' is the command to turn machines/nodes on@nFurther commands can be retrieved by clicking on@nmachines/nodes with the Techage Info Tool.@n@nLocal commands:@n- clear @= clear screen@n- help @= this message@n- pub @= switch to public use@n- priv @= switch to private use@nTo program a user button with a command:@n set <button-num> <button-text> <command>@ne.g. 'set 1 ON cmd 123 on'@n=
|
||||
Accu Box=
|
||||
Active:=
|
||||
All nodes:=
|
||||
Allow to dig/place Techage power lines nearby power poles=
|
||||
@ -32,6 +33,7 @@ Build derrick=
|
||||
Compressed Gravel=
|
||||
Consum. 1=
|
||||
Consum. 2=
|
||||
Current power:=
|
||||
Depth=
|
||||
Digging depth=
|
||||
Dirt with Ash=
|
||||
@ -44,6 +46,8 @@ Ele Power Source=
|
||||
Electricity=
|
||||
Electrolyzer=
|
||||
Electronic Fab=
|
||||
Energy storage=
|
||||
Energy stored:=
|
||||
Enter=
|
||||
Epoxide Resin=
|
||||
Epoxide Resin Barrel=
|
||||
@ -56,12 +60,14 @@ Flywheel=
|
||||
Force order of filter items=
|
||||
Fuel Cell=
|
||||
Fuel Menu=
|
||||
Fuel cell=
|
||||
Furnace Top=
|
||||
Gas Cylinder Large=
|
||||
Gas Cylinder Small=
|
||||
Genera. 1=
|
||||
Genera. 2=
|
||||
Generator=
|
||||
Generators=
|
||||
Gibbsite Powder=
|
||||
Gravel Rinser=
|
||||
Gravel Sieve=
|
||||
@ -75,6 +81,7 @@ Hydrogen Cylinder Small=
|
||||
In use:=
|
||||
Insert destination node number(s)=
|
||||
Insert door/gate block number(s)=
|
||||
Intake=
|
||||
Inverter=
|
||||
Leave Powder=
|
||||
Liquid Filler=
|
||||
@ -85,6 +92,7 @@ Load=
|
||||
Lye=
|
||||
Lye Barrel=
|
||||
Lye Canister=
|
||||
Maximum power:=
|
||||
Melting Guide=
|
||||
Melting Pot active (heat@==
|
||||
Melting Pot inactive (heat@==
|
||||
@ -101,11 +109,14 @@ Needle Powder=
|
||||
Network Data=
|
||||
No network or active generator available!=
|
||||
No plan available=
|
||||
No power grid or running generator!=
|
||||
No wind at this altitude!=
|
||||
Node number to send the events to=
|
||||
Node numbers to read the states from=
|
||||
Node owner=
|
||||
Number blocks:=
|
||||
Number of all nodes=
|
||||
Number of power grid blocks=
|
||||
Oil=
|
||||
Oil Drill Box=
|
||||
Oil Pumpjack=
|
||||
@ -114,6 +125,7 @@ Oil Tank=
|
||||
Oil amount=
|
||||
Optionally configure@nthe pusher with one item=
|
||||
Outp=
|
||||
Output=
|
||||
Plan=
|
||||
Plastic Granules=
|
||||
Position=
|
||||
@ -121,6 +133,8 @@ Position temperature=
|
||||
Power AC=
|
||||
Power DC=
|
||||
Power Source=
|
||||
Power grid total=
|
||||
Power station=
|
||||
Priv missing=
|
||||
Propane Cylinder Large=
|
||||
Propane Cylinder Small=
|
||||
@ -139,14 +153,17 @@ Remove derrick=
|
||||
Rinsing=
|
||||
River Water Barrel=
|
||||
Save=
|
||||
Select type=
|
||||
Send an event if state is equal or larget than=
|
||||
Send signal if nodes have been:=
|
||||
Show all forceload blocks in a 64x64x64 range=
|
||||
Sieved Basalt Gravel=
|
||||
Sieved Gravel=
|
||||
Solar system=
|
||||
Start level=
|
||||
Start level @= 0@nmeans the same level@nas the quarry is placed=
|
||||
Steam Power Source=
|
||||
Storage systems=
|
||||
Store=
|
||||
Switched to private use!=
|
||||
Switched to public use!=
|
||||
@ -248,6 +265,7 @@ TA3 Player Detector=
|
||||
TA3 Power Station Firebox=
|
||||
TA3 Power Station Oil Burner=
|
||||
TA3 Power Terminal=
|
||||
TA3 Power Terminal Old=
|
||||
TA3 Propane=
|
||||
TA3 Protected Chest=
|
||||
TA3 Pump=
|
||||
@ -335,10 +353,13 @@ The wind turbines are too close together!=
|
||||
Thermal=
|
||||
Time=
|
||||
Tiny Generator=
|
||||
Tiny generator=
|
||||
To add fuel punch@nthis block@nwith a fuel container=
|
||||
To add liquids punch@nthe tank@nwith a liquid container=
|
||||
To add water punch@nthe boiler@nwith a water bucket=
|
||||
To many blocks in the power grid!=
|
||||
Turned on:=
|
||||
Type=
|
||||
Update=
|
||||
Usmium Nuggets=
|
||||
Usmium Powder=
|
||||
@ -347,6 +368,7 @@ Water=
|
||||
Water Barrel=
|
||||
Water Boiler=
|
||||
Water Pump=
|
||||
Wind turbine=
|
||||
[Bucket] Lava can only be placed below sea level!=
|
||||
[TA4 Wind Turbine]=
|
||||
[TA] Area is protected!=
|
||||
|
@ -140,7 +140,7 @@ Der Strommastkopf schützt Stromleitungen und Masten in einem Radius von 8 m.
|
||||
|
||||
### TA Strommastkopf 2 / Power Pole Top 2
|
||||
|
||||
Dieser Strommastkopf hat nur 2 Arme und wird für die Überlandleitungen genutzt.
|
||||
Dieser Strommastkopf hat zwei feste Arme und wird für die Überlandleitungen genutzt. Er kann aber auch Strom nach unten und oben weiterleiten.
|
||||
Der Strommastkopf schützt Stromleitungen und Masten in einem Radius von 8 m.
|
||||
|
||||
[ta3_powerpole2|image]
|
||||
@ -189,9 +189,11 @@ Bei Volllast kann ein Akku 400 s lang Strom aufnehmen und wenn er voll ist, auch
|
||||
|
||||
### TA3 Strom Terminal / Power Terminal
|
||||
|
||||
Das Strom-Terminal muss mit dem Stromnetz verbunden werden. Es zeigt Daten aus dem Stromnetz an wie:
|
||||
- Anzahl und Leistung der verschiedenen Generatoren und Akkus (aktuell/maximal)
|
||||
- Anzahl der Netzwerk-Blöcke (max. 1000)
|
||||
Das Strom-Terminal muss mit dem Stromnetz verbunden werden. Es zeigt Daten aus dem Stromnetz an.
|
||||
|
||||
In der oberen Hälfte werden nur die Daten eines ausgewählten Typs ausgegeben. Wird als Typ bspw. "Kraftwerk" gewählt, so werden nur die Daten von Öl- und Kohlekraftwerken gesammelt und ausgegeben. Links werden die Daten von Generatoren (Stromabgabe) und rechts die Daten von Energiespeichern (Stromaufnahme) ausgegeben. Beim Akkublocks bspw. wird beides ausgegeben, da der Akku Strom aufnehmen und abgeben kann.
|
||||
|
||||
In der unteren Hälfte werden die Daten aller Generatoren und Speichersystemen des ganzen Stromnetzen zusammengefasst ausgegeben.
|
||||
|
||||
[ta3_powerterminal|image]
|
||||
|
||||
|
@ -14,7 +14,7 @@ Der Rotor muss in einer Höhe (Y-Koordinate) von 12 bis maximal 20 m platziert w
|
||||
|
||||
Der Strom muss vom Rotor-Block durch den Mast nach unten geführt werden. Dazu zuerst die Stromleitung nach oben ziehen und das Stromkabel dann mit TA4 Säulenblöcke "verputzen". Unten kann eine Arbeitsplattform errichtet werden. Der Plan rechts zeigt den Aufbau im oberen Teil.
|
||||
|
||||
Die Windkraftanlage liefert eine Leistung von 80 ku, aber dies nur 8 Stunden am Tag (siehe oben).
|
||||
Die Windkraftanlage liefert eine Leistung von 70 ku, aber dies nur 8 Stunden am Tag (siehe oben).
|
||||
|
||||
[ta4_windturbine|plan]
|
||||
|
||||
@ -70,7 +70,7 @@ Der Plan rechts zeigt 3 Einheiten mit je zwei Solarmodulen und einem Trägermodu
|
||||
|
||||
Solarmodule liefern Gleichspannung, welcher nicht direkt in das Stromnetz eingespeist werden kann. Daher müssen zuerst die Solareinheiten über das rote Kabel mit dem Wechselrichter verbunden werden. Dieser besteht aus zwei Blöcken, einen für das rote Kabel zu den Solarmodulen (DC) und einen für das graue Stromkabel ins Stromnetz (AC).
|
||||
|
||||
Der Kartenbereich, wo die Solaranlage steht, muss komplett geladen sein. Es empfiehlt sich daher, zuerst einen Forceload Block zu setzen, und dann innerhalb dieses Bereiches die Module zu platzieren.
|
||||
Der Kartenbereich, wo die Solaranlage steht, muss komplett geladen sein. Die gilt auch für die direkte Position über dem Solarmodul, denn dort wird regelmäßig die Lichtstärke gemessen. Es empfiehlt sich daher, zuerst einen Forceload Block zu setzen, und dann innerhalb dieses Bereiches die Module zu platzieren.
|
||||
|
||||
[ta4_solarplant|plan]
|
||||
|
||||
|
@ -80,12 +80,12 @@ local function trigger_network(pos, outdir, Cable)
|
||||
local nvm = techage.get_nvm(pos)
|
||||
local netID = nvm[Cable.tube_type] and nvm[Cable.tube_type]["netID"]
|
||||
if not netID then
|
||||
print("determine_netID !!!!!!!!!!!!!!!!!!!!")
|
||||
--print("determine_netID !!!!!!!!!!!!!!!!!!!!")
|
||||
netID = determine_netID(pos, outdir, Cable)
|
||||
store_netID(pos, outdir, netID, Cable)
|
||||
networks.build_network(pos, outdir, Cable, netID)
|
||||
elseif not networks.get_network(Cable.tube_type, netID) then
|
||||
print("build_network !!!!!!!!!!!!!!!!!!!!")
|
||||
--print("build_network !!!!!!!!!!!!!!!!!!!!")
|
||||
delete_netID(pos, outdir, Cable)
|
||||
networks.build_network(pos, outdir, Cable, netID)
|
||||
end
|
||||
@ -163,6 +163,11 @@ function techage.power.consumer_alive(pos, Cable, cycle_time)
|
||||
local rv = (cycle_time / 2) + 1
|
||||
if def["netID"] and def["calive"] and def["calive"] < rv then -- network available
|
||||
def["calive"] = rv
|
||||
def["still_runing"] = true
|
||||
return def["taken"] or 0
|
||||
elseif def["still_runing"] then
|
||||
def["calive"] = rv
|
||||
def["still_runing"] = false
|
||||
return def["taken"] or 0
|
||||
elseif not def["cstate"] or def["cstate"] == RUNNING then
|
||||
local ndef = net_def(pos, Cable.tube_type)
|
||||
|
@ -8,7 +8,7 @@
|
||||
GPL v3
|
||||
See LICENSE.txt for more information
|
||||
|
||||
TA3 Power Terminal
|
||||
TA3 Power Terminal Old
|
||||
|
||||
]]--
|
||||
|
||||
@ -155,7 +155,7 @@ local function formspec(pos, nvm)
|
||||
end
|
||||
|
||||
minetest.register_node("techage:power_terminal", {
|
||||
description = S("TA3 Power Terminal"),
|
||||
description = S("TA3 Power Terminal Old"),
|
||||
inventory_image = "techage_power_terminal_front.png",
|
||||
tiles = {
|
||||
"techage_power_terminal_top.png",
|
||||
@ -212,19 +212,9 @@ minetest.register_node("techage:power_terminal", {
|
||||
on_rotate = screwdriver.disallow,
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 2, level = 2},
|
||||
groups = {cracky = 2, level = 2, not_in_creative_inventory = 1},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
})
|
||||
|
||||
Cable:add_secondary_node_names({"techage:power_terminal"})
|
||||
|
||||
minetest.register_alias("techage:ta3_power_terminal", "techage:power_terminal")
|
||||
|
||||
minetest.register_craft({
|
||||
output = "techage:power_terminal",
|
||||
recipe = {
|
||||
{"", "techage:usmium_nuggets", "default:steel_ingot"},
|
||||
{"", "techage:basalt_glass_thin", "default:copper_ingot"},
|
||||
{"", "techage:vacuum_tube", "default:steel_ingot"},
|
||||
},
|
||||
})
|
368
power/power_terminal2.lua
Normal file
368
power/power_terminal2.lua
Normal file
@ -0,0 +1,368 @@
|
||||
--[[
|
||||
|
||||
TechAge
|
||||
=======
|
||||
|
||||
Copyright (C) 2019-2020 Joachim Stolberg
|
||||
|
||||
GPL v3
|
||||
See LICENSE.txt for more information
|
||||
|
||||
TA3 Power Terminal
|
||||
|
||||
]]--
|
||||
|
||||
-- for lazy programmers
|
||||
local S2P = minetest.string_to_pos
|
||||
local P2S = function(pos) if pos then return minetest.pos_to_string(pos) end end
|
||||
local M = minetest.get_meta
|
||||
local N = function(pos) return minetest.get_node(pos).name end
|
||||
local S = techage.S
|
||||
|
||||
local CYCLE_TIME = 2
|
||||
|
||||
local Cable = techage.ElectricCable
|
||||
local power = techage.power
|
||||
local networks = techage.networks
|
||||
local STOPPED = techage.power.STOPPED
|
||||
local NOPOWER = techage.power.NOPOWER
|
||||
local RUNNING = techage.power.RUNNING
|
||||
|
||||
local Generators = {
|
||||
S("Power station"),
|
||||
S("Tiny generator"),
|
||||
S("Solar system") ,
|
||||
S("Wind turbine"),
|
||||
S("Accu Box"),
|
||||
S("Energy storage"),
|
||||
S("Fuel cell"),
|
||||
S("Electrolyzer"),
|
||||
}
|
||||
|
||||
local Storage = {
|
||||
[S("Accu Box")] = true,
|
||||
[S("Energy storage")] = true,
|
||||
[S("Fuel cell")] = true,
|
||||
[S("Electrolyzer")] = true,
|
||||
}
|
||||
|
||||
local GeneratorPerformances = {
|
||||
80, -- S("Power station")
|
||||
12, -- S("Tiny generator")
|
||||
100, -- S("Solar system")
|
||||
70, -- S("Wind turbine")
|
||||
10, -- S("Accu Box")
|
||||
60, -- S("Energy storage")
|
||||
25, -- S("Fuel cell")
|
||||
30, -- S("Electrolyzer")
|
||||
}
|
||||
|
||||
--
|
||||
-- Generate the needed tables for the formspec
|
||||
--
|
||||
local Gentypes = table.concat(Generators, ",")
|
||||
local Gentype2Idx = {}
|
||||
local Gentype2Maxvalue = {}
|
||||
|
||||
for idx,name in ipairs(Generators) do
|
||||
Gentype2Idx[name] = idx
|
||||
Gentype2Maxvalue[name] = GeneratorPerformances[idx]
|
||||
end
|
||||
|
||||
local function generator_data(gen_tbl, nominal)
|
||||
local pow_max = 0
|
||||
local pow_curr = 0
|
||||
local num_nodes = 0
|
||||
|
||||
for i,gen in ipairs(gen_tbl or {}) do
|
||||
if gen.nominal == nominal then
|
||||
local nvm = techage.get_nvm(gen.pos)
|
||||
if nvm.ele1 and nvm.ele1.gstate and nvm.ele1.galive and nvm.ele1.given then
|
||||
num_nodes = num_nodes + 1
|
||||
if nvm.ele1.gstate == RUNNING then
|
||||
pow_max = pow_max + (nvm.ele1.curr_power or nominal)
|
||||
if nvm.ele1.galive > 0 and nvm.ele1.given > 0 then
|
||||
pow_curr = pow_curr + nvm.ele1.given
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return pow_max, pow_curr, num_nodes
|
||||
end
|
||||
|
||||
local function consumer_data(gen_tbl, nominal)
|
||||
local pow_max = 0
|
||||
local pow_curr = 0
|
||||
local num_nodes = 0
|
||||
|
||||
for i,gen in ipairs(gen_tbl or {}) do
|
||||
if gen.nominal == nominal then
|
||||
local nvm = techage.get_nvm(gen.pos)
|
||||
if nvm.ele1 and nvm.ele1.cstate and nvm.ele1.calive and nvm.ele1.taken then
|
||||
num_nodes = num_nodes + 1
|
||||
if nvm.ele1.cstate == RUNNING then
|
||||
pow_max = pow_max + nominal
|
||||
if nvm.ele1.calive > 0 and nvm.ele1.taken > 0 then
|
||||
pow_curr = pow_curr + nvm.ele1.taken
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return pow_max, pow_curr, num_nodes
|
||||
end
|
||||
|
||||
local function storage_load(gen_tbl, nominal)
|
||||
local load_curr = 0 -- percentage
|
||||
local num = 0
|
||||
|
||||
for i,gen in ipairs(gen_tbl or {}) do
|
||||
if gen.nominal == nominal then
|
||||
local ndef = techage.NodeDef[techage.get_node_lvm(gen.pos).name]
|
||||
if ndef and ndef.on_recv_message then
|
||||
local resp = ndef.on_recv_message(gen.pos, "0", "load")
|
||||
if type(resp) == "number" then
|
||||
load_curr = load_curr + resp
|
||||
num = num + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if num > 0 then
|
||||
return math.floor(load_curr / num)
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
local function calc_network_data_type(pos, nvm, gentype)
|
||||
local pow_max1, pow_curr1, num_nodes1, pow_stored1
|
||||
local pow_max2, pow_curr2, num_nodes2, pow_stored2
|
||||
local nominal = Gentype2Maxvalue[gentype]
|
||||
local netw = techage.networks.has_network("ele1", nvm.ele1 and nvm.ele1.netID) or {}
|
||||
|
||||
if gentype == S("Accu Box") or gentype == S("Energy storage") then
|
||||
pow_max1, pow_curr1, num_nodes1 = generator_data(netw.gen2, nominal)
|
||||
pow_max2, pow_curr2, num_nodes2 = consumer_data(netw.con2, nominal)
|
||||
pow_stored1 = storage_load(netw.con2, Gentype2Maxvalue[gentype]).." %"
|
||||
pow_stored2 = pow_stored1
|
||||
elseif gentype == S("Fuel cell") then
|
||||
pow_max1, pow_curr1, num_nodes1 = generator_data(netw.gen2, nominal)
|
||||
pow_max2, pow_curr2, num_nodes2 = 0, 0, 0
|
||||
pow_stored1 = storage_load(netw.gen2, Gentype2Maxvalue[gentype]).." %"
|
||||
pow_stored2 = "-"
|
||||
elseif gentype == S("Electrolyzer") then
|
||||
pow_max1, pow_curr1, num_nodes1 = 0, 0, 0
|
||||
pow_max2, pow_curr2, num_nodes2 = consumer_data(netw.con2, nominal)
|
||||
pow_stored2 = storage_load(netw.con2, Gentype2Maxvalue[gentype]).." %"
|
||||
pow_stored1 = "-"
|
||||
else -- gen1 generators
|
||||
pow_max1, pow_curr1, num_nodes1 = generator_data(netw.gen1, nominal)
|
||||
pow_max2, pow_curr2, num_nodes2 = 0, 0, 0
|
||||
pow_stored1 = "-"
|
||||
pow_stored2 = "-"
|
||||
end
|
||||
return netw,
|
||||
{pow_max = pow_max1, pow_curr = pow_curr1, num_nodes = num_nodes1, pow_stored = pow_stored1},
|
||||
{pow_max = pow_max2, pow_curr = pow_curr2, num_nodes = num_nodes2, pow_stored = pow_stored2}
|
||||
end
|
||||
|
||||
local function calc_network_data_total(pos, nvm)
|
||||
local netw = techage.networks.has_network("ele1", nvm.ele1 and nvm.ele1.netID) or {}
|
||||
|
||||
local pow_max1 = netw.available1 or 0
|
||||
local pow_max2 = netw.available2 or 0
|
||||
local pow_used1 = netw.on and math.min(netw.needed1 + netw.needed2, netw.available1) or 0
|
||||
local pow_used2 = netw.on and math.max(netw.needed1 - pow_used1, -netw.available2) or 0
|
||||
local num_nodes1 = #(netw.gen1 or {})
|
||||
local num_nodes2 = #(netw.gen2 or {})
|
||||
|
||||
return netw,
|
||||
{pow_max = pow_max1, pow_curr = pow_used1, num_nodes = num_nodes1},
|
||||
{pow_max = pow_max2, pow_curr = pow_used2, num_nodes = num_nodes2}
|
||||
end
|
||||
|
||||
local function get_state(netw)
|
||||
local state = ""
|
||||
|
||||
if #(netw.gen1 or {}) + #(netw.gen2 or {}) == 0 then
|
||||
state = S("No power grid or running generator!")
|
||||
elseif (netw.num_nodes or 0) < techage.networks.MAX_NUM_NODES then
|
||||
state = S("Number of power grid blocks")..": "..(netw.num_nodes or 0)
|
||||
else
|
||||
state = S("To many blocks in the power grid!")
|
||||
end
|
||||
return state
|
||||
end
|
||||
|
||||
local function column(x,y, data)
|
||||
if data.pow_stored then
|
||||
return
|
||||
"label["..x..","..(y+0.0)..";"..data.num_nodes.. "]"..
|
||||
"label["..x..","..(y+0.5)..";"..data.pow_max.. " ku]"..
|
||||
"label["..x..","..(y+1.0)..";"..data.pow_curr.. " ku]"..
|
||||
"label["..x..","..(y+1.5)..";"..data.pow_stored.."]"
|
||||
else
|
||||
return
|
||||
"label["..x..","..(y+0.0)..";"..data.num_nodes.. "]"..
|
||||
"label["..x..","..(y+0.5)..";"..data.pow_max.. " ku]"..
|
||||
"label["..x..","..(y+1.0)..";"..data.pow_curr.. " ku]"
|
||||
end
|
||||
end
|
||||
|
||||
local function formspec_type(pos, nvm)
|
||||
return "size[5,4]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"box[0,-0.1;4.8,0.5;#c6e8ff]"..
|
||||
"label[1.5,-0.1;"..minetest.colorize( "#000000", S("Select type")).."]"..
|
||||
"dropdown[0,1;5.2;gentype;"..Gentypes..";"..(nvm.gentype_idx or 1).."]"..
|
||||
"style_type[button;bgcolor=#395c74]"..
|
||||
"button[0,2.4;5,1;set;"..S("Store").."]"
|
||||
end
|
||||
|
||||
local function formspec(pos, nvm)
|
||||
local gentype = nvm.gentype or S("Power station")
|
||||
local netw, gen1, gen2 = calc_network_data_type(pos, nvm, gentype)
|
||||
local _, sum1, sum2 = calc_network_data_total(pos, nvm)
|
||||
netw.prop = ((netw.prop or 0) + 1) % 2
|
||||
local star = netw.prop == 1 and "*" or ""
|
||||
local state = get_state(netw)
|
||||
|
||||
return "size[9,7]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"box[0,-0.1;8.8,0.5;#c6e8ff]"..
|
||||
"label[3.5,-0.1;"..minetest.colorize( "#000000", S("Network Data")).."]"..
|
||||
"label[8.5,-0.1;"..minetest.colorize( "#000000", star).."]"..
|
||||
|
||||
"style_type[button;bgcolor=#395c74]"..
|
||||
"button[0,0.7;3,1;config;"..S("Type").."]"..
|
||||
|
||||
"box[0,1.6;8.8,0.4;#c6e8ff]"..
|
||||
"box[0,2.15;8.8,0.4;#395c74]"..
|
||||
"box[0,2.65;8.8,0.4;#395c74]"..
|
||||
"box[0,3.15;8.8,0.4;#395c74]"..
|
||||
"box[0,3.65;8.8,0.4;#395c74]"..
|
||||
"label[0.1,1.55;"..minetest.colorize( "#000000", gentype).."]"..
|
||||
"label[3.7,1.55;"..minetest.colorize( "#000000", S("Output")).."]"..
|
||||
"label[6.2,1.55;"..minetest.colorize( "#000000", S("Intake")).."]"..
|
||||
"label[0.1,2.1;"..S("Number blocks:").."]"..
|
||||
"label[0.1,2.6;"..S("Maximum power:").."]"..
|
||||
"label[0.1,3.1;"..S("Current power:").."]"..
|
||||
"label[0.1,3.6;"..S("Energy stored:").."]"..
|
||||
column(3.7, 2.1, gen1)..
|
||||
column(6.2, 2.1, gen2)..
|
||||
|
||||
--"box[0,5.3;8.8,0.4;#c6e8ff]"..
|
||||
"box[0,4.5;8.8,0.4;#c6e8ff]"..
|
||||
"box[0,5.05;8.8,0.4;#395c74]"..
|
||||
"box[0,5.55;8.8,0.4;#395c74]"..
|
||||
"box[0,6.05;8.8,0.4;#395c74]"..
|
||||
"label[0.1,4.45;"..minetest.colorize( "#000000", S("Power grid total")).."]"..
|
||||
"label[3.7,4.45;"..minetest.colorize( "#000000", S("Generators")).."]"..
|
||||
"label[6.2,4.45;"..minetest.colorize( "#000000", S("Storage systems")).."]"..
|
||||
"label[0.1,5.0;"..S("Number blocks:").."]"..
|
||||
"label[0.1,5.5;"..S("Maximum power:").."]"..
|
||||
"label[0.1,6.0;"..S("Current power:").."]"..
|
||||
column(3.7, 5.0, sum1)..
|
||||
column(6.2, 5.0, sum2)..
|
||||
"box[0,6.75;8.8,0.4;#000000]"..
|
||||
"label[0.1,6.7;"..state.."]"
|
||||
end
|
||||
|
||||
minetest.register_node("techage:ta3_power_terminal", {
|
||||
description = S("TA3 Power Terminal"),
|
||||
inventory_image = "techage_power_terminal_front.png",
|
||||
tiles = {
|
||||
"techage_power_terminal_top.png",
|
||||
"techage_power_terminal_top.png",
|
||||
"techage_power_terminal_side.png",
|
||||
"techage_power_terminal_side.png",
|
||||
"techage_power_terminal_back.png",
|
||||
"techage_power_terminal_front.png",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{ -8/16, -8/16, 0/16, 8/16, 8/16, 8/16},
|
||||
},
|
||||
},
|
||||
|
||||
after_place_node = function(pos)
|
||||
local nvm = techage.get_nvm(pos)
|
||||
M(pos):set_int("outdir", networks.side_to_outdir(pos, "B"))
|
||||
Cable:after_place_node(pos)
|
||||
M(pos):set_string("formspec", formspec(pos, nvm))
|
||||
end,
|
||||
after_dig_node = function(pos)
|
||||
Cable:after_dig_node(pos)
|
||||
techage.del_mem(pos)
|
||||
end,
|
||||
tubelib2_on_update2 = function(pos, outdir, tlib2, node)
|
||||
power.update_network(pos, outdir, tlib2)
|
||||
end,
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
techage.set_activeformspec(pos, clicker)
|
||||
minetest.get_node_timer(pos):start(CYCLE_TIME)
|
||||
local nvm = techage.get_nvm(pos)
|
||||
M(pos):set_string("formspec", formspec(pos, nvm))
|
||||
end,
|
||||
on_timer = function(pos, elapsed)
|
||||
local nvm = techage.get_nvm(pos)
|
||||
if techage.is_activeformspec(pos) then
|
||||
M(pos):set_string("formspec", formspec(pos, nvm))
|
||||
end
|
||||
return true
|
||||
end,
|
||||
|
||||
on_receive_fields = function(pos, formname, fields, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
return
|
||||
end
|
||||
local nvm = techage.get_nvm(pos)
|
||||
|
||||
if fields.config then
|
||||
techage.reset_activeformspec(pos, player)
|
||||
M(pos):set_string("formspec", formspec_type(pos, nvm))
|
||||
elseif fields.set then
|
||||
nvm.gentype = fields.gentype
|
||||
nvm.gentype_idx = Gentype2Idx[fields.gentype] or 1
|
||||
techage.set_activeformspec(pos, player)
|
||||
M(pos):set_string("formspec", formspec(pos, nvm))
|
||||
end
|
||||
end,
|
||||
|
||||
networks = {
|
||||
ele1 = {
|
||||
sides = {B = 1}, -- Cable connection side
|
||||
ntype = "term",
|
||||
},
|
||||
},
|
||||
|
||||
paramtype2 = "facedir",
|
||||
paramtype = "light",
|
||||
on_rotate = screwdriver.disallow,
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {cracky = 2, level = 2},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
})
|
||||
|
||||
Cable:add_secondary_node_names({"techage:ta3_power_terminal"})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "techage:ta3_power_terminal",
|
||||
recipe = {
|
||||
{"", "techage:usmium_nuggets", "default:steel_ingot"},
|
||||
{"", "techage:basalt_glass_thin", "default:copper_ingot"},
|
||||
{"", "techage:vacuum_tube", "default:steel_ingot"},
|
||||
},
|
||||
})
|
@ -222,7 +222,8 @@ minetest.register_node("techage:powerswitchsmall_on", {
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
techage.register_node({"techage:powerswitch", "techage:powerswitch_on"}, {
|
||||
techage.register_node({"techage:powerswitch", "techage:powerswitch_on",
|
||||
"techage:powerswitchsmall", "techage:powerswitchsmall_on"}, {
|
||||
on_recv_message = function(pos, src, topic, payload)
|
||||
local node = techage.get_node_lvm(pos)
|
||||
if topic == "on" and node.name == "techage:powerswitch" then
|
||||
|
@ -22,7 +22,7 @@ local M = minetest.get_meta
|
||||
local S = techage.S
|
||||
|
||||
local CYCLE_TIME = 2
|
||||
local PWR_PERF = 80
|
||||
local PWR_PERF = 70
|
||||
|
||||
local Cable = techage.ElectricCable
|
||||
local power = techage.power
|
||||
|
Loading…
Reference in New Issue
Block a user