|
|
@ -182,10 +182,10 @@ void KNutMainWindow::setConfig (unsigned int changeSetting) {
|
|
|
|
|
|
|
|
|
|
|
|
//qDebug ("KNutMainWindow::setConfig");
|
|
|
|
//qDebug ("KNutMainWindow::setConfig");
|
|
|
|
KNutVarData::VarStrucDef analogMemberData;
|
|
|
|
KNutVarData::VarStrucDef analogMemberData;
|
|
|
|
bool tqrepaintVoltagePanels = false;
|
|
|
|
bool repaintVoltagePanels = false;
|
|
|
|
bool tqrepaintFrequencyPanels = false;
|
|
|
|
bool repaintFrequencyPanels = false;
|
|
|
|
bool tqrepaintAllPanels = false;
|
|
|
|
bool repaintAllPanels = false;
|
|
|
|
bool tqrepaintOAPanels = false;
|
|
|
|
bool repaintOAPanels = false;
|
|
|
|
|
|
|
|
|
|
|
|
// Main Setting
|
|
|
|
// Main Setting
|
|
|
|
|
|
|
|
|
|
|
@ -236,8 +236,8 @@ void KNutMainWindow::setConfig (unsigned int changeSetting) {
|
|
|
|
m_analogRecords->setFrequency(50);
|
|
|
|
m_analogRecords->setFrequency(50);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_analogRecords->setXfer(m_lowXfer,m_highXfer);
|
|
|
|
m_analogRecords->setXfer(m_lowXfer,m_highXfer);
|
|
|
|
tqrepaintVoltagePanels = true;
|
|
|
|
repaintVoltagePanels = true;
|
|
|
|
tqrepaintFrequencyPanels = true;
|
|
|
|
repaintFrequencyPanels = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
@ -246,12 +246,12 @@ void KNutMainWindow::setConfig (unsigned int changeSetting) {
|
|
|
|
if ((changeSetting & KNutPrefDlg::ChangeVoltage) || ((changeSetting & KNutPrefDlg::ChangeXFer))) {
|
|
|
|
if ((changeSetting & KNutPrefDlg::ChangeVoltage) || ((changeSetting & KNutPrefDlg::ChangeXFer))) {
|
|
|
|
// byla aktivovana zmena napeti nebo zmena xfer a zaroven ho ups podporuje
|
|
|
|
// byla aktivovana zmena napeti nebo zmena xfer a zaroven ho ups podporuje
|
|
|
|
m_analogRecords->setVoltage(m_settingData->inputVoltage);
|
|
|
|
m_analogRecords->setVoltage(m_settingData->inputVoltage);
|
|
|
|
tqrepaintVoltagePanels=true;
|
|
|
|
repaintVoltagePanels=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((changeSetting & KNutPrefDlg::ChangeFrequency) || ((changeSetting & KNutPrefDlg::ChangeXFer))) {
|
|
|
|
if ((changeSetting & KNutPrefDlg::ChangeFrequency) || ((changeSetting & KNutPrefDlg::ChangeXFer))) {
|
|
|
|
// byla aktivovana zmena napeti nebo zmena xfer a zaroven ho ups podporuje
|
|
|
|
// byla aktivovana zmena napeti nebo zmena xfer a zaroven ho ups podporuje
|
|
|
|
m_analogRecords->setFrequency(m_settingData->inputFrequency);
|
|
|
|
m_analogRecords->setFrequency(m_settingData->inputFrequency);
|
|
|
|
tqrepaintFrequencyPanels=true;
|
|
|
|
repaintFrequencyPanels=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -267,12 +267,12 @@ void KNutMainWindow::setConfig (unsigned int changeSetting) {
|
|
|
|
if (m_settingData->customBAnalogColor) {
|
|
|
|
if (m_settingData->customBAnalogColor) {
|
|
|
|
m_aPanelPalette.setColor(TQPalette::Active,TQColorGroup::Background,m_settingData->aPanelBackgroundColor);
|
|
|
|
m_aPanelPalette.setColor(TQPalette::Active,TQColorGroup::Background,m_settingData->aPanelBackgroundColor);
|
|
|
|
m_aPanelPalette.setColor(TQPalette::Inactive,TQColorGroup::Background,m_settingData->aPanelBackgroundColor);
|
|
|
|
m_aPanelPalette.setColor(TQPalette::Inactive,TQColorGroup::Background,m_settingData->aPanelBackgroundColor);
|
|
|
|
tqrepaintAllPanels=true;
|
|
|
|
repaintAllPanels=true;
|
|
|
|
m_panelMeter->setAnalogBG(m_aPanelPalette);
|
|
|
|
m_panelMeter->setAnalogBG(m_aPanelPalette);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
m_aPanelPalette = m_mainPalette;
|
|
|
|
m_aPanelPalette = m_mainPalette;
|
|
|
|
tqrepaintAllPanels=true;
|
|
|
|
repaintAllPanels=true;
|
|
|
|
m_panelMeter->setAnalogBG(m_aPanelPalette);
|
|
|
|
m_panelMeter->setAnalogBG(m_aPanelPalette);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -280,17 +280,17 @@ void KNutMainWindow::setConfig (unsigned int changeSetting) {
|
|
|
|
if ((changeSetting & KNutPrefDlg::ChangeCustomAPanelOColor) || // je provedena zmena barvy panelu
|
|
|
|
if ((changeSetting & KNutPrefDlg::ChangeCustomAPanelOColor) || // je provedena zmena barvy panelu
|
|
|
|
(changeSetting & KNutPrefDlg::ChangeAPOColor)) {
|
|
|
|
(changeSetting & KNutPrefDlg::ChangeAPOColor)) {
|
|
|
|
if (m_settingData->customOAnalogColor) {
|
|
|
|
if (m_settingData->customOAnalogColor) {
|
|
|
|
tqrepaintAllPanels=true;
|
|
|
|
repaintAllPanels=true;
|
|
|
|
tqrepaintOAPanels=true;
|
|
|
|
repaintOAPanels=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
tqrepaintAllPanels=true;
|
|
|
|
repaintAllPanels=true;
|
|
|
|
tqrepaintOAPanels=true;
|
|
|
|
repaintOAPanels=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// regeneration of panel uses for setting Main and setting Analog
|
|
|
|
// regeneration of panel uses for setting Main and setting Analog
|
|
|
|
// pregenerovani panelu slozi pro setting Main a setting Analog
|
|
|
|
// pregenerovani panelu slozi pro setting Main a setting Analog
|
|
|
|
m_panelMeter->tqrepaintAnalogPanels (tqrepaintFrequencyPanels, tqrepaintVoltagePanels, tqrepaintAllPanels);
|
|
|
|
m_panelMeter->repaintAnalogPanels (repaintFrequencyPanels, repaintVoltagePanels, repaintAllPanels);
|
|
|
|
|
|
|
|
|
|
|
|
if (m_activeUpsInfo->record.name != "") {
|
|
|
|
if (m_activeUpsInfo->record.name != "") {
|
|
|
|
m_panelMeter->setSize();
|
|
|
|
m_panelMeter->setSize();
|
|
|
@ -451,14 +451,14 @@ void KNutMainWindow::showUpsData (void) {
|
|
|
|
|
|
|
|
|
|
|
|
//qDebug ("KNutMainWindow::showUpsData 1");
|
|
|
|
//qDebug ("KNutMainWindow::showUpsData 1");
|
|
|
|
m_panelMeter->activateAnalogs(); // makes panel and makes background of panel
|
|
|
|
m_panelMeter->activateAnalogs(); // makes panel and makes background of panel
|
|
|
|
tqrepaintAnalogs(false);
|
|
|
|
repaintAnalogs(false);
|
|
|
|
//qDebug ("KNutMainWindow::showUpsData 2");
|
|
|
|
//qDebug ("KNutMainWindow::showUpsData 2");
|
|
|
|
m_panelMeter->setSize(true);
|
|
|
|
m_panelMeter->setSize(true);
|
|
|
|
//qDebug ("KNutMainWindow::showUpsData 3");
|
|
|
|
//qDebug ("KNutMainWindow::showUpsData 3");
|
|
|
|
m_mainSplit->refresh();
|
|
|
|
m_mainSplit->refresh();
|
|
|
|
// doesn't tqrepaint analog pointers, because pointers will be tqrepainted twice
|
|
|
|
// doesn't tqrepaint analog pointers, because pointers will be repainted twice
|
|
|
|
//qDebug ("KNutMainWindow::showUpsData 4");
|
|
|
|
//qDebug ("KNutMainWindow::showUpsData 4");
|
|
|
|
// tqrepaintAnalogs(false); // don't make this
|
|
|
|
// repaintAnalogs(false); // don't make this
|
|
|
|
//qDebug ("KNutMainWindow::showUpsData 5");
|
|
|
|
//qDebug ("KNutMainWindow::showUpsData 5");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
@ -483,7 +483,7 @@ void KNutMainWindow::setCombo (TQString name) {
|
|
|
|
if (toolBar(0)->getCombo(1)->currentText() != name) toolBar(0)->getCombo(1)->setCurrentText(name);
|
|
|
|
if (toolBar(0)->getCombo(1)->currentText() != name) toolBar(0)->getCombo(1)->setCurrentText(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KNutMainWindow::tqrepaintPanel (void) {
|
|
|
|
void KNutMainWindow::repaintPanel (void) {
|
|
|
|
TQString nutStringVar;
|
|
|
|
TQString nutStringVar;
|
|
|
|
|
|
|
|
|
|
|
|
if (m_activeUpsInfo->upsNet == 0) return;
|
|
|
|
if (m_activeUpsInfo->upsNet == 0) return;
|
|
|
@ -501,8 +501,8 @@ void KNutMainWindow::tqrepaintPanel (void) {
|
|
|
|
|
|
|
|
|
|
|
|
/// je volan vzdy po timeoutu
|
|
|
|
/// je volan vzdy po timeoutu
|
|
|
|
/// this function is called after timeout always
|
|
|
|
/// this function is called after timeout always
|
|
|
|
void KNutMainWindow::tqrepaintAnalogs ( bool run ) {
|
|
|
|
void KNutMainWindow::repaintAnalogs ( bool run ) {
|
|
|
|
//qDebug ("KNutMainWindow::tqrepaintAnalogs");
|
|
|
|
//qDebug ("KNutMainWindow::repaintAnalogs");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQString nutStringVar;
|
|
|
|
TQString nutStringVar;
|
|
|
@ -528,7 +528,7 @@ void KNutMainWindow::tqrepaintAnalogs ( bool run ) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//qDebug ("KNutMainWindow::tqrepaintAnalogs 1");
|
|
|
|
//qDebug ("KNutMainWindow::repaintAnalogs 1");
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i< knc::NumberOfVars; i++) {
|
|
|
|
for (int i=0; i< knc::NumberOfVars; i++) {
|
|
|
|
if (m_activeUpsInfo->record.upsVarCode[i] != 0) { // jistota pokud by nam to nekde propadlo
|
|
|
|
if (m_activeUpsInfo->record.upsVarCode[i] != 0) { // jistota pokud by nam to nekde propadlo
|
|
|
@ -540,17 +540,17 @@ void KNutMainWindow::tqrepaintAnalogs ( bool run ) {
|
|
|
|
nutStringVar = m_activeUpsInfo->upsNet->readStringVar ((char *)nameUpsVars2[m_activeUpsInfo->record.upsVarCode[i]]);
|
|
|
|
nutStringVar = m_activeUpsInfo->upsNet->readStringVar ((char *)nameUpsVars2[m_activeUpsInfo->record.upsVarCode[i]]);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//qDebug ("KNutMainWindow::tqrepaintAnalogs 2 ");
|
|
|
|
//qDebug ("KNutMainWindow::repaintAnalogs 2 ");
|
|
|
|
|
|
|
|
|
|
|
|
if (nutStringVar.isEmpty()) numVar=0;
|
|
|
|
if (nutStringVar.isEmpty()) numVar=0;
|
|
|
|
else numVar = nutStringVar.toFloat();
|
|
|
|
else numVar = nutStringVar.toFloat();
|
|
|
|
|
|
|
|
|
|
|
|
m_panelMeter->tqrepaintScaleAnalogPanel (i, numVar);
|
|
|
|
m_panelMeter->repaintScaleAnalogPanel (i, numVar);
|
|
|
|
if (newRange) m_panelMeter->tqrepaintAnalogPanels (true, true, false); //freq volt
|
|
|
|
if (newRange) m_panelMeter->repaintAnalogPanels (true, true, false); //freq volt
|
|
|
|
m_panelMeter->tqrepaintAnalogPointer(i,numVar,run);
|
|
|
|
m_panelMeter->repaintAnalogPointer(i,numVar,run);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // end for
|
|
|
|
} // end for
|
|
|
|
//qDebug ("KNutMainWindow::tqrepaintAnalogs 3 ");
|
|
|
|
//qDebug ("KNutMainWindow::repaintAnalogs 3 ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|