поддержка 2С6

This commit is contained in:
Vorpal 2025-10-01 11:49:27 +03:00
parent 8eb3c21b34
commit 2a2b1038d6
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();
if (p) {
const int abType = p->grObj[n_ab]->type;
if (abType == 12) {
switch (abType) {
case grSHILKA:
ui->lineEdit_2->setText(QString::fromLocal8Bit("2A6"));
ui->lineEdit_3->setText(QString::fromLocal8Bit("ÁÌ \"Øèëêà\""));
} else
{
break;
case grTOR:
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;
exist=true;
boegotov = false;
type = 0;
type = grBASE;
n_Ab = 0;
pic = QImage(":/new/pics/ground0.xpm");
@ -125,18 +125,15 @@ void groundObj::paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidg
QFont f;
QString s, s1;
if (exist)
{
if (exist) {
p0 = QPointF(x,y);
p->setPen(Qt::green);
p->drawEllipse(p0, 0.5, 0.5);
if (type==1 || type == 12) // type == 1 is TOR, type == 12 is Shilks
{
if (priznakSektor)
{
if (type==grTOR || type == grSHILKA || type == grTUNGUSKA) {
if (priznakSektor) {
br = p->brush();
br.setStyle(Qt::NoBrush);
p->setBrush(br);
@ -145,7 +142,20 @@ void groundObj::paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidg
pen.setStyle(Qt::DashLine);
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);
pen.setColor(Qt::cyan);
@ -245,18 +255,25 @@ void groundObj::setType(int t)
prepareGeometryChange();
type=t;
if (t==0)
{
switch (t) {
case grBASE:
pic = QImage(":/new/pics/ground0.xpm");
}
if (t==1)
{
break;
case grTOR:
pic = QImage(":/new/pics/tor2.xpm");
initRockets(8, 4);
}
if (t==12) {
break;
case grSHILKA:
pic = QImage(":/new/pics/sh.xpm");
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 <cmath>
enum grObjType {
grBASE = 0,
grTOR = 1,
grSHILKA = 12,
grTUNGUSKA = 18
};
class groundObj : public QGraphicsItem
{
void initRockets(int _allR, int _activeR);

View File

@ -24,5 +24,6 @@
<file>pics/alt3.xpm</file>
<file>pics/alt00.xpm</file>
<file>pics/sh.xpm</file>
<file>pics/tung.xpm</file>
</qresource>
</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[1]->setPos(QPointF(0, 150));
grObj[1]->setType(1);
grObj[1]->setType(grTOR);
grObj[1]->setBoegotov(false);
grObj[2]->setPos(QPointF(150, 0));
grObj[2]->setType(1);
grObj[2]->setType(grSHILKA);
grObj[2]->setBoegotov(false);
grObj[3]->setPos(QPointF(0, -100));
grObj[3]->setType(1);
grObj[3]->setType(grTUNGUSKA);
// grObj[3]->setSektor(30,170);
grObj[3]->setBoegotov(false);