<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.9.0"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
                 xmlns:harp="clr-namespace:Bonsai.Harp;assembly=Bonsai.Harp"
                 xmlns:p1="clr-namespace:Harp.Behavior;assembly=Harp.Behavior"
                 xmlns:ui="clr-namespace:Bonsai.Design;assembly=Bonsai.Design"
                 xmlns="https://bonsai-rx.org/2018/workflow">
  <Workflow>
    <Nodes>
      <Expression xsi:type="Annotation">
        <Name>Harp Device Pattern</Name>
        <Text><![CDATA[]]></Text>
      </Expression>
      <Expression xsi:type="rx:BehaviorSubject" TypeArguments="harp:HarpMessage">
        <rx:Name>Behavior Commands</rx:Name>
      </Expression>
      <Expression xsi:type="Combinator">
        <Combinator xsi:type="p1:Device">
          <harp:OperationMode>Active</harp:OperationMode>
          <harp:OperationLed>On</harp:OperationLed>
          <harp:DumpRegisters>true</harp:DumpRegisters>
          <harp:VisualIndicators>On</harp:VisualIndicators>
          <harp:Heartbeat>Disabled</harp:Heartbeat>
          <harp:IgnoreErrors>false</harp:IgnoreErrors>
          <harp:PortName>COM8</harp:PortName>
        </Combinator>
      </Expression>
      <Expression xsi:type="Combinator">
        <Combinator xsi:type="p1:DeviceDataWriter">
          <p1:Path>Behavior.harp</p1:Path>
          <p1:Buffered>true</p1:Buffered>
          <p1:Overwrite>false</p1:Overwrite>
          <p1:FilterType>Include</p1:FilterType>
          <p1:MessageType xsi:nil="true" />
        </Combinator>
      </Expression>
      <Expression xsi:type="rx:PublishSubject">
        <Name>Behavior Events</Name>
      </Expression>
      <Expression xsi:type="Annotation">
        <Name>Visualize Analog Data</Name>
        <Text><![CDATA[]]></Text>
      </Expression>
      <Expression xsi:type="SubscribeSubject">
        <Name>Behavior Events</Name>
      </Expression>
      <Expression xsi:type="Combinator">
        <Combinator xsi:type="harp:FilterMessageType">
          <harp:FilterType>Include</harp:FilterType>
          <harp:MessageType>Event</harp:MessageType>
        </Combinator>
      </Expression>
      <Expression xsi:type="p1:Parse">
        <harp:Register xsi:type="p1:TimestampedAnalogData" />
      </Expression>
      <Expression xsi:type="ui:VisualizerWindow">
        <ui:Visible>true</ui:Visible>
        <ui:Location>
          <ui:X>400</ui:X>
          <ui:Y>100</ui:Y>
        </ui:Location>
        <ui:Size>
          <ui:Width>300</ui:Width>
          <ui:Height>300</ui:Height>
        </ui:Size>
        <ui:WindowState xsi:nil="true" />
      </Expression>
    </Nodes>
    <Edges>
      <Edge From="1" To="2" Label="Source1" />
      <Edge From="2" To="3" Label="Source1" />
      <Edge From="3" To="4" Label="Source1" />
      <Edge From="6" To="7" Label="Source1" />
      <Edge From="7" To="8" Label="Source1" />
      <Edge From="8" To="9" Label="Source1" />
    </Edges>
  </Workflow>
</WorkflowBuilder>
