Skip to content

Commit

Permalink
Added processing file list example.
Browse files Browse the repository at this point in the history
  • Loading branch information
hugo.marques committed Jun 2, 2024
1 parent 7c29497 commit 8cd2579
Show file tree
Hide file tree
Showing 2 changed files with 239 additions and 120 deletions.
125 changes: 73 additions & 52 deletions workflows/examples.starter/IO/ProcessFileList.bonsai
Original file line number Diff line number Diff line change
@@ -1,53 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.8.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:io="clr-namespace:Bonsai.IO;assembly=Bonsai.System"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="Combinator">
<Combinator xsi:type="io:GetFiles">
<io:Path>.</io:Path>
<io:SearchPattern>*.txt</io:SearchPattern>
<io:SearchOption>TopDirectoryOnly</io:SearchOption>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Concat" />
</Expression>
<Expression xsi:type="rx:SelectMany">
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="io:GetFileNameWithoutExtension" />
</Expression>
<Expression xsi:type="Add">
<Operand xsi:type="StringProperty">
<Value>_new</Value>
</Operand>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
</Edges>
</Workflow>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="IntProperty">
<Value>0</Value>
</Combinator>
</Expression>
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
</Edges>
</Workflow>
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.8.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:io="clr-namespace:Bonsai.IO;assembly=Bonsai.System"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="Annotation">
<Name>1</Name>
<Text><![CDATA[]]></Text>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="io:GetFiles">
<io:Path>.</io:Path>
<io:SearchPattern>*.txt</io:SearchPattern>
<io:SearchOption>TopDirectoryOnly</io:SearchOption>
</Combinator>
</Expression>
<Expression xsi:type="Annotation">
<Name>2</Name>
<Text><![CDATA[]]></Text>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Concat" />
</Expression>
<Expression xsi:type="Annotation">
<Name>3</Name>
<Text><![CDATA[]]></Text>
</Expression>
<Expression xsi:type="rx:SelectMany">
<Name>Modify Filename</Name>
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="io:GetFileNameWithoutExtension" />
</Expression>
<Expression xsi:type="Add">
<Operand xsi:type="StringProperty">
<Value>_new</Value>
</Operand>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
</Edges>
</Workflow>
</Expression>
<Expression xsi:type="Annotation">
<Name>4</Name>
<Text><![CDATA[]]></Text>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="IntProperty">
<Value>0</Value>
</Combinator>
</Expression>
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="3" Label="Source1" />
<Edge From="2" To="3" Label="Source2" />
<Edge From="3" To="5" Label="Source1" />
<Edge From="4" To="5" Label="Source2" />
<Edge From="6" To="7" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
234 changes: 166 additions & 68 deletions workflows/examples.starter/IO/ProcessFileList.bonsai.layout
Original file line number Diff line number Diff line change
@@ -1,69 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<VisualizerLayout xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings xsi:type="WorkflowEditorSettings">
<Visible>true</Visible>
<Location>
<X>149</X>
<Y>299</Y>
</Location>
<Size>
<Width>332</Width>
<Height>244</Height>
</Size>
<WindowState>Normal</WindowState>
<VisualizerTypeName>Bonsai.Design.ObjectTextVisualizer</VisualizerTypeName>
<VisualizerSettings>
<ObjectTextVisualizer />
</VisualizerSettings>
<EditorDialogSettings>
<Visible>false</Visible>
<Location>
<X>283</X>
<Y>404</Y>
</Location>
<Size>
<Width>480</Width>
<Height>356</Height>
</Size>
<WindowState>Normal</WindowState>
</EditorDialogSettings>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<?xml version="1.0" encoding="utf-8"?>
<VisualizerLayout xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings xsi:type="WorkflowEditorSettings">
<Visible>true</Visible>
<Location>
<X>149</X>
<Y>299</Y>
</Location>
<Size>
<Width>334</Width>
<Height>244</Height>
</Size>
<WindowState>Normal</WindowState>
<VisualizerTypeName>Bonsai.Design.ObjectTextVisualizer</VisualizerTypeName>
<VisualizerSettings>
<ObjectTextVisualizer />
</VisualizerSettings>
<EditorDialogSettings>
<Visible>true</Visible>
<Location>
<X>334</X>
<Y>535</Y>
</Location>
<Size>
<Width>480</Width>
<Height>356</Height>
</Size>
<WindowState>Normal</WindowState>
</EditorDialogSettings>
<EditorVisualizerLayout>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
</EditorVisualizerLayout>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
<DialogSettings>
<Visible>false</Visible>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<WindowState>Normal</WindowState>
</DialogSettings>
</VisualizerLayout>

0 comments on commit 8cd2579

Please sign in to comment.