e2b53fb9da7413d676e325d726e8e23765f9f623
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;
Stefan Schuermans add monochrome support for...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 128)   etp_pixfmt_t pixfmt;
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 129)   stBlinkenFrame *pClonedFrame;
Stefan Schuermans add monochrome support for...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 130)   int frameWidth, frameHeight, frameChannels, frameMaxval, channels;
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 131) 
src/noarch/FlexiPix.cpp 132)   // leave if no display
src/noarch/FlexiPix.cpp 133)   if (!m_pDisplay)
src/noarch/FlexiPix.cpp 134)     return;
src/noarch/FlexiPix.cpp 135) 
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 136)   // 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 137)   // can read data section of MCUF packet
src/noarch/FlexiPix.cpp 138) 
src/noarch/FlexiPix.cpp 139)   // frame available
src/noarch/FlexiPix.cpp 140)   if (pFrame) {
Stefan Schuermans add monochrome support for...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 141)     frameWidth = BlinkenFrameGetWidth(pFrame);
src/common/EtherPix.cpp 142)     frameHeight = BlinkenFrameGetHeight(pFrame);
src/common/EtherPix.cpp 143)     frameChannels = BlinkenFrameGetChannels(pFrame);
src/common/EtherPix.cpp 144)     frameMaxval = BlinkenFrameGetMaxval(pFrame);
src/common/EtherPix.cpp 145)     // format matches
src/common/EtherPix.cpp 146)     // (size matches and 24bit RGB or monochrome as required by EtherPix)
src/common/EtherPix.cpp 147)     if (frameWidth == (int)m_size.m_width &&
src/common/EtherPix.cpp 148)         frameHeight == (int)m_size.m_height &&
src/common/EtherPix.cpp 149)         (frameChannels == 1 || frameChannels == 3) &&
src/common/EtherPix.cpp 150)         frameMaxval == 255) {
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 151)       // convert to MCUF packet
src/noarch/FlexiPix.cpp 152)       haveData = BlinkenFrameToNetwork(pFrame, BlinkenProtoMcuf,
src/noarch/FlexiPix.cpp 153)                                        data, sizeof(data)) >= 0;
Stefan Schuermans add monochrome support for...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 154)       channels = frameChannels;
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 155)     }
src/noarch/FlexiPix.cpp 156)     // format does not match
src/noarch/FlexiPix.cpp 157)     else {
src/noarch/FlexiPix.cpp 158)       // convert format: clone and resize
src/noarch/FlexiPix.cpp 159)       pClonedFrame = BlinkenFrameClone(pFrame);
src/noarch/FlexiPix.cpp 160)       if (pClonedFrame) {
Stefan Schuermans add monochrome support for...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 161)         channels = frameChannels == 1 ? 1 : 3;
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 162)         BlinkenFrameResize(pClonedFrame, m_size.m_height,
Stefan Schuermans add monochrome support for...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 163)                            m_size.m_width, channels, 255);
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 164)         // convert to MCUF packet
Stefan Schuermans fix etherpix output for mon...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 165)         haveData = BlinkenFrameToNetwork(pClonedFrame, BlinkenProtoMcuf,
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 166)                                          data, sizeof(data)) >= 0;
Stefan Schuermans add monochrome support for...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 167)         // free cloned frame
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 168)         BlinkenFrameFree(pClonedFrame);
src/noarch/FlexiPix.cpp 169)       }
src/noarch/FlexiPix.cpp 170)     }
src/noarch/FlexiPix.cpp 171)   }
src/noarch/FlexiPix.cpp 172) 
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 173)   // data available -> to EtherPix display
Stefan Schuermans add monochrome support for...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 174)   if (haveData) {
src/common/EtherPix.cpp 175)     pixfmt = channels == 1 ? etp_pixfmt_mono8 : etp_pixfmt_rgb24;
src/common/EtherPix.cpp 176)     etp_display_data_fmt(m_pDisplay, (etp_u8_t*)(data + 12),
src/common/EtherPix.cpp 177)                          channels, m_size.m_width * channels,
src/common/EtherPix.cpp 178)                          0, 0, m_size.m_width, m_size.m_height, pixfmt);
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 179)   // no data available -> clear EtherPix display
Stefan Schuermans add monochrome support for...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 180)   } else {
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

src/common/EtherPix.cpp 181)     etp_display_data_clear(m_pDisplay);
Stefan Schuermans add monochrome support for...

Stefan Schuermans authored 6 years ago

src/common/EtherPix.cpp 182)   }
Stefan Schuermans added flexipix output suppo...

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 183) 
src/noarch/FlexiPix.cpp 184)   // send configured frame
src/noarch/FlexiPix.cpp 185)   sendFrame();
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 7 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 7 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 7 years ago

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

Stefan Schuermans authored 12 years ago

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

Stefan Schuermans authored 7 years ago

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

Stefan Schuermans authored 12 years ago

src/noarch/FlexiPix.cpp 197)     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 198)   }
Stefan Schuermans rename FlexiPix to EtherPix

Stefan Schuermans authored 7 years ago

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