Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ViewerConnection.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_ViewerConnection_h_
00003 #define INCLUDED_ViewerConnection_h_
00004 
00005 #include <string>
00006 
00007 #include "Shared/ProjectInterface.h"
00008 #include "Wireless/Wireless.h"
00009 
00010 namespace DualCoding {
00011 
00012 static const unsigned int DIALOG_BUFFER_SIZE=20000;
00013 
00014 #if defined(PLATFORM_APERIOS)
00015 static const unsigned int SKETCH_BUFFER_SIZE=70000; // Raised to 120,000 for sketch<usint> in world space; then lowered to 70000 due to memory shortage
00016 #else
00017 static const unsigned int SKETCH_BUFFER_SIZE=(unsigned int)(1.5*(1<<20)); // Raised to 1.5MB for higher resolution (640x480) uint images
00018 #endif
00019 
00020 static const unsigned int CAM_LAYER=ProjectInterface::fullLayer; //!< the full resolution layer in the filter bank
00021 static const unsigned int CAM_CHANNEL=0;  //!< corresponds to appropriate thresholding listed in tekkotsu.xml
00022 static const unsigned int WORLD_WIDTH=225;
00023 static const unsigned int WORLD_HEIGHT=225;
00024 
00025 static const unsigned short CAM_DIALOG_PORT   = 5800;
00026 static const unsigned short CAM_SKETCH_PORT      = 5801;
00027 static const unsigned short LOCAL_DIALOG_PORT = 5802;
00028 static const unsigned short LOCAL_SKETCH_PORT    = 5803;
00029 static const unsigned short WORLD_DIALOG_PORT = 5804;
00030 static const unsigned short WORLD_SKETCH_PORT    = 5805;
00031 
00032 class ViewerConnection {
00033 
00034  private:
00035   Socket *dialogSock, *sketchSock;
00036   int dialogPort, sketchPort;
00037 
00038  public:
00039   ViewerConnection(void) : dialogSock(NULL), sketchSock(NULL), dialogPort(0), sketchPort(0) {}
00040 
00041   Socket *getDialogSocket() const { return dialogSock; }
00042   Socket *getSketchSocket() const { return sketchSock; }
00043 
00044   void setDialogSocket(Socket* sock, int const port) { dialogSock = sock; dialogPort = port; }
00045   void setSketchSocket(Socket* sock, int const port) { sketchSock = sock; sketchPort = port; }
00046 
00047   void writeBigString(std::string const &msg);
00048 
00049  private:
00050   ViewerConnection(const ViewerConnection&); //!< never call this
00051   ViewerConnection& operator=(const ViewerConnection&); //!< never call this
00052 
00053 };
00054 
00055 } // namespace
00056 
00057 #endif

DualCoding 5.1CVS
Generated Mon May 9 04:56:28 2016 by Doxygen 1.6.3