<?xml version="1.0"?>
<?xml-stylesheet href='http://gres.uninova.pt/iopt-flow/show-pf.xsl' type='text/xsl' ?>
<net name="sample__main" type="iopt-flow">
  <signal id="SensorT1" x="145" y="90" mode="input" type="range" min="0" max="50" frac="0" value="20" dynamic="none" microstep="0" nano-step="0"/>
  <signal id="SensorT2" x="95" y="160" mode="input" type="range" min="0" max="50" frac="0" value="20" dynamic="none" microstep="0" nano-step="0"/>
  <signal id="SensorT3" x="145" y="245" mode="input" type="range" min="0" max="50" frac="0" value="20" dynamic="none" microstep="0" nano-step="0"/>
  <operation id="o006" x="310" y="180" constant="3" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="3"/>
    <output off_x="20" off_y="0" name="K" id="o006.K" type="range" min="3" max="3" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>3</text>
        <operand type="literal" value="3"/>
      </expression>
    </output>
  </operation>
  <operation id="op1" x="250" y="160" rot="0" shape="arrow" size="30" locked="true">
    <name text="+" off_x="-5" off_y="3"/>
    <input id="op1.SensorT1" name="SensorT1" type="range" dynamic="all" min="0" max="50" off_x="-30" off_y="-15" frac="0"/>
    <input id="op1.SensorT2" name="SensorT2" type="range" dynamic="all" min="0" max="50" off_x="-30" off_y="0" frac="0"/>
    <input id="op1.SensorT3" name="SensorT3" type="range" dynamic="all" min="0" max="50" off_x="-30" off_y="15" frac="0"/>
    <output id="op1.out" name="out" type="range" min="-32768" max="32767" off_x="30" off_y="0" microstep="0" nano-step="1" frac="0">
      <expression>
        <text>SensorT1 + SensorT2 + SensorT3</text>
        <operand type="signal" idRef="SensorT1"/>
        <operator type="add"/>
        <operand type="signal" idRef="SensorT2"/>
        <operator type="add"/>
        <operand type="signal" idRef="SensorT3"/>
      </expression>
    </output>
  </operation>
  <arc id="a007" type="read" source="SensorT1" target="op1.SensorT1" c1_x="0" c1_y="35" c2_x="-45" c2_y="0"/>
  <arc id="a008" type="read" source="SensorT2" target="op1.SensorT2"/>
  <arc id="a009" type="read" source="SensorT3" target="op1.SensorT3" c2_x="-45" c2_y="0" c1_x="0" c1_y="-40"/>
  <operation id="o010" x="390" y="170" rot="0" shape="arrow" size="25" locked="true">
    <name text="/" off_x="-5" off_y="4"/>
    <input id="o010.op1_out" name="op1_out" type="range" dynamic="all" min="-32768" max="32767" off_x="-25" off_y="-10" frac="0"/>
    <input id="o010.o006_K" name="o006_K" type="range" dynamic="all" min="3" max="3" off_x="-25" off_y="10"/>
    <output id="o010.out" name="out" type="range" min="-32768" max="32767" off_x="25" off_y="0" microstep="0" nano-step="2">
      <expression>
        <text>op1_out / o006_K</text>
        <operand type="signal" idRef="op1_out"/>
        <operator type="div"/>
        <operand type="signal" idRef="o006_K"/>
      </expression>
    </output>
  </operation>
  <arc id="a011" type="read" source="op1.out" target="o010.op1_out"/>
  <arc id="a012" type="read" source="o006.K" target="o010.o006_K"/>
  <operation id="o013" x="555" y="80" rot="0" shape="arrow" size="25" locked="true">
    <name text="-" off_x="-5" off_y="-3"/>
    <input id="o013.Media" name="Media" type="range" dynamic="all" min="0" max="50" off_x="-25" off_y="-10" frac="0"/>
    <input id="o013.SensorT1" name="SensorT1" type="range" dynamic="all" min="0" max="50" off_x="-25" off_y="10" frac="0"/>
    <output id="o013.out" name="out" type="range" min="-32768" max="32767" off_x="25" off_y="0" microstep="0" nano-step="3">
      <expression>
        <text>Media - SensorT1</text>
        <operand type="signal" idRef="Media"/>
        <operator type="sub"/>
        <operand type="signal" idRef="SensorT1"/>
      </expression>
    </output>
  </operation>
  <operation id="o014" x="555" y="180" rot="0" shape="arrow" size="25" locked="true">
    <name text="-" off_x="-5" off_y="-3"/>
    <input id="o014.Media" name="Media" type="range" dynamic="all" min="0" max="50" off_x="-25" off_y="-10" frac="0"/>
    <input id="o014.SensorT2" name="SensorT2" type="range" dynamic="all" min="0" max="50" off_x="-25" off_y="10" frac="0"/>
    <output id="o014.out" name="out" type="range" min="-32768" max="32767" off_x="25" off_y="0" microstep="0" nano-step="3">
      <expression>
        <text>Media - SensorT2</text>
        <operand type="signal" idRef="Media"/>
        <operator type="sub"/>
        <operand type="signal" idRef="SensorT2"/>
      </expression>
    </output>
  </operation>
  <operation id="o015" x="560" y="280" rot="0" shape="arrow" size="25" locked="true">
    <name text="-" off_x="-5" off_y="-3"/>
    <input id="o015.Media" name="Media" type="range" dynamic="all" min="0" max="50" off_x="-25" off_y="-10" frac="0"/>
    <input id="o015.SensorT3" name="SensorT3" type="range" dynamic="all" min="0" max="50" off_x="-25" off_y="10" frac="0"/>
    <output id="o015.out" name="out" type="range" min="-32768" max="32767" off_x="25" off_y="0" microstep="0" nano-step="3">
      <expression>
        <text>Media - SensorT3</text>
        <operand type="signal" idRef="Media"/>
        <operator type="sub"/>
        <operand type="signal" idRef="SensorT3"/>
      </expression>
    </output>
  </operation>
  <signal id="Media" x="445" y="170" mode="internal" type="range" min="0" max="50" frac="0" value="0" dynamic="type" microstep="0" nano-step="2"/>
  <signal id="DiferencaT1" x="730" y="80" mode="output" type="range" min="0" max="50" frac="0" value="0" dynamic="type" microstep="0" nano-step="4"/>
  <signal id="DiferencaT2" x="735" y="180" mode="output" type="range" min="0" max="50" frac="0" value="0" dynamic="type" microstep="0" nano-step="4"/>
  <signal id="DiferencaT3" x="735" y="280" mode="output" type="range" min="0" max="50" frac="0" value="0" dynamic="type" microstep="0" nano-step="4"/>
  <operation id="o020" x="645" y="80" rot="0" shape="arrow" size="20" locked="true">
    <name text="Abs" off_x="-15" off_y="-20"/>
    <input id="o020.o013_out" name="o013_out" type="range" dynamic="all" min="-32768" max="32767" off_x="-20" off_y="0"/>
    <output id="o020.out" name="out" type="range" min="0" max="32767" off_x="20" off_y="0" microstep="0" nano-step="4">
      <expression>
        <text>o013_out WHEN (()o013_out &gt;= 0)</text>
        <operand type="signal" idRef="o013_out"/>
        <operator type="when"/>
        <operand type="sub-expression"/>
        <operand type="signal" idRef="o013_out"/>
        <operator type="more-or-equal"/>
        <operand type="literal" value="0"/>
      </expression>
      <expression>
        <text>i2</text>
        <operand type="signal" idRef="i2" neg="treu"/>
      </expression>
    </output>
  </operation>
  <operation id="o021" x="645" y="180" rot="0" shape="arrow" size="20" locked="true">
    <name text="Abs" off_x="-15" off_y="-20"/>
    <input id="o021.o014_out" name="o014_out" type="range" dynamic="all" min="-32768" max="32767" off_x="-20" off_y="0"/>
    <output id="o021.out" name="out" type="range" min="0" max="32767" off_x="20" off_y="0" microstep="0" nano-step="4">
      <expression>
        <text>o014_out WHEN (()o014_out &gt;= 0)</text>
        <operand type="signal" idRef="o014_out"/>
        <operator type="when"/>
        <operand type="sub-expression"/>
        <operand type="signal" idRef="o014_out"/>
        <operator type="more-or-equal"/>
        <operand type="literal" value="0"/>
      </expression>
      <expression>
        <text>i2</text>
        <operand type="signal" idRef="i2" neg="treu"/>
      </expression>
    </output>
  </operation>
  <operation id="o022" x="645" y="280" rot="0" shape="arrow" size="20" locked="true">
    <name text="Abs" off_x="-15" off_y="-20"/>
    <input id="o022.o015_out" name="o015_out" type="range" dynamic="all" min="-32768" max="32767" off_x="-20" off_y="0"/>
    <output id="o022.out" name="out" type="range" min="0" max="32767" off_x="20" off_y="0" microstep="0" nano-step="4">
      <expression>
        <text>o015_out WHEN (()o015_out &gt;= 0)</text>
        <operand type="signal" idRef="o015_out"/>
        <operator type="when"/>
        <operand type="sub-expression"/>
        <operand type="signal" idRef="o015_out"/>
        <operator type="more-or-equal"/>
        <operand type="literal" value="0"/>
      </expression>
      <expression>
        <text>i2</text>
        <operand type="signal" idRef="i2" neg="treu"/>
      </expression>
    </output>
  </operation>
  <arc id="a023" type="read" source="o010.out" target="Media"/>
  <arc id="a024" type="read" source="Media" target="o014.Media"/>
  <arc id="a025" type="read" source="Media" target="o013.Media" c2_x="-50" c2_y="0" c1_x="0" c1_y="-65"/>
  <arc id="a026" type="read" source="Media" target="o015.Media" c2_x="-55" c2_y="0" c1_x="5" c1_y="60"/>
  <arc id="a027" type="read" source="o013.out" target="o020.o013_out"/>
  <arc id="a028" type="read" source="o020.out" target="DiferencaT1"/>
  <arc id="a029" type="read" source="o014.out" target="o021.o014_out"/>
  <arc id="a030" type="read" source="o021.out" target="DiferencaT2"/>
  <arc id="a031" type="read" source="o015.out" target="o022.o015_out"/>
  <arc id="a032" type="read" source="o022.out" target="DiferencaT3"/>
  <arc id="a033" type="read" source="SensorT1" target="o013.SensorT1"/>
  <arc id="a034" type="read" source="SensorT2" target="o014.SensorT2" c1_x="0" c1_y="40" c2_x="-240" c2_y="15"/>
  <arc id="a035" type="read" source="SensorT3" target="o015.SensorT3" c1_x="0" c1_y="30" c2_x="-215" c2_y="0"/>
  <place id="p037" x="355" y="390" init_marking="1">
    <name off_x="-10" off_y="-10" text="p037"/>
    <comment off_x="0" off_y="20" text="-"/>
  </place>
  <transition id="t038" x="430" y="385" priority="0" microstep="0">
    <name off_x="-10" off_y="-10" text="t038"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </transition>
  <place id="p039" x="510" y="380" init_marking="0">
    <name off_x="-10" off_y="-10" text="p039"/>
    <comment off_x="-10" off_y="20" text="-"/>
  </place>
  <arc id="a040" type="normal" source="p037" target="t038"/>
  <arc id="a041" type="normal" source="t038" target="p039"/>
  <arc id="a042" type="read" source="Media" target="t038"/>
</net>
