Commit aeeb78c6 authored by Valérie Maquil's avatar Valérie Maquil
Browse files

added light bulb scenario

parent c6d3d18e
<?xml version="1.0" encoding="UTF-8"?>
<scenario>
<scenes>
<scene>
<name>Empty</name>
</scene>
</scenes>
<objects>
<object>
<type>ValueWidget</type>
<handles>
<handle>1</handle>
</handles>
<coronas>
<corona>
<type>Shadow</type>
<handle>1</handle>
<centre>
<x>0</x>
<y>0</y>
<z>0</z>
</centre>
<shape>Circle</shape>
<drawPriority>0</drawPriority>
</corona>
<corona>
<type>TextBox</type>
<handle>1</handle>
<centre>
<x>0</x>
<y>0</y>
<z>0</z>
</centre>
<drawPriority>1</drawPriority>
<text>Banana</text>
</corona>
</coronas>
<name>IncandescentLightBulbs</name>
<definingShape></definingShape>
<networkAdapter></networkAdapter>
<lowerBound>0</lowerBound>
<upperBound>10</upperBound>
<lowerStopAngle>3.1415</lowerStopAngle>
<upperStopAngle>6.2830</upperStopAngle>
<stepSize>1</stepSize>
<variable>
<name>IncandescentLightBulbs</name>
<unit>piece</unit>
<value>1</value>
</variable>
<modifyValueOnRotation>True</modifyValueOnRotation>
</object>
<object>
<type>ValueWidget</type>
<handles>
<handle>2</handle>
</handles>
<coronas>
<corona>
<type>Shadow</type>
<handle>2</handle>
<centre>
<x>0</x>
<y>0</y>
<z>0</z>
</centre>
<shape>Circle</shape>
<drawPriority>0</drawPriority>
</corona>
<corona>
<type>TextBox</type>
<handle>2</handle>
<centre>
<x>0</x>
<y>0</y>
<z>0</z>
</centre>
<drawPriority>2</drawPriority>
<text>Banana</text>
</corona>
</coronas>
<name>CompactFluorescents</name>
<definingShape></definingShape>
<networkAdapter></networkAdapter>
<lowerBound>0</lowerBound>
<upperBound>10</upperBound>
<lowerStopAngle>3.1415</lowerStopAngle>
<upperStopAngle>6.2830</upperStopAngle>
<stepSize>1</stepSize>
<variable>
<name>CompactFluorescents</name>
<unit>piece</unit>
<value>1</value>
</variable>
<modifyValueOnRotation>True</modifyValueOnRotation>
</object>
<object>
<type>ValueWidget</type>
<handles>
<handle>3</handle>
</handles>
<coronas>
<corona>
<type>Shadow</type>
<handle>3</handle>
<centre>
<x>0</x>
<y>0</y>
<z>0</z>
</centre>
<shape>Circle</shape>
<drawPriority>0</drawPriority>
</corona>
<corona>
<type>TextBox</type>
<handle>3</handle>
<centre>
<x>0</x>
<y>0</y>
<z>0</z>
</centre>
<drawPriority>3</drawPriority>
<text>Banana</text>
</corona>
</coronas>
<name>LightEmittingDiodes</name>
<definingShape></definingShape>
<networkAdapter></networkAdapter>
<lowerBound>0</lowerBound>
<upperBound>10</upperBound>
<lowerStopAngle>3.1415</lowerStopAngle>
<upperStopAngle>6.2830</upperStopAngle>
<stepSize>1</stepSize>
<variable>
<name>LightEmittingDiodes</name>
<unit>piece</unit>
<value>1</value>
</variable>
<modifyValueOnRotation>True</modifyValueOnRotation>
</object>
<object>
<type>ValueWidget</type>
<handles>
<handle>7</handle>
</handles>
<coronas>
<corona>
<type>Shadow</type>
<handle>7</handle>
<centre>
<x>0</x>
<y>0</y>
<z>0</z>
</centre>
<shape>Circle</shape>
<drawPriority>0</drawPriority>
</corona>
<corona>
<type>TextBox</type>
<handle>7</handle>
<centre>
<x>50</x>
<y>50</y>
<z>0</z>
</centre>
<drawPriority>1</drawPriority>
<lineWidth>100</lineWidth>
<text>Banana</text>
</corona>
</coronas>
<name>Watts</name>
<definingShape></definingShape>
<networkAdapter></networkAdapter>
<lowerBound>0</lowerBound>
<upperBound>1</upperBound>
<lowerStopAngle>3.1415</lowerStopAngle>
<upperStopAngle>6.2830</upperStopAngle>
<stepSize>1</stepSize>
<variable>
<name>Watts</name>
<unit>W</unit>
<value>0</value>
</variable>
<modifyValueOnRotation>False</modifyValueOnRotation>
<dynamic>true</dynamic>
</object>
<object>
<type>ValueWidget</type>
<handles>
<handle>8</handle>
</handles>
<coronas>
<corona>
<type>Shadow</type>
<handle>8</handle>
<centre>
<x>0</x>
<y>0</y>
<z>0</z>
</centre>
<shape>Circle</shape>
<drawPriority>0</drawPriority>
</corona>
<corona>
<type>TextBox</type>
<handle>8</handle>
<centre>
<x>50</x>
<y>50</y>
<z>0</z>
</centre>
<drawPriority>1</drawPriority>
<lineWidth>100</lineWidth>
<text>Banana</text>
</corona>
</coronas>
<name>Costs</name>
<definingShape></definingShape>
<networkAdapter></networkAdapter>
<lowerBound>0</lowerBound>
<upperBound>1</upperBound>
<lowerStopAngle>3.1415</lowerStopAngle>
<upperStopAngle>6.2830</upperStopAngle>
<stepSize>1</stepSize>
<variable>
<name>Costs</name>
<unit></unit>
<value>0</value>
</variable>
<modifyValueOnRotation>False</modifyValueOnRotation>
<dynamic>true</dynamic>
</object>
</objects>
<system>
<outputs>
<output name="Watts" unit="W" />
<output name="Costs" unit="€" />
</outputs>
<equations>
<equation name="PowerConsumption">
<parameters>
<parameter name="IncandescentLightBulbs" unit="pieces"/>
<parameter name="CompactFluorescents" unit="pieces"/>
<parameter name="LightEmittingDiodes" unit="pieces"/>
</parameters>
<invoke>(60*IncandescentLightBulbs) + (14*CompactFluorescents) + (7*LightEmittingDiodes)</invoke>
<results>
<result name="Watts" />
</results>
</equation>
<equation name="Costs">
<parameters>
<parameter name="IncandescentLightBulbs" unit="pieces"/>
<parameter name="CompactFluorescents" unit="pieces"/>
<parameter name="LightEmittingDiodes" unit="pieces"/>
</parameters>
<invoke>(10*IncandescentLightBulbs) + (2*CompactFluorescents) + (1*LightEmittingDiodes)</invoke>
<results>
<result name="Costs" />
</results>
</equation>
</equations>
</system>
</scenario>
\ No newline at end of file
/**
* Copyright Luxembourg Institute of Science and Technology, 2016. All rights reserved. If you wish
* to use this code for any purpose, please contact the author(s).
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package lu.list.itis.dkd.tui.scenario.lights;
import lu.list.itis.dkd.tui.exception.BuildException;
import lu.list.itis.dkd.tui.scenario.Scenario;
import org.jdom2.Document;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import java.io.File;
import java.io.IOException;
/**
* @author Eric Tobias [eric.tobias@list.lu]
* @since [major].[minor]
* @version [major].[minor].[micro]
*/
public class LightScenario extends Scenario {
/**
* @param scenarioDescription
* @throws BuildException
*/
public LightScenario(Document scenarioDescription) throws BuildException {
super(scenarioDescription);
}
/**
* @param fileUri
* @throws BuildException
*/
public LightScenario(String fileUri) throws BuildException {
super(fileUri);
}
/**
* @param args
* @throws IOException
* @throws JDOMException
* @throws BuildException
*/
public static void main(String[] args) throws BuildException, JDOMException, IOException {
final SAXBuilder builder = new SAXBuilder();
final File xmlFile = new File("light_scenario.xml");
final LightScenario scenario = new LightScenario(builder.build(xmlFile));
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment