[gcompris/gcomprixogoo] New hydroelectric activity. Learn how an hydoelectric dam works.
- From: Bruno Coudoin <bcoudoin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcompris/gcomprixogoo] New hydroelectric activity. Learn how an hydoelectric dam works.
- Date: Mon, 20 Dec 2010 01:23:32 +0000 (UTC)
commit 4be57c9427eb647944dbc90c6ac6acd4138f5ab8
Author: Bruno Coudoin <bruno coudoin free fr>
Date: Mon Dec 20 02:22:04 2010 +0100
New hydroelectric activity. Learn how an hydoelectric dam works.
This is heavily based on the watercycle activity.
configure.ac | 3 +
po/POTFILES.in | 2 +
src/Makefile.am | 2 +-
src/hydroelectric-activity/.gitignore | 1 +
src/hydroelectric-activity/Makefile.am | 32 +
src/hydroelectric-activity/gcompris | 1 +
src/hydroelectric-activity/hydroelectric.py | 733 ++++++++++++++++++++
src/hydroelectric-activity/hydroelectric.svg | 438 ++++++++++++
src/hydroelectric-activity/hydroelectric.xml.in | 20 +
src/hydroelectric-activity/init_path.sh | 8 +
src/hydroelectric-activity/resources/Makefile.am | 1 +
.../resources/hydroelectric/Makefile.am | 5 +
.../resources/hydroelectric/hydroelectric.svgz | Bin 0 -> 78879 bytes
13 files changed, 1245 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index eefec8e..8ad5c32 100644
--- a/configure.ac
+++ b/configure.ac
@@ -730,6 +730,9 @@ src/hanoi_real-activity/resources/hanoi_real/Makefile
src/hexagon-activity/Makefile
src/hexagon-activity/resources/Makefile
src/hexagon-activity/resources/hexagon/Makefile
+src/hydroelectric-activity/Makefile
+src/hydroelectric-activity/resources/Makefile
+src/hydroelectric-activity/resources/hydroelectric/Makefile
src/imageid-activity/Makefile
src/imageid-activity/resources/Makefile
src/imageid-activity/resources/imageid/Makefile
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8a0984a..cf19a50 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -439,3 +439,5 @@ src/wordsgame-activity/wordsgame.c
src/wordsgame-activity/wordsgame.xml.in
src/hangman-activity/hangman.xml.in
src/hangman-activity/hangman.py
+src/hydroelectric-activity/hydroelectric.xml.in
+src/hydroelectric-activity/hydroelectric.py
diff --git a/src/Makefile.am b/src/Makefile.am
index 51bec62..a63b84d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = hangman-activity \
+SUBDIRS = hydroelectric-activity hangman-activity \
goocanvas gcompris boards \
advanced_colors-activity \
algebra_by-activity \
diff --git a/src/hydroelectric-activity/.gitignore b/src/hydroelectric-activity/.gitignore
new file mode 100644
index 0000000..935172e
--- /dev/null
+++ b/src/hydroelectric-activity/.gitignore
@@ -0,0 +1 @@
+hydroelectric.xml
diff --git a/src/hydroelectric-activity/Makefile.am b/src/hydroelectric-activity/Makefile.am
new file mode 100644
index 0000000..9c5848e
--- /dev/null
+++ b/src/hydroelectric-activity/Makefile.am
@@ -0,0 +1,32 @@
+SUBDIRS = resources
+
+pythondir = $(PYTHON_PLUGIN_DIR)
+
+dist_python_DATA= hydroelectric.py
+
+
+
+xmldir = $(pkgdatadir)/@PACKAGE_DATA_DIR@
+
+xml_in_files = \
+ hydroelectric.xml.in
+
+
+xml_DATA = $(xml_in_files:.xml.in=.xml)
+
+# Do not use the INTLTOOL_XML_RULE, we don't need to embed the translations
+# in the file themselves. GCompris pick the translations from the po file at
+# runtime.
+#
+$(xml_DATA): %.xml: %.xml.in
+ sed -e "s/\(<\{1\}\/*\)_/\1/g" $< > $@
+
+# Use this directive and instead of the one above to embed the translations
+# in the xml files directly, this is needed for the tool gcompris2spip
+# INTLTOOL_XML_RULE@
+
+icondir = $(pkgdatadir)/@PACKAGE_DATA_DIR@
+icon_DATA = hydroelectric.svg
+
+EXTRA_DIST = $(icon_DATA) ${xml_in_files} init_path.sh
+CLEANFILES = $(xml_DATA)
diff --git a/src/hydroelectric-activity/gcompris b/src/hydroelectric-activity/gcompris
new file mode 120000
index 0000000..6a7dc8a
--- /dev/null
+++ b/src/hydroelectric-activity/gcompris
@@ -0,0 +1 @@
+../boards/python/gcompris
\ No newline at end of file
diff --git a/src/hydroelectric-activity/hydroelectric.py b/src/hydroelectric-activity/hydroelectric.py
new file mode 100644
index 0000000..97c21e9
--- /dev/null
+++ b/src/hydroelectric-activity/hydroelectric.py
@@ -0,0 +1,733 @@
+# gcompris - hydroelectric
+#
+# Copyright (C) 2010 Bruno Coudoin
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, see <http://www.gnu.org/licenses/>.
+#
+import gobject
+import goocanvas
+import gcompris
+import gcompris.utils
+import gcompris.anim
+import gcompris.skin
+import gcompris.sound
+import gcompris.bonus
+import gtk
+import gtk.gdk
+
+from gcompris import gcompris_gettext as _
+
+class Gcompris_hydroelectric:
+ """The Hydroelectric activity"""
+
+
+ def __init__(self, gcomprisBoard):
+ self.gcomprisBoard = gcomprisBoard
+ self.boat_is_arrived = False
+
+ def start(self):
+ self.gcomprisBoard.level=1
+ self.gcomprisBoard.maxlevel=1
+ self.gcomprisBoard.sublevel=1
+ self.gcomprisBoard.number_of_sublevel=1
+
+ # Just a tick counter
+ self.tick = 0
+
+ # The basic duration factor for object animations
+ # Higher is longer animation (slower)
+ self.timerinc = 20
+ self.step_time = 100
+
+ # Used to display the bonus a single time
+ self.you_won = False
+
+ # Need to manage the timers to quit properly
+ self.waterlevel_timer = 0
+
+ gcompris.sound.play_ogg("sounds/Harbor1.wav", "sounds/Harbor3.wav")
+
+ # Create our rootitem. We put each canvas item in it so at the end we
+ # only have to kill it. The canvas deletes all the items it contains automaticaly.
+ self.rootitem = goocanvas.Group(parent = self.gcomprisBoard.canvas.get_root_item())
+
+ svghandle = gcompris.utils.load_svg("hydroelectric/hydroelectric.svgz")
+ goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#BACKGROUND",
+ pointer_events = goocanvas.EVENTS_NONE
+ )
+
+ # Take care, the items are stacked on each other in the order you add them.
+ # If you need, you can reorder them later with raise and lower functions.
+
+ # The River
+ self.riveritem = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#RIVERWATER",
+ pointer_events = goocanvas.EVENTS_NONE,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+
+ # The Sun
+ self.sunitem = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#SUN",
+ tooltip = "\n\n" + \
+ _("The sun heats the water and creates water vapor. "
+ "Water vapor combines into small water droplets which "
+ "becomes clouds.")
+ )
+ self.sunitem.connect("button_press_event", self.sun_item_event)
+ # This item is clickeable and it must be seen
+ gcompris.utils.item_focus_init(self.sunitem, None)
+ self.sun_on = 0
+ self.sunitem_orig_y1 = self.sunitem.get_bounds().y1
+ self.sunitem_target_y1 = 10
+ self.sun_connect_handler = 0
+
+ # The Snow
+ self.snowitem = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#SNOW",
+ pointer_events = goocanvas.EVENTS_NONE,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+
+ # The rain
+ self.rainitem = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#RAIN",
+ pointer_events = goocanvas.EVENTS_NONE,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+
+ # The cloud
+ self.clouditem = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#CLOUD",
+ visibility = goocanvas.ITEM_INVISIBLE,
+ tooltip = "\n\n" + \
+ _("As a cloud matures, the dense water droplets may combine "
+ "to produce larger droplets, which may combine to form "
+ "droplets large enough to fall as rain")
+ )
+ self.clouditem.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.clouditem.connect("animation-finished", self.cloud_arrived)
+ self.cloud_on = False
+ self.cloud_is_arrived = False
+ self.clouditem_bounds = self.clouditem.get_bounds()
+ self.its_raining = False
+
+ # The vapor
+ self.vaporitem = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#VAPOR",
+ pointer_events = goocanvas.EVENTS_NONE,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+ self.vaporitem.connect("animation-finished", self.vapor_arrived)
+
+ # The reservoir level
+ self.reservoirlevel = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#RESERVOIR1",
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+
+ # The Dam
+ goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#DAM",
+ pointer_events = goocanvas.EVENTS_NONE,
+ )
+
+ # The TURBINE
+ self.turbineitem = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#TURBINE",
+ tooltip = "\n\n" + \
+ _("Flowing water is directed on to the blades of a turbine runner, "
+ "creating a force on the blades. In this way, energy is transferred "
+ "from the water flow to the turbine")
+ )
+ self.turbineitem.connect("button_press_event", self.turbine_item_event)
+ # This item is clickeable and it must be seen
+ gcompris.utils.item_focus_init(self.turbineitem, None)
+ self.turbine_on = False
+
+ # The Cable from turbine to transformer 1
+ self.turbine_cable_on = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#TURBINE_CABLE_ON",
+ pointer_events = goocanvas.EVENTS_NONE,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+
+ # The Cables from transformer 1 to transformer 2
+ self.cable1_cv1_to_cv2_on = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#CABLE1_CV1_TO_CV2_ON",
+ pointer_events = goocanvas.EVENTS_NONE,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+ self.cable2_cv1_to_cv2_on = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#CABLE2_CV1_TO_CV2_ON",
+ pointer_events = goocanvas.EVENTS_NONE,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+
+ # The Cable from transformer 2 to Town
+ self.cable_to_town_on = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#CABLE_TO_TOWN_ON",
+ pointer_events = goocanvas.EVENTS_NONE,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+ # The Cable from transformer 2 to Tux
+ self.cable_to_tux_on = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#CABLE_TO_TUX_ON",
+ pointer_events = goocanvas.EVENTS_NONE,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+
+ # TRANSFORMER1
+ self.transformer1item = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#TRANSFORMER1",
+ tooltip = "\n\n" + \
+ _("This is a step up transformer. Electricity is transmitted "
+ "at high voltages (110 kV or above) "
+ "to reduce the energy lost in long distance transmission.")
+ )
+ self.transformer1item.connect("button_press_event", self.transformer1_item_event)
+ # This item is clickeable and it must be seen
+ gcompris.utils.item_focus_init(self.transformer1item, None)
+ self.transformer1_on = 0
+
+ # TRANSFORMER2
+ self.transformer2item = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#TRANSFORMER2",
+ tooltip = "\n\n" + \
+ _("This is a step down transformer. Electricity is transformed "
+ "in low voltage, ready to be used by the customers.")
+ )
+ self.transformer2item.connect("button_press_event", self.transformer2_item_event)
+ # This item is clickeable and it must be seen
+ gcompris.utils.item_focus_init(self.transformer2item, None)
+ self.transformer2_on = 0
+
+ # The tuxboat
+ self.boatitem = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#BOAT"
+ )
+ self.boatitem.translate(-100, 0);
+ self.boatitem_parked = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#BOAT_PARKED",
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+
+ # Tux in his saloon
+ self.tuxsaloonitem = goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#SALOON",
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+
+ goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#FOREGROUND",
+ pointer_events = goocanvas.EVENTS_NONE
+ )
+
+ # The level of water in the reservoir
+ self.waterlevel_max = 5
+ self.waterlevel_min = 1
+ self.waterlevel = 0
+ self.waterlevel_timer = gobject.timeout_add(1000, self.update_waterlevel)
+
+ # We have 2 counters, the production one and the consumption
+ # The children have to make sure there is no more consumption
+ # than production.
+ self.prod_count = 0
+
+ x = 303
+ y = 224
+ tooltip =_("This is the meter for electricity produced by the turbine. "
+ "The electricity power is measured in Watt (W).")
+ goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#PROD_COUNT",
+ tooltip = "\n\n" + tooltip
+ )
+ self.prod_count_item = goocanvas.Text(
+ parent = self.rootitem,
+ x = x,
+ y = y,
+ font = "Sans 8",
+ text = str(self.prod_count) + "W",
+ tooltip = "\n\n" + tooltip
+ )
+
+ x = 590
+ y = 203
+ tooltip =_("This is the meter for electricity consumed by the users. "
+ "The electricity power is measured in Watt (W).")
+ goocanvas.Svg(
+ parent = self.rootitem,
+ svg_handle = svghandle,
+ svg_id = "#CONSO_COUNT",
+ tooltip = "\n\n" + tooltip
+ )
+ self.conso_count_item = goocanvas.Text(
+ parent = self.rootitem,
+ x = x,
+ y = y,
+ font = "Sans 8",
+ text = "0W",
+ tooltip = "\n\n" + tooltip
+ )
+
+ self.consumers = []
+ self.consumers.append( Consumer(self.rootitem, svghandle,
+ self.update_conso_count,
+ "#LIGHT_BUILDING_ON",
+ "#LIGHT_BUILDING_OFF",
+ "#BUILDING_LIGHTS_ON",
+ None, 800) )
+ self.consumers.append( Consumer(self.rootitem, svghandle,
+ self.update_conso_count,
+ "#LIGHT_HOUSE_ON",
+ "#LIGHT_HOUSE_OFF",
+ "#HOUSE_LIGHTS_ON",
+ None, 400) )
+ self.consumers.append( Consumer(self.rootitem, svghandle,
+ self.update_conso_count,
+ "#LIGHT_BUTTON_ON",
+ "#LIGHT_BUTTON_OFF",
+ "#TUX_ON",
+ "#TUX_OFF",
+ 100) )
+
+ # Some item ordering
+ self.rainitem.raise_(None)
+ self.clouditem.raise_(None)
+ self.vaporitem.raise_(None)
+
+ # Ready GO
+ target_x = 700
+ trip_x = int(target_x - self.boatitem.get_bounds().x1)
+ self.boatitem.connect("animation-finished", self.boat_arrived)
+ self.boatitem.animate(target_x,
+ 0,
+ 1,
+ 1,
+ True,
+ self.timerinc*trip_x,
+ self.step_time,
+ goocanvas.ANIMATE_FREEZE)
+
+ gcompris.bar_set(0)
+ gcompris.bar_location(5, -1, 0.6)
+ gcompris.bar_set_level(self.gcomprisBoard)
+
+
+ def end(self):
+ # Remove all the timer first
+ if self.waterlevel_timer :
+ gobject.source_remove(self.waterlevel_timer)
+
+ # Remove the root item removes all the others inside it
+ self.rootitem.remove()
+
+
+ def ok(self):
+ pass
+
+
+ def repeat(self):
+ pass
+
+
+ def config(self):
+ pass
+
+ def key_press(self, keyval, commit_str, preedit_str):
+ return False
+
+ # This is called each second to update the reservoir water level
+ def update_waterlevel(self):
+ old_waterlevel = self.waterlevel
+ self.tick += 1
+
+ if self.its_raining and self.waterlevel < self.waterlevel_max :
+ self.waterlevel += 1
+
+ if not self.cloud_on \
+ and self.waterlevel == self.waterlevel_max \
+ and self.tick % 200 == 0:
+ # Simulate a miss of water
+ self.waterlevel -= 1
+ self.set_turbine_state(False)
+
+ # Redisplay the level of water if needed
+ if old_waterlevel != self.waterlevel :
+ # Represent the water level
+ self.reservoirlevel.set_properties(
+ svg_id = "#RESERVOIR%d" %self.waterlevel,
+ visibility = goocanvas.ITEM_VISIBLE)
+
+ if self.waterlevel == self.waterlevel_max \
+ and self.tick % 20 == 0:
+ self.cloud_reset()
+
+ self.waterlevel_timer = gobject.timeout_add(1000, self.update_waterlevel)
+
+ def boat_arrived(self, item, status):
+ # park the boat, change the boat to remove tux
+ self.boat_is_arrived = True
+ self.boatitem_parked.props.visibility = goocanvas.ITEM_VISIBLE
+ self.boatitem.props.visibility = goocanvas.ITEM_INVISIBLE
+ gcompris.sound.play_ogg("sounds/Harbor3.wav")
+
+ # Now display tux in the saloon
+ self.tuxsaloonitem.props.visibility = goocanvas.ITEM_VISIBLE
+
+ # Display all consumers
+ map(lambda s: s.off(), self.consumers)
+
+ def sun_down(self):
+ # Move the sun down
+ trip_y = self.sunitem_orig_y1 - self.sunitem_target_y1
+ if self.sun_connect_handler:
+ self.sunitem.disconnect(self.sun_connect_handler)
+ self.sun_connect_handler = self.sunitem.connect("animation-finished",
+ self.sun_down_arrived)
+ self.sunitem.animate(0,
+ 0,
+ 1,
+ 1,
+ True,
+ int(self.timerinc*abs(trip_y)),
+ self.step_time,
+ goocanvas.ANIMATE_FREEZE)
+ return False
+
+ def sun_up_arrived(self, item, status):
+ # Start the vapor
+ self.init_vapor()
+
+ def sun_down_arrived(self, item, status):
+ gcompris.utils.item_focus_init(self.sunitem, None)
+ # Stop the sun
+ self.sun_on = 0
+
+ def cloud_reset(self):
+ if (not self.cloud_is_arrived or self.waterlevel != self.waterlevel_max):
+ return
+
+ self.clouditem.translate(self.clouditem_bounds.x1 - self.clouditem.get_bounds().x1,
+ 0)
+ self.clouditem.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.rainitem.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.snowitem.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.cloud_is_arrived = False
+ self.cloud_on = False
+ self.its_raining = False
+
+ def cloud_arrived(self, item, status):
+ self.sun_down()
+ self.clouditem.connect("button_press_event", self.cloud_item_event)
+ gcompris.utils.item_focus_init(self.clouditem, None)
+ self.cloud_is_arrived = True
+
+ def move_cloud(self):
+ if (self.cloud_on):
+ return
+ self.cloud_on = True
+ self.clouditem.props.visibility = goocanvas.ITEM_VISIBLE
+ trip_x = 270
+ self.clouditem.animate(trip_x,
+ 0,
+ 1,
+ 1,
+ True,
+ self.timerinc*trip_x,
+ self.step_time,
+ goocanvas.ANIMATE_FREEZE)
+
+ def vapor_arrived(self, item, state):
+ self.vapor_on = 0
+ self.vaporitem.props.visibility = goocanvas.ITEM_INVISIBLE
+ # Start the cloud
+ self.move_cloud()
+
+ def init_vapor(self):
+ self.vapor_on = 1
+ self.vaporitem.props.visibility = goocanvas.ITEM_VISIBLE
+ trip_y = 80
+ self.vaporitem.animate(0,
+ trip_y * -1,
+ 1,
+ 1,
+ True,
+ self.timerinc*trip_y,
+ self.step_time,
+ goocanvas.ANIMATE_RESET)
+
+
+
+ def pause(self, pause):
+ pass
+
+ def set_level(self, level):
+ pass
+
+ def sun_item_event(self, widget, target, event=None):
+ if event.type == gtk.gdk.BUTTON_PRESS:
+ if event.button == 1:
+ if not self.sun_on :
+ gcompris.utils.item_focus_remove(self.sunitem, None)
+ gcompris.sound.play_ogg("sounds/bleep.wav")
+ trip_y = self.sunitem_target_y1 - self.sunitem_orig_y1
+ if self.sun_connect_handler:
+ self.sunitem.disconnect(self.sun_connect_handler)
+ self.sun_connect_handler = self.sunitem.connect("animation-finished",
+ self.sun_up_arrived)
+ self.sunitem.animate(0,
+ trip_y,
+ 1,
+ 1,
+ True,
+ int(self.timerinc*abs(trip_y)),
+ self.step_time,
+ goocanvas.ANIMATE_FREEZE)
+
+ self.sun_on = 1
+ return True
+ return False
+
+ def cloud_item_event(self, widget, target, event=None):
+ gcompris.sound.play_ogg("sounds/Water5.wav")
+ self.rainitem.props.visibility = goocanvas.ITEM_VISIBLE
+ self.snowitem.props.visibility = goocanvas.ITEM_VISIBLE
+ self.riveritem.props.visibility = goocanvas.ITEM_VISIBLE
+ self.its_raining = True
+ self.clouditem.disconnect_by_func(self.cloud_item_event)
+ gcompris.utils.item_focus_remove(self.clouditem, None)
+ return True
+
+ def turbine_item_event(self, widget, target, event=None):
+ if self.turbine_on:
+ self.set_turbine_state(False)
+ else:
+ self.set_turbine_state(True)
+ return True
+
+ def set_turbine_state(self, state):
+ if state and self.waterlevel == self.waterlevel_max \
+ and not self.turbine_on:
+ gcompris.sound.play_ogg("sounds/bubble.wav")
+ self.turbine_on = True
+ self.add_prod_count(1000)
+ self.turbine_cable_on.props.visibility = goocanvas.ITEM_VISIBLE
+ elif self.turbine_on:
+ self.turbine_on = False
+ self.turbine_cable_on.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.set_transformer1_state(False)
+ self.add_prod_count(-1000)
+
+ def add_prod_count(self, value):
+ self.prod_count += value
+ self.prod_count_item.set_properties(text = str(self.prod_count) + "W")
+
+ def update_conso_count(self):
+ conso_count = 0
+ if self.transformer2_on:
+ conso_count = reduce(lambda x, y: x + y,
+ map(lambda x: x.consumption, self.consumers) )
+
+ self.conso_count_item.set_properties(text = str(conso_count) + "W")
+
+ # Simulate a miss of power
+ if conso_count > self.prod_count:
+ self.set_transformer2_state(False)
+ gcompris.utils.dialog( \
+ _("It is not possible to consume more electricity "
+ "than what is produced. This is a key limitation in the "
+ "distribution of electricity, with minor exceptions, "
+ "electrical energy cannot be stored, and therefore it "
+ "must be generated as it is needed. A sophisticated "
+ "system of control is therefore required to ensure electric "
+ "generation very closely matches the demand. If supply and demand "
+ "are not in balance, generation plants and transmission equipment "
+ "can shut down which, in the worst cases, can lead to a major "
+ "regional blackout."), None)
+
+ def transformer1_item_event(self, widget, target, event=None):
+ if self.transformer1_on:
+ self.set_transformer1_state(False)
+ else:
+ self.set_transformer1_state(True)
+ return True
+
+ def set_transformer1_state(self, state):
+ if state and self.turbine_on:
+ gcompris.sound.play_ogg("sounds/bubble.wav")
+ self.transformer1_on = True
+ self.cable1_cv1_to_cv2_on.props.visibility = goocanvas.ITEM_VISIBLE
+ self.cable2_cv1_to_cv2_on.props.visibility = goocanvas.ITEM_VISIBLE
+ else:
+ self.transformer1_on = False
+ self.cable1_cv1_to_cv2_on.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.cable2_cv1_to_cv2_on.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.set_transformer2_state(False)
+
+ def transformer2_item_event(self, widget, target, event=None):
+ if self.transformer2_on:
+ self.set_transformer2_state(False)
+ else:
+ self.set_transformer2_state(True)
+ return True
+
+ def set_transformer2_state(self, state):
+ if state and self.transformer1_on:
+ gcompris.sound.play_ogg("sounds/bubble.wav")
+ self.transformer2_on = True
+ self.cable_to_town_on.props.visibility = goocanvas.ITEM_VISIBLE
+ self.cable_to_tux_on.props.visibility = goocanvas.ITEM_VISIBLE
+ map(lambda s: s.power_on(), self.consumers)
+ else:
+ self.transformer2_on = False
+ self.cable_to_town_on.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.cable_to_tux_on.props.visibility = goocanvas.ITEM_INVISIBLE
+ map(lambda s: s.power_off(), self.consumers)
+
+ self.update_conso_count()
+
+#
+class Consumer:
+ # Pass the SVG IDs of the stuff to act on
+ def __init__(self, rootitem, svghandle,
+ update_conso_count,
+ switch_on, switch_off,
+ target_on, target_off, power):
+ self.power_count = power
+ self.consumption = 0
+ self.update_conso_count = update_conso_count
+ self.switch_on = goocanvas.Svg(
+ parent = rootitem,
+ svg_handle = svghandle,
+ svg_id = switch_on,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+ self.switch_on.connect("button_press_event",
+ self.lightbutton_item_event_on)
+ gcompris.utils.item_focus_init(self.switch_on, None)
+ self.switch_off = goocanvas.Svg(
+ parent = rootitem,
+ svg_handle = svghandle,
+ svg_id = switch_off,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+ self.switch_off.connect("button_press_event",
+ self.lightbutton_item_event_off)
+ gcompris.utils.item_focus_init(self.switch_off, None)
+ self.target_on = goocanvas.Svg(
+ parent = rootitem,
+ svg_handle = svghandle,
+ svg_id = target_on,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+ if target_off:
+ self.target_off = goocanvas.Svg(
+ parent = rootitem,
+ svg_handle = svghandle,
+ svg_id = target_off,
+ visibility = goocanvas.ITEM_INVISIBLE
+ )
+ else:
+ self.target_off = None
+ # Is there power comming in
+ self.power = False
+ # Is the light is switched on
+ self.is_on = False
+
+ def update_light(self):
+ if self.power and self.is_on:
+ self.target_on.props.visibility = goocanvas.ITEM_VISIBLE
+ if self.target_off:
+ self.target_off.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.consumption = self.power_count
+ else:
+ if self.target_off:
+ self.target_off.props.visibility = goocanvas.ITEM_VISIBLE
+ self.target_on.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.consumption = 0
+ self.update_conso_count()
+
+ def on(self):
+ self.switch_on.props.visibility = goocanvas.ITEM_VISIBLE
+ self.switch_off.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.is_on = True
+ self.update_light()
+
+ def off(self):
+ self.switch_off.props.visibility = goocanvas.ITEM_VISIBLE
+ self.switch_on.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.switch_off.raise_(None)
+ self.switch_on.raise_(None)
+ self.is_on = False
+ self.update_light()
+
+ def lightbutton_item_event_on(self, widget, target, event):
+ self.off()
+
+ def lightbutton_item_event_off(self, widget, target, event):
+ self.on()
+
+ def power_off(self):
+ self.power = False
+ self.update_light()
+
+ def power_on(self):
+ self.power = True
+ self.update_light()
diff --git a/src/hydroelectric-activity/hydroelectric.svg b/src/hydroelectric-activity/hydroelectric.svg
new file mode 100644
index 0000000..9479fc7
--- /dev/null
+++ b/src/hydroelectric-activity/hydroelectric.svg
@@ -0,0 +1,438 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="100"
+ height="100"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.48.0 r9654"
+ version="1.0"
+ sodipodi:docname="hydroelectric.svg">
+ <defs
+ id="defs4">
+ <linearGradient
+ y2="954.76569"
+ x2="674.64966"
+ y1="874.65875"
+ x1="674.64966"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1576"
+ xlink:href="#linearGradient4161"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="693.25641"
+ x2="440.10486"
+ y1="613.38153"
+ x1="440.10486"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1574"
+ xlink:href="#linearGradient3211"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="163.79573"
+ x2="208.62442"
+ y1="119.7196"
+ x1="208.62442"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1570"
+ xlink:href="#linearGradient9611"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="143.83321"
+ x2="555.45441"
+ y1="146.65633"
+ x1="547.49896"
+ gradientTransform="translate(57,-24)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1568"
+ xlink:href="#linearGradient5079"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="143.83321"
+ x2="555.45441"
+ y1="146.65633"
+ x1="547.49896"
+ gradientTransform="translate(57,-24)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1566"
+ xlink:href="#linearGradient5079"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="143.83321"
+ x2="555.45441"
+ y1="146.65633"
+ x1="547.49896"
+ gradientTransform="translate(57,-24)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1564"
+ xlink:href="#linearGradient5079"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="143.83321"
+ x2="555.45441"
+ y1="146.65633"
+ x1="547.49896"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1562"
+ xlink:href="#linearGradient5079"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="143.83321"
+ x2="555.45441"
+ y1="146.65633"
+ x1="547.49896"
+ gradientTransform="translate(57,-24)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1560"
+ xlink:href="#linearGradient5079"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="143.83321"
+ x2="555.45441"
+ y1="146.65633"
+ x1="547.49896"
+ gradientTransform="translate(57,-24)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1558"
+ xlink:href="#linearGradient5079"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="143.83321"
+ x2="555.45441"
+ y1="146.65633"
+ x1="547.49896"
+ gradientTransform="translate(57,-24)"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1556"
+ xlink:href="#linearGradient5079"
+ inkscape:collect="always" />
+ <linearGradient
+ y2="143.83321"
+ x2="555.45441"
+ y1="146.65633"
+ x1="547.49896"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1554"
+ xlink:href="#linearGradient5079"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient5079"
+ inkscape:collect="always">
+ <stop
+ id="stop5081"
+ offset="0"
+ style="stop-color:white;stop-opacity:1;" />
+ <stop
+ id="stop5083"
+ offset="1"
+ style="stop-color:white;stop-opacity:0" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4161">
+ <stop
+ id="stop4163"
+ offset="0"
+ style="stop-color:#ffc800;stop-opacity:1;" />
+ <stop
+ id="stop4165"
+ offset="1"
+ style="stop-color:#ffc100;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3211">
+ <stop
+ id="stop3213"
+ offset="0"
+ style="stop-color:#b4b4b4;stop-opacity:1;" />
+ <stop
+ id="stop3215"
+ offset="1"
+ style="stop-color:#f0f0f0;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient9611"
+ inkscape:collect="always">
+ <stop
+ id="stop9613"
+ offset="0"
+ style="stop-color:#ffc800;stop-opacity:1;" />
+ <stop
+ id="stop9615"
+ offset="1"
+ style="stop-color:#ffc800;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5079"
+ id="linearGradient11637"
+ gradientUnits="userSpaceOnUse"
+ x1="847.01324"
+ y1="23.273985"
+ x2="847.01324"
+ y2="64.715645" />
+ <linearGradient
+ y2="163.79573"
+ x2="208.62442"
+ y1="119.7196"
+ x1="208.62442"
+ gradientUnits="userSpaceOnUse"
+ id="linearGradient1570-3"
+ xlink:href="#linearGradient9611-3"
+ inkscape:collect="always" />
+ <linearGradient
+ id="linearGradient9611-3"
+ inkscape:collect="always">
+ <stop
+ id="stop9613-0"
+ offset="0"
+ style="stop-color:#ffc800;stop-opacity:1;" />
+ <stop
+ id="stop9615-6"
+ offset="1"
+ style="stop-color:#ffc800;stop-opacity:0;" />
+ </linearGradient>
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient5079"
+ id="linearGradient11719"
+ gradientUnits="userSpaceOnUse"
+ x1="847.01324"
+ y1="23.273985"
+ x2="847.01324"
+ y2="64.715645" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="4.0660063"
+ inkscape:cx="26.66091"
+ inkscape:cy="47.684738"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ width="100px"
+ height="100px"
+ inkscape:window-width="1680"
+ inkscape:window-height="973"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ showgrid="false"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Calque 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <g
+ id="g10037"
+ transform="matrix(5.1149861e-4,0.99999987,-0.99999987,5.1149861e-4,110.55932,-2.1140974)">
+ <path
+ sodipodi:nodetypes="ccccccccccccccc"
+ id="path8254"
+ d="m 82.192022,54.548025 1.784488,8.701706 -1.182387,6.437153 0.745795,7.428073 L 62.04016,77.67498 45.877516,76.821642 28.381518,77.877954 15.036381,77.449838 17.550357,66.131872 14.727681,57.005434 15.75948,46.67745 l 24.316759,-0.983699 28.766148,0.856806 15.420588,-0.278729 -2.070953,8.276197 z"
+ style="fill:#005aff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path8248"
+ d="m 16.346987,25.568268 69.388876,-0.347814 0.69563,37.042182 -2.78251,-1.912977 -3.47814,-3.478139 -3.99986,-2.086883 -4.34768,1.043442 -3.13032,2.434697 -2.60861,1.739069 -5.56502,0.521721 -2.95642,-3.825953 -3.99986,-1.739069 -2.6086,-0.347814 -3.82595,1.912976 -3.65205,2.782512 -1.91298,1.217348 -3.99986,-0.173907 -3.30423,-1.565162 -3.30423,-2.782512 -4.52158,-1.043441 -2.4347,0 -2.26079,1.391255 -4.869395,1.73907 0.173907,-23.651346 -0.695628,-8.869255 z"
+ style="fill:#e9bc9f;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path8248-5"
+ d="m 14.844127,90.426861 69.388563,0.263389 0.725842,-22.023116 -2.784069,1.135106 -3.480977,2.065115 -4.00156,1.237507 -4.346826,-0.623931 -3.128334,-1.45012 -2.607191,-1.036104 -5.564591,-0.314731 -2.95954,2.272333 -4.001277,1.030714 -2.608881,0.204671 -3.824389,-1.140496 -3.64978,-1.657339 -1.911986,-0.725344 -3.999999,0.100137 -3.305505,0.927882 -3.306498,1.651665 -4.522429,0.616697 -2.434699,-0.002 -2.259655,-0.829021 -4.867974,-1.037948 0.154616,14.062211 -0.702861,5.272709 z"
+ style="fill:#e9bc9f;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.77107543000000001px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path2101"
+ d="m 60.830157,21.846133 -31.21875,1.9375 -16.71875,-0.625 2.25,18.8125 -1.90625,19.75 1.28125,14.65625 -0.8125,16.875 23.3125,1.28125 17.53125,-1.9375 18.96875,2.40625 14.46875,-0.96875 -2.71875,-25.71875 3.03125,-20.71875 -1.125,-23.46875 -26.34375,-2.28125 z m -19.5,5.25 27.375,1.625 14.6875,-0.5625 -1.96875,15.84375 1.6875,16.65625 -1.125,12.3125 0.71875,14.1875 -20.5,1.09375 -15.375,-1.625 -16.65625,2.03125 -12.71875,-0.8125 2.40625,-21.65625 -2.6875,-17.4375 0.96875,-19.78125 23.1875,-1.875 z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ style="display:inline"
+ inkscape:label="thunder"
+ id="layer4"
+ transform="matrix(-0.54125215,0,0,0.57993744,112.33703,-10.816106)">
+ <g
+ id="g2605"
+ transform="translate(-130.815,-14.4103)"
+ style="stroke-width:0.80000001;stroke-miterlimit:4;display:inline">
+ <path
+ id="path2607"
+ d="m 213.57143,117.00504 15.71428,0 -16.34821,28.31593 -5.35932,-3.0942 -19.79361,34.28353 12.89812,-48.13644 5.45925,3.1519 7.42949,-14.52072 z"
+ style="fill:#fff000;fill-opacity:1;fill-rule:evenodd;stroke:#ffc800;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ inkscape:connector-curvature="0" />
+ <path
+ sodipodi:nodetypes="cccccccc"
+ style="opacity:0.8;fill:url(#linearGradient1570-3);fill-opacity:1;fill-rule:evenodd;stroke:none"
+ d="m 214.77394,119.89818 9.40882,-0.17858 -12.44687,21.71154 -4.54868,-2.62618 -14.12113,24.99077 9.34005,-31.74834 4.63351,2.67515 7.7343,-14.82436 z"
+ id="path2609"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ <g
+ id="g11695"
+ transform="translate(0,-12)">
+ <g
+ transform="matrix(0.69038707,0,0,0.69038707,-24.719928,2.7927433)"
+ id="g10033">
+ <path
+ sodipodi:type="arc"
+ style="fill:#eacf8e;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ id="path40749"
+ sodipodi:cx="52.219921"
+ sodipodi:cy="50.022652"
+ sodipodi:rx="46.026146"
+ sodipodi:ry="45.919357"
+ d="M 97.773325,56.587165 C 94.139413,81.687243 70.798592,99.095844 45.640141,95.470364 20.481691,91.844883 3.0326052,68.558217 6.6665172,43.458138 10.300429,18.35806 33.641251,0.94945886 58.799701,4.5749395 83.905515,8.192835 101.34459,31.394462 97.7926,56.452625"
+ sodipodi:start="0.1434489"
+ sodipodi:end="6.4236745"
+ sodipodi:open="true"
+ transform="matrix(0.407863,0,0,0.430531,103.0796,48.38688)" />
+ <path
+ inkscape:connector-curvature="0"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ d="m 122.57872,49.823615 -5.21162,1.010781 -3.52521,1.923288 -2.20681,2.938511 -2.90371,2.281038 -1.94879,2.940636 -1.41523,6.141128 c 0,0 0.17631,3.949198 0.35272,4.499423 0.1764,0.550228 0.44314,3.754686 0.44314,3.754686 l 1.33139,3.947449 2.55935,3.852768 3.16412,3.21372 4.94257,3.016797 5.29378,1.198725 7.2358,-1.382229 3.43479,-1.55425 3.17256,-1.469209 2.65637,-3.113132 2.4692,-3.942441 1.31198,-4.318425 0.62791,-4.588813 -1.05825,-4.481565 -0.45168,-3.676493 -2.6456,-4.038775 -0.96344,-2.379499 -3.34694,-2.102066 -3.45204,-2.576324 -4.40731,-1.285894 -5.45905,0.190165 z m 7.89941,4.659197 6.5191,4.900144 3.21407,7.794201 -0.21939,6.278745 -1.01466,4.423166 -2.80533,3.663602 -5.72022,3.290002 -9.17318,1.409398 -6.91932,-4.366581 -3.49798,-7.703426 -0.67469,-8.791848 c 0.32727,-2.662266 3.35159,-5.224964 4.63365,-7.625022 l 7.4138,-3.904596 8.24415,0.632215 z"
+ id="path47274"
+ sodipodi:nodetypes="cccccccsccccccccccccccccccccccccccccccccccc" />
+ <path
+ sodipodi:open="true"
+ sodipodi:end="6.4236745"
+ sodipodi:start="0.1434489"
+ transform="matrix(1.4484628,0,0,1.4484628,35.758098,-5.5881109)"
+ d="m 63.557582,51.988871 c -0.140779,0.974651 -1.045015,1.650638 -2.019666,1.509858 -0.974651,-0.14078 -1.650638,-1.045015 -1.509858,-2.019666 0.140779,-0.974651 1.045015,-1.650638 2.019666,-1.509858 0.972612,0.140485 1.648211,1.041418 1.510605,2.014442"
+ sodipodi:ry="1.7830764"
+ sodipodi:rx="1.7830764"
+ sodipodi:cy="51.733967"
+ sodipodi:cx="61.79282"
+ id="path11261"
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ sodipodi:type="arc" />
+ </g>
+ <path
+ transform="matrix(0.37941851,0,0,0.37941851,38.567226,31.918613)"
+ d="m 61.362423,50.934654 c 1.245443,-0.104813 0.755744,1.627121 0.174207,2.070009 -1.575931,1.200196 -3.668749,-0.160764 -4.314224,-1.721595 -1.154603,-2.791962 0.930721,-5.747726 3.617397,-6.558439 3.942806,-1.189753 7.862721,1.701871 8.802653,5.513199 1.252783,5.079899 -2.472233,9.991525 -7.409,11.046868 -6.212417,1.328041 -12.127162,-3.241923 -13.291083,-9.304802 -1.409664,-7.342958 4.011176,-14.266697 11.200603,-15.535298 8.472492,-1.495003 16.408671,4.780146 17.779514,13.096405 1.582692,9.60145 -5.548929,18.552271 -14.992207,20.023728 C 52.20023,71.236693 42.233271,63.247148 40.662339,52.676721 38.899992,40.818299 47.748481,29.834137 59.44615,28.164562 72.432779,26.311018 84.434928,36.019197 86.202523,48.844174"
+ sodipodi:t0="0"
+ sodipodi:argument="-18.933516"
+ sodipodi:radius="24.92791"
+ sodipodi:revolution="3"
+ sodipodi:expansion="1"
+ sodipodi:cy="50.934654"
+ sodipodi:cx="61.362423"
+ id="path11311"
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ sodipodi:type="spiral" />
+ <g
+ id="g11678">
+ <path
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 74.564597,50.576822 c -1.351644,1.270835 -1.183446,0.401875 -0.981071,-0.589293 3.065292,-1.500513 4.31985,-0.664706 6.501861,-0.03413 0.18165,0.05249 0.410499,2.52954 -0.344403,1.856129 -1.02123,-1.390732 -4.053802,-2.429052 -5.176387,-1.232711 z"
+ id="rect11184"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 72.307649,43.389114 c -0.441652,1.801918 -0.773761,0.9815 -1.143752,0.03997 1.753881,-2.927706 3.261254,-2.909838 5.434758,-3.569141 0.180939,-0.05489 1.721737,1.898079 0.721873,1.744343 -1.61385,-0.610357 -4.722782,0.170122 -5.012879,1.784827 z"
+ id="rect11184-6"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 67.540603,38.068372 c 0.364283,1.819138 -0.284438,1.217022 -1.018831,0.521295 0.346597,-3.395207 1.719256,-4.018345 3.407957,-5.537255 0.140579,-0.12645 2.364238,0.988669 1.393555,1.273515 -1.720376,0.131738 -4.204809,2.157126 -3.782681,3.742445 z"
+ id="rect11184-8"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 61.101238,37.110713 c 1.58888,0.957822 0.706802,1.030765 -0.302172,1.103837 -2.273208,-2.545601 -1.807618,-3.979379 -1.790312,-6.250611 0.0014,-0.189077 2.32442,-1.078959 1.880129,-0.170131 -1.062924,1.359132 -1.242888,4.559478 0.212355,5.316905 z"
+ id="rect11184-5"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 52.393501,41.280592 c 1.853569,0.07903 1.114389,0.565848 0.263901,1.113607 -3.215226,-1.144501 -3.493855,-2.626006 -4.56733,-4.627618 -0.08937,-0.166629 1.522822,-2.061091 1.568522,-1.05051 -0.281393,1.702312 1.094676,4.597314 2.734907,4.564521 z"
+ id="rect11184-4"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 48.152202,49.75258 c 1.644454,-0.858917 1.24799,-0.06759 0.785638,0.832189 -3.356504,0.61761 -4.338953,-0.525756 -6.269831,-1.721794 -0.160745,-0.09957 0.287374,-2.546469 0.832537,-1.69432 0.608023,1.614733 3.247867,3.432926 4.651656,2.583925 z"
+ id="rect11184-7"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 49.583909,58.579455 c 0.176806,-1.846809 0.623911,-1.082951 1.12599,-0.204722 -1.312705,3.150296 -2.806858,3.350296 -4.862369,4.316565 -0.171116,0.08045 -1.977792,-1.629546 -0.966208,-1.621812 1.685076,0.370902 4.64871,-0.850358 4.702587,-2.490031 z"
+ id="rect11184-70"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 57.776689,65.302249 c -0.0052,-1.855245 0.514685,-1.138923 1.100481,-0.314173 -0.997389,3.263859 -2.464722,3.609444 -4.415548,4.772661 -0.162401,0.09684 -2.128085,-1.427704 -1.120619,-1.519225 1.71333,0.203839 4.542891,-1.302211 4.435686,-2.939263 z"
+ id="rect11184-2"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 66.782734,63.466398 c -1.481264,-1.11706 -0.596372,-1.098357 0.414748,-1.066653 1.997657,2.767114 1.386235,4.145032 1.134053,6.402287 -0.02099,0.187914 -2.423572,0.832698 -1.887643,-0.02529 1.19783,-1.241875 1.707918,-4.40643 0.338842,-5.310344 z"
+ id="rect11184-21"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.898;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new"
+ d="m 72.97859,58.371737 c -1.853405,-0.08279 -1.113238,-0.56811 -0.26164,-1.114141 3.212895,1.151027 3.488516,2.633095 4.557925,4.636883 0.08903,0.16681 -1.527004,2.057995 -1.570652,1.047323 0.284849,-1.701738 -1.08534,-4.599527 -2.725633,-4.570065 z"
+ id="rect11184-41"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+ </g>
+ <path
+ id="path5654-9"
+ d="m 44.410349,18.064044 3.863487,5.911056 -2.173212,1.542015 -1.20734,-3.598034 -2.414679,-2.05602 1.931744,-1.799017 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path5654-4"
+ d="m 46.13194,28.147648 3.863487,5.911056 -2.173212,1.542015 -1.20734,-3.598034 -2.414679,-2.05602 1.931744,-1.799017 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path5654-48"
+ d="m 41.827963,51.143186 3.863487,5.911056 -2.173212,1.542015 -1.20734,-3.598034 -2.414679,-2.05602 1.931744,-1.799017 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path5654-0"
+ d="m 43.672524,66.391563 3.863487,5.911056 -2.173212,1.542015 -1.20734,-3.598034 -2.414679,-2.05602 1.931744,-1.799017 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ inkscape:connector-curvature="0" />
+ <path
+ id="path5654-98"
+ d="m 43.180641,37.370457 3.863487,5.911056 -2.173212,1.542015 -1.20734,-3.598034 -2.414679,-2.05602 1.931744,-1.799017 z"
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/src/hydroelectric-activity/hydroelectric.xml.in b/src/hydroelectric-activity/hydroelectric.xml.in
new file mode 100644
index 0000000..ad03149
--- /dev/null
+++ b/src/hydroelectric-activity/hydroelectric.xml.in
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<GCompris>
+ <Board
+ name="hydroelectric"
+ type="python:hydroelectric"
+ section="/experience"
+ icon="hydroelectric.svg"
+ difficulty="3"
+ author="Bruno Coudoin (bruno coudoin gcompris net)"
+ boarddir=""
+ demo="1">
+ <_title>Learn about an hydroelectric dam</_title>
+ <_description>Tux has come back from a long fishing party on his boat. Bring the electrical system back up so he can have light in his home.</_description>
+ <_prerequisite></_prerequisite>
+ <_goal>Learn about an hydroelectric dam</_goal>
+ <_manual>Click on different active elements : sun, cloud, dam, transformer, in order to reactivate the entire electrical system. When the system is back up and Tux is in his home, push the light button for him.</_manual>
+ <_credit>Drawing by Stephane Cabaraux.</_credit>
+ </Board>
+ <Data directory=""/>
+</GCompris>
diff --git a/src/hydroelectric-activity/init_path.sh b/src/hydroelectric-activity/init_path.sh
new file mode 100755
index 0000000..db9415f
--- /dev/null
+++ b/src/hydroelectric-activity/init_path.sh
@@ -0,0 +1,8 @@
+# Set the different path for this activity
+# This is sourced by runit.sh
+path=$1
+activity=hydroelectric
+plugindir=$path/../boards/.libs
+pythonplugindir=$path
+resourcedir=$path/resources
+section="/experience"
diff --git a/src/hydroelectric-activity/resources/Makefile.am b/src/hydroelectric-activity/resources/Makefile.am
new file mode 100644
index 0000000..856f533
--- /dev/null
+++ b/src/hydroelectric-activity/resources/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = hydroelectric
\ No newline at end of file
diff --git a/src/hydroelectric-activity/resources/hydroelectric/Makefile.am b/src/hydroelectric-activity/resources/hydroelectric/Makefile.am
new file mode 100644
index 0000000..5ac0c2e
--- /dev/null
+++ b/src/hydroelectric-activity/resources/hydroelectric/Makefile.am
@@ -0,0 +1,5 @@
+imgdir = $(pkgdatadir)/@PACKAGE_DATA_DIR@/hydroelectric
+img_DATA = \
+ hydroelectric.svgz
+
+EXTRA_DIST = $(img_DATA)
diff --git a/src/hydroelectric-activity/resources/hydroelectric/hydroelectric.svgz b/src/hydroelectric-activity/resources/hydroelectric/hydroelectric.svgz
new file mode 100644
index 0000000..6c8f94e
Binary files /dev/null and b/src/hydroelectric-activity/resources/hydroelectric/hydroelectric.svgz differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]