Update of /cvsroot/playerstage/code/player/server/drivers/shell
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12937

Modified Files:
        readlog.cc 
Log Message:
Added readlog support for PTZ.


Index: readlog.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/shell/readlog.cc,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** readlog.cc  11 Sep 2006 22:13:17 -0000      1.42
--- readlog.cc  13 Sep 2006 11:15:40 -0000      1.43
***************
*** 64,67 ****
--- 64,68 ----
  - @ref interface_imu
  - @ref interface_pointcloud3d
+ - @ref interface_ptz
  
  The following interfaces are supported in principle but are currently
***************
*** 288,291 ****
--- 289,298 ----
                                  int linenum,
                                  int token_count, char **tokens, double time);
+ 
+   // Parse PTZ data
+   private: int ParsePTZ (player_devaddr_t id,
+                          unsigned short type, unsigned short subtype,
+                          int linenum,
+                          int token_count, char **tokens, double time);
  #if 0
  
***************
*** 1159,1162 ****
--- 1166,1172 ----
        return this->ParsePointCloud3d (id, type, subtype, linenum,
                                        token_count, tokens, time);
+   else if (id.interf == PLAYER_PTZ_CODE)
+       return this->ParsePTZ (id, type, subtype, linenum,
+                             token_count, tokens, time);
  
  #if 0
***************
*** 2016,2019 ****
--- 2026,2071 ----
  }
  
+ ////////////////////////////////////////////////////////////////////////////
+ // Parse PTZ data
+ int ReadLog::ParsePTZ (player_devaddr_t id, 
+                       unsigned short type, unsigned short subtype,
+                       int linenum,
+                       int token_count, char **tokens, double time)
+ {
+     switch(type)
+     {
+         case PLAYER_MSGTYPE_DATA:
+             switch(subtype)
+             {
+                 case PLAYER_PTZ_DATA_STATE:
+                 {
+                     if (token_count < 12)
+                     {
+                         PLAYER_ERROR2("invalid line at %s:%d", 
this->filename, linenum);
+                         return -1;
+                     }
+                   player_ptz_data_t data;
+                   
+                   data.pan  = atof (tokens[7]);
+                   data.tilt = atof (tokens[8]);
+                   data.zoom = atof (tokens[9]);
+                   data.panspeed  = atof (tokens[10]);
+                   data.tiltspeed = atof (tokens[11]);
+                   
+                     this->Publish (id, NULL, type, subtype,
+                                   (void*)&data, sizeof(data), &time);
+                     return (0);
+                 }
+               
+                 default:
+                     PLAYER_ERROR1 ("unknown PTZ data subtype %d\n", subtype);
+                     return (-1);
+             }
+         default:
+             PLAYER_ERROR1 ("unknown PTZ message type %d\n", type);
+             return (-1);
+     }
+ }
+ 
  #if 0
  ////////////////////////////////////////////////////////////////////////////


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to