<?xml version="1.0" encoding="UTF-8"?>
<net name="pong" type="iopt-flow">
  <operation id="o001" x="790" y="70" constant="1" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="1"/>
    <output off_x="20" off_y="0" name="K" id="o001.K" type="range" min="1" max="1" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>1</text>
        <operand type="literal" value="1"/>
      </expression>
    </output>
  </operation>
  <signal id="X" x="260" y="350" mode="output" type="range" min="-1" max="801" frac="0" value="0" dynamic="none" microstep="0" nano-step="3"/>
  <signal id="XS" x="245" y="510" mode="internal" type="range" min="-5" max="5" frac="0" value="0" dynamic="none" microstep="0" nano-step="1"/>
  <operation id="o005" x="175" y="515" rot="0" shape="arrow" size="24">
    <name off_x="-19" off_y="-24" text="o005"/>
    <input off_x="-24" off_y="-8" name="X" id="o005.X" type="range" min="-1" max="801" dynamic="all" frac="0"/>
    <input off_x="-24" off_y="8" name="XS" id="o005.XS" type="range" min="-5" max="5" dynamic="all" frac="0"/>
    <output off_x="24" off_y="0" name="out" id="o005.out" type="range" min="-5" max="801" dynamic="type" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="X" delay="1"/>
          <operator type="less"/>
          <operand type="literal" value="1"/>
          <operator type="or"/>
          <operand type="signal" idRef="XS" delay="1"/>
          <operator type="equal"/>
          <operand type="literal" value="0"/>
        </operand>
        <text>1 WHEN (X[-1] &lt; 1 OR XS[-1] = 0)</text>
      </expression>
      <expression>
        <operand type="literal" value="-1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="X" delay="1"/>
          <operator type="more"/>
          <operand type="literal" value="799"/>
        </operand>
        <text>-1 WHEN (X[-1] &gt; 799)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="XS" delay="1"/>
        <text>XS[-1] OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a006" type="read" source="XS" target="o005.XS" view="symbolic"/>
  <arc id="a007" type="read" source="X" target="o005.X" view="symbolic"/>
  <arc id="a009" type="read" source="o005.out" target="XS"/>
  <signal id="Y" x="280" y="370" mode="output" type="range" min="-1" max="801" frac="0" value="0" dynamic="none" microstep="0" nano-step="3"/>
  <signal id="YS" x="240" y="610" mode="internal" type="range" min="-5" max="5" frac="0" value="0" dynamic="none" microstep="0" nano-step="1"/>
  <operation id="o016" x="170" y="615" rot="0" shape="arrow" size="24">
    <name off_x="-19" off_y="-24" text="o005"/>
    <input off_x="-24" off_y="-8" name="Y" id="o016.Y" type="range" min="-1" max="801" dynamic="type" frac="0"/>
    <input off_x="-24" off_y="8" name="YS" id="o016.YS" type="range" min="-5" max="5" dynamic="type" frac="0"/>
    <output off_x="24" off_y="0" name="out" id="o016.out" type="range" min="-5" max="801" dynamic="type" frac="0" microstep="0" nano-step="1">
      <expression>
        <operand type="literal" value="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="Y" delay="1"/>
          <operator type="less"/>
          <operand type="literal" value="1"/>
          <operator type="or"/>
          <operand type="signal" idRef="YS" delay="1"/>
          <operator type="equal"/>
          <operand type="literal" value="0"/>
        </operand>
        <text>1 WHEN (Y[-1] &lt; 1 OR YS[-1] = 0)</text>
      </expression>
      <expression>
        <operand type="literal" value="-1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="Y" delay="1"/>
          <operator type="more-or-equal"/>
          <operand type="literal" value="599"/>
        </operand>
        <text>-1 WHEN (Y[-1] &gt;= 599)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="YS" delay="1"/>
        <text>YS[-1] OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a018" type="read" source="YS" target="o016.YS" view="symbolic"/>
  <arc id="a019" type="read" source="Y" target="o016.Y" view="symbolic"/>
  <arc id="a020" type="read" source="o016.out" target="YS"/>
  <signal id="Enable" x="1170" y="120" mode="internal" type="boolean" min="0" max="1" microstep="0" nano-step="2" frac="0" value="0" dynamic="none"/>
  <operation id="o002" x="155" y="315" rot="0" shape="arrow" size="32">
    <name off_x="-27" off_y="-32" text="o002"/>
    <input off_x="-32" off_y="-16" name="Enable" id="o002.Enable" type="boolean" min="0" max="1" dynamic="all" frac="0"/>
    <input off_x="-32" off_y="0" name="XS" id="o002.XS" type="range" min="-5" max="5" dynamic="all" frac="0"/>
    <input off_x="-32" off_y="16" name="X" id="o002.X" type="range" min="-1" max="801" dynamic="all" frac="0"/>
    <output off_x="32" off_y="0" name="out" id="o002.out" type="range" min="-5" max="801" dynamic="type" frac="0" microstep="0" nano-step="3">
      <expression>
        <operand type="signal" idRef="XS"/>
        <operator type="add"/>
        <operand type="signal" idRef="X" delay="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="Enable"/>
        </operand>
        <text>XS + X[-1] WHEN (Enable)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="X" delay="1"/>
        <text>X[-1] OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a003" type="read" source="Enable" target="o002.Enable" view="symbolic"/>
  <arc id="a004" type="read" source="XS" target="o002.XS" view="symbolic"/>
  <arc id="a005" type="read" source="X" target="o002.X" view="symbolic"/>
  <arc id="a010" type="read" source="o002.out" target="X"/>
  <operation id="o011" x="155" y="410" rot="0" shape="arrow" size="32">
    <name off_x="-27" off_y="-32" text="o002"/>
    <input off_x="-32" off_y="-16" name="Enable" id="o011.Enable" type="boolean" min="0" max="1" dynamic="all" frac="0"/>
    <input off_x="-32" off_y="0" name="YS" id="o011.YS" type="range" min="-5" max="5" dynamic="all" frac="0"/>
    <input off_x="-32" off_y="16" name="Y" id="o011.Y" type="range" min="-1" max="801" dynamic="all" frac="0"/>
    <output off_x="32" off_y="0" name="out" id="o011.out" type="range" min="-5" max="801" dynamic="type" frac="0" microstep="0" nano-step="3">
      <expression>
        <operand type="signal" idRef="YS"/>
        <operator type="add"/>
        <operand type="signal" idRef="Y" delay="1"/>
        <operator type="when"/>
        <operand type="sub-expression">
          <operand type="signal" idRef="Enable"/>
        </operand>
        <text>YS + Y[-1] WHEN (Enable)</text>
      </expression>
      <expression>
        <operand type="signal" idRef="Y" delay="1"/>
        <text>Y[-1] OTHERWISE</text>
      </expression>
    </output>
  </operation>
  <arc id="a012" type="read" source="Y" target="o011.Y" view="symbolic"/>
  <arc id="a013" type="read" source="YS" target="o011.YS" view="symbolic"/>
  <arc id="a014" type="read" source="Enable" target="o011.Enable" view="symbolic"/>
  <arc id="a015" type="read" source="o011.out" target="Y"/>
  <signal id="OK" x="615" y="330" mode="output" type="boolean" dynamic="type" microstep="0" nano-step="4"/>
  <component id="c1" class="ui/label_icon.xml" x="490" y="380" width="150" height="140" rot="0" implementation="iopt-flow" target="external" res_location="ball.png">
    <name off_x="-75" off_y="-75" text="ball"/>
    <source_model file="files/ui_label.xml"/>
    <input id="c1.Visible" name="Visible" off_x="-75" off_y="-50" type="boolean" microstep="0" nano-step="1"/>
    <input id="c1.X" name="X" off_x="-75" off_y="-30" type="range" min="0" max="1023" microstep="0" nano-step="3"/>
    <input id="c1.Y" name="Y" off_x="-75" off_y="-10" type="range" min="0" max="1023" microstep="0" nano-step="3"/>
    <input id="c1.Width" name="Width" off_x="-75" off_y="10" type="range" min="0" max="1023" microstep="0" nano-step="0"/>
    <input id="c1.Height" name="Height" off_x="-75" off_y="30" type="range" min="0" max="1023" microstep="0" nano-step="0"/>
    <input id="c1.PageNr" name="PageNr" off_x="-75" off_y="50" type="range" min="0" max="31" microstep="0" nano-step="0"/>
    <output id="c1.Show" name="Show" off_x="75" off_y="-50" type="boolean" microstep="0" nano-step="4"/>
    <comment text="Ball" off_x="0" off_y="20"/>
  </component>
  <arc id="a001" type="read" source="X" target="c1.X"/>
  <arc id="a002" type="read" source="o001.K" target="c1.Visible" view="symbolic"/>
  <arc id="a008" type="read" source="c1.Show" target="OK"/>
  <arc id="a011" type="read" source="Y" target="c1.Y"/>
  <component id="c013" class="ui/checkbox.xml" x="990" y="180" width="180" height="200" rot="0" implementation="iopt-flow" target="external">
    <name off_x="-90" off_y="-105" text="ui_checkbox_enable"/>
    <source_model file="files/ui_checkbox.xml"/>
    <input id="c013.Set" name="Set" type="event" off_x="-90" off_y="-80" microstep="0" nano-step="0"/>
    <input id="c013.Reset" name="Reset" type="event" off_x="-90" off_y="-60" microstep="0" nano-step="0"/>
    <input id="c013.Visible" name="Visible" off_x="-90" off_y="-40" type="boolean" microstep="0" nano-step="1"/>
    <input id="c013.Sensitive" name="Sensitive" off_x="-90" off_y="-20" type="boolean" microstep="0" nano-step="1"/>
    <input id="c013.X" name="X" off_x="-90" off_y="0" type="range" min="0" max="1023" microstep="0" nano-step="1"/>
    <input id="c013.Y" name="Y" off_x="-90" off_y="20" type="range" min="0" max="1023" microstep="0" nano-step="1"/>
    <input id="c013.Width" name="Width" off_x="-90" off_y="40" type="range" min="0" max="1023" microstep="0" nano-step="0"/>
    <input id="c013.Height" name="Height" off_x="-90" off_y="60" type="range" min="0" max="1023" microstep="0" nano-step="0"/>
    <input id="c013.PageNr" name="PageNr" off_x="-90" off_y="80" type="range" min="0" max="31" microstep="0" nano-step="0"/>
    <output id="c013.Changed" name="Changed" type="event" off_x="90" off_y="-80" microstep="0" nano-step="2"/>
    <output id="c013.Checked" name="Checked" off_x="90" off_y="-60" type="boolean" microstep="0" nano-step="2"/>
    <comment text="Run/Pause" off_x="0" off_y="20"/>
  </component>
  <arc id="a016" type="read" source="c013.Checked" target="Enable"/>
  <operation id="o017" x="825" y="180" constant="50" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="50"/>
    <output off_x="20" off_y="0" name="K" id="o017.K" type="range" min="50" max="50" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>50</text>
        <operand type="literal" value="50"/>
      </expression>
    </output>
  </operation>
  <arc id="a021" type="read" source="o017.K" target="c013.X"/>
  <operation id="o022" x="780" y="200" constant="640" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="640"/>
    <output off_x="20" off_y="0" name="K" id="o022.K" type="range" min="640" max="640" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>640</text>
        <operand type="literal" value="640"/>
      </expression>
    </output>
  </operation>
  <arc id="a023" type="read" source="o022.K" target="c013.Y"/>
  <arc id="a024" type="read" source="o001.K" target="c013.Visible" view="symbolic"/>
  <arc id="a025" type="read" source="o001.K" target="c013.Sensitive" view="symbolic"/>
  <component id="c026" class="ui/number.xml" x="995" y="435" width="200" height="240" rot="0" implementation="iopt-flow" target="external">
    <name off_x="-100" off_y="-125" text="ui_number_x"/>
    <source_model file="files/ui_number.xml"/>
    <input id="c026.Set" name="Set" type="event" off_x="-100" off_y="-100" microstep="0" nano-step="4"/>
    <input id="c026.NewVal" name="NewVal" off_x="-100" off_y="-80" type="range" min="0" max="65535" microstep="0" nano-step="3"/>
    <input id="c026.Visible" name="Visible" off_x="-100" off_y="-60" type="boolean" microstep="0" nano-step="1"/>
    <input id="c026.Sensitive" name="Sensitive" off_x="-100" off_y="-40" type="boolean" microstep="0" nano-step="0"/>
    <input id="c026.X" name="X" off_x="-100" off_y="-20" type="range" min="0" max="1023" microstep="0" nano-step="1"/>
    <input id="c026.Y" name="Y" off_x="-100" off_y="0" type="range" min="0" max="1023" microstep="0" nano-step="1"/>
    <input id="c026.Width" name="Width" off_x="-100" off_y="20" type="range" min="0" max="1023" microstep="0" nano-step="0"/>
    <input id="c026.Height" name="Height" off_x="-100" off_y="40" type="range" min="0" max="1023" microstep="0" nano-step="0"/>
    <input id="c026.PageNr" name="PageNr" off_x="-100" off_y="60" type="range" min="0" max="31" microstep="0" nano-step="0"/>
    <input id="c026.Min" name="Min" off_x="-100" off_y="80" type="range" min="0" max="65535" microstep="0" nano-step="0"/>
    <input id="c026.Max" name="Max" off_x="-100" off_y="100" type="range" min="0" max="65535" microstep="0" nano-step="0"/>
    <output id="c026.Changed" name="Changed" type="event" off_x="100" off_y="-100" microstep="0" nano-step="5"/>
    <output id="c026.Value" name="Value" off_x="100" off_y="-80" type="range" min="0" max="65535" microstep="0" nano-step="5"/>
    <comment text="X" off_x="0" off_y="20"/>
  </component>
  <arc id="a027" type="read" source="o001.K" target="c026.Visible" view="symbolic"/>
  <arc id="a029" type="read" source="X" target="c026.NewVal" view="symbolic"/>
  <operation id="o030" x="800" y="335" rot="0" shape="arrow" size="16">
    <name off_x="-11" off_y="-16" text="o030"/>
    <input off_x="-16" off_y="0" name="X" id="o030.X" type="range" min="-1" max="801" dynamic="all" frac="0"/>
    <output off_x="16" off_y="0" name="out" id="o030.out" type="event" min="0" max="1" dynamic="none" frac="0" microstep="0" nano-step="4">
      <expression>
        <operand type="signal" idRef="X"/>
        <operator type="diff"/>
        <operand type="signal" idRef="X" delay="1"/>
        <text>X &lt;&gt; X[-1]</text>
      </expression>
    </output>
  </operation>
  <arc id="a031" type="read" source="X" target="o030.X" view="symbolic"/>
  <arc id="a032" type="read" source="o022.K" target="c026.Y" view="symbolic"/>
  <operation id="o033" x="800" y="415" constant="600" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="600"/>
    <output off_x="20" off_y="0" name="K" id="o033.K" type="range" min="600" max="600" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>600</text>
        <operand type="literal" value="600"/>
      </expression>
    </output>
  </operation>
  <arc id="a034" type="read" source="o033.K" target="c026.X"/>
  <arc id="a035" type="read" source="o030.out" target="c026.Set"/>
  <component id="c036" class="ui/number.xml" x="1000" y="710" width="200" height="240" rot="0" implementation="iopt-flow" target="external">
    <name off_x="-100" off_y="-125" text="ui_number_y"/>
    <source_model file="files/ui_number.xml"/>
    <input id="c036.Set" name="Set" type="event" off_x="-100" off_y="-100" microstep="0" nano-step="4"/>
    <input id="c036.NewVal" name="NewVal" off_x="-100" off_y="-80" type="range" min="0" max="65535" microstep="0" nano-step="3"/>
    <input id="c036.Visible" name="Visible" off_x="-100" off_y="-60" type="boolean" microstep="0" nano-step="0"/>
    <input id="c036.Sensitive" name="Sensitive" off_x="-100" off_y="-40" type="boolean" microstep="0" nano-step="0"/>
    <input id="c036.X" name="X" off_x="-100" off_y="-20" type="range" min="0" max="1023" microstep="0" nano-step="1"/>
    <input id="c036.Y" name="Y" off_x="-100" off_y="0" type="range" min="0" max="1023" microstep="0" nano-step="0"/>
    <input id="c036.Width" name="Width" off_x="-100" off_y="20" type="range" min="0" max="1023" microstep="0" nano-step="0"/>
    <input id="c036.Height" name="Height" off_x="-100" off_y="40" type="range" min="0" max="1023" microstep="0" nano-step="0"/>
    <input id="c036.PageNr" name="PageNr" off_x="-100" off_y="60" type="range" min="0" max="31" microstep="0" nano-step="0"/>
    <input id="c036.Min" name="Min" off_x="-100" off_y="80" type="range" min="0" max="65535" microstep="0" nano-step="0"/>
    <input id="c036.Max" name="Max" off_x="-100" off_y="100" type="range" min="0" max="65535" microstep="0" nano-step="0"/>
    <output id="c036.Changed" name="Changed" type="event" off_x="100" off_y="-100" microstep="0" nano-step="5"/>
    <output id="c036.Value" name="Value" off_x="100" off_y="-80" type="range" min="0" max="65535" microstep="0" nano-step="5"/>
    <comment text="Y" off_x="0" off_y="20"/>
  </component>
  <operation id="o037" x="805" y="610" rot="0" shape="arrow" size="16">
    <name off_x="-11" off_y="-16" text="o030"/>
    <input off_x="-16" off_y="0" name="Y" id="o037.Y" type="range" min="-1" max="801" dynamic="all" frac="0"/>
    <output off_x="16" off_y="0" name="out" id="o037.out" type="event" min="0" max="1" dynamic="none" frac="0" microstep="0" nano-step="4">
      <expression>
        <operand type="signal" idRef="Y"/>
        <operator type="diff"/>
        <operand type="signal" idRef="Y" delay="1"/>
        <text>Y &lt;&gt; Y[-1]</text>
      </expression>
    </output>
  </operation>
  <operation id="o038" x="805" y="690" constant="700" rot="0" shape="rect" size="20" locked="true">
    <name off_x="-15" off_y="-5" text="700"/>
    <output off_x="20" off_y="0" name="K" id="o038.K" type="range" min="700" max="700" dynamic="none" microstep="0" nano-step="1">
      <expression>
        <text>700</text>
        <operand type="literal" value="700"/>
      </expression>
    </output>
  </operation>
  <arc id="a039" type="read" source="o038.K" target="c036.X"/>
  <arc id="a040" type="read" source="o037.out" target="c036.Set"/>
  <arc id="a041" type="read" source="Y" target="o037.Y" view="symbolic"/>
  <arc id="a042" type="read" source="Y" target="c036.NewVal" view="symbolic"/>
  <arc id="a044" type="read" source="o001.K" target="c036.Visible" view="symbolic"/>
  <arc id="a045" type="read" source="o022.K" target="c036.Y" view="symbolic"/>
  <component id="c003" class="rnd/rnd_gen.xml" x="1195" y="70" width="100" height="40" rot="0" implementation="iopt-flow" target="external">
    <name off_x="-50" off_y="-25" text="rnd_gen"/>
    <source_model file="files/rnd_gen.xml"/>
    <input id="c003.Gen" name="Gen" type="event" off_x="-50" off_y="0"/>
    <output id="c003.Rnd" name="Rnd" off_x="50" off_y="0" type="range" min="0" max="32767"/>
  </component>
  <arc id="a017" type="read" source="c013.Changed" target="c003.Gen"/>
</net>
