~sjdv1982/hivesystem/trunk

« back to all changes in this revision

Viewing changes to sparta/actuators/object_.py

  • Committer: Sjoerd de Vries
  • Date: 2014-06-09 10:19:38 UTC
  • mfrom: (182.1.43 hive-view)
  • Revision ID: sjdv1982@gmail.com-20140609101938-7ji5g0buo09r0se6
merged with hive-view branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import libcontext, bee
 
2
from bee.segments import *
 
3
from libcontext.socketclasses import *
 
4
from libcontext.pluginclasses import *
 
5
 
 
6
class object_(bee.worker):
 
7
    """
 
8
    The object actuator creates a new 3D object of "object class" at "location".  
 
9
    If a process class of the same name as "object class" has been registered, launch it. 
 
10
    Output contains the name of the last spawned object.
 
11
    """
 
12
        
 
13
    #Inputs and outputs
 
14
    trig = antenna("push", "trigger")
 
15
    class_ = antenna("pull", ("str", "identifier"))
 
16
    placement = antenna("pull", ("object", "matrix"))
 
17
    outp = output("pull", ("str", "identifier"))
 
18
    v_outp = variable(("str", "identifier"))
 
19
    connect(v_outp, outp)
 
20
   
 
21
    subprocess = variable("bool")
 
22
    parameter(subprocess, True)
 
23
   
 
24
    # Mark "object class" as an initially folded, and define the I/O names
 
25
    guiparams = {
 
26
      "trig" : {"name": "Trigger"},
 
27
      "class_" : {"name": "Object Class", "fold" : True},
 
28
      "placement" : {"name": "Object Placement"},
 
29
      "outp" : {"name": "Output"},
 
30
      "_memberorder" : ["trig", "class_", "placement", "outp"],
 
31
    }
 
32
    
 
33
    # Method to manipulate the parameter form as it appears in the GUI
 
34
    @staticmethod
 
35
    def form(f):
 
36
        f.subprocess.name = "Subprocess mode"
 
37
        f.subprocess.advanced = True
 
38
            
 
39
    # Finally, declare our sockets and plugins, to communicate with the rest of the hive
 
40
    def place(self):    
 
41
        raise NotImplementedError("sparta.sensors.object_ has not been implemented yet") 
 
42
        
 
43
      
 
44
     
 
 
b'\\ No newline at end of file'