diff --git a/companion/src/printdialog.cpp b/companion/src/printdialog.cpp index 0d5740de6..f243d5785 100644 --- a/companion/src/printdialog.cpp +++ b/companion/src/printdialog.cpp @@ -85,8 +85,14 @@ void PrintDialog::printSetup() str.append(fv(tr("EEprom Size"), QString("%1").arg(firmware->getEepromInterface()->getSize(*g_model)))); str.append(fv(tr("Timer1"), getTimerStr(g_model->timers[0]))); //value, mode, count up/down str.append(fv(tr("Timer2"), getTimerStr(g_model->timers[1]))); //value, mode, count up/down - str.append(fv(tr("Protocol"), getProtocol(g_model))); //proto, numch, delay, - str.append(fv(tr("Pulse Polarity"), g_model->moduleData[0].polarityToString())); + if (firmware->getCapability(NumModules)>1) { + str.append(""+tr("Internal module")+"
"); //proto, numch, delay, + } + str.append(fv(tr("Protocol"), getProtocol(g_model->moduleData[0]))); //proto, numch, delay, + if (firmware->getCapability(NumModules)>1) { + str.append(""+tr("External module")+"
"); //proto, numch, delay, + str.append(fv(tr("Protocol"), getProtocol(g_model->moduleData[1]))); //proto, numch, delay, + } str.append(fv(tr("Throttle Trim"), g_model->thrTrim ? tr("Enabled") : tr("Disabled"))); str.append(fv(tr("Trim Increment"), getTrimInc(g_model))); str.append(fv(tr("Center Beep"), getCenterBeepStr(g_model))); // specify which channels beep @@ -436,7 +442,7 @@ void PrintDialog::printLimits() void PrintDialog::printCurves() { - int i,r,g,b,c,count; + int i,r,g,b,c,count,usedcurves=0; char buffer[16]; QPen pen(Qt::black, 2, Qt::SolidLine); @@ -447,27 +453,38 @@ void PrintDialog::printCurves() if (numcurves==0) { numcurves=16; } - { - QImage qi(ISIZEW+1,ISIZEW+1,QImage::Format_RGB32); - QPainter painter(&qi); - painter.setBrush(QBrush("#FFFFFF")); - painter.setPen(QColor(0,0,0)); - painter.drawRect(0,0,ISIZEW,ISIZEW); - str.append(""+QString("
").arg(curvefile5)); - for(i=0; i"); - str.append(QString("").arg(i+1)); - if(i%2) str.append(""); + + QImage qi(ISIZEW+1,ISIZEW+1,QImage::Format_RGB32); + QPainter painter(&qi); + painter.setBrush(QBrush("#FFFFFF")); + painter.setPen(QColor(0,0,0)); + painter.drawRect(0,0,ISIZEW,ISIZEW); + str.append("
").arg(buffer)+tr("Curve")+QString(" %1
"+QString("
").arg(curvefile5)); + for(i=0; icurves[i].count; + count=0; + for(int j=0; jcurves[i].points[j].y!=0) + count++; } + if ((count>0) || (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)|| (g_model->curves[i].count !=5)) { + if(usedcurves%2 == 0) str.append(""); + str.append(QString("").arg(i+1)); + if(usedcurves%2) str.append(""); + usedcurves++; + } + } + if (!(usedcurves%2)) str.append(""); + if (usedcurves!=0) { str.append("
").arg(buffer)+tr("Curve")+QString(" %1
"); str.append(""); str.append(doTC(" ")); @@ -481,48 +498,50 @@ void PrintDialog::printCurves() str.append(doTC(tr("pt %1").arg(i+1), "", true)); str.append(""); for(i=0; i"); int curvepoints=g_model->curves[i].count; - if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) - str.append(QString("").arg(i+1)); - else - str.append(QString("").arg(i+1)); count=0; for(int j=0; jcurves[i].points[j].y!=0) count++; } - for(int j=0; jcurves[i].points[j].y),"green")); - if (j>0 && count!=0) { - if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) - painter.drawLine(ISIZEW/2+(ISIZEW*g_model->curves[i].points[j-1].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW/2+(ISIZEW*g_model->curves[i].points[j].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); - else - painter.drawLine(ISIZEW*(j-1)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW*(j)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); - } - } - for(int j=curvepoints; j"); - if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) { - str.append(""); + if ((count>0) || (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM)) { + pen.setColor(colors[i]); + painter.setPen(pen); + colors[i].getRgb(&r,&g,&b); + c=r; + c*=256; + c+=g; + c*=256; + c+=b; + sprintf(buffer,"%06x",c); + str.append(""); + if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) + str.append(QString("").arg(i+1)); + else + str.append(QString("").arg(i+1)); for(int j=0; jcurves[i].points[j].x),"green")); + str.append(doTR(QString::number(g_model->curves[i].points[j].y),"green")); + if (j>0 && (count!=0 ||(g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM))) { + if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) + painter.drawLine(ISIZEW/2+(ISIZEW*g_model->curves[i].points[j-1].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW/2+(ISIZEW*g_model->curves[i].points[j].x)/200,ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); + else + painter.drawLine(ISIZEW*(j-1)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j-1].y)/200,ISIZEW*(j)/(curvepoints-1),ISIZEW/2-(ISIZEW*g_model->curves[i].points[j].y)/200); + } } for(int j=curvepoints; j"); + str.append(""); + if (g_model->curves[i].type == CurveData::CURVE_TYPE_CUSTOM) { + str.append(""); + for(int j=0; jcurves[i].points[j].x),"green")); + } + for(int j=curvepoints; j"); + } } } str.append("
").arg(buffer)+tr("Curve")+QString(" %1Y").arg(buffer)+tr("Curve")+QString(" %1Y
X
").arg(buffer)+tr("Curve")+QString(" %1Y").arg(buffer)+tr("Curve")+QString(" %1Y
X
"); @@ -534,11 +553,9 @@ void PrintDialog::printCurves() painter.drawLine(ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5,(ISIZEW*i)/(20)); painter.drawLine((ISIZEW*i)/(20),ISIZEW/2-5,(ISIZEW*i)/(20),ISIZEW/2+5); } - qi.save(curvefile5, "png",100); - + te->append(str); } - te->append(str); } void PrintDialog::printSwitches()