Compare commits

...

1 Commits

Author SHA1 Message Date
2a2b1038d6 поддержка 2С6 2025-10-01 11:49:27 +03:00
6 changed files with 77 additions and 25 deletions

View File

@ -42,13 +42,19 @@ 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;
if (abType == 12) { switch (abType) {
ui->lineEdit_2->setText(QString::fromLocal8Bit("2A6")); case grSHILKA:
ui->lineEdit_3->setText(QString::fromLocal8Bit("ÁÌ \"Øèëêà\"")); ui->lineEdit_2->setText(QString::fromLocal8Bit("2A6"));
} else ui->lineEdit_3->setText(QString::fromLocal8Bit("ÁÌ \"Øèëêà\""));
{ break;
ui->lineEdit_2->setText(QString::fromLocal8Bit("9A331")); case grTOR:
ui->lineEdit_3->setText(QString::fromLocal8Bit("ÁÌ \"ÒÎÐ\"")); ui->lineEdit_2->setText(QString::fromLocal8Bit("9A331"));
ui->lineEdit_3->setText(QString::fromLocal8Bit("ÁÌ \"ÒÎÐ\""));
break;
case grTUNGUSKA:
ui->lineEdit_2->setText(QString::fromLocal8Bit("2C6Ì"));
ui->lineEdit_3->setText(QString::fromLocal8Bit("Òóíãóñêà"));
break;
} }
} }
} }

View File

@ -6,7 +6,7 @@ groundObj::groundObj( )
x=y=type=0; x=y=type=0;
exist=true; exist=true;
boegotov = false; boegotov = false;
type = 0; type = grBASE;
n_Ab = 0; n_Ab = 0;
pic = QImage(":/new/pics/ground0.xpm"); pic = QImage(":/new/pics/ground0.xpm");
@ -125,18 +125,15 @@ 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==1 || type == 12) // type == 1 is TOR, type == 12 is Shilks if (type==grTOR || type == grSHILKA || type == grTUNGUSKA) {
{ if (priznakSektor) {
if (priznakSektor)
{
br = p->brush(); br = p->brush();
br.setStyle(Qt::NoBrush); br.setStyle(Qt::NoBrush);
p->setBrush(br); p->setBrush(br);
@ -145,7 +142,20 @@ void groundObj::paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidg
pen.setStyle(Qt::DashLine); pen.setStyle(Qt::DashLine);
p->setPen(pen); p->setPen(pen);
const qreal elRadius = (type==12) ? 25 : 160; qreal elRadius = 0;
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);
@ -245,18 +255,25 @@ void groundObj::setType(int t)
prepareGeometryChange(); prepareGeometryChange();
type=t; type=t;
if (t==0) switch (t) {
{ case grBASE:
pic = QImage(":/new/pics/ground0.xpm"); pic = QImage(":/new/pics/ground0.xpm");
} break;
if (t==1) case grTOR:
{
pic = QImage(":/new/pics/tor2.xpm"); pic = QImage(":/new/pics/tor2.xpm");
initRockets(8, 4); initRockets(8, 4);
} break;
if (t==12) { case grSHILKA:
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;
} }
} }
} }

View File

@ -10,6 +10,13 @@
#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);

View File

@ -24,5 +24,6 @@
<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>

21
pics/tung.xpm Normal file
View File

@ -0,0 +1,21 @@
/* XPM */
static char * tung_bmp[] = {
"16 16 2 1",
". c #ff0000",
"! c None",
"!!!!!!...!!!!!!!",
"!!!!!.!!!.!!!!!!",
"!!!!.!!!!!.!!!!!",
"!!!.!!!!!!!.!!!!",
"!!.!!!..!!...!!!",
"!.!!!!!!!!!.!.!!",
".!!..!!!!!!.!!.!",
".!..........!!.!",
".!!..!!!!!!.!!.!",
"!.!!!!!!!!!.!.!!",
"!!.!!!..!!...!!!",
"!!!.!!!!!!!.!!!!",
"!!!!.!!!!!.!!!!!",
"!!!!!.!!!.!!!!!!",
"!!!!!!...!!!!!!!",
"!!!!!!!!!!!!!!!!"};

View File

@ -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(1); grObj[1]->setType(grTOR);
grObj[1]->setBoegotov(false); grObj[1]->setBoegotov(false);
grObj[2]->setPos(QPointF(150, 0)); grObj[2]->setPos(QPointF(150, 0));
grObj[2]->setType(1); grObj[2]->setType(grSHILKA);
grObj[2]->setBoegotov(false); grObj[2]->setBoegotov(false);
grObj[3]->setPos(QPointF(0, -100)); grObj[3]->setPos(QPointF(0, -100));
grObj[3]->setType(1); grObj[3]->setType(grTUNGUSKA);
// grObj[3]->setSektor(30,170); // grObj[3]->setSektor(30,170);
grObj[3]->setBoegotov(false); grObj[3]->setBoegotov(false);