[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/harvard/spaulding/src/gui Makefile, 1.2, 1.3 Session.java, 1.2, 1.3

Konrad Lorincz konradlorincz at users.sourceforge.net
Thu Dec 20 18:24:43 PST 2007


Update of /cvsroot/tinyos/tinyos-1.x/contrib/harvard/spaulding/src/gui
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20801/src/gui

Modified Files:
	Makefile Session.java 
Log Message:
Updated readSD to handle various sampling rates

Index: Makefile
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/harvard/spaulding/src/gui/Makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Makefile	20 Dec 2007 01:29:34 -0000	1.2
--- Makefile	21 Dec 2007 02:24:40 -0000	1.3
***************
*** 34,38 ****
  
  java:
! 	$(JAVAC) *.java
  
  run:
--- 34,38 ----
  
  java:
! 	$(JAVAC)  *.java
  
  run:

Index: Session.java
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/harvard/spaulding/src/gui/Session.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Session.java	20 Dec 2007 01:29:34 -0000	1.2
--- Session.java	21 Dec 2007 02:24:41 -0000	1.3
***************
*** 56,66 ****
      transient private Thread thread;
  
- 
      // --- Session State ---
      private Date date = null;            // serves as the session ID
      private String sessionName = "DefaultSessionName"; // the session name
      private int subjectID = 0;
!     private Map<Node, Long> nodesDownloadTailBlockID = Collections.synchronizedMap(new HashMap<Node, Long>());
!     private Map<Node, Long> nodesDownloadHeadBlockID = Collections.synchronizedMap(new HashMap<Node, Long>());
      // ---------------------
  
--- 56,65 ----
      transient private Thread thread;
  
      // --- Session State ---
      private Date date = null;            // serves as the session ID
      private String sessionName = "DefaultSessionName"; // the session name
      private int subjectID = 0;
!     private Map<Node, Long> nodesDownloadStartBlockID = Collections.synchronizedMap(new HashMap<Node, Long>());
!     private Map<Node, Long> nodesDownloadEndBlockID = Collections.synchronizedMap(new HashMap<Node, Long>());
      // ---------------------
  
***************
*** 309,313 ****
                      System.out.println("=====>>>>> Session.run() - part 1");
                      for (Node node: this.participatingNodes)
!                         this.nodesDownloadTailBlockID.put(node, node.getHeadBlockID());
                      setState(State.SAMPLING);
                      this.startSamplingPrivate();
--- 308,312 ----
                      System.out.println("=====>>>>> Session.run() - part 1");
                      for (Node node: this.participatingNodes)
!                         this.nodesDownloadStartBlockID.put(node, node.getHeadBlockID()+1);
                      setState(State.SAMPLING);
                      this.startSamplingPrivate();
***************
*** 337,344 ****
                      // Record the tailBlockID for each node.  This will be used when we download data for this session
                      String infoLog = "samplingDurationMS= " + this.samplingDuration +
!                                      ", <nodeID,tailBlockID,headBlockID>=";
                      for (Node node: this.participatingNodes) {
!                         nodesDownloadHeadBlockID.put(node, node.getHeadBlockID());
!                         infoLog += " <" + node.getNodeID() + "," + node.getTailBlockID() + "," + node.getHeadBlockID() + ">";
                      }
                      Logger.writeln(infoLog, getFileInfoStr(), true);
--- 336,348 ----
                      // Record the tailBlockID for each node.  This will be used when we download data for this session
                      String infoLog = "samplingDurationMS= " + this.samplingDuration +
!                                      ", <nodeID,startBlockID,endBlockID>=";
                      for (Node node: this.participatingNodes) {
!                         long startBlockID = nodesDownloadStartBlockID.get(node);
!                         long endBlockID = node.getHeadBlockID();
!                         if (endBlockID < startBlockID)
!                             endBlockID = startBlockID;
! 
!                         nodesDownloadEndBlockID.put(node, endBlockID);
!                         infoLog += " <" + node.getNodeID() + "," + startBlockID + "," + endBlockID + ">";
                      }
                      Logger.writeln(infoLog, getFileInfoStr(), true);
***************
*** 423,429 ****
              //FetchRequest fetchRequest = new FetchRequest(spauldingApp, node, fetchLogger, -1, nbrBlockToDownload);
  
! //            int nbrBlockToDownload = nbrBlocksToDownload(node.getNodeID());
!             long startBlockID = nodesDownloadTailBlockID.get(node);
!             int nbrBlockToDownload = (int)(nodesDownloadHeadBlockID.get(node) - startBlockID + 1);
  
              FetchLogger fetchLogger = new FetchLogger(spauldingApp, node, FetchLogger.MANUAL_FETCH, getDate(), getSessionDir());
--- 427,432 ----
              //FetchRequest fetchRequest = new FetchRequest(spauldingApp, node, fetchLogger, -1, nbrBlockToDownload);
  
!             long startBlockID = nodesDownloadStartBlockID.get(node);
!             int nbrBlockToDownload = (int)(nodesDownloadEndBlockID.get(node) - startBlockID);
  
              FetchLogger fetchLogger = new FetchLogger(spauldingApp, node, FetchLogger.MANUAL_FETCH, getDate(), getSessionDir());



More information about the Tinyos-contrib-commits mailing list