Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some cleanup

  • Loading branch information...
commit b6165f199afb9a5b98e6a8016fc2c14461813312 1 parent 5750da9
Jörn Zaefferer authored
1  META-INF/MANIFEST.MF
View
@@ -5,7 +5,6 @@ Bundle-SymbolicName: JGlove2011;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: jGlove.JGlovePlugin
Bundle-Vendor: noDNA
-Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.forms
2  build.properties
View
@@ -4,12 +4,10 @@ bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/,\
- plugin.properties,\
product_lg.gif,\
splash.bmp,\
resource/,\
html/,\
- help_customization.ini,\
toc.xml,\
dom4j-1.6.1.jar
BIN  resource/persistent.dat
View
Binary file not shown
61 src/jGlove/sensor/Sensor.java
View
@@ -4,8 +4,6 @@
import jGlove.shared.Source;
/**
- * A concrete implementation of the abstract class Source.
- * <p>
* A Sensor object is bound to a channel from the GloveBox
* and provides methods to calibrate this channel.
*/
@@ -19,15 +17,8 @@
* The index cannot be changed after the object is created.
*/
private int index;
-
- /**
- * the upper calibration-value, default is 1024
- */
+
private int calibrationHigh = 1024;
-
- /**
- * the lower calibration-value, default is 0
- */
private int calibrationLow = 0;
/**
@@ -48,36 +39,16 @@
private double calibrationFactor = 1.0;
/**
- * Creates a new Sensor with only the index
- * @param index the index of this sensor, it cannot be changed later
- */
- public Sensor(int index) {
- this.index = index;
- }
-
- /**
- * Creates a new Sensor
- * @param index the index of this sensor, it cannot be changed later
- * @param value a starting rawvalue for this sensor
- * @param active wheather this sensor is active or not
- * @param name the name of this sensor
- * @param type the type of this sensor, one of ISource.TYPE_XXX constants
- */
- public Sensor(int index, int value, boolean active, String name, int type) {
- this(index);
- setValueRaw(value);
- setActive(active);
- setName(name);
- setType(type);
- }
-
- /**
* Creates a new Sensor
* @param index the index of this sensor, it cannot be changed later
* @param value a starting rawvalue for this sensor
*/
public Sensor(int index, int value) {
- this(index, value, false, Messages.Sensor_defaultname_prefix +index, 0);
+ this.index = index;
+ setValueRaw(value);
+ setActive(false);
+ setName(Messages.Sensor_defaultname_prefix +index);
+ setType(0);
}
/**
@@ -106,23 +77,14 @@ public void setValueRaw(int valueRaw) {
}
}
- /* (non-Javadoc)
- * @see jGlove.shared.ISource#getValue()
- */
public int getValue() {
return valueRaw;
}
- /* (non-Javadoc)
- * @see jGlove.shared.ISource#getValueScaled()
- */
public int getValueScaled() {
return valueScaled;
}
- /* (non-Javadoc)
- * @see jGlove.shared.ISource#getValueMidi()
- */
public int getValueMidi() {
int midiValue = valueScaled / 2;
midiValue = Math.min(127, midiValue);
@@ -130,18 +92,10 @@ public int getValueMidi() {
return midiValue;
}
- /**
- * Returns the upper calibration value of this sensor
- * @return the upper calibration value
- */
public int getCalibrationHigh() {
return calibrationHigh;
}
- /**
- * Returns the lower calibration value of this sensor
- * @return the lower calibration value
- */
public int getCalibrationLow() {
return calibrationLow;
}
@@ -175,9 +129,6 @@ public int getIndex() {
return index;
}
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
public String toString() {
return "i: "+index+", valueMidi: "+ getValueMidi() +", valueRaw: "+valueRaw+", valueScaled: "+valueScaled; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
Please sign in to comment.
Something went wrong with that request. Please try again.