/*********************************************************************************/ /********** THIS FILE IS GENERATED BY TOUCHGFX DESIGNER, DO NOT MODIFY ***********/ /*********************************************************************************/ #include #include #include #include #include DriverViewViewBase::DriverViewViewBase() : updateItemCallback(this, &DriverViewViewBase::updateItemCallbackHandler) { touchgfx::CanvasWidgetRenderer::setupBuffer(canvasBuffer, CANVAS_BUFFER_SIZE); __background.setPosition(0, 0, 480, 320); __background.setColor(touchgfx::Color::getColorFromRGB(0, 0, 0)); add(__background); tireTempRR.setXY(240, 197); add(tireTempRR); tireTempFR.setXY(240, 122); add(tireTempFR); tireTempRL.setXY(165, 197); add(tireTempRL); tireTempFL.setXY(165, 122); add(tireTempFL); ttDivVert.setPosition(239, 122, 3, 150); ttDivVertPainter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255)); ttDivVert.setPainter(ttDivVertPainter); ttDivVert.setStart(0, 0); ttDivVert.setEnd(0, 320); ttDivVert.setLineWidth(10); ttDivVert.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING); add(ttDivVert); ttDivHoriz.setPosition(165, 196, 150, 3); ttDivHorizPainter.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255)); ttDivHoriz.setPainter(ttDivHorizPainter); ttDivHoriz.setStart(0, 0); ttDivHoriz.setEnd(480, 0); ttDivHoriz.setLineWidth(10); ttDivHoriz.setLineEndingStyle(touchgfx::Line::ROUND_CAP_ENDING); add(ttDivHoriz); tsSoC.setXY(15, 122); tsSoC.setProgressIndicatorPosition(0, 0, 40, 150); tsSoC.setRange(0, 100); tsSoC.setBackground(touchgfx::Bitmap(BITMAP_BAT_BAR_BG_ID)); tsSoCPainter.setColor(touchgfx::Color::getColorFromRGB(136, 255, 0)); tsSoC.setPainter(tsSoCPainter); tsSoC.setStart(9, 150); tsSoC.setEnd(9, 0); tsSoC.setLineWidth(100); tsSoC.setLineEndingStyle(touchgfx::Line::BUTT_CAP_ENDING); tsSoC.setValue(60); add(tsSoC); lvSoC.setXY(425, 122); lvSoC.setProgressIndicatorPosition(0, 0, 40, 150); lvSoC.setRange(0, 100); lvSoC.setBackground(touchgfx::Bitmap(BITMAP_BAT_BAR_BG_ID)); lvSoCPainter.setColor(touchgfx::Color::getColorFromRGB(136, 255, 0)); lvSoC.setPainter(lvSoCPainter); lvSoC.setStart(9, 150); lvSoC.setEnd(9, 0); lvSoC.setLineWidth(100); lvSoC.setLineEndingStyle(touchgfx::Line::BUTT_CAP_ENDING); lvSoC.setValue(80); add(lvSoC); tireLabel.setPosition(165, 97, 150, 25); tireLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255)); tireLabel.setLinespacing(0); tireLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_H6UX)); add(tireLabel); tsSoCLabel.setPosition(15, 97, 40, 25); tsSoCLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255)); tsSoCLabel.setLinespacing(0); tsSoCLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_PHFD)); add(tsSoCLabel); lvSoCLabel.setPosition(425, 97, 40, 25); lvSoCLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255)); lvSoCLabel.setLinespacing(0); lvSoCLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_4OBM)); add(lvSoCLabel); field1.setXY(15, 15); add(field1); field2.setXY(165, 15); add(field2); field3.setXY(315, 15); add(field3); fieldTypeSelection.setPosition(15, 95, 150, 225); fieldTypeSelection.setHorizontal(false); fieldTypeSelection.setCircular(true); fieldTypeSelection.setEasingEquation(touchgfx::EasingEquations::linearEaseOut); fieldTypeSelection.setSwipeAcceleration(10); fieldTypeSelection.setDragAcceleration(10); fieldTypeSelection.setNumberOfItems(1); fieldTypeSelection.setSelectedItemOffset(94); fieldTypeSelection.setDrawableSize(26, 0); fieldTypeSelection.setDrawables(fieldTypeSelectionListItems, updateItemCallback); fieldTypeSelection.animateToItem(0, 0); fieldTypeSelection.setVisible(false); add(fieldTypeSelection); progressBar.setXY(15, 280); progressBar.setProgressIndicatorPosition(0, 0, 480, 55); progressBar.setRange(0, 100); progressBar.setDirection(touchgfx::AbstractDirectionProgress::RIGHT); progressBar.setBackground(touchgfx::Bitmap(BITMAP_PRECHARGE_BG_ID)); progressBar.setColor(touchgfx::Color::getColorFromRGB(99, 186, 0)); progressBar.setValue(0); progressBar.setVisible(false); add(progressBar); prechargeLabel.setXY(105, 275); prechargeLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255)); prechargeLabel.setLinespacing(0); prechargeLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_HMH2)); prechargeLabel.setVisible(false); add(prechargeLabel); r2dLabel.setPosition(139, 275, 202, 37); r2dLabel.setColor(touchgfx::Color::getColorFromRGB(255, 255, 255)); r2dLabel.setLinespacing(0); r2dLabel.setTypedText(touchgfx::TypedText(T___SINGLEUSE_NGUK)); r2dLabel.setVisible(false); add(r2dLabel); } DriverViewViewBase::~DriverViewViewBase() { touchgfx::CanvasWidgetRenderer::resetBuffer(); } void DriverViewViewBase::setupScreen() { tireTempRR.initialize(); tireTempFR.initialize(); tireTempRL.initialize(); tireTempFL.initialize(); field1.initialize(); field2.initialize(); field3.initialize(); fieldTypeSelection.initialize(); for (int i = 0; i < fieldTypeSelectionListItems.getNumberOfDrawables(); i++) { fieldTypeSelectionListItems[i].initialize(); } } void DriverViewViewBase::handleKeyEvent(uint8_t key) { if(22 == key) { //SelectPreviousField //When hardware button 22 clicked call virtual function //Call selectPrevField selectPrevField(); } if(21 == key) { //SelectNextField //When hardware button 21 clicked call virtual function //Call selectNextField selectNextField(); } if(24 == key) { //SelectPreviousFieldType //When hardware button 24 clicked call virtual function //Call selectPrevFieldType selectPrevFieldType(); } if(23 == key) { //SelectNextFieldType //When hardware button 23 clicked call virtual function //Call selectNextFieldType selectNextFieldType(); } if(6 == key) { //ConfirmFieldType //When hardware button 6 clicked call virtual function //Call confirmFieldType confirmFieldType(); } } void DriverViewViewBase::updateItemCallbackHandler(touchgfx::DrawableListItemsInterface* items, int16_t containerIndex, int16_t itemIndex) { if (items == &fieldTypeSelectionListItems) { touchgfx::Drawable* d = items->getDrawable(containerIndex); DriverViewFieldSelection* cc = (DriverViewFieldSelection*)d; fieldTypeSelectionUpdateItem(*cc, itemIndex); } }