void TracFacilities_c::processMsg( const CanPkg_c& arc_data ) { CanPkgExt_c pkg( arc_data, getMultitonInst() ); if( !pkg.isValid() || (pkg.getMonitorItemForSA() == NULL) ) return; IsoName_c const& rcc_tempISOName = pkg.getISONameForSA(); switch (pkg.isoPgn() & 0x3FF00LU) { case TRACTOR_FACILITIES_PGN: if ( checkParseReceived (rcc_tempISOName) ) { // sender is allowed to send for (uint8_t ui8_counter = 0;ui8_counter<sizeof(arrui8_facilitiesBitData)/sizeof(uint8_t);++ui8_counter) arrui8_facilitiesBitData[ui8_counter] = pkg.getUint8Data(ui8_counter); setSelectedDataSourceISOName (rcc_tempISOName); setUpdateTime( pkg.time() ); } else { // there is a sender conflict IsoAgLib::getILibErrInstance().registerNonFatal( IsoAgLib::iLibErr_c::TracMultipleSender, getMultitonInst() ); } break; } }
Knob::Knob(QWidget* parent, const char* name) : SliderBase(parent, name) { hasScale = false; d_borderWidth = 4; d_shineWidth = 3; d_totalAngle = 270.0; d_scaleDist = 1; d_symbol = Line; d_maxScaleTicks = 11; d_knobWidth = 30; _faceColSel = false; d_faceColor = palette().color(QPalette::Window); d_rimColor = palette().mid().color(); d_shinyColor = palette().mid().color(); d_curFaceColor = d_faceColor; d_altFaceColor = d_faceColor; d_markerColor = palette().dark().color().darker(125); d_dotWidth = 8; l_slope = 0; l_const = 100; setMinimumSize(30,30); setUpdateTime(50); }
RssParser::RssParser(QString url, QObject *parent) : QObject(parent) { if(!url.isEmpty()) setUrl(url); connect(&m_reloadTimer, SIGNAL(timeout()), this, SLOT(reloadData())); setUpdateTime(60); }
//! Constructor QwtWheel::QwtWheel( QWidget *parent ): QwtAbstractSlider( Qt::Horizontal, parent ) { d_data = new PrivateData; setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ); setAttribute( Qt::WA_WState_OwnSizePolicy, false ); setUpdateTime( 50 ); }
void TracPTO_c::processMsg( const CanPkg_c& arc_data ) { CanPkgExt_c pkg( arc_data, getMultitonInst() ); if( !pkg.isValid() || (pkg.getMonitorItemForSA() == NULL) ) return; IsoName_c const& rcc_tempISOName = pkg.getISONameForSA(); if (((pkg.isoPgn() /*& 0x3FFFF*/) == FRONT_PTO_STATE_PGN) || ((pkg.isoPgn() /*& 0x3FFFF*/) == REAR_PTO_STATE_PGN)) { const ecutime_t ci32_now = pkg.time(); // only take values, if i am not the regular sender // and if actual sender isn't in conflict to previous sender if ( checkParseReceived( rcc_tempISOName ) ) { // sender is allowed to send PtoData_t* pt_ptoData = NULL; if (pkg.isoPgn() == FRONT_PTO_STATE_PGN) { // front PTO pt_ptoData = &mt_ptoFront; } else { // rear PTO pt_ptoData = &mt_ptoRear; } pt_ptoData->i32_lastPto = ci32_now; pt_ptoData->ui16_pto8DigitPerRpm = pkg.getUint16Data(0); pt_ptoData->ui16_ptoSetPoint8DigitPerRpm = pkg.getUint16Data(2); pt_ptoData->t_ptoEngaged = IsoAgLib::IsoActiveFlag_t( ( pkg.getUint8Data(4) >> 6) & 3 ); pt_ptoData->t_pto1000 = IsoAgLib::IsoActiveFlag_t( ( pkg.getUint8Data(4) >> 4) & 3 ); pt_ptoData->t_ptoEconomy = IsoAgLib::IsoActiveFlag_t( ( pkg.getUint8Data(4) >> 2) & 3 ); pt_ptoData->t_ptoEngagementReqStatus = IsoAgLib::IsoReqFlag_t( pkg.getUint8Data(4) & 3 ); pt_ptoData->t_ptoModeReqStatus = IsoAgLib::IsoReqFlag_t( (pkg.getUint8Data(5) >> 6) & 3 ); pt_ptoData->t_ptoEconomyModeReqStatus = IsoAgLib::IsoReqFlag_t( (pkg.getUint8Data(5) >> 4) & 3 ); pt_ptoData->t_ptoShaftSpeedLimitStatus = IsoAgLib::IsoLimitFlag_t( (pkg.getUint8Data(5) >> 1) & 0x7 ); // set last time setSelectedDataSourceISOName (rcc_tempISOName); // update time pt_ptoData->i32_lastPto = pkg.time(); // must be set because this is needed in basecommon_c setUpdateTime( pt_ptoData->i32_lastPto ); //msg from Tractor received do tell Scheduler_c next call not until 3000ms mt_task.setNextTriggerTime( pkg.time() + CONFIG_TIMEOUT_TRACTOR_DATA ); } else { // there is a sender conflict IsoAgLib::getILibErrInstance().registerNonFatal( IsoAgLib::iLibErr_c::TracMultipleSender, getMultitonInst() ); } }
void QwtKnob::initKnob() { d_data = new PrivateData; setScaleDraw( new QwtRoundScaleDraw() ); setUpdateTime( 50 ); setTotalAngle( 270.0 ); recalcAngle(); setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Minimum ) ); setRange( 0.0, 10.0, 1.0 ); setValue( 0.0 ); }
void QwtWheel::initWheel() { d_data = new PrivateData; #if QT_VERSION < 0x040000 setWFlags(Qt::WNoAutoErase); #endif setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); #if QT_VERSION >= 0x040000 setAttribute(Qt::WA_WState_OwnSizePolicy, false); #else clearWState( WState_OwnSizePolicy ); #endif setUpdateTime(50); }
void QwtKnob::initKnob() { #if QT_VERSION < 0x040000 setWFlags(Qt::WNoAutoErase); #endif d_data = new PrivateData; setScaleDraw(new QwtRoundScaleDraw()); setUpdateTime(50); setTotalAngle( 270.0 ); recalcAngle(); setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); setRange(0.0, 10.0, 1.0); setValue(0.0); }
GLImageHttpDrawable::GLImageHttpDrawable(QObject *parent) : GLImageDrawable("",parent) , m_url("") , m_pollDviz(false) , m_updateTime(1000) , m_isDataPoll(false) , m_slideId(-1) , m_slideName("") , m_rx(0) { //setImage(QImage("Pm5544.jpg")); setImage(QImage("dot.gif")); connect(&m_pollDvizTimer, SIGNAL(timeout()), this, SLOT(initDvizPoll())); connect(&m_pollImageTimer, SIGNAL(timeout()), this, SLOT(initImagePoll())); setUpdateTime(m_updateTime); }
Knob::Knob(QWidget* parent, const char* name) : SliderBase(parent, name) { hasScale = false; d_borderWidth = 2; d_borderDist = 4; d_totalAngle = 270.0; d_scaleDist = 1; d_symbol = Line; d_maxScaleTicks = 11; d_knobWidth = 30; _faceColSel = FALSE; d_faceColor = palette().color(QPalette::Window); d_curFaceColor = d_faceColor; d_altFaceColor = d_faceColor; d_markerColor = QColor(255,255,255,157); d_markerColorDisabled = QColor(255,255,255,50); d_dotWidth = 8; setMinimumSize(30, 30); setUpdateTime(50); }
/*! \brief Constructor \param parent Parent widget \param name Name */ QwtKnob::QwtKnob(QWidget* parent, const char *name): QwtSliderBase(Qt::Horizontal, parent, name, Qt::WRepaintNoErase|Qt::WResizeNoErase) { d_angle = 0.0; d_oldAngle = 0.0; d_nTurns = 0.0; d_borderWidth = 2; d_borderDist = 4; d_totalAngle = 270.0; d_scaleDist = 4; d_hasScale = 0; d_symbol = Line; d_maxScaleTicks = 11; d_knobWidth = 50; d_dotWidth = 8; scaleDraw()->setGeometry( 0, 0, d_knobWidth + 2 * d_scaleDist, QwtScaleDraw::Round ); setUpdateTime(50); setTotalAngle( 270.0 ); recalcAngle(); setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum)); }
OutputWindow::OutputWindow() : QGraphicsView(new QGraphicsScene()) , m_url("") , m_pollDviz(false) , m_updateTime(1000) , m_isDataPoll(false) , m_slideId(-1) , m_slideName("") //, m_startStopButton(0) , m_countValue(0) , m_drw(0) , m_blinkCount(0) { // Setup graphics view setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform ); setCacheMode(QGraphicsView::CacheBackground); setViewportUpdateMode(QGraphicsView::BoundingRectViewportUpdate); setOptimizationFlags(QGraphicsView::DontSavePainterState); setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); setTransformationAnchor(AnchorUnderMouse); setResizeAnchor(AnchorViewCenter); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Add pixmap item for background QPixmap bluePixmap(32,23); bluePixmap.fill(Qt::blue); m_pixmap = scene()->addPixmap(bluePixmap); // Background behind text m_counterBgRect = scene()->addRect(0,0,100,60,QPen(), Qt::black); m_counterBgRect->setZValue(99); // Add text (for use with clock) QFont font("Monospace", 50, 600); m_counterText = new QGraphicsSimpleTextItem("0"); m_counterText->setFont(font); m_counterText->setPen(QPen(Qt::black)); m_counterText->setBrush(Qt::white); m_counterText->setPos(0, -13); m_counterText->setZValue(100); scene()->addItem(m_counterText); // Background behind text m_overlayBgRect = scene()->addRect(0,300,100,60,QPen(), Qt::black); m_overlayBgRect->setZValue(99); // Add text (for use with clock) //QFont font("Monospace", 50, 600); m_overlayText = new QGraphicsSimpleTextItem("Hello, World!"); m_overlayText->setFont(font); m_overlayText->setPen(QPen(Qt::black)); m_overlayText->setBrush(Qt::white); m_overlayText->setPos(0, 300-13); m_overlayText->setZValue(100); scene()->addItem(m_overlayText); m_blinkOverlay = false; connect(&m_blinkOverlayTimer, SIGNAL(timeout()), this, SLOT(blinkOverlaySlot())); GET_CONFIG(); QPoint windowPos(1024,0); QPoint windowSize(1024,768); //QPoint windowPos(10,10); //QPoint windowSize = QPoint(640,480); QString windowGeomString = config.value("geom","1024,0,1024,768").toString(); if(!windowGeomString.isEmpty()) { QStringList list = windowGeomString.split(","); windowPos = QPoint(list[0].toInt(), list[1].toInt()); windowSize = QPoint(list[2].toInt(), list[3].toInt()); } setWindowGeom(QRect(windowPos.x(),windowPos.y(),windowSize.x(),windowSize.y())); bool frameless = config.value("frameless","true").toString() == "true"; if(frameless) setWindowFlags(Qt::FramelessWindowHint);// | Qt::ToolTip); connect(&m_pollDvizTimer, SIGNAL(timeout()), this, SLOT(initDvizPoll())); //connect(&m_pollImageTimer, SIGNAL(timeout()), this, SLOT(initImagePoll())); setUpdateTime(m_updateTime); //setUrl("http://10.10.9.90:8081/image"); //setUrl(""); //setPollDviz(true); setInputSource(config.value("source","dviz://192.168.0.10:8081/image").toString()); // m_startStopButton = new QPushButton("Start Counter"); // connect(m_startStopButton, SIGNAL(clicked()), this, SLOT(toggleCounter())); connect(&m_counterTimer, SIGNAL(timeout()), this, SLOT(counterTick())); m_counterTimer.setInterval(1000); // // m_startStopButton->show(); //toggleCounter(); setCounterActive(false); setBlinkOverlay(config.value("blink-overlay","false").toString() == "true", config.value("blink-speed", 333).toInt()); //setOverlayVisible(config.value("overlay-visible", "true").toString() == "true"); setCounterVisible(config.value("counter-visible", "true").toString() == "true"); setCounterAlignment((Qt::Alignment)config.value("counter-alignment", (int)(Qt::AlignLeft | Qt::AlignTop)).toInt()); setOverlayAlignment((Qt::Alignment)config.value("overlay-alignment", (int)(Qt::AlignCenter | Qt::AlignBottom)).toInt()); setOverlayText(config.value("overlay-text").toString()); }
void TracLight_c::processMsg( const CanPkg_c& arc_data ) { CanPkgExt_c pkg( arc_data, getMultitonInst() ); if( !pkg.isValid() || (pkg.getMonitorItemForSA() == NULL) ) return; IsoName_c const& rcc_tempISOName = pkg.getISONameForSA(); lightBitData_t* pt_data = NULL; switch (pkg.isoPgn() /*& 0x3FFFF*/) // don't need to &, we're interested in the whole PGN! { case LIGHTING_DATA_PGN: // lighting state information is sent by more than one sender -> store ALL messages with SA as key in STL_NAMESPACE::map pt_data = &(mmap_data[pkg.isoSa()]); if (pt_data != NULL) pt_data->dataMsgReq = IsoAgLib::IsoDontCare; //reserved field in lighting data break; case LIGHTING_COMMAND_PGN: // CMD is EXCLUSIVELY SENT BY ONE TRACTOR ECU!!! --> CHECK if ( checkParseReceived (rcc_tempISOName) ) { // sender is allowed to send pt_data = &mt_cmd; mt_cmd.dataMsgReq = IsoAgLib::IsoDataReq_t( pkg.getUint8Data(7) & 3 ); if (mt_cmd.dataMsgReq == IsoAgLib::IsoDataRequested) mb_cmdWait4Response = true; // set last time - use the array of send time stamps which is needed in tractor mode // in implement mode, the first item can be used to trace received tractor commands marr_timeStamp[0] = pkg.time(); setSelectedDataSourceISOName (rcc_tempISOName); setUpdateTime( pkg.time() ); } else { // there is a sender conflict IsoAgLib::getILibErrInstance().registerNonFatal( IsoAgLib::iLibErr_c::TracMultipleSender, getMultitonInst() ); } break; } if ( pt_data == NULL ) { // preconditions for parsing of this message are NOT fullfilled --> exit function with false return; } // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // from here on, we can safely process the message as all preconditions are fullfilled // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ uint16_t ui16_temp = pkg.getUint16Data( 0 ); pt_data->daytimeRunning = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 0) & 3 ) ; pt_data->alternateHead = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 2) & 3 ) ; pt_data->lowBeamHead = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 4) & 3 ) ; pt_data->highBeamHead = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 6) & 3 ) ; pt_data->frontFog = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 8) & 3 ) ; pt_data->beacon = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 10) & 3 ) ; pt_data->rightTurn = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 12) & 3 ) ; pt_data->leftTurn = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 14) & 3 ) ; ui16_temp = pkg.getUint16Data( 2 ); pt_data->backUpLightAlarmHorn = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 0) & 3 ) ; pt_data->centerStop = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 2) & 3 ) ; pt_data->rightStop = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 4) & 3 ) ; pt_data->leftStop = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 6) & 3 ) ; pt_data->implClearance = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 8) & 3 ) ; pt_data->tracClearance = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 10) & 3 ) ; pt_data->implMarker = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 12) & 3 ) ; pt_data->tracMarker = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 14) & 3 ) ; ui16_temp = pkg.getUint16Data( 4 ); pt_data->rearFog = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 0) & 3 ) ; pt_data->undersideWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 2) & 3 ) ; pt_data->rearLowWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 4) & 3 ) ; pt_data->rearHighWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 6) & 3 ) ; pt_data->sideLowWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 8) & 3 ) ; pt_data->sideHighWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 10) & 3 ) ; pt_data->frontLowWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 12) & 3 ) ; pt_data->frontHighWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 14) & 3 ) ; ui16_temp = pkg.getUint16Data( 6 ); pt_data->implOEMOpt2 = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 0) & 3 ) ; pt_data->implOEMOpt1 = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 2) & 3 ) ; pt_data->implRightForwardWork =IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 4) & 3 ) ; pt_data->implLeftForwardWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 6) & 3 ) ; // pt_data->dataMsgReq is treated separately pt_data->implRightFacingWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 10) & 3 ) ; pt_data->implLeftFacingWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 12) & 3 ) ; pt_data->implRearWork = IsoAgLib::IsoActiveFlag_t( (ui16_temp >> 14) & 3 ) ; if ( mb_cmdWait4Response ) sendMessage(); }
void TracAux_c::processMsg( const CanPkg_c& arc_data ) { CanPkgExt_c pkg( arc_data, getMultitonInst() ); if( !pkg.isValid() || (pkg.getMonitorItemForSA() == NULL) ) return; IsoName_c const& rcc_tempISOName = pkg.getISONameForSA(); unsigned int valveNumber = 15; const int32_t ci32_now = pkg.time(); switch (pkg.isoPgn() /*& 0x3FFFF*/) // don't need to &, as this is the complete PGN anyway... { case AUX_VALVE_0_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_1_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_2_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_3_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_4_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_5_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_6_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_7_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_8_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_9_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_10_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_11_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_12_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_13_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_14_ESTIMATED_FLOW: valveNumber--; case AUX_VALVE_15_ESTIMATED_FLOW: if ( checkParseReceived( rcc_tempISOName ) ) { // sender is allowed to send marr_valve[valveNumber].ui8_extendPortEstFlow = pkg.getUint8Data(0); marr_valve[valveNumber].ui8_retractPortEstFlow = pkg.getUint8Data(1); marr_valve[valveNumber].ui8_estFailSaveMode = ( (pkg.getUint8Data(2) >> 6) & 3 ); marr_valve[valveNumber].ui8_estValveState = ( pkg.getUint8Data(2) & 0xF ); marr_valve[valveNumber].ui8_estValveLimitStatus = ( pkg.getUint8Data(3) >> 5); setSelectedDataSourceISOName (rcc_tempISOName); setUpdateTime( ci32_now ); } else { // there is a sender conflict IsoAgLib::getILibErrInstance().registerNonFatal( IsoAgLib::iLibErr_c::TracMultipleSender, getMultitonInst() ); } break; case AUX_VALVE_0_MEASURED_FLOW: valveNumber--; case AUX_VALVE_1_MEASURED_FLOW: valveNumber--; case AUX_VALVE_2_MEASURED_FLOW: valveNumber--; case AUX_VALVE_3_MEASURED_FLOW: valveNumber--; case AUX_VALVE_4_MEASURED_FLOW: valveNumber--; case AUX_VALVE_5_MEASURED_FLOW: valveNumber--; case AUX_VALVE_6_MEASURED_FLOW: valveNumber--; case AUX_VALVE_7_MEASURED_FLOW: valveNumber--; case AUX_VALVE_8_MEASURED_FLOW: valveNumber--; case AUX_VALVE_9_MEASURED_FLOW: valveNumber--; case AUX_VALVE_10_MEASURED_FLOW: valveNumber--; case AUX_VALVE_11_MEASURED_FLOW: valveNumber--; case AUX_VALVE_12_MEASURED_FLOW: valveNumber--; case AUX_VALVE_13_MEASURED_FLOW: valveNumber--; case AUX_VALVE_14_MEASURED_FLOW: valveNumber--; case AUX_VALVE_15_MEASURED_FLOW: if ( checkParseReceived( rcc_tempISOName ) ) { // sender is allowed to send marr_valve[valveNumber].ui8_extendPortMeasuredFlow = pkg.getUint8Data(0); marr_valve[valveNumber].ui8_retractPortMeasuredFlow = pkg.getUint8Data(1); marr_valve[valveNumber].ui16_extendPortPressure = ( static_cast<uint16_t>(pkg.getUint8Data(2)) + ( static_cast<uint16_t>(pkg.getUint8Data(3)) << 8 ) ); marr_valve[valveNumber].ui16_retractPortPressure = ( static_cast<uint16_t>(pkg.getUint8Data(4)) + ( static_cast<uint16_t>(pkg.getUint8Data(5)) << 8 ) ); marr_valve[valveNumber].ui8_returnPortPressure = pkg.getUint8Data(6); marr_valve[valveNumber].ui8_measuredValveLimitStatus = ( pkg.getUint8Data(7) >> 5 ); setSelectedDataSourceISOName (rcc_tempISOName); setUpdateTime( ci32_now ); } else { // there is a sender conflict