Compare commits
No commits in common. "add_Tunguska" and "main" have entirely different histories.
add_Tungus
...
main
@ -42,19 +42,13 @@ void abnticket::fillUi(int n_ab) {
|
|||||||
Widget *p = (Widget*)this->parentWidget();
|
Widget *p = (Widget*)this->parentWidget();
|
||||||
if (p) {
|
if (p) {
|
||||||
const int abType = p->grObj[n_ab]->type;
|
const int abType = p->grObj[n_ab]->type;
|
||||||
switch (abType) {
|
if (abType == 12) {
|
||||||
case grSHILKA:
|
ui->lineEdit_2->setText(QString::fromLocal8Bit("2A6"));
|
||||||
ui->lineEdit_2->setText(QString::fromLocal8Bit("2A6"));
|
ui->lineEdit_3->setText(QString::fromLocal8Bit("ÁÌ \"Øèëêà\""));
|
||||||
ui->lineEdit_3->setText(QString::fromLocal8Bit("ÁÌ \"Øèëêà\""));
|
} else
|
||||||
break;
|
{
|
||||||
case grTOR:
|
ui->lineEdit_2->setText(QString::fromLocal8Bit("9A331"));
|
||||||
ui->lineEdit_2->setText(QString::fromLocal8Bit("9A331"));
|
ui->lineEdit_3->setText(QString::fromLocal8Bit("ÁÌ \"ÒÎÐ\""));
|
||||||
ui->lineEdit_3->setText(QString::fromLocal8Bit("ÁÌ \"ÒÎÐ\""));
|
|
||||||
break;
|
|
||||||
case grTUNGUSKA:
|
|
||||||
ui->lineEdit_2->setText(QString::fromLocal8Bit("2C6Ì"));
|
|
||||||
ui->lineEdit_3->setText(QString::fromLocal8Bit("Òóíãóñêà"));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ groundObj::groundObj( )
|
|||||||
x=y=type=0;
|
x=y=type=0;
|
||||||
exist=true;
|
exist=true;
|
||||||
boegotov = false;
|
boegotov = false;
|
||||||
type = grBASE;
|
type = 0;
|
||||||
n_Ab = 0;
|
n_Ab = 0;
|
||||||
pic = QImage(":/new/pics/ground0.xpm");
|
pic = QImage(":/new/pics/ground0.xpm");
|
||||||
|
|
||||||
@ -125,15 +125,18 @@ void groundObj::paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidg
|
|||||||
QFont f;
|
QFont f;
|
||||||
QString s, s1;
|
QString s, s1;
|
||||||
|
|
||||||
if (exist) {
|
if (exist)
|
||||||
|
{
|
||||||
p0 = QPointF(x,y);
|
p0 = QPointF(x,y);
|
||||||
|
|
||||||
p->setPen(Qt::green);
|
p->setPen(Qt::green);
|
||||||
p->drawEllipse(p0, 0.5, 0.5);
|
p->drawEllipse(p0, 0.5, 0.5);
|
||||||
|
|
||||||
|
|
||||||
if (type==grTOR || type == grSHILKA || type == grTUNGUSKA) {
|
if (type==1 || type == 12) // type == 1 is TOR, type == 12 is Shilks
|
||||||
if (priznakSektor) {
|
{
|
||||||
|
if (priznakSektor)
|
||||||
|
{
|
||||||
br = p->brush();
|
br = p->brush();
|
||||||
br.setStyle(Qt::NoBrush);
|
br.setStyle(Qt::NoBrush);
|
||||||
p->setBrush(br);
|
p->setBrush(br);
|
||||||
@ -142,20 +145,7 @@ void groundObj::paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidg
|
|||||||
pen.setStyle(Qt::DashLine);
|
pen.setStyle(Qt::DashLine);
|
||||||
p->setPen(pen);
|
p->setPen(pen);
|
||||||
|
|
||||||
qreal elRadius = 0;
|
const qreal elRadius = (type==12) ? 25 : 160;
|
||||||
switch (type) {
|
|
||||||
case grTOR:
|
|
||||||
elRadius = 160;
|
|
||||||
break;
|
|
||||||
case grSHILKA:
|
|
||||||
elRadius = 25;
|
|
||||||
break;
|
|
||||||
case grTUNGUSKA:
|
|
||||||
elRadius = 100;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
elRadius = 0;
|
|
||||||
}
|
|
||||||
p->drawEllipse(p0, elRadius, elRadius);
|
p->drawEllipse(p0, elRadius, elRadius);
|
||||||
|
|
||||||
pen.setColor(Qt::cyan);
|
pen.setColor(Qt::cyan);
|
||||||
@ -255,25 +245,18 @@ void groundObj::setType(int t)
|
|||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
type=t;
|
type=t;
|
||||||
|
|
||||||
switch (t) {
|
if (t==0)
|
||||||
case grBASE:
|
{
|
||||||
pic = QImage(":/new/pics/ground0.xpm");
|
pic = QImage(":/new/pics/ground0.xpm");
|
||||||
break;
|
}
|
||||||
case grTOR:
|
if (t==1)
|
||||||
|
{
|
||||||
pic = QImage(":/new/pics/tor2.xpm");
|
pic = QImage(":/new/pics/tor2.xpm");
|
||||||
initRockets(8, 4);
|
initRockets(8, 4);
|
||||||
break;
|
}
|
||||||
case grSHILKA:
|
if (t==12) {
|
||||||
pic = QImage(":/new/pics/sh.xpm");
|
pic = QImage(":/new/pics/sh.xpm");
|
||||||
initRockets(4, 1);
|
initRockets(4, 1);
|
||||||
break;
|
|
||||||
case grTUNGUSKA:
|
|
||||||
pic = QImage(":/new/pics/tung.xpm");
|
|
||||||
initRockets(4, 1);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
pic = QImage();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,13 +10,6 @@
|
|||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
enum grObjType {
|
|
||||||
grBASE = 0,
|
|
||||||
grTOR = 1,
|
|
||||||
grSHILKA = 12,
|
|
||||||
grTUNGUSKA = 18
|
|
||||||
};
|
|
||||||
|
|
||||||
class groundObj : public QGraphicsItem
|
class groundObj : public QGraphicsItem
|
||||||
{
|
{
|
||||||
void initRockets(int _allR, int _activeR);
|
void initRockets(int _allR, int _activeR);
|
||||||
|
|||||||
1
pics.qrc
1
pics.qrc
@ -24,6 +24,5 @@
|
|||||||
<file>pics/alt3.xpm</file>
|
<file>pics/alt3.xpm</file>
|
||||||
<file>pics/alt00.xpm</file>
|
<file>pics/alt00.xpm</file>
|
||||||
<file>pics/sh.xpm</file>
|
<file>pics/sh.xpm</file>
|
||||||
<file>pics/tung.xpm</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@ -1,21 +0,0 @@
|
|||||||
/* XPM */
|
|
||||||
static char * tung_bmp[] = {
|
|
||||||
"16 16 2 1",
|
|
||||||
". c #ff0000",
|
|
||||||
"! c None",
|
|
||||||
"!!!!!!...!!!!!!!",
|
|
||||||
"!!!!!.!!!.!!!!!!",
|
|
||||||
"!!!!.!!!!!.!!!!!",
|
|
||||||
"!!!.!!!!!!!.!!!!",
|
|
||||||
"!!.!!!..!!...!!!",
|
|
||||||
"!.!!!!!!!!!.!.!!",
|
|
||||||
".!!..!!!!!!.!!.!",
|
|
||||||
".!..........!!.!",
|
|
||||||
".!!..!!!!!!.!!.!",
|
|
||||||
"!.!!!!!!!!!.!.!!",
|
|
||||||
"!!.!!!..!!...!!!",
|
|
||||||
"!!!.!!!!!!!.!!!!",
|
|
||||||
"!!!!.!!!!!.!!!!!",
|
|
||||||
"!!!!!.!!!.!!!!!!",
|
|
||||||
"!!!!!!...!!!!!!!",
|
|
||||||
"!!!!!!!!!!!!!!!!"};
|
|
||||||
@ -69,17 +69,17 @@ Widget::Widget(QWidget *parent) :
|
|||||||
grObj[0]->setBoegotov(true);
|
grObj[0]->setBoegotov(true);
|
||||||
|
|
||||||
grObj[1]->setPos(QPointF(0, 150));
|
grObj[1]->setPos(QPointF(0, 150));
|
||||||
grObj[1]->setType(grTOR);
|
grObj[1]->setType(1);
|
||||||
grObj[1]->setBoegotov(false);
|
grObj[1]->setBoegotov(false);
|
||||||
|
|
||||||
|
|
||||||
grObj[2]->setPos(QPointF(150, 0));
|
grObj[2]->setPos(QPointF(150, 0));
|
||||||
grObj[2]->setType(grSHILKA);
|
grObj[2]->setType(1);
|
||||||
grObj[2]->setBoegotov(false);
|
grObj[2]->setBoegotov(false);
|
||||||
|
|
||||||
|
|
||||||
grObj[3]->setPos(QPointF(0, -100));
|
grObj[3]->setPos(QPointF(0, -100));
|
||||||
grObj[3]->setType(grTUNGUSKA);
|
grObj[3]->setType(1);
|
||||||
// grObj[3]->setSektor(30,170);
|
// grObj[3]->setSektor(30,170);
|
||||||
grObj[3]->setBoegotov(false);
|
grObj[3]->setBoegotov(false);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user