Commit e88665eb authored by Jussi Lindgren's avatar Jussi Lindgren

contrib: Added Hello World tutorial for the Python box

parent 20debf8f
<OpenViBE-Scenario>
<Boxes>
<Box>
<Identifier>(0x00003954, 0x000010bb)</Identifier>
<Name>Hello World!</Name>
<AlgorithmClassIdentifier>(0x5dc4f669, 0xd3fd4d64)</AlgorithmClassIdentifier>
<Settings>
<Setting>
<TypeIdentifier>(0x007deef9, 0x2f3e95c6)</TypeIdentifier>
<Name>Clock frequency (Hz)</Name>
<DefaultValue>60</DefaultValue>
<Value>1</Value>
</Setting>
<Setting>
<TypeIdentifier>(0xb0d0db45, 0x49cbc34a)</TypeIdentifier>
<Name>Script</Name>
<DefaultValue></DefaultValue>
<Value>${__volatile_ScenarioDir}/scripts/python-hello-world.py</Value>
</Setting>
<Setting>
<TypeIdentifier>(0x79a9edeb, 0x245d83fc)</TypeIdentifier>
<Name>Message</Name>
<DefaultValue>Hello World!</DefaultValue>
<Value>Hello World!</Value>
</Setting>
</Settings>
<Attributes>
<Attribute>
<Identifier>(0x17ee7c08, 0x94c14893)</Identifier>
<Value></Value>
</Attribute>
<Attribute>
<Identifier>(0x1fa7a38f, 0x54edbe0b)</Identifier>
<Value>304</Value>
</Attribute>
<Attribute>
<Identifier>(0x1fa963f5, 0x1a638cd4)</Identifier>
<Value>51</Value>
</Attribute>
<Attribute>
<Identifier>(0x207c9054, 0x3c841b63)</Identifier>
<Value>176</Value>
</Attribute>
<Attribute>
<Identifier>(0x30a4e5c9, 0x83502953)</Identifier>
<Value></Value>
</Attribute>
<Attribute>
<Identifier>(0x4e7b798a, 0x183beafb)</Identifier>
<Value>(0x5c654f10, 0xb451e467)</Value>
</Attribute>
<Attribute>
<Identifier>(0x527ad68d, 0x16d746a0)</Identifier>
<Value></Value>
</Attribute>
<Attribute>
<Identifier>(0x61d11811, 0x71e65362)</Identifier>
<Value></Value>
</Attribute>
<Attribute>
<Identifier>(0xad100179, 0xa3c984ab)</Identifier>
<Value>101</Value>
</Attribute>
<Attribute>
<Identifier>(0xc67a01dc, 0x28ce06c1)</Identifier>
<Value></Value>
</Attribute>
<Attribute>
<Identifier>(0xce18836a, 0x9c0eb403)</Identifier>
<Value>2</Value>
</Attribute>
<Attribute>
<Identifier>(0xf191c1c8, 0xa0123976)</Identifier>
<Value></Value>
</Attribute>
<Attribute>
<Identifier>(0xfba64161, 0x65304e21)</Identifier>
<Value></Value>
</Attribute>
</Attributes>
</Box>
</Boxes>
<Links></Links>
<MessageLinks></MessageLinks>
<Comments>
<Comment>
<Identifier>(0x000047c8, 0x000050cf)</Identifier>
<Text>&lt;b&gt;Hello World!&lt;/b&gt;
Prints a friendly message.
You can customize the message by editing
the box configuration.
</Text>
<Attributes>
<Attribute>
<Identifier>(0x473d9a43, 0x97fc0a97)</Identifier>
<Value>-80</Value>
</Attribute>
<Attribute>
<Identifier>(0x7234b86b, 0x2b8651a5)</Identifier>
<Value>304</Value>
</Attribute>
</Attributes>
</Comment>
</Comments>
<VisualisationTree>
<VisualisationWidget>
<Identifier>(0x00003962, 0x00000a21)</Identifier>
<Name>Default window</Name>
<Type>1</Type>
<ParentIdentifier>(0xffffffff, 0xffffffff)</ParentIdentifier>
<BoxIdentifier>(0xffffffff, 0xffffffff)</BoxIdentifier>
<NumChildren>1</NumChildren>
<Attributes>
<Attribute>
<Identifier>(0x4c90d4ad, 0x7a2554ec)</Identifier>
<Value>507</Value>
</Attribute>
<Attribute>
<Identifier>(0x7b814cca, 0x271df6dd)</Identifier>
<Value>798</Value>
</Attribute>
</Attributes>
</VisualisationWidget>
<VisualisationWidget>
<Identifier>(0x0000781e, 0x00004e65)</Identifier>
<Name>Default tab</Name>
<Type>2</Type>
<ParentIdentifier>(0x00003962, 0x00000a21)</ParentIdentifier>
<Index>0</Index>
<BoxIdentifier>(0xffffffff, 0xffffffff)</BoxIdentifier>
<NumChildren>1</NumChildren>
</VisualisationWidget>
<VisualisationWidget>
<Identifier>(0x00006808, 0x00000e28)</Identifier>
<Name>Empty</Name>
<Type>0</Type>
<ParentIdentifier>(0x0000781e, 0x00004e65)</ParentIdentifier>
<Index>0</Index>
<BoxIdentifier>(0xffffffff, 0xffffffff)</BoxIdentifier>
<NumChildren>0</NumChildren>
</VisualisationWidget>
</VisualisationTree>
</OpenViBE-Scenario>
\ No newline at end of file
class MyOVBox(OVBox):
def __init__(self):
OVBox.__init__(self)
def initialize(self):
# nop
return
def process(self):
# print the string specified in the box configuration.
# 'Message' is the name of the config entry.
print(self.setting['Message'])
def uninitialize(self):
# nop
return
box = MyOVBox()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment