Revert "Make cycle time optional"
This reverts commit 3048e4dbc6.
Without a CT line vbit2 defaults to 1 cycle which could be too fast on
magazines with very few pages.
This commit is contained in:
@@ -64,7 +64,6 @@ void LevelOnePage::clearPage()
|
|||||||
m_fastTextLink[i] = { 0x0ff, 0x3f7f };
|
m_fastTextLink[i] = { 0x0ff, 0x3f7f };
|
||||||
|
|
||||||
/* m_subPageNumber = 0x0000; */
|
/* m_subPageNumber = 0x0000; */
|
||||||
m_cycleOn = false;
|
|
||||||
m_cycleValue = 20;
|
m_cycleValue = 20;
|
||||||
m_cycleType = CTseconds;
|
m_cycleType = CTseconds;
|
||||||
m_defaultCharSet = 0;
|
m_defaultCharSet = 0;
|
||||||
@@ -342,7 +341,6 @@ bool LevelOnePage::setControlBit(int bitNumber, bool active)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* void LevelOnePage::setSubPageNumber(int newSubPageNumber) { m_subPageNumber = newSubPageNumber; } */
|
/* void LevelOnePage::setSubPageNumber(int newSubPageNumber) { m_subPageNumber = newSubPageNumber; } */
|
||||||
void LevelOnePage::setCycleOn(int cycleOn) { m_cycleOn = cycleOn; };
|
|
||||||
void LevelOnePage::setCycleValue(int newValue) { m_cycleValue = newValue; };
|
void LevelOnePage::setCycleValue(int newValue) { m_cycleValue = newValue; };
|
||||||
void LevelOnePage::setCycleType(CycleTypeEnum newType) { m_cycleType = newType; }
|
void LevelOnePage::setCycleType(CycleTypeEnum newType) { m_cycleType = newType; }
|
||||||
void LevelOnePage::setDefaultCharSet(int newDefaultCharSet) { m_defaultCharSet = newDefaultCharSet; }
|
void LevelOnePage::setDefaultCharSet(int newDefaultCharSet) { m_defaultCharSet = newDefaultCharSet; }
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ public:
|
|||||||
int maxEnhancements() const { return 208; };
|
int maxEnhancements() const { return 208; };
|
||||||
|
|
||||||
/* void setSubPageNumber(int); */
|
/* void setSubPageNumber(int); */
|
||||||
int cycleOn() const { return m_cycleOn; };
|
|
||||||
void setCycleOn(int cycleOn);
|
|
||||||
int cycleValue() const { return m_cycleValue; };
|
int cycleValue() const { return m_cycleValue; };
|
||||||
void setCycleValue(int newValue);
|
void setCycleValue(int newValue);
|
||||||
CycleTypeEnum cycleType() const { return m_cycleType; };
|
CycleTypeEnum cycleType() const { return m_cycleType; };
|
||||||
@@ -109,7 +107,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
unsigned char m_level1Page[25][40];
|
unsigned char m_level1Page[25][40];
|
||||||
/* int m_subPageNumber; */
|
/* int m_subPageNumber; */
|
||||||
bool m_cycleOn;
|
|
||||||
int m_cycleValue;
|
int m_cycleValue;
|
||||||
CycleTypeEnum m_cycleType;
|
CycleTypeEnum m_cycleType;
|
||||||
int m_defaultCharSet, m_defaultNOS, m_secondCharSet, m_secondNOS;
|
int m_defaultCharSet, m_defaultNOS, m_secondCharSet, m_secondNOS;
|
||||||
|
|||||||
40
loadsave.cpp
40
loadsave.cpp
@@ -35,6 +35,9 @@ void loadTTI(QFile *inFile, TeletextDocument *document)
|
|||||||
{
|
{
|
||||||
QByteArray inLine;
|
QByteArray inLine;
|
||||||
bool firstSubPageAlreadyFound = false;
|
bool firstSubPageAlreadyFound = false;
|
||||||
|
int cycleCommandsFound = 0;
|
||||||
|
int mostRecentCycleValue = -1;
|
||||||
|
LevelOnePage::CycleTypeEnum mostRecentCycleType;
|
||||||
|
|
||||||
LevelOnePage* loadingPage = document->subPage(0);
|
LevelOnePage* loadingPage = document->subPage(0);
|
||||||
|
|
||||||
@@ -76,9 +79,12 @@ void loadTTI(QFile *inFile, TeletextDocument *document)
|
|||||||
bool cycleValueOk;
|
bool cycleValueOk;
|
||||||
int cycleValueRead = inLine.mid(3, inLine.size()-5).toInt(&cycleValueOk);
|
int cycleValueRead = inLine.mid(3, inLine.size()-5).toInt(&cycleValueOk);
|
||||||
if (cycleValueOk) {
|
if (cycleValueOk) {
|
||||||
loadingPage->setCycleOn(true);
|
cycleCommandsFound++;
|
||||||
|
// House-keep CT command values, in case it's the only one within multiple subpages
|
||||||
|
mostRecentCycleValue = cycleValueRead;
|
||||||
loadingPage->setCycleValue(cycleValueRead);
|
loadingPage->setCycleValue(cycleValueRead);
|
||||||
loadingPage->setCycleType(inLine.endsWith("C") ? LevelOnePage::CTcycles : LevelOnePage::CTseconds);
|
mostRecentCycleType = inLine.endsWith("C") ? LevelOnePage::CTcycles : LevelOnePage::CTseconds;
|
||||||
|
loadingPage->setCycleType(mostRecentCycleType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (inLine.startsWith("FL,")) {
|
if (inLine.startsWith("FL,")) {
|
||||||
@@ -153,6 +159,13 @@ void loadTTI(QFile *inFile, TeletextDocument *document)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If there's more than one subpage but only one valid CT command was found, apply it to all subpages
|
||||||
|
// I don't know if this is correct
|
||||||
|
if (cycleCommandsFound == 1 && document->numberOfSubPages()>1)
|
||||||
|
for (int i=0; i<document->numberOfSubPages(); i++) {
|
||||||
|
document->subPage(i)->setCycleValue(mostRecentCycleValue);
|
||||||
|
document->subPage(i)->setCycleType(mostRecentCycleType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void importT42(QFile *inFile, TeletextDocument *document)
|
void importT42(QFile *inFile, TeletextDocument *document)
|
||||||
@@ -454,26 +467,19 @@ void saveTTI(QSaveFile &file, const TeletextDocument &document)
|
|||||||
outStream << endl;
|
outStream << endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Cycle time - assume that only Level One Pages have configurable cycle times
|
// Cycle time
|
||||||
if (document.pageFunction() == TeletextDocument::PFLevelOnePage && document.subPage(p)->cycleOn()) {
|
if (document.pageFunction() == TeletextDocument::PFLevelOnePage)
|
||||||
|
// Assume that only Level One Pages have configurable cycle times
|
||||||
outStream << QString("CT,%1,%2").arg(document.subPage(p)->cycleValue()).arg(document.subPage(p)->cycleType()==LevelOnePage::CTcycles ? 'C' : 'T');
|
outStream << QString("CT,%1,%2").arg(document.subPage(p)->cycleValue()).arg(document.subPage(p)->cycleType()==LevelOnePage::CTcycles ? 'C' : 'T');
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
else
|
||||||
outStream << Qt::endl;
|
// X/28/0 specifies page function and coding but the PF command
|
||||||
#else
|
// should make it obvious to a human that this isn't a Level One Page
|
||||||
outStream << endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
// Not a Level One Page: X/28/0 specifies page function and coding but the PF command
|
|
||||||
// should make it obvious to a human that this isn't a Level One Page
|
|
||||||
if (document.pageFunction() != TeletextDocument::PFLevelOnePage) {
|
|
||||||
outStream << QString("PF,%1,%2").arg(document.pageFunction()).arg(document.packetCoding());
|
outStream << QString("PF,%1,%2").arg(document.pageFunction()).arg(document.packetCoding());
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||||
outStream << Qt::endl;
|
outStream << Qt::endl;
|
||||||
#else
|
#else
|
||||||
outStream << endl;
|
outStream << endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
// FastText links
|
// FastText links
|
||||||
bool writeFLCommand = false;
|
bool writeFLCommand = false;
|
||||||
|
|||||||
@@ -82,9 +82,7 @@ PageOptionsDockWidget::PageOptionsDockWidget(TeletextWidget *parent): QDockWidge
|
|||||||
|
|
||||||
// Cycle
|
// Cycle
|
||||||
QHBoxLayout *pageCycleLayout = new QHBoxLayout;
|
QHBoxLayout *pageCycleLayout = new QHBoxLayout;
|
||||||
m_cycleOnCheckBox = new QCheckBox(tr("Page cycle"));
|
pageCycleLayout->addWidget(new QLabel(tr("Page cycle")));
|
||||||
pageCycleLayout->addWidget(m_cycleOnCheckBox);
|
|
||||||
connect(m_cycleOnCheckBox, &QCheckBox::stateChanged, this, &PageOptionsDockWidget::setCycleOn );
|
|
||||||
m_cycleValueSpinBox = new QSpinBox;
|
m_cycleValueSpinBox = new QSpinBox;
|
||||||
m_cycleValueSpinBox->setRange(1, 99);
|
m_cycleValueSpinBox->setRange(1, 99);
|
||||||
m_cycleValueSpinBox->setWrapping(true);
|
m_cycleValueSpinBox->setWrapping(true);
|
||||||
@@ -175,19 +173,11 @@ void PageOptionsDockWidget::updateWidgets()
|
|||||||
m_fastTextEdit[i]->setText(QString::number(absoluteLinkPageNumber, 16).toUpper());
|
m_fastTextEdit[i]->setText(QString::number(absoluteLinkPageNumber, 16).toUpper());
|
||||||
m_fastTextEdit[i]->blockSignals(false);
|
m_fastTextEdit[i]->blockSignals(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool cycleOn = m_parentMainWidget->document()->currentSubPage()->cycleOn();
|
|
||||||
|
|
||||||
m_cycleOnCheckBox->blockSignals(true);
|
|
||||||
m_cycleOnCheckBox->setChecked(cycleOn);
|
|
||||||
m_cycleOnCheckBox->blockSignals(false);
|
|
||||||
m_cycleValueSpinBox->blockSignals(true);
|
m_cycleValueSpinBox->blockSignals(true);
|
||||||
m_cycleValueSpinBox->setValue(m_parentMainWidget->document()->currentSubPage()->cycleValue());
|
m_cycleValueSpinBox->setValue(m_parentMainWidget->document()->currentSubPage()->cycleValue());
|
||||||
m_cycleValueSpinBox->setEnabled(cycleOn);
|
|
||||||
m_cycleValueSpinBox->blockSignals(false);
|
m_cycleValueSpinBox->blockSignals(false);
|
||||||
m_cycleTypeCombo->blockSignals(true);
|
m_cycleTypeCombo->blockSignals(true);
|
||||||
m_cycleTypeCombo->setCurrentIndex(m_parentMainWidget->document()->currentSubPage()->cycleType() == LevelOnePage::CTseconds);
|
m_cycleTypeCombo->setCurrentIndex(m_parentMainWidget->document()->currentSubPage()->cycleType() == LevelOnePage::CTseconds);
|
||||||
m_cycleTypeCombo->setEnabled(cycleOn);
|
|
||||||
m_cycleTypeCombo->blockSignals(false);
|
m_cycleTypeCombo->blockSignals(false);
|
||||||
for (int i=0; i<=7; i++) {
|
for (int i=0; i<=7; i++) {
|
||||||
m_controlBitsAct[i]->blockSignals(true);
|
m_controlBitsAct[i]->blockSignals(true);
|
||||||
@@ -230,13 +220,6 @@ void PageOptionsDockWidget::setFastTextLinkPageNumber(int linkNumber, const QStr
|
|||||||
m_parentMainWidget->document()->setFastTextLinkPageNumberOnAllSubPages(linkNumber, pageNumberRead);
|
m_parentMainWidget->document()->setFastTextLinkPageNumberOnAllSubPages(linkNumber, pageNumberRead);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageOptionsDockWidget::setCycleOn(bool active)
|
|
||||||
{
|
|
||||||
m_cycleValueSpinBox->setEnabled(active);
|
|
||||||
m_cycleTypeCombo->setEnabled(active);
|
|
||||||
m_parentMainWidget->document()->currentSubPage()->setCycleOn(active);
|
|
||||||
}
|
|
||||||
|
|
||||||
void PageOptionsDockWidget::updateDefaultNOSOptions()
|
void PageOptionsDockWidget::updateDefaultNOSOptions()
|
||||||
{
|
{
|
||||||
while (m_defaultNOSCombo->count() > 0)
|
while (m_defaultNOSCombo->count() > 0)
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ public:
|
|||||||
private:
|
private:
|
||||||
TeletextWidget *m_parentMainWidget;
|
TeletextWidget *m_parentMainWidget;
|
||||||
QLineEdit *m_pageNumberEdit, *m_pageDescriptionEdit;
|
QLineEdit *m_pageNumberEdit, *m_pageDescriptionEdit;
|
||||||
QCheckBox *m_cycleOnCheckBox;
|
|
||||||
QSpinBox *m_cycleValueSpinBox;
|
QSpinBox *m_cycleValueSpinBox;
|
||||||
QComboBox *m_cycleTypeCombo;
|
QComboBox *m_cycleTypeCombo;
|
||||||
QCheckBox *m_controlBitsAct[8];
|
QCheckBox *m_controlBitsAct[8];
|
||||||
@@ -57,9 +56,6 @@ private:
|
|||||||
void setSecondNOS();
|
void setSecondNOS();
|
||||||
void updateDefaultNOSOptions();
|
void updateDefaultNOSOptions();
|
||||||
void updateSecondNOSOptions();
|
void updateSecondNOSOptions();
|
||||||
|
|
||||||
private slots:
|
|
||||||
void setCycleOn(bool active);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct languageComboBoxItem {
|
struct languageComboBoxItem {
|
||||||
|
|||||||
Reference in New Issue
Block a user