Открыть боковую панель
МОС
Исходные коды
devel
smartcar
Коммиты
7ae2b65e
Коммит
7ae2b65e
создал
Июн 02, 2025
по автору
Коул Милена Ричардовна
Просмотр файлов
remove processTimer
владелец
d8b096f5
Изменения
2
Скрыть пробелы
Построчно
Рядом
vench.cpp
Просмотр файла @
7ae2b65e
...
...
@@ -164,8 +164,6 @@ Vench::Vench(QString kat, QString prt, bool isBluetoothMode, QObject* parent)
mSleep
(
100
);
timer
=
new
QTimer
(
this
);
fl_ans3_ust
=
0
;
ansStatus
=
0
;
...
...
@@ -173,9 +171,6 @@ Vench::Vench(QString kat, QString prt, bool isBluetoothMode, QObject* parent)
// ?????????????????????? //
//checkVibrUst->setChecked( false );
connect
(
timer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
ProcessTimer
()));
timer
->
start
(
200
);
if
(
!
kat
.
isEmpty
())
SetKatalog
(
kat
);
if
(
!
prt
.
isEmpty
())
...
...
@@ -344,284 +339,6 @@ void Vench::ClearSpBeg()
}
}
void
Vench
::
ProcessTimer
()
{
for
(
int
i
=
0
;
i
<
k_hid
;
++
i
)
{
if
(
mas_fl_hid
[
i
]
!=
2
)
{
/*listV->setRowHidden(mas_hid[i], true);
ui->listV->setRowHidden(mas_hid[i], true);
ui->listV_n->setRowHidden(mas_hid[i], true);
list_PANID->setRowHidden(mas_hid[i], true);
ui->list_PANID_n->setRowHidden(mas_hid[i], true);
list_vib->setRowHidden(mas_hid[i], true);
ui->listVibr->setRowHidden(mas_hid[i], true);
ui->listVibr_n->setRowHidden(mas_hid[i], true);
///for new regim prostoy
if ((mas_hid[i] == 0) && (ui->BCar_1))
ui->BCar_1->setEnabled(false);
if ((mas_hid[i] == 1) && (ui->BCar_2))
ui->BCar_2->setEnabled(false);
///end for new regim prostoy*/
}
else
{
/*listV->setRowHidden(mas_hid[i], false);
ui->listV->setRowHidden(mas_hid[i], false);
ui->listV_n->setRowHidden(mas_hid[i], false);
list_PANID->setRowHidden(mas_hid[i], false);
ui->list_PANID_n->setRowHidden(mas_hid[i], false);
list_vib->setRowHidden(mas_hid[i], false);
ui->listVibr->setRowHidden(mas_hid[i], false);
ui->listVibr_n->setRowHidden(mas_hid[i], false);
///for new regim prostoy
if ((mas_hid[i] == 0) && (ui->BCar_1))
ui->BCar_1->setEnabled(true);
if ((mas_hid[i] == 1) && (ui->BCar_2))
ui->BCar_2->setEnabled(true);
///end for new regim prostoy*/
}
}
k_hid
=
0
;
if
(
fl_begin
==
3
)
//regim SUPER_N
{
/*ui->stackedWidget->show();
ui->stackedWidget->setCurrentIndex(2);*/
}
if
(
fl_begin
==
1
)
//regim START
{
//setMinimumSize(QSize( 600, 370));
fl_diskr
=
false
;
/*checkVibrUst->setChecked(true); //chtoby rabotal po algoritmu vibrannih ustroistv
ui->stackedWidget->show();
ui->stackedWidget->setCurrentIndex(0);*/
}
if
(
fl_begin
==
0
)
//regim SUPER
{
/*setMinimumSize(QSize(600, 670));
ui->stackedWidget->hide();
tabWidget2->show();*/
}
if
(
fl_begin
==
2
)
//regim BASE
{
/*setMinimumSize(QSize(600, 370));
ui->stackedWidget->show();
ui->stackedWidget->setCurrentIndex(1);*/
}
if
(
fl_begin
==
4
)
//regim BlueTooth
{
/*setMinimumSize(QSize(600, 370));
ui->stackedWidget->show();
ui->stackedWidget->setCurrentIndex(3);*/
}
/*if(fl_repaint_panid == 1)
{
list_PANID->clear();
int k = listV->count();
if (k > MAX_USTR)
k = 0;
for(int i = 0; i < k; ++i)
{
QString stt;
if (act_ust[i].fl_pan == 1)
stt = QString().setNum(act_ust[i].pan1, 16) + " ";
else
stt ="* ";
list_PANID->addItem(stt);
if (ui->list_PANID_n)
ui->list_PANID_n->addItem(stt);
SetHiddenCar(i, act_ust[i].fl_antisleep);
}
fl_repaint_panid = 0;
}*/
if
(
fl_ans3_ust
==
1
)
{
ansStatus
=
2
;
emit
AnsStatusChanged
();
if
(
flcomport
==
0
)
{
ansStatus
=
0
;
emit
AnsStatusChanged
();
}
fl_ans3_ust
=
0
;
}
if
(
fl_obn_spact
==
1
)
{
/*SpActDatch->clear();
listV->clear();
list_PANID->clear();
ui->list_PANID_n->clear();
//for BASE
ui->listV->clear();
ui->listV_n->clear();*/
if
(
flcomport
!=
0
)
{
ansStatus
=
1
;
emit
AnsStatusChanged
();
}
}
else
if
(
fl_obn_spact
==
2
)
{
/*SpActDatch->insertItem(MAX_USTR, txtAct);
listV->addItem(txtAct);
ui->listV->addItem(txtAct);
ui->listV_n->addItem(txtAct);*/
if
(
kol_ust
>
0
)
{
SetHiddenCar
(
kol_ust
-
1
,
act_ust
[
kol_ust
-
1
].
fl_antisleep
);
//chtoby ne pokazivalsa esli net otveta na komandu ne spat
//SpActDatch->setCurrentIndex(0);
}
}
else
if
(
fl_obn_spact
==
3
)
{
/*SpActDatch->clear();
listV->clear();
ui->listV->clear();
ui->listV_n->clear();*/
ClearSpBeg
();
QString
tt
,
txt
;
for
(
int
i
=
0
;
i
<
kol_ust
;
++
i
)
{
if
(
act_ust
[
i
].
vibr_sp
==
1
)
txt
=
" "
;
else
txt
=
" "
;
tt
.
setNum
(
i
+
1
,
10
);
txt
=
txt
+
tt
+
" : "
;
for
(
int
j
=
0
;
j
<
8
;
++
j
)
{
tt
.
setNum
(
mas_mac_addr
[
i
][
j
],
16
);
txt
=
txt
+
tt
+
" "
;
}
txt
=
txt
+
"; "
;
for
(
int
j
=
0
;
j
<
2
;
++
j
)
{
tt
.
setNum
(
mas_set_addr
[
i
][
j
],
16
);
txt
=
txt
+
tt
+
" "
;
}
if
(
act_ust
[
i
].
fl_sleep
==
0
)
txt
=
txt
+
trUtf8
(
"; без сна; "
);
if
(
act_ust
[
i
].
fl_sleep
==
1
)
txt
=
txt
+
trUtf8
(
"; может спать; "
);
tt
.
setNum
(
act_ust
[
i
].
impl
,
16
);
txt
=
txt
+
tt
+
", "
;
tt
.
setNum
(
act_ust
[
i
].
impr
,
16
);
txt
=
txt
+
tt
;
/*listV->addItem(txt);
ui->listV->addItem(txt);
ui->listV_n->addItem(txt);
///for new regim prostoy
if (i == 0)
ui->BCar_1->setEnabled(true);
if (i == 1)
ui->BCar_2->setEnabled(true);
///end for new regim prostoy*/
SetHiddenCar
(
i
,
act_ust
[
i
].
fl_antisleep
);
}
//SpActDatch->insertItem(MAX_USTR, txt);
fl_repaint_panid
=
1
;
}
else
if
(
fl_obn_spact
==
4
)
{
/*list_vib->clear();
ui->listVibr->clear();
ui->listVibr_n->clear();
int k = listV->count();
if (k > MAX_USTR)
k = 0;
for(int i = 0; i < k; ++i)
{
QString stt;
if (act_ust[i].vibr_sp == 1)
stt = "*";
else
stt = " ";
list_vib->addItem(stt);
ui->listVibr->addItem(stt);
ui->listVibr_n->addItem(stt);
SetHiddenCar(i, act_ust[i].fl_antisleep);
}*/
}
fl_obn_spact
=
0
;
if
(
fl_play
==
0
)
{
// ToDo: проверить изменение текста
/*if(ui->pBPlay->isChecked() == 1)
{
ui->pBPlay->setChecked(0);
ui->pBPlay->setText(trUtf8("Поехали"));
ui->pBPlay->setStyleSheet("background: lightgray");
}*/
}
if
(
fl_unsleep
)
{
if
(
GetTime
()
>
(
TimeNeSpat
+
PER_TIMENESPAT
))
{
#ifdef PRINT_DEBUG
qDebug
(
"Send Comm Ne Spat
\n
"
);
#endif
TimeNeSpat
=
GetTime
();
BPressStop
();
}
}
// init com-port
if
(
flcomport
==
0
)
{
if
((
-
timer_init_port
+
GetTime
())
>
TIMER_INIT_PORT
)
{
QByteArray
rr
=
addr
.
toLocal8Bit
();
qDebug
(
"ustroistvo vvoda-vivoda: %s
\n
"
,
rr
.
constData
());
// smotrim kakoe ustroistvo otkrilos
if
(
COMInit
(
rr
.
constData
())
!=
1
)
qDebug
(
"Error open port Exit
\n
"
);
timer_init_port
=
GetTime
();
}
else
if
(
GetTime
()
>
3
*
timer_init_port
)
timer_init_port
=
GetTime
();
if
(
flcomport
!=
0
)
{
ansStatus
=
1
;
emit
AnsStatusChanged
();
}
mSleep
(
3
);
if
(
!
fl_bluetooth
)
{
SendVklAPI
();
SendVklNP
();
SendZaprosI
();
}
}
// end init com-port
}
// end processtimer
void
Vench
::
BPressZapPANID
()
{
#ifdef PRINT_DEBUG
...
...
vench.h
Просмотр файла @
7ae2b65e
...
...
@@ -402,7 +402,6 @@ public slots:
virtual
void
SpVibr
();
virtual
void
SpVibr_n
();
virtual
void
ProcessTimer
();
virtual
void
ClearSpBeg
();
int
mSleep
(
int
zd
);
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать