BowlerKernel
AnalogPrismaticLink.java
Go to the documentation of this file.
1 package com.neuronrobotics.sdk.addons.kinematics;
2 
3 import com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel;
4 import com.neuronrobotics.sdk.dyio.peripherals.IAnalogInputListener;
5 
6 
7 // TODO: Auto-generated Javadoc
12 
15 
23  super(conf);
24 
26  }
27 
28  /* (non-Javadoc)
29  * @see com.neuronrobotics.sdk.addons.kinematics.AbstractLink#cacheTargetValueDevice()
30  */
31  @Override
32  public void cacheTargetValueDevice() {
33  //ignore, input only
34  }
35 
36  /* (non-Javadoc)
37  * @see com.neuronrobotics.sdk.addons.kinematics.AbstractLink#flush(double)
38  */
39  @Override
40  public void flushDevice(double time) {
41  //ignore, input only
42  }
43 
44  /* (non-Javadoc)
45  * @see com.neuronrobotics.sdk.addons.kinematics.AbstractLink#flushAll(double)
46  */
47  @Override
48  public void flushAllDevice(double time) {
49  //ignore, input only
50  }
51 
52  /* (non-Javadoc)
53  * @see com.neuronrobotics.sdk.addons.kinematics.AbstractLink#getCurrentPosition()
54  */
55  @Override
56  public double getCurrentPosition() {
57  int val=getChannel().getValue();
58  fireLinkListener(val);
59  return val;
60  }
61 
70  //new RuntimeException().printStackTrace();
71  this.channel = channel;
72  }
73 
80  return channel;
81  }
82 
83  /* (non-Javadoc)
84  * @see com.neuronrobotics.sdk.dyio.peripherals.IAnalogInputListener#onAnalogValueChange(com.neuronrobotics.sdk.dyio.peripherals.AnalogInputChannel, double)
85  */
86  @Override
87  public void onAnalogValueChange(AnalogInputChannel chan, double value) {
88  if(chan == getChannel() ) {
89  fireLinkListener((int) value);
90  }
91  }
92 
93 }