[chronojump] Implementing encoder images
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Implementing encoder images
- Date: Wed, 22 Jan 2014 21:00:08 +0000 (UTC)
commit 9e7d72a8e3776e2e2e187aa1313656705dd3a9a8
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed Jan 22 21:59:21 2014 +0100
Implementing encoder images
images/svg/encoder-mode-icons.svg | 26 +++++++---
src/Makefile.am | 14 +++++-
src/constants.cs | 42 +++++++++++++----
src/encoder.cs | 94 +++++++++++++++++++++++++++++++++++-
src/gui/encoder.cs | 48 ++++++++++---------
src/sqlite/main.cs | 6 +-
src/utilEncoder.cs | 2 +-
7 files changed, 185 insertions(+), 47 deletions(-)
---
diff --git a/images/svg/encoder-mode-icons.svg b/images/svg/encoder-mode-icons.svg
index 2dc6738..748e95a 100644
--- a/images/svg/encoder-mode-icons.svg
+++ b/images/svg/encoder-mode-icons.svg
@@ -31,9 +31,9 @@
inkscape:window-height="711"
id="namedview5689"
showgrid="false"
- inkscape:zoom="0.14012593"
- inkscape:cx="602.18491"
- inkscape:cy="6589.5796"
+ inkscape:zoom="0.17303085"
+ inkscape:cx="9513.9765"
+ inkscape:cy="1777.3612"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
@@ -8676,7 +8676,7 @@
<dc:title>Openclipart</dc:title>
</cc:Agent>
</dc:publisher>
- <dc:title></dc:title>
+ <dc:title />
<dc:date>2013-08-08T13:03:15</dc:date>
<dc:description>Simple database or storage symbol. Font is "League Gothic". Drawn on
Inkscape</dc:description>
<dc:source>http://openclipart.org/detail/181674/database-symbol-by-eternaltyro-181674</dc:source>
@@ -12903,14 +12903,22 @@
sodipodi:role="line"
x="7002.1357"
y="4986.3325"
- id="tspan15669-8">demult = 2</tspan><tspan
+ id="tspan5082">WEIGHTEDMOVPULLEYLINEARONPERSON1INV</tspan><tspan
sodipodi:role="line"
x="7002.1357"
y="5108.0825"
- id="tspan15867">massPulley = mass / demult</tspan><tspan
+ id="tspan5086">x *=-1 //on inverted</tspan><tspan
sodipodi:role="line"
x="7002.1357"
y="5229.8325"
+ id="tspan15669-8">demult = 2</tspan><tspan
+ sodipodi:role="line"
+ x="7002.1357"
+ y="5351.5825"
+ id="tspan15867">massPulley = mass / demult</tspan><tspan
+ sodipodi:role="line"
+ x="7002.1357"
+ y="5473.333"
id="tspan15869">P = (massPulley*a + massSubj? *(a+g))*v</tspan></text>
<text
xml:space="preserve"
@@ -12930,10 +12938,14 @@
sodipodi:role="line"
x="9512.0303"
y="5050.917"
- id="tspan15669-8-5">(same as</tspan><tspan
+ id="tspan5084">WEIGHTEDMOVPULLEYLINEARONPERSON2INV</tspan><tspan
sodipodi:role="line"
x="9512.0303"
y="5172.667"
+ id="tspan15669-8-5">(same as</tspan><tspan
+ sodipodi:role="line"
+ x="9512.0303"
+ y="5294.417"
id="tspan15871">WEIGHTEDMOVPULLEYLINEARONPERSON1)</tspan></text>
<text
xml:space="preserve"
diff --git a/src/Makefile.am b/src/Makefile.am
index ea85a82..6d819fc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -263,7 +263,19 @@ RESOURCES = \
../images/encoder-rotary-friction.png,encoder-rotary-friction.png \
../images/encoder-rotary-axis.png,encoder-rotary-axis.png \
../images/encoder-linear-free-weight.png,encoder-linear-free-weight.png \
- ../images/encoder-linear-free-weight-inv.png,encoder-linear-free-weight-inv.png
+ ../images/encoder-linear-free-weight-inv.png,encoder-linear-free-weight-inv.png \
+ ../images/encoder-linear-inertial.png,encoder-linear-inertial.png \
+
../images/encoder-linear-or-inv-on-person-weighted-moving-pulley1.png,encoder-linear-or-inv-on-person-weighted-moving-pulley1.png
\
+
../images/encoder-linear-or-inv-on-person-weighted-moving-pulley2.png,encoder-linear-or-inv-on-person-weighted-moving-pulley2.png
\
+
../images/encoder-linear-or-inv-on-weighted-moving-pulley.png,encoder-linear-or-inv-on-weighted-moving-pulley.png
\
+ ../images/encoder-linear-inclined-plane.png,encoder-linear-inclined-plane.png \
+ ../images/encoder-rotary-friction-pulley.png,encoder-rotary-friction-pulley.png \
+ ../images/encoder-rotary-friction-pulley-axis.png,encoder-rotary-friction-pulley-axis.png \
+ ../images/encoder-friction-inertial.png,encoder-friction-inertial.png \
+
../images/encoder-rotary-friction-on-fixed-pulley-with-weighted-moving-pulley.png,encoder-rotary-friction-on-fixed-pulley-with-weighted-moving-pulley.png
\
+ ../images/encoder-rotary-axis-pulley-axis.png,encoder-rotary-axis-pulley-axis.png \
+ ../images/encoder-axis-inertial.png,encoder-axis-inertial.png \
+
../images/encoder-rotary-axis-on-fixed-pulley-with-weighted-moving-pulley.png,encoder-rotary-axis-on-fixed-pulley-with-weighted-moving-pulley.png
IMAGES = $(top_srcdir)/images/chronojump-logo-2013.png \
$(top_srcdir)/images/chronojump-logo-2013_320.png \
diff --git a/src/constants.cs b/src/constants.cs
index bc6c0f3..7411833 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -609,18 +609,42 @@ public class Constants
public static string ConcentricEccentric = "Concentric-eccentric";
public enum EncoderCheckFileOp { ANALYZE_EXPORT_ALL_CURVES, ANALYZE_SAVE_IMAGE, ANALYZE_SAVE_TABLE}
+
+
+ //three encoder types
+ public static string FileNameEncoderTypeLinear = "encoder-linear.png";
+ public static string FileNameEncoderTypeRotaryFriction = "encoder-rotary-friction.png";
+ public static string FileNameEncoderTypeRotaryAxis = "encoder-rotary-axis.png";
- public static string FileNameEncoderLinear = "encoder-linear.png";
- public static string FileNameEncoderRotaryFriction = "encoder-rotary-friction.png";
- public static string FileNameEncoderRotaryAxis = "encoder-rotary-axis.png";
-
+ //encoder configurations
+ //linear
public static string FileNameEncoderLinearFreeWeight = "encoder-linear-free-weight.png";
public static string FileNameEncoderLinearFreeWeightInv = "encoder-linear-free-weight-inv.png";
-
-
- public enum EncoderSignalMode { //this names are used on graph.R change there also if needed
- LINEAR, LINEARINVERTED, ROTARYFRICTION, ROTARYAXIS,
- LINEARINERTIAL, LINEARINVERTEDINERTIAL, ROTARYINERTIAL
+ public static string FileNameEncoderLinearInertial = "encoder-linear-inertial.png";
+ public static string FileNameEncoderWeightedMovPulleyOnPerson1 =
"encoder-linear-or-inv-on-person-weighted-moving-pulley1.png";
+ public static string FileNameEncoderWeightedMovPulleyOnPerson2 =
"encoder-linear-or-inv-on-person-weighted-moving-pulley2.png";
+ public static string FileNameEncoderWeightedMovPulleyOnLinearEncoder =
"encoder-linear-or-inv-on-weighted-moving-pulley.png";
+ public static string FileNameEncoderLinearOnPlane = "encoder-linear-inclined-plane.png";
+
+ //rotary friction
+ public static string FileNameEncoderFrictionSide = "encoder-rotary-friction-pulley.png";
+ public static string FileNameEncoderFrictionAxis = "encoder-rotary-friction-pulley-axis.png";
+ public static string FileNameEncoderFrictionInertial = "encoder-friction-inertial.png";
+ public static string FileNameEncoderFrictionWithMovPulley =
"encoder-rotary-friction-on-fixed-pulley-with-weighted-moving-pulley.png";
+
+ //rotary axis
+ public static string FileNameEncoderRotaryAxisOnAxis = "encoder-rotary-axis-pulley-axis.png";
+ public static string FileNameEncoderAxisInertial = "encoder-axis-inertial.png";
+ public static string FileNameEncoderAxisWithMovPulley =
"encoder-rotary-axis-on-fixed-pulley-with-weighted-moving-pulley.png";
+
+ public enum EncoderMode { //this names are used on graph.R change there also if needed
+ LINEAR, LINEARINVERTED, LINEARINERTIAL,
+ WEIGHTEDMOVPULLEYLINEARONPERSON1, WEIGHTEDMOVPULLEYLINEARONPERSON1INV,
+ WEIGHTEDMOVPULLEYLINEARONPERSON2, WEIGHTEDMOVPULLEYLINEARONPERSON2INV,
+ WEIGHTEDMOVPULLEYONLINEARENCODER, LINEARONPLANE,
+ ROTARYFRICTIONSIDE, ROTARYFRICTIONAXIS, //friction
+ ROTARYFRICTIONINERTIAL, WEIGHTEDMOVPULLEYROTARYFRICTION, //friction
+ ROTARYAXIS, ROTARYAXISINERTIAL, WEIGHTEDMOVPULLEYROTARYAXIS //axis
}
public enum Encoder1RMMethod { NONWEIGHTED, WEIGHTED, WEIGHTED2, WEIGHTED3 }
diff --git a/src/encoder.cs b/src/encoder.cs
index 0d3fd85..c6f6c97 100644
--- a/src/encoder.cs
+++ b/src/encoder.cs
@@ -598,19 +598,107 @@ public class EncoderModeList
public EncoderModeList(string type)
{
list = new ArrayList();
+ EncoderMode enc = new EncoderMode();
+
if(type == "linear") {
- EncoderMode enc = new EncoderMode();
enc = new EncoderMode(
- Constants.EncoderSignalMode.LINEAR.ToString(),
+ Constants.EncoderMode.LINEAR.ToString(),
Constants.FileNameEncoderLinearFreeWeight,
"Text for normal linear encoder");
list.Add(enc);
enc = new EncoderMode(
- Constants.EncoderSignalMode.LINEARINVERTED.ToString(),
+ Constants.EncoderMode.LINEARINVERTED.ToString(),
Constants.FileNameEncoderLinearFreeWeightInv,
"Text for inverted linear encoder");
list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.LINEARINERTIAL.ToString(),
+ Constants.FileNameEncoderLinearInertial,
+ "Linear encoder on inertial machine. NOT Recommended!");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.WEIGHTEDMOVPULLEYLINEARONPERSON1.ToString(),
+ Constants.FileNameEncoderWeightedMovPulleyOnPerson1,
+ "");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.WEIGHTEDMOVPULLEYLINEARONPERSON1INV.ToString(),
+ Constants.FileNameEncoderWeightedMovPulleyOnPerson1,
+ "Inverted");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.WEIGHTEDMOVPULLEYLINEARONPERSON2.ToString(),
+ Constants.FileNameEncoderWeightedMovPulleyOnPerson2,
+ "");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.WEIGHTEDMOVPULLEYLINEARONPERSON2INV.ToString(),
+ Constants.FileNameEncoderWeightedMovPulleyOnPerson2,
+ "Inverted");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.WEIGHTEDMOVPULLEYONLINEARENCODER.ToString(),
+ Constants.FileNameEncoderWeightedMovPulleyOnLinearEncoder,
+ "");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.LINEARONPLANE.ToString(),
+ Constants.FileNameEncoderLinearOnPlane,
+ "");
+ list.Add(enc);
+ }
+ else if(type == "rotary-friction") {
+ enc = new EncoderMode(
+ Constants.EncoderMode.ROTARYFRICTIONSIDE.ToString(),
+ Constants.FileNameEncoderFrictionSide,
+ "");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.ROTARYFRICTIONAXIS.ToString(),
+ Constants.FileNameEncoderFrictionAxis ,
+ "");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.ROTARYFRICTIONINERTIAL.ToString(),
+ Constants.FileNameEncoderFrictionInertial ,
+ "");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.WEIGHTEDMOVPULLEYROTARYFRICTION.ToString(),
+ Constants.FileNameEncoderFrictionWithMovPulley ,
+ "");
+ list.Add(enc);
+
+ }
+ else { // rotary-axis
+ enc = new EncoderMode(
+ Constants.EncoderMode.ROTARYAXIS.ToString(),
+ Constants.FileNameEncoderRotaryAxisOnAxis ,
+ "");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.ROTARYAXISINERTIAL.ToString(),
+ Constants.FileNameEncoderAxisInertial ,
+ "");
+ list.Add(enc);
+
+ enc = new EncoderMode(
+ Constants.EncoderMode.WEIGHTEDMOVPULLEYROTARYAXIS.ToString(),
+ Constants.FileNameEncoderAxisWithMovPulley ,
+ "");
+ list.Add(enc);
}
}
}
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 9e3f438..19574be 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -581,25 +581,25 @@ public partial class ChronoJumpWindow
ArrayList data = new ArrayList(3);
if(radiobutton_encoder_capture_linear.Active) {
if(checkbutton_encoder_capture_inverted.Active) {
- if(checkbutton_encoder_capture_inertial.Active)
-
data.Add(Constants.EncoderSignalMode.LINEARINVERTEDINERTIAL.ToString());
- else
- data.Add(Constants.EncoderSignalMode.LINEARINVERTED.ToString());
+ //if(checkbutton_encoder_capture_inertial.Active)
+ //data.Add(Constants.EncoderMode.LINEARINVERTEDINERTIAL.ToString());
+ //else
+ data.Add(Constants.EncoderMode.LINEARINVERTED.ToString());
} else {
if(checkbutton_encoder_capture_inertial.Active)
- data.Add(Constants.EncoderSignalMode.LINEARINERTIAL.ToString());
+ data.Add(Constants.EncoderMode.LINEARINERTIAL.ToString());
else
- data.Add(Constants.EncoderSignalMode.LINEAR.ToString());
+ data.Add(Constants.EncoderMode.LINEAR.ToString());
}
}
else { //(radiobutton_encoder_capture_rotary.Active)
if(checkbutton_encoder_capture_inertial.Active)
- data.Add(Constants.EncoderSignalMode.ROTARYINERTIAL.ToString());
+ data.Add(Constants.EncoderMode.ROTARYFRICTIONINERTIAL.ToString());
else {
if(radiobutton_encoder_capture_rotary_friction.Active)
- data.Add(Constants.EncoderSignalMode.ROTARYFRICTION.ToString());
+ data.Add(Constants.EncoderMode.ROTARYFRICTIONSIDE.ToString());
else
- data.Add(Constants.EncoderSignalMode.ROTARYAXIS.ToString());
+ data.Add(Constants.EncoderMode.ROTARYAXIS.ToString());
}
}
@@ -618,9 +618,10 @@ public partial class ChronoJumpWindow
private void setEncoderCombos(EncoderSQL eSQL) {
//TODO diferentiate both rotary encoders
if (
- eSQL.encoderMode == Constants.EncoderSignalMode.LINEARINERTIAL.ToString() ||
- eSQL.encoderMode ==
Constants.EncoderSignalMode.LINEARINVERTEDINERTIAL.ToString() ||
- eSQL.encoderMode == Constants.EncoderSignalMode.ROTARYINERTIAL.ToString()
+ eSQL.encoderMode == Constants.EncoderMode.LINEARINERTIAL.ToString() ||
+ //eSQL.encoderMode == Constants.EncoderMode.LINEARINVERTEDINERTIAL.ToString()
||
+ eSQL.encoderMode == Constants.EncoderMode.ROTARYFRICTIONINERTIAL.ToString() ||
+ eSQL.encoderMode == Constants.EncoderMode.ROTARYAXISINERTIAL.ToString()
) {
//inertial machines
checkbutton_encoder_capture_inertial.Active = true;
@@ -631,21 +632,21 @@ public partial class ChronoJumpWindow
checkbutton_encoder_capture_inertial.Active = false;
- if(eSQL.encoderMode == Constants.EncoderSignalMode.LINEARINVERTED.ToString()) {
+ if(eSQL.encoderMode == Constants.EncoderMode.LINEARINVERTED.ToString()) {
radiobutton_encoder_capture_linear.Active = true;
checkbutton_encoder_capture_inverted.Active = true;
} else if(
- eSQL.encoderMode == Constants.EncoderSignalMode.ROTARYFRICTION.ToString() ||
- eSQL.encoderMode == Constants.EncoderSignalMode.ROTARYAXIS.ToString() ) {
+ eSQL.encoderMode == Constants.EncoderMode.ROTARYFRICTIONSIDE.ToString() ||
+ eSQL.encoderMode == Constants.EncoderMode.ROTARYAXIS.ToString() ) {
radiobutton_encoder_capture_rotary.Active = true;
checkbutton_encoder_capture_inverted.Active = false;
- if(eSQL.encoderMode == Constants.EncoderSignalMode.ROTARYFRICTION.ToString())
+ if(eSQL.encoderMode == Constants.EncoderMode.ROTARYFRICTIONSIDE.ToString())
radiobutton_encoder_capture_rotary_friction.Active = true;
else
radiobutton_encoder_capture_rotary_axis.Active = true;
- } else { //default to linear: (eSQL.encoderMode ==
Constants.EncoderSignalMode.LINEAR.ToString())
+ } else { //default to linear: (eSQL.encoderMode == Constants.EncoderMode.LINEAR.ToString())
radiobutton_encoder_capture_linear.Active = true;
checkbutton_encoder_capture_inverted.Active = false;
}
@@ -4609,21 +4610,22 @@ public class EncoderConfigurationWindow {
gladeXML.Autoconnect(this);
Pixbuf pixbuf;
-
- pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameEncoderLinear);
+
+ //three encoder types
+ pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameEncoderTypeLinear);
image_encoder_linear.Pixbuf = pixbuf;
- pixbuf = new Pixbuf (null, Util.GetImagePath(false) +
Constants.FileNameEncoderRotaryFriction);
+ pixbuf = new Pixbuf (null, Util.GetImagePath(false) +
Constants.FileNameEncoderTypeRotaryFriction);
image_encoder_rotary_friction.Pixbuf = pixbuf;
- pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameEncoderRotaryAxis);
+ pixbuf = new Pixbuf (null, Util.GetImagePath(false) +
Constants.FileNameEncoderTypeRotaryAxis);
image_encoder_rotary_axis.Pixbuf = pixbuf;
- pixbuf = new Pixbuf (null, Util.GetImagePath(false) +
Constants.FileNameEncoderLinearFreeWeight);
+ //encoder configurations
+ //linear (default)
pixbuf = new Pixbuf (null, Util.GetImagePath(false) +
Constants.FileNameEncoderLinearFreeWeight);
image_encoder_configuration.Pixbuf = pixbuf;
-
//put an icon to window
UtilGtk.IconWindow(encoder_configuration);
}
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 1730557..cdfb735 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -1291,11 +1291,11 @@ class Sqlite
if(currentVersion == "0.95") {
dbcon.Open();
- Update(true, Constants.EncoderTable, "future3", "",
Constants.EncoderSignalMode.LINEAR.ToString(),
+ Update(true, Constants.EncoderTable, "future3", "",
Constants.EncoderMode.LINEAR.ToString(),
"signalOrCurve", "signal");
- Update(true, Constants.EncoderTable, "future3", "0",
Constants.EncoderSignalMode.LINEAR.ToString(),
+ Update(true, Constants.EncoderTable, "future3", "0",
Constants.EncoderMode.LINEAR.ToString(),
"signalOrCurve", "signal");
- Update(true, Constants.EncoderTable, "future3", "1",
Constants.EncoderSignalMode.LINEARINVERTED.ToString(),
+ Update(true, Constants.EncoderTable, "future3", "1",
Constants.EncoderMode.LINEARINVERTED.ToString(),
"signalOrCurve", "signal");
Log.WriteLine("Encoder signal future3 three modes");
diff --git a/src/utilEncoder.cs b/src/utilEncoder.cs
index 5985348..477c72b 100644
--- a/src/utilEncoder.cs
+++ b/src/utilEncoder.cs
@@ -445,7 +445,7 @@ public class UtilEncoder
double byteConverted = byteReaded;
//invert sign if inverted is selected
- if(encoderMode == Constants.EncoderSignalMode.LINEARINVERTED.ToString())
+ if(encoderMode == Constants.EncoderMode.LINEARINVERTED.ToString())
byteConverted *= -1;
else if(encoderMode == "ROTARYAXIS") {
int ticksRotaryEncoder = 200; //our rotary axis encoder send 200 ticks by turn
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]