1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 00:35:18 +03:00

Issue #875 fixed

This commit is contained in:
bsongis 2014-03-27 16:29:45 +01:00
parent e24301cf13
commit 6d1ad5d121
4 changed files with 43 additions and 41 deletions

View file

@ -4,6 +4,41 @@
#include "simulatordialog.h" #include "simulatordialog.h"
#include "flashinterface.h" #include "flashinterface.h"
const QColor colors[C9X_MAX_CURVES] = {
QColor(0,0,127),
QColor(0,127,0),
QColor(127,0,0),
QColor(0,127,127),
QColor(127,0,127),
QColor(127,127,0),
QColor(127,127,127),
QColor(0,0,255),
QColor(0,127,255),
QColor(127,0,255),
QColor(0,255,0),
QColor(0,255,127),
QColor(127,255,0),
QColor(255,0,0),
QColor(255,0,127),
QColor(255,127,0),
QColor(0,0,127),
QColor(0,127,0),
QColor(127,0,0),
QColor(0,127,127),
QColor(127,0,127),
QColor(127,127,0),
QColor(127,127,127),
QColor(0,0,255),
QColor(0,127,255),
QColor(127,0,255),
QColor(0,255,0),
QColor(0,255,127),
QColor(127,255,0),
QColor(255,0,0),
QColor(255,0,127),
QColor(255,127,0),
};
QString getPhaseName(int val, char * phasename) QString getPhaseName(int val, char * phasename)
{ {
if (!val) return "---"; if (!val) return "---";

View file

@ -4,6 +4,8 @@
#include <QtGui> #include <QtGui>
#include "eeprominterface.h" #include "eeprominterface.h"
extern const QColor colors[C9X_MAX_CURVES];
#define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetEepromInterface()->getCapability(LogicalSwitches)-1) #define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetEepromInterface()->getCapability(LogicalSwitches)-1)
//convert from mode 1 to mode generalSettings.stickMode //convert from mode 1 to mode generalSettings.stickMode

View file

@ -10,25 +10,6 @@
#define GFX_MARGIN 16 #define GFX_MARGIN 16
static const QColor colors[C9X_MAX_CURVES] = {
QColor(0,0,127),
QColor(0,127,0),
QColor(127,0,0),
QColor(0,127,127),
QColor(127,0,127),
QColor(127,127,0),
QColor(127,127,127),
QColor(0,0,255),
QColor(0,127,255),
QColor(127,0,255),
QColor(0,255,0),
QColor(0,255,127),
QColor(127,255,0),
QColor(255,0,0),
QColor(255,0,127),
QColor(255,127,0),
};
#if 0 #if 0
#ifdef __APPLE__ #ifdef __APPLE__
ui->curveEdit_1->setStyleSheet("color: #00007f;"); ui->curveEdit_1->setStyleSheet("color: #00007f;");

View file

@ -42,7 +42,8 @@ printDialog::printDialog(QWidget *parent, GeneralSettings *gg, ModelData *gm, QS
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) { if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
gvars=1; gvars=1;
} }
} else { }
else {
gvars=1; gvars=1;
} }
@ -519,23 +520,6 @@ void printDialog::printCurves()
int i,r,g,b,c,count; int i,r,g,b,c,count;
char buffer[16]; char buffer[16];
QPen pen(Qt::black, 2, Qt::SolidLine); QPen pen(Qt::black, 2, Qt::SolidLine);
QColor * qplot_color[16];
qplot_color[0]=new QColor(0,0,127);
qplot_color[1]=new QColor(0,127,0);
qplot_color[2]=new QColor(127,0,0);
qplot_color[3]=new QColor(0,127,127);
qplot_color[4]=new QColor(127,0,127);
qplot_color[5]=new QColor(127,127,0);
qplot_color[6]=new QColor(127,127,127);
qplot_color[7]=new QColor(0,0,255);
qplot_color[8]=new QColor(0,127,255);
qplot_color[9]=new QColor(127,0,255);
qplot_color[10]=new QColor(0,200,0);
qplot_color[11]=new QColor(0,200,127);
qplot_color[12]=new QColor(127,200,0);
qplot_color[13]=new QColor(255,0,0);
qplot_color[14]=new QColor(255,0,127);
qplot_color[15]=new QColor(255,127,0);
QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-before:auto;\" width=\"100%\"><tr><td><h2>"; QString str = "<table border=1 cellspacing=0 cellpadding=3 style=\"page-break-before:auto;\" width=\"100%\"><tr><td><h2>";
str.append(tr("Curves")); str.append(tr("Curves"));
@ -552,9 +536,9 @@ void printDialog::printCurves()
painter.drawRect(0,0,ISIZEW,ISIZEW); painter.drawRect(0,0,ISIZEW,ISIZEW);
str.append("<table border=0 cellspacing=0 cellpadding=3 width=\"100%\">"+QString("<tr><td width=\"400\"><img src=\"%1\" border=0></td><td><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">").arg(curvefile5)); str.append("<table border=0 cellspacing=0 cellpadding=3 width=\"100%\">"+QString("<tr><td width=\"400\"><img src=\"%1\" border=0></td><td><table border=1 cellspacing=0 cellpadding=3 width=\"100%\">").arg(curvefile5));
for(i=0; i<numcurves; i++) { for(i=0; i<numcurves; i++) {
pen.setColor(*qplot_color[i]); pen.setColor(colors[i]);
painter.setPen(pen); painter.setPen(pen);
qplot_color[i]->getRgb(&r,&g,&b); colors[i].getRgb(&r,&g,&b);
c=r; c=r;
c*=256; c*=256;
c+=g; c+=g;
@ -576,9 +560,9 @@ void printDialog::printCurves()
str.append(doTC(tr("pt %1").arg(i+1), "", true)); str.append(doTC(tr("pt %1").arg(i+1), "", true));
str.append("</tr>"); str.append("</tr>");
for(i=0; i<numcurves; i++) { for(i=0; i<numcurves; i++) {
pen.setColor(*qplot_color[i]); pen.setColor(colors[i]);
painter.setPen(pen); painter.setPen(pen);
qplot_color[i]->getRgb(&r,&g,&b); colors[i].getRgb(&r,&g,&b);
c=r; c=r;
c*=256; c*=256;
c+=g; c+=g;