save loops

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
mbedalvaro
Date:
Tue Dec 02 08:29:59 2014 +0000
Parent:
0:df6fdd9b99f0
Commit message:
updated

Changed in this revision

blobConfig.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
rigidLoop.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/blobConfig.cpp	Tue Dec 02 04:39:15 2014 +0000
+++ b/blobConfig.cpp	Tue Dec 02 08:29:59 2014 +0000
@@ -340,13 +340,13 @@
 void blobConfig::allKill() { // this put all the blobs in "dead" mode, meaning that neither rendering nor update is done (but they are not deleted).
     for (int i=0; i<blobArray.size(); i++) {
         blobArray[i]->render = false;
-        blobArray[i]->standByMode = false;
+        blobArray[i]->standByMode = true;
     }
 }
 void blobConfig::allAlive() {
     for (int i=0; i<blobArray.size(); i++) {
         blobArray[i]->render = true;
-        blobArray[i]->standByMode = true;
+        blobArray[i]->standByMode = false;
     }
 }
 
@@ -526,7 +526,8 @@
 
 void blobConfig::sendConfData() {
 // For the time being, only "per blob" data sending:
-// (b) Per-spot sending of data (note: both are NOT exclusive; so if we want just packaged data, we need to make all the spot STOP sending data.
+// (b) Per-spot sending of data (note: both are NOT exclusive; so if we want just packaged data, 
+// we need to make all the spot STOP sending data.
     for (int i=0; i<blobArray.size(); i++) { 
         if (blobArray[i]->render==true) blobArray[i]->sendData(); // a blob that is in stand-by mode may send data (good for testing with a fixed loop)
     }
--- a/main.cpp	Tue Dec 02 04:39:15 2014 +0000
+++ b/main.cpp	Tue Dec 02 08:29:59 2014 +0000
@@ -796,6 +796,15 @@
         }
     }
 
+      else if (!strcmp( address[0], "sendAnchorPos" ) ) {
+        int value=data[0];
+        if (value!=-1) { // otherwise do nothing, this is a reception error (there was no data)
+            for (int i=0; i< blobconf.numBlobs; i++) {
+                blobconf.blobArray[i]->sendingAnchorPosition=(value>0);
+            }
+        }
+    }
+
     else if (!strcmp( address[0], "sendRegions" ) ) {
         int value=data[0];
         if (value!=-1) { // otherwise do nothing, this is a reception error (there was no data)
--- a/rigidLoop.cpp	Tue Dec 02 04:39:15 2014 +0000
+++ b/rigidLoop.cpp	Tue Dec 02 08:29:59 2014 +0000
@@ -978,7 +978,7 @@
 
         // (a) Anchor mass:
         if (sendingAnchorPosition) {
-            sprintf(auxstring, "/p %d",identifier);
+            sprintf(auxstring, "/p%d",identifier);
             sendMes.setSubAddress(auxstring);
             long    x, y;    //ATTENTION: parameters to setArgs should be long or unsigned long only (not int!!)
             x=(long)(centerMass.pos.x);
@@ -1104,7 +1104,7 @@
 
     // =====================   SERIAL  ======================
     if (sendSerial) {
-        //.. to do
+        //...
     }
 
     myled2=0; // for tests...