﻿<?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:obis="clr-namespace:BFC.ObisLaser;assembly=BFC.ObisLaser" xmlns="https://bonsai-rx.org/2018/workflow">
  <Description>Controls laser 1 behind an OBIS controller from a panel: open the visualizer of ObisLaserVisualizer while the workflow runs. Requires the BFC.ObisLaser.Design package. Set PortName on Device.</Description>
  <Workflow>
    <Nodes>
      <Expression xsi:type="rx:PublishSubject" TypeArguments="obis:ObisCommand">
        <rx:Name>LaserCommands</rx:Name>
      </Expression>
      <Expression xsi:type="SubscribeSubject">
        <Name>LaserCommands</Name>
      </Expression>
      <Expression xsi:type="Combinator">
        <Combinator xsi:type="obis:Device">
          <obis:PortName>COM3</obis:PortName>
          <obis:Timeout>PT1S</obis:Timeout>
        </Combinator>
      </Expression>
      <Expression xsi:type="rx:PublishSubject">
        <Name>LaserReplies</Name>
      </Expression>
      <Expression xsi:type="SubscribeSubject">
        <Name>LaserReplies</Name>
      </Expression>
      <Expression xsi:type="Combinator">
        <Combinator xsi:type="obis:ObisLaserVisualizer">
          <obis:Channel>1</obis:Channel>
          <obis:PollState>false</obis:PollState>
          <obis:PollInterval>PT1S</obis:PollInterval>
        </Combinator>
      </Expression>
      <Expression xsi:type="MulticastSubject">
        <Name>LaserCommands</Name>
      </Expression>
    </Nodes>
    <Edges>
      <Edge From="1" To="2" Label="Source1" />
      <Edge From="2" To="3" Label="Source1" />
      <Edge From="4" To="5" Label="Source1" />
      <Edge From="5" To="6" Label="Source1" />
    </Edges>
  </Workflow>
</WorkflowBuilder>