]> rtime.felk.cvut.cz Git - orte.git/blob - orte/Robot_Demo/src/org/ocera/orte/demo/SpeedMotionType.java
Check whether windows dll is produced
[orte.git] / orte / Robot_Demo / src / org / ocera / orte / demo / SpeedMotionType.java
1 package org.ocera.orte.demo;
2
3 import org.ocera.orte.*;
4 import org.ocera.orte.types.*;
5
6
7 public class SpeedMotionType extends MessageData
8 {
9    public  short[]      speed = new short[2];
10    
11   public SpeedMotionType(DomainApp domainApp, String newTopic) {
12     super();
13     this.setTopic(newTopic);
14     if (!domainApp.regNewDataType("motion_speed",getMaxDataLength())) {
15       System.out.println(":j!: cannot register data type \"motion_speed\"!");    
16     }
17   }
18       
19   @Override
20   public void write()
21   {
22         buffer.rewind();
23         buffer.putShort(this.speed[0]);
24         buffer.putShort(this.speed[1]);         
25   }
26  
27   @Override
28   public void read() {
29           buffer.rewind();
30           this.speed[0] = buffer.getShort();
31           this.speed[1] = buffer.getShort();
32   }
33
34   @Override
35   public int getMaxDataLength()
36   {
37     return 2 * ORTEConstant.SHORT_FIELD_SIZE;
38   }
39 }