eb5161562075ef34ea0678b23e35fe865007e084
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp   1) /* Blinker
Stefan Schuermans update copyright years

Stefan Schuermans authored 10 years ago

src/noarch/FlexiPix.cpp   2)    Copyright 2011-2014 Stefan Schuermans <stefan@blinkenarea.org>
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp   3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
src/noarch/FlexiPix.cpp   4)    a blinkenarea.org project */
src/noarch/FlexiPix.cpp   5) 
src/noarch/FlexiPix.cpp   6) #include <stdlib.h>
src/noarch/FlexiPix.cpp   7) #include <string>
src/noarch/FlexiPix.cpp   8) #include <string.h>
src/noarch/FlexiPix.cpp   9) 
src/noarch/FlexiPix.cpp  10) #include <BlinkenLib/BlinkenFrame.h>
src/noarch/FlexiPix.cpp  11) #include <BlinkenLib/BlinkenProto.h>
src/noarch/FlexiPix.cpp  12) 
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  13) #ifdef BLINKER_CFG_ETHERPIX
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  14) extern "C" {
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  15) #include <etherpix/etherpix.h>
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  16) } // extern "C"
src/noarch/FlexiPix.cpp  17) #endif // #ifdef BLINKER_CFG_FLEIXPIX
src/noarch/FlexiPix.cpp  18) 
src/noarch/FlexiPix.cpp  19) #include "Directory.h"
src/noarch/FlexiPix.cpp  20) #include "File.h"
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  21) #include "EtherPix.h"
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  22) #include "InStreamFile.h"
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  23) #include "Mgrs.h"
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  24) #include "Module.h"
src/noarch/FlexiPix.cpp  25) #include "Size.h"
src/noarch/FlexiPix.cpp  26) #include "StreamRecv.h"
src/noarch/FlexiPix.cpp  27) #include "Time.h"
src/noarch/FlexiPix.cpp  28) #include "TimeCallee.h"
src/noarch/FlexiPix.cpp  29) 
src/noarch/FlexiPix.cpp  30) namespace Blinker {
src/noarch/FlexiPix.cpp  31) 
src/noarch/FlexiPix.cpp  32) /**
src/noarch/FlexiPix.cpp  33)  * @brief constructor
Stefan Schuermans make modules know their name

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  34)  * @param[in] name module name
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  35)  * @param[in] mgrs managers
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  36)  * @param[in] dirBase base directory
src/noarch/FlexiPix.cpp  37)  */
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  38) EtherPix::EtherPix(const std::string &name, Mgrs &mgrs,
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  39)                  const Directory &dirBase):
Stefan Schuermans make modules know their name

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  40)   Module(name, mgrs, dirBase),
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  41)   m_fileInStream(dirBase.getFile("instream"), mgrs.m_streamMgr),
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  42)   m_fileConfig(dirBase.getFile("etherpix.etp")),
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  43)   m_pDisplay(NULL)
src/noarch/FlexiPix.cpp  44) {
src/noarch/FlexiPix.cpp  45)   // set up
src/noarch/FlexiPix.cpp  46)   m_fileInStream.setStreamRecv(this);
src/noarch/FlexiPix.cpp  47)   createDisplay();
src/noarch/FlexiPix.cpp  48) }
src/noarch/FlexiPix.cpp  49) 
src/noarch/FlexiPix.cpp  50) /// virtual destructor
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  51) EtherPix::~EtherPix()
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  52) {
src/noarch/FlexiPix.cpp  53)   // clean up
src/noarch/FlexiPix.cpp  54)   destroyDisplay();
src/noarch/FlexiPix.cpp  55)   m_fileInStream.setStreamRecv(NULL);
Stefan Schuermans put all managers in one str...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  56)   m_mgrs.m_callMgr.cancelTimeCall(this);
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  57) }
src/noarch/FlexiPix.cpp  58) 
src/noarch/FlexiPix.cpp  59) /// check for update of configuration
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  60) void EtherPix::updateConfig()
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  61) {
src/noarch/FlexiPix.cpp  62)   // input stream name file was modified -> re-get input stream
src/noarch/FlexiPix.cpp  63)   if (m_fileInStream.checkModified())
src/noarch/FlexiPix.cpp  64)     m_fileInStream.update();
src/noarch/FlexiPix.cpp  65) 
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  66)   // EtherPix config file was modified -> re-create display
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  67)   if (m_fileConfig.checkModified())
src/noarch/FlexiPix.cpp  68)     createDisplay();
src/noarch/FlexiPix.cpp  69) }
src/noarch/FlexiPix.cpp  70) 
src/noarch/FlexiPix.cpp  71) /**
src/noarch/FlexiPix.cpp  72)  * @brief set current frame
src/noarch/FlexiPix.cpp  73)  * @param[in] stream stream name
src/noarch/FlexiPix.cpp  74)  * @param[in] pFrame current frame (NULL for none)
src/noarch/FlexiPix.cpp  75)  */
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  76) void EtherPix::setFrame(const std::string &stream, stBlinkenFrame *pFrame)
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  77) {
src/noarch/FlexiPix.cpp  78)   displayFrame(pFrame);
src/noarch/FlexiPix.cpp  79)   (void)stream; // unused
src/noarch/FlexiPix.cpp  80) }
src/noarch/FlexiPix.cpp  81) 
src/noarch/FlexiPix.cpp  82) /// callback when requested time reached
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  83) void EtherPix::timeCall()
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  84) {
src/noarch/FlexiPix.cpp  85)   // refresh frame
src/noarch/FlexiPix.cpp  86)   sendFrame();
src/noarch/FlexiPix.cpp  87) }
src/noarch/FlexiPix.cpp  88) 
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  89) /// (re-)create EtherPix display
src/common/EtherPix.cpp  90) void EtherPix::createDisplay()
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  91) {
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  92) #ifdef BLINKER_CFG_ETHERPIX
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  93)   destroyDisplay();
src/noarch/FlexiPix.cpp  94) 
src/noarch/FlexiPix.cpp  95)   // create a display
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp  96)   m_pDisplay = etp_display_create(m_fileConfig.getPath().c_str(), NULL, NULL);
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp  97)   if (!m_pDisplay)
src/noarch/FlexiPix.cpp  98)     return;
src/noarch/FlexiPix.cpp  99) 
src/noarch/FlexiPix.cpp 100)   // get size of display
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 101)   etp_display_get_size(m_pDisplay, &m_size.m_width, &m_size.m_height);
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 102) 
src/noarch/FlexiPix.cpp 103)   // output current frame
src/noarch/FlexiPix.cpp 104)   displayFrame(m_fileInStream.getCurFrame());
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 105) #endif // #ifdef BLINKER_CFG_ETHERPIX
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 106) }
src/noarch/FlexiPix.cpp 107) 
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 108) /// destroy EtherPix display
src/common/EtherPix.cpp 109) void EtherPix::destroyDisplay()
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 110) {
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 111) #ifdef BLINKER_CFG_ETHERPIX
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 112)   if (m_pDisplay) {
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 113)     etp_display_free(m_pDisplay);
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 114)     m_pDisplay = NULL;
src/noarch/FlexiPix.cpp 115)   }
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 116) #endif // #ifdef BLINKER_CFG_ETHERPIX
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 117) }
src/noarch/FlexiPix.cpp 118) 
src/noarch/FlexiPix.cpp 119) /**
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 120)  * @brief display frame on EtherPix
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 121)  * @param[in] pFrame frame to display (or NULL)
src/noarch/FlexiPix.cpp 122)  */
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 123) void EtherPix::displayFrame(stBlinkenFrame *pFrame)
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 124) {
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 125) #ifdef BLINKER_CFG_ETHERPIX
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 126)   char data[65536];
src/noarch/FlexiPix.cpp 127)   bool haveData = false;
src/noarch/FlexiPix.cpp 128)   stBlinkenFrame *pClonedFrame;
src/noarch/FlexiPix.cpp 129) 
src/noarch/FlexiPix.cpp 130)   // leave if no display
src/noarch/FlexiPix.cpp 131)   if (!m_pDisplay)
src/noarch/FlexiPix.cpp 132)     return;
src/noarch/FlexiPix.cpp 133) 
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 134)   // convert frame to needed size and then to MCUF data as EtherPix library
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 135)   // can read data section of MCUF packet
src/noarch/FlexiPix.cpp 136) 
src/noarch/FlexiPix.cpp 137)   // frame available
src/noarch/FlexiPix.cpp 138)   if (pFrame) {
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 139)     // format matches (size matches and 24bit RGB as required by EtherPix)
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 140)     if (BlinkenFrameGetWidth(pFrame) == (int)m_size.m_width &&
src/noarch/FlexiPix.cpp 141)         BlinkenFrameGetHeight(pFrame) == (int)m_size.m_height &&
src/noarch/FlexiPix.cpp 142)         BlinkenFrameGetChannels(pFrame) == 3 &&
src/noarch/FlexiPix.cpp 143)         BlinkenFrameGetMaxval(pFrame) == 255) {
src/noarch/FlexiPix.cpp 144)       // convert to MCUF packet
src/noarch/FlexiPix.cpp 145)       haveData = BlinkenFrameToNetwork(pFrame, BlinkenProtoMcuf,
src/noarch/FlexiPix.cpp 146)                                        data, sizeof(data)) >= 0;
src/noarch/FlexiPix.cpp 147)     }
src/noarch/FlexiPix.cpp 148)     // format does not match
src/noarch/FlexiPix.cpp 149)     else {
src/noarch/FlexiPix.cpp 150)       // convert format: clone and resize
src/noarch/FlexiPix.cpp 151)       pClonedFrame = BlinkenFrameClone(pFrame);
src/noarch/FlexiPix.cpp 152)       if (pClonedFrame) {
src/noarch/FlexiPix.cpp 153)         BlinkenFrameResize(pClonedFrame, m_size.m_height,
src/noarch/FlexiPix.cpp 154)                            m_size.m_width, 3, 255);
src/noarch/FlexiPix.cpp 155)         // convert to MCUF packet
src/noarch/FlexiPix.cpp 156)         haveData = BlinkenFrameToNetwork(pFrame, BlinkenProtoMcuf,
src/noarch/FlexiPix.cpp 157)                                          data, sizeof(data)) >= 0;
src/noarch/FlexiPix.cpp 158)         // free clones frame
src/noarch/FlexiPix.cpp 159)         BlinkenFrameFree(pClonedFrame);
src/noarch/FlexiPix.cpp 160)       }
src/noarch/FlexiPix.cpp 161)     }
src/noarch/FlexiPix.cpp 162)   }
src/noarch/FlexiPix.cpp 163) 
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 164)   // data available -> to EtherPix display
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 165)   if (haveData)
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 166)     etp_display_data(m_pDisplay, (etp_u8_t*)(data + 12), 3, m_size.m_width * 3,
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 167)                      0, 0, m_size.m_width, m_size.m_height);
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 168)   // no data available -> clear EtherPix display
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 169)   else
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 170)     etp_display_data_clear(m_pDisplay);
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 171) 
src/noarch/FlexiPix.cpp 172)   // send configured frame
src/noarch/FlexiPix.cpp 173)   sendFrame();
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 174) #else // #ifdef BLINKER_CFG_ETHERPIX
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 175)   (void)pFrame;
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 176) #endif // #ifdef BLINKER_CFG_ETHERPIX else
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 177) }
src/noarch/FlexiPix.cpp 178) 
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 179) /// (re-)send frame to EtherPix
src/common/EtherPix.cpp 180) void EtherPix::sendFrame()
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 181) {
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 182) #ifdef BLINKER_CFG_ETHERPIX
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 183)   if (m_pDisplay) {
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 184)     etp_display_send(m_pDisplay);
Stefan Schuermans make modules know their name

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 185)     m_mgrs.m_callMgr.requestTimeCall(this, Time::now() + Time(1)); // refresh
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 186)   }
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 187) #endif // #ifdef BLINKER_CFG_ETHERPIX