Move some getters from headers
This commit is contained in:
@@ -36,6 +36,16 @@ DRCSPage::DRCSPage(const PageBase &other)
|
|||||||
setControlBit(b, other.controlBit(b));
|
setControlBit(b, other.controlBit(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PageBase::PageFunctionEnum DRCSPage::pageFunction() const
|
||||||
|
{
|
||||||
|
return PFGlobalPOP;
|
||||||
|
}
|
||||||
|
|
||||||
|
PageBase::PacketCodingEnum DRCSPage::packetCoding() const
|
||||||
|
{
|
||||||
|
return Coding7bit;
|
||||||
|
}
|
||||||
|
|
||||||
int DRCSPage::drcsMode(int c) const
|
int DRCSPage::drcsMode(int c) const
|
||||||
{
|
{
|
||||||
if (!packetExists(28, 3))
|
if (!packetExists(28, 3))
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ public:
|
|||||||
DRCSPage(const PageBase &other);
|
DRCSPage(const PageBase &other);
|
||||||
|
|
||||||
// TODO PFNormalPOP as well?
|
// TODO PFNormalPOP as well?
|
||||||
PageFunctionEnum pageFunction() const { return PFGlobalPOP; }
|
PageFunctionEnum pageFunction() const;
|
||||||
PacketCodingEnum packetCoding() const override { return Coding7bit; }
|
PacketCodingEnum packetCoding() const;
|
||||||
|
|
||||||
int drcsMode(int c) const;
|
int drcsMode(int c) const;
|
||||||
bool ptu(int c, uchar *data) const;
|
bool ptu(int c, uchar *data) const;
|
||||||
|
|||||||
@@ -80,6 +80,16 @@ void LevelOnePage::clearPage()
|
|||||||
// If clearPage() is called outside constructor, we need to implement m_enhancements.clear();
|
// If clearPage() is called outside constructor, we need to implement m_enhancements.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PageBase::PageFunctionEnum LevelOnePage::pageFunction() const
|
||||||
|
{
|
||||||
|
return PFLevelOnePage;
|
||||||
|
}
|
||||||
|
|
||||||
|
PageBase::PacketCodingEnum LevelOnePage::packetCoding() const
|
||||||
|
{
|
||||||
|
return Coding7bit;
|
||||||
|
}
|
||||||
|
|
||||||
bool LevelOnePage::isEmpty() const
|
bool LevelOnePage::isEmpty() const
|
||||||
{
|
{
|
||||||
if (!m_enhancements.isEmpty())
|
if (!m_enhancements.isEmpty())
|
||||||
@@ -295,10 +305,47 @@ bool LevelOnePage::setControlBit(int b, bool active)
|
|||||||
return PageX26Base::setControlBit(b, active);
|
return PageX26Base::setControlBit(b, active);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::maxEnhancements() const
|
||||||
|
{
|
||||||
|
return 208;
|
||||||
|
}
|
||||||
|
|
||||||
/* void LevelOnePage::setSubPageNumber(int newSubPageNumber) { m_subPageNumber = newSubPageNumber; } */
|
/* void LevelOnePage::setSubPageNumber(int newSubPageNumber) { m_subPageNumber = newSubPageNumber; } */
|
||||||
void LevelOnePage::setCycleValue(int newValue) { m_cycleValue = newValue; };
|
|
||||||
void LevelOnePage::setCycleType(CycleTypeEnum newType) { m_cycleType = newType; }
|
int LevelOnePage::cycleValue() const
|
||||||
void LevelOnePage::setDefaultCharSet(int newDefaultCharSet) { m_defaultCharSet = newDefaultCharSet; }
|
{
|
||||||
|
return m_cycleValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setCycleValue(int newValue)
|
||||||
|
{
|
||||||
|
m_cycleValue = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
LevelOnePage::CycleTypeEnum LevelOnePage::cycleType() const
|
||||||
|
{
|
||||||
|
return m_cycleType;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setCycleType(CycleTypeEnum newType)
|
||||||
|
{
|
||||||
|
m_cycleType = newType;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::defaultCharSet() const
|
||||||
|
{
|
||||||
|
return m_defaultCharSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setDefaultCharSet(int newDefaultCharSet)
|
||||||
|
{
|
||||||
|
m_defaultCharSet = newDefaultCharSet;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::defaultNOS() const
|
||||||
|
{
|
||||||
|
return m_defaultNOS;
|
||||||
|
}
|
||||||
|
|
||||||
void LevelOnePage::setDefaultNOS(int defaultNOS)
|
void LevelOnePage::setDefaultNOS(int defaultNOS)
|
||||||
{
|
{
|
||||||
@@ -309,6 +356,11 @@ void LevelOnePage::setDefaultNOS(int defaultNOS)
|
|||||||
PageX26Base::setControlBit(C14NOS, m_defaultNOS & 0x4);
|
PageX26Base::setControlBit(C14NOS, m_defaultNOS & 0x4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::secondCharSet() const
|
||||||
|
{
|
||||||
|
return m_secondCharSet;
|
||||||
|
}
|
||||||
|
|
||||||
void LevelOnePage::setSecondCharSet(int newSecondCharSet)
|
void LevelOnePage::setSecondCharSet(int newSecondCharSet)
|
||||||
{
|
{
|
||||||
m_secondCharSet = newSecondCharSet;
|
m_secondCharSet = newSecondCharSet;
|
||||||
@@ -316,8 +368,18 @@ void LevelOnePage::setSecondCharSet(int newSecondCharSet)
|
|||||||
m_secondNOS = 0x7;
|
m_secondNOS = 0x7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::secondNOS() const
|
||||||
|
{
|
||||||
|
return m_secondNOS;
|
||||||
|
}
|
||||||
|
|
||||||
void LevelOnePage::setSecondNOS(int newSecondNOS) { m_secondNOS = newSecondNOS; }
|
void LevelOnePage::setSecondNOS(int newSecondNOS) { m_secondNOS = newSecondNOS; }
|
||||||
|
|
||||||
|
unsigned char LevelOnePage::character(int r, int c) const
|
||||||
|
{
|
||||||
|
return PageX26Base::packetExists(r) ? PageX26Base::packet(r).at(c) : 0x20;
|
||||||
|
}
|
||||||
|
|
||||||
void LevelOnePage::setCharacter(int r, int c, unsigned char newCharacter)
|
void LevelOnePage::setCharacter(int r, int c, unsigned char newCharacter)
|
||||||
{
|
{
|
||||||
QByteArray pkt;
|
QByteArray pkt;
|
||||||
@@ -338,10 +400,45 @@ void LevelOnePage::setCharacter(int r, int c, unsigned char newCharacter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LevelOnePage::setDefaultScreenColour(int newDefaultScreenColour) { m_defaultScreenColour = newDefaultScreenColour; }
|
int LevelOnePage::defaultScreenColour() const
|
||||||
void LevelOnePage::setDefaultRowColour(int newDefaultRowColour) { m_defaultRowColour = newDefaultRowColour; }
|
{
|
||||||
void LevelOnePage::setColourTableRemap(int newColourTableRemap) { m_colourTableRemap = newColourTableRemap; }
|
return m_defaultScreenColour;
|
||||||
void LevelOnePage::setBlackBackgroundSubst(bool newBlackBackgroundSubst) { m_blackBackgroundSubst = newBlackBackgroundSubst; }
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setDefaultScreenColour(int newDefaultScreenColour)
|
||||||
|
{
|
||||||
|
m_defaultScreenColour = newDefaultScreenColour;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::defaultRowColour() const
|
||||||
|
{
|
||||||
|
return m_defaultRowColour;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setDefaultRowColour(int newDefaultRowColour)
|
||||||
|
{
|
||||||
|
m_defaultRowColour = newDefaultRowColour;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::colourTableRemap() const
|
||||||
|
{
|
||||||
|
return m_colourTableRemap;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setColourTableRemap(int newColourTableRemap)
|
||||||
|
{
|
||||||
|
m_colourTableRemap = newColourTableRemap;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LevelOnePage::blackBackgroundSubst() const
|
||||||
|
{
|
||||||
|
return m_blackBackgroundSubst;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setBlackBackgroundSubst(bool newBlackBackgroundSubst)
|
||||||
|
{
|
||||||
|
m_blackBackgroundSubst = newBlackBackgroundSubst;
|
||||||
|
}
|
||||||
|
|
||||||
int LevelOnePage::CLUT(int index, int renderLevel) const
|
int LevelOnePage::CLUT(int index, int renderLevel) const
|
||||||
{
|
{
|
||||||
@@ -552,36 +649,101 @@ int LevelOnePage::levelRequired() const
|
|||||||
return levelSeen;
|
return levelSeen;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LevelOnePage::setLeftSidePanelDisplayed(bool newLeftSidePanelDisplayed) { m_leftSidePanelDisplayed = newLeftSidePanelDisplayed; }
|
bool LevelOnePage::leftSidePanelDisplayed() const
|
||||||
void LevelOnePage::setRightSidePanelDisplayed(bool newRightSidePanelDisplayed) { m_rightSidePanelDisplayed = newRightSidePanelDisplayed; }
|
{
|
||||||
void LevelOnePage::setSidePanelColumns(int newSidePanelColumns) { m_sidePanelColumns = newSidePanelColumns; }
|
return m_leftSidePanelDisplayed;
|
||||||
void LevelOnePage::setSidePanelStatusL25(bool newSidePanelStatusL25) { m_sidePanelStatusL25 = newSidePanelStatusL25; }
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setLeftSidePanelDisplayed(bool newLeftSidePanelDisplayed)
|
||||||
|
{
|
||||||
|
m_leftSidePanelDisplayed = newLeftSidePanelDisplayed;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LevelOnePage::rightSidePanelDisplayed() const
|
||||||
|
{
|
||||||
|
return m_rightSidePanelDisplayed;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setRightSidePanelDisplayed(bool newRightSidePanelDisplayed)
|
||||||
|
{
|
||||||
|
m_rightSidePanelDisplayed = newRightSidePanelDisplayed;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::sidePanelColumns() const
|
||||||
|
{
|
||||||
|
return m_sidePanelColumns;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setSidePanelColumns(int newSidePanelColumns)
|
||||||
|
{
|
||||||
|
m_sidePanelColumns = newSidePanelColumns;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool LevelOnePage::sidePanelStatusL25() const
|
||||||
|
{
|
||||||
|
return m_sidePanelStatusL25;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LevelOnePage::setSidePanelStatusL25(bool newSidePanelStatusL25)
|
||||||
|
{
|
||||||
|
m_sidePanelStatusL25 = newSidePanelStatusL25;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::fastTextLinkPageNumber(int linkNumber) const
|
||||||
|
{
|
||||||
|
return m_fastTextLink[linkNumber].pageNumber;
|
||||||
|
}
|
||||||
|
|
||||||
void LevelOnePage::setFastTextLinkPageNumber(int linkNumber, int pageNumber)
|
void LevelOnePage::setFastTextLinkPageNumber(int linkNumber, int pageNumber)
|
||||||
{
|
{
|
||||||
m_fastTextLink[linkNumber].pageNumber = pageNumber;
|
m_fastTextLink[linkNumber].pageNumber = pageNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::composeLinkFunction(int linkNumber) const
|
||||||
|
{
|
||||||
|
return m_composeLink[linkNumber].function;
|
||||||
|
}
|
||||||
|
|
||||||
void LevelOnePage::setComposeLinkFunction(int linkNumber, int newFunction)
|
void LevelOnePage::setComposeLinkFunction(int linkNumber, int newFunction)
|
||||||
{
|
{
|
||||||
m_composeLink[linkNumber].function = newFunction;
|
m_composeLink[linkNumber].function = newFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LevelOnePage::composeLinkLevel2p5(int linkNumber) const
|
||||||
|
{
|
||||||
|
return m_composeLink[linkNumber].level2p5;
|
||||||
|
}
|
||||||
|
|
||||||
void LevelOnePage::setComposeLinkLevel2p5(int linkNumber, bool newRequired)
|
void LevelOnePage::setComposeLinkLevel2p5(int linkNumber, bool newRequired)
|
||||||
{
|
{
|
||||||
m_composeLink[linkNumber].level2p5 = newRequired;
|
m_composeLink[linkNumber].level2p5 = newRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LevelOnePage::composeLinkLevel3p5(int linkNumber) const
|
||||||
|
{
|
||||||
|
return m_composeLink[linkNumber].level3p5;
|
||||||
|
}
|
||||||
|
|
||||||
void LevelOnePage::setComposeLinkLevel3p5(int linkNumber, bool newRequired)
|
void LevelOnePage::setComposeLinkLevel3p5(int linkNumber, bool newRequired)
|
||||||
{
|
{
|
||||||
m_composeLink[linkNumber].level3p5 = newRequired;
|
m_composeLink[linkNumber].level3p5 = newRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::composeLinkPageNumber(int linkNumber) const
|
||||||
|
{
|
||||||
|
return m_composeLink[linkNumber].pageNumber;
|
||||||
|
}
|
||||||
|
|
||||||
void LevelOnePage::setComposeLinkPageNumber(int linkNumber, int newPageNumber)
|
void LevelOnePage::setComposeLinkPageNumber(int linkNumber, int newPageNumber)
|
||||||
{
|
{
|
||||||
m_composeLink[linkNumber].pageNumber = newPageNumber;
|
m_composeLink[linkNumber].pageNumber = newPageNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int LevelOnePage::composeLinkSubPageCodes(int linkNumber) const
|
||||||
|
{
|
||||||
|
return m_composeLink[linkNumber].subPageCodes;
|
||||||
|
}
|
||||||
|
|
||||||
void LevelOnePage::setComposeLinkSubPageCodes(int linkNumber, int newSubPageCodes)
|
void LevelOnePage::setComposeLinkSubPageCodes(int linkNumber, int newSubPageCodes)
|
||||||
{
|
{
|
||||||
m_composeLink[linkNumber].subPageCodes = newSubPageCodes;
|
m_composeLink[linkNumber].subPageCodes = newSubPageCodes;
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ public:
|
|||||||
LevelOnePage();
|
LevelOnePage();
|
||||||
LevelOnePage(const PageBase &other);
|
LevelOnePage(const PageBase &other);
|
||||||
|
|
||||||
PageFunctionEnum pageFunction() const override { return PFLevelOnePage; }
|
PageFunctionEnum pageFunction() const override;
|
||||||
PacketCodingEnum packetCoding() const override { return Coding7bit; }
|
PacketCodingEnum packetCoding() const override;
|
||||||
|
|
||||||
bool isEmpty() const override;
|
bool isEmpty() const override;
|
||||||
|
|
||||||
@@ -55,30 +55,30 @@ public:
|
|||||||
|
|
||||||
void clearPage();
|
void clearPage();
|
||||||
|
|
||||||
int maxEnhancements() const override { return 208; };
|
int maxEnhancements() const override;
|
||||||
|
|
||||||
/* void setSubPageNumber(int); */
|
/* void setSubPageNumber(int); */
|
||||||
int cycleValue() const { return m_cycleValue; };
|
int cycleValue() const;
|
||||||
void setCycleValue(int newValue);
|
void setCycleValue(int newValue);
|
||||||
CycleTypeEnum cycleType() const { return m_cycleType; };
|
CycleTypeEnum cycleType() const;
|
||||||
void setCycleType(CycleTypeEnum newType);
|
void setCycleType(CycleTypeEnum newType);
|
||||||
int defaultCharSet() const { return m_defaultCharSet; }
|
int defaultCharSet() const;
|
||||||
void setDefaultCharSet(int newDefaultCharSet);
|
void setDefaultCharSet(int newDefaultCharSet);
|
||||||
int defaultNOS() const { return m_defaultNOS; }
|
int defaultNOS() const;
|
||||||
void setDefaultNOS(int defaultNOS);
|
void setDefaultNOS(int defaultNOS);
|
||||||
int secondCharSet() const { return m_secondCharSet; }
|
int secondCharSet() const;
|
||||||
void setSecondCharSet(int newSecondCharSet);
|
void setSecondCharSet(int newSecondCharSet);
|
||||||
int secondNOS() const { return m_secondNOS; }
|
int secondNOS() const;
|
||||||
void setSecondNOS(int newSecondNOS);
|
void setSecondNOS(int newSecondNOS);
|
||||||
unsigned char character(int r, int c) const { return PageX26Base::packetExists(r) ? PageX26Base::packet(r).at(c) : 0x20; }
|
unsigned char character(int r, int c) const;
|
||||||
void setCharacter(int r, int c, unsigned char newChar);
|
void setCharacter(int r, int c, unsigned char newChar);
|
||||||
int defaultScreenColour() const { return m_defaultScreenColour; }
|
int defaultScreenColour() const;
|
||||||
void setDefaultScreenColour(int newDefaultScreenColour);
|
void setDefaultScreenColour(int newDefaultScreenColour);
|
||||||
int defaultRowColour() const { return m_defaultRowColour; }
|
int defaultRowColour() const;
|
||||||
void setDefaultRowColour(int newDefaultRowColour);
|
void setDefaultRowColour(int newDefaultRowColour);
|
||||||
int colourTableRemap() const { return m_colourTableRemap; }
|
int colourTableRemap() const;
|
||||||
void setColourTableRemap(int newColourTableRemap);
|
void setColourTableRemap(int newColourTableRemap);
|
||||||
bool blackBackgroundSubst() const { return m_blackBackgroundSubst; }
|
bool blackBackgroundSubst() const;
|
||||||
void setBlackBackgroundSubst(bool newBlackBackgroundSubst);
|
void setBlackBackgroundSubst(bool newBlackBackgroundSubst);
|
||||||
int CLUT(int index, int renderLevel=3) const;
|
int CLUT(int index, int renderLevel=3) const;
|
||||||
void setCLUT(int index, int newColour);
|
void setCLUT(int index, int newColour);
|
||||||
@@ -88,25 +88,25 @@ public:
|
|||||||
int dCLUT(bool globalDrcs, int mode, int index) const;
|
int dCLUT(bool globalDrcs, int mode, int index) const;
|
||||||
void setDCLUT(bool globalDrcs, int mode, int index, int colour);
|
void setDCLUT(bool globalDrcs, int mode, int index, int colour);
|
||||||
int levelRequired() const;
|
int levelRequired() const;
|
||||||
bool leftSidePanelDisplayed() const { return m_leftSidePanelDisplayed; }
|
bool leftSidePanelDisplayed() const;
|
||||||
void setLeftSidePanelDisplayed(bool newLeftSidePanelDisplayed);
|
void setLeftSidePanelDisplayed(bool newLeftSidePanelDisplayed);
|
||||||
bool rightSidePanelDisplayed() const { return m_rightSidePanelDisplayed; }
|
bool rightSidePanelDisplayed() const;
|
||||||
void setRightSidePanelDisplayed(bool newRightSidePanelDisplayed);
|
void setRightSidePanelDisplayed(bool newRightSidePanelDisplayed);
|
||||||
int sidePanelColumns() const { return m_sidePanelColumns; }
|
int sidePanelColumns() const;
|
||||||
void setSidePanelColumns(int newSidePanelColumns);
|
void setSidePanelColumns(int newSidePanelColumns);
|
||||||
bool sidePanelStatusL25() const { return m_sidePanelStatusL25; }
|
bool sidePanelStatusL25() const;
|
||||||
void setSidePanelStatusL25(bool newSidePanelStatusL25);
|
void setSidePanelStatusL25(bool newSidePanelStatusL25);
|
||||||
int fastTextLinkPageNumber(int linkNumber) const { return m_fastTextLink[linkNumber].pageNumber; }
|
int fastTextLinkPageNumber(int linkNumber) const;
|
||||||
void setFastTextLinkPageNumber(int linkNumber, int pageNumber);
|
void setFastTextLinkPageNumber(int linkNumber, int pageNumber);
|
||||||
int composeLinkFunction(int linkNumber) const { return m_composeLink[linkNumber].function; }
|
int composeLinkFunction(int linkNumber) const;
|
||||||
void setComposeLinkFunction(int linkNumber, int newFunction);
|
void setComposeLinkFunction(int linkNumber, int newFunction);
|
||||||
bool composeLinkLevel2p5(int linkNumber) const { return m_composeLink[linkNumber].level2p5; }
|
bool composeLinkLevel2p5(int linkNumber) const;
|
||||||
void setComposeLinkLevel2p5(int linkNumber, bool newRequired);
|
void setComposeLinkLevel2p5(int linkNumber, bool newRequired);
|
||||||
bool composeLinkLevel3p5(int linkNumber) const { return m_composeLink[linkNumber].level3p5; }
|
bool composeLinkLevel3p5(int linkNumber) const;
|
||||||
void setComposeLinkLevel3p5(int linkNumber, bool newRequired);
|
void setComposeLinkLevel3p5(int linkNumber, bool newRequired);
|
||||||
int composeLinkPageNumber(int linkNumber) const { return m_composeLink[linkNumber].pageNumber; }
|
int composeLinkPageNumber(int linkNumber) const;
|
||||||
void setComposeLinkPageNumber(int linkNumber, int newPageNumber);
|
void setComposeLinkPageNumber(int linkNumber, int newPageNumber);
|
||||||
int composeLinkSubPageCodes(int linkNumber) const { return m_composeLink[linkNumber].subPageCodes; }
|
int composeLinkSubPageCodes(int linkNumber) const;
|
||||||
void setComposeLinkSubPageCodes(int linkNumber, int newSubPageCodes);
|
void setComposeLinkSubPageCodes(int linkNumber, int newSubPageCodes);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -27,6 +27,16 @@ PageBase::PageBase()
|
|||||||
m_controlBits[b] = false;
|
m_controlBits[b] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PageBase::PageFunctionEnum PageBase::pageFunction() const
|
||||||
|
{
|
||||||
|
return PFUnknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
PageBase::PacketCodingEnum PageBase::packetCoding() const
|
||||||
|
{
|
||||||
|
return CodingUnknown;
|
||||||
|
}
|
||||||
|
|
||||||
bool PageBase::isEmpty() const
|
bool PageBase::isEmpty() const
|
||||||
{
|
{
|
||||||
for (int y=0; y<26; y++)
|
for (int y=0; y<26; y++)
|
||||||
@@ -40,6 +50,16 @@ bool PageBase::isEmpty() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QByteArray PageBase::packet(int y) const
|
||||||
|
{
|
||||||
|
return m_displayPackets[y];
|
||||||
|
}
|
||||||
|
|
||||||
|
QByteArray PageBase::packet(int y, int d) const
|
||||||
|
{
|
||||||
|
return m_designationPackets[y-26][d];
|
||||||
|
}
|
||||||
|
|
||||||
bool PageBase::setPacket(int y, QByteArray pkt)
|
bool PageBase::setPacket(int y, QByteArray pkt)
|
||||||
{
|
{
|
||||||
m_displayPackets[y] = pkt;
|
m_displayPackets[y] = pkt;
|
||||||
@@ -54,6 +74,16 @@ bool PageBase::setPacket(int y, int d, QByteArray pkt)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PageBase::packetExists(int y) const
|
||||||
|
{
|
||||||
|
return !m_displayPackets[y].isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PageBase::packetExists(int y, int d) const
|
||||||
|
{
|
||||||
|
return !m_designationPackets[y-26][d].isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
bool PageBase::clearPacket(int y)
|
bool PageBase::clearPacket(int y)
|
||||||
{
|
{
|
||||||
m_displayPackets[y] = QByteArray();
|
m_displayPackets[y] = QByteArray();
|
||||||
@@ -77,6 +107,11 @@ void PageBase::clearAllPackets()
|
|||||||
clearPacket(y, d);
|
clearPacket(y, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PageBase::controlBit(int b) const
|
||||||
|
{
|
||||||
|
return m_controlBits[b];
|
||||||
|
}
|
||||||
|
|
||||||
bool PageBase::setControlBit(int b, bool active)
|
bool PageBase::setControlBit(int b, bool active)
|
||||||
{
|
{
|
||||||
m_controlBits[b] = active;
|
m_controlBits[b] = active;
|
||||||
|
|||||||
@@ -22,11 +22,8 @@
|
|||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
|
||||||
// If we inherit from QObject then we can't copy construct, so "make a new subpage that's a copy of this one" wouldn't work
|
class PageBase
|
||||||
class PageBase //: public QObject
|
|
||||||
{
|
{
|
||||||
//Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum ControlBitsEnum { C4ErasePage, C5Newsflash, C6Subtitle, C7SuppressHeader, C8Update, C9InterruptedSequence, C10InhibitDisplay, C11SerialMagazine, C12NOS, C13NOS, C14NOS };
|
enum ControlBitsEnum { C4ErasePage, C5Newsflash, C6Subtitle, C7SuppressHeader, C8Update, C9InterruptedSequence, C10InhibitDisplay, C11SerialMagazine, C12NOS, C13NOS, C14NOS };
|
||||||
// Available Page Functions according to 9.4.2.1 of the spec
|
// Available Page Functions according to 9.4.2.1 of the spec
|
||||||
@@ -36,22 +33,22 @@ public:
|
|||||||
|
|
||||||
PageBase();
|
PageBase();
|
||||||
|
|
||||||
virtual PageFunctionEnum pageFunction() const { return PFUnknown; }
|
virtual PageFunctionEnum pageFunction() const;
|
||||||
virtual PacketCodingEnum packetCoding() const { return CodingUnknown; }
|
virtual PacketCodingEnum packetCoding() const;
|
||||||
|
|
||||||
virtual bool isEmpty() const;
|
virtual bool isEmpty() const;
|
||||||
|
|
||||||
virtual QByteArray packet(int y) const { return m_displayPackets[y]; }
|
virtual QByteArray packet(int y) const;
|
||||||
virtual QByteArray packet(int y, int d) const { return m_designationPackets[y-26][d]; }
|
virtual QByteArray packet(int y, int d) const;
|
||||||
virtual bool setPacket(int y, QByteArray pkt);
|
virtual bool setPacket(int y, QByteArray pkt);
|
||||||
virtual bool setPacket(int y, int d, QByteArray pkt);
|
virtual bool setPacket(int y, int d, QByteArray pkt);
|
||||||
virtual bool packetExists(int y) const { return !m_displayPackets[y].isEmpty(); }
|
virtual bool packetExists(int y) const;
|
||||||
virtual bool packetExists(int y, int d) const { return !m_designationPackets[y-26][d].isEmpty(); }
|
virtual bool packetExists(int y, int d) const ;
|
||||||
virtual bool clearPacket(int y);
|
virtual bool clearPacket(int y);
|
||||||
virtual bool clearPacket(int y, int d);
|
virtual bool clearPacket(int y, int d);
|
||||||
virtual void clearAllPackets();
|
virtual void clearAllPackets();
|
||||||
|
|
||||||
virtual bool controlBit(int b) const { return m_controlBits[b]; }
|
virtual bool controlBit(int b) const;
|
||||||
virtual bool setControlBit(int b, bool active);
|
virtual bool setControlBit(int b, bool active);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -21,6 +21,11 @@
|
|||||||
|
|
||||||
#include "pagex26base.h"
|
#include "pagex26base.h"
|
||||||
|
|
||||||
|
X26TripletList *PageX26Base::enhancements()
|
||||||
|
{
|
||||||
|
return &m_enhancements;
|
||||||
|
}
|
||||||
|
|
||||||
QByteArray PageX26Base::packetFromEnhancementList(int p) const
|
QByteArray PageX26Base::packetFromEnhancementList(int p) const
|
||||||
{
|
{
|
||||||
QByteArray result(40, 0x00);
|
QByteArray result(40, 0x00);
|
||||||
@@ -79,3 +84,8 @@ void PageX26Base::setEnhancementListFromPacket(int p, QByteArray pkt)
|
|||||||
while (m_enhancements.size()>1 && m_enhancements.at(m_enhancements.size()-2).mode() == 0x1f && m_enhancements.at(m_enhancements.size()-2).address() == 0x3f && m_enhancements.at(m_enhancements.size()-2).data() == newX26Triplet.data())
|
while (m_enhancements.size()>1 && m_enhancements.at(m_enhancements.size()-2).mode() == 0x1f && m_enhancements.at(m_enhancements.size()-2).address() == 0x3f && m_enhancements.at(m_enhancements.size()-2).data() == newX26Triplet.data())
|
||||||
m_enhancements.removeLast();
|
m_enhancements.removeLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PageX26Base::packetFromEnhancementListNeeded(int n) const
|
||||||
|
{
|
||||||
|
return ((m_enhancements.size()+12) / 13) > n;
|
||||||
|
}
|
||||||
|
|||||||
@@ -26,18 +26,16 @@
|
|||||||
#include "pagebase.h"
|
#include "pagebase.h"
|
||||||
#include "x26triplets.h"
|
#include "x26triplets.h"
|
||||||
|
|
||||||
class PageX26Base : public PageBase //: public QObject
|
class PageX26Base : public PageBase
|
||||||
{
|
{
|
||||||
//Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
X26TripletList *enhancements() { return &m_enhancements; };
|
X26TripletList *enhancements();
|
||||||
virtual int maxEnhancements() const =0;
|
virtual int maxEnhancements() const =0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QByteArray packetFromEnhancementList(int p) const;
|
QByteArray packetFromEnhancementList(int p) const;
|
||||||
void setEnhancementListFromPacket(int p, QByteArray pkt);
|
void setEnhancementListFromPacket(int p, QByteArray pkt);
|
||||||
bool packetFromEnhancementListNeeded(int n) const { return ((m_enhancements.size()+12) / 13) > n; };
|
bool packetFromEnhancementListNeeded(int n) const;
|
||||||
|
|
||||||
X26TripletList m_enhancements;
|
X26TripletList m_enhancements;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,6 +26,41 @@ X26Triplet::X26Triplet(int address, int mode, int data)
|
|||||||
m_data = data;
|
m_data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int X26Triplet::address() const
|
||||||
|
{
|
||||||
|
return m_address;
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::mode() const
|
||||||
|
{
|
||||||
|
return m_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::modeExt() const
|
||||||
|
{
|
||||||
|
return (m_address >= 40) ? m_mode : (m_mode | 0x20);
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::data() const
|
||||||
|
{
|
||||||
|
return m_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::addressRow() const
|
||||||
|
{
|
||||||
|
return (m_address == 40) ? 24 :m_address-40;
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::addressColumn() const
|
||||||
|
{
|
||||||
|
return (m_address);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool X26Triplet::isRowTriplet() const
|
||||||
|
{
|
||||||
|
return (m_address >= 40);
|
||||||
|
}
|
||||||
|
|
||||||
void X26Triplet::setAddress(int address)
|
void X26Triplet::setAddress(int address)
|
||||||
{
|
{
|
||||||
m_address = address;
|
m_address = address;
|
||||||
@@ -51,6 +86,26 @@ void X26Triplet::setAddressColumn(int addressColumn)
|
|||||||
m_address = addressColumn;
|
m_address = addressColumn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int X26Triplet::objectSource() const
|
||||||
|
{
|
||||||
|
return (m_address & 0x18) >> 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::objectLocalDesignationCode() const
|
||||||
|
{
|
||||||
|
return (((m_address & 0x01) << 3) | (m_data >> 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::objectLocalTripletNumber() const
|
||||||
|
{
|
||||||
|
return m_data & 0x0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::objectLocalIndex() const
|
||||||
|
{
|
||||||
|
return objectLocalDesignationCode() * 13 + objectLocalTripletNumber();
|
||||||
|
}
|
||||||
|
|
||||||
void X26Triplet::setObjectLocalDesignationCode(int i)
|
void X26Triplet::setObjectLocalDesignationCode(int i)
|
||||||
{
|
{
|
||||||
m_address = (m_address & 0x38) | (i >> 3);
|
m_address = (m_address & 0x38) | (i >> 3);
|
||||||
@@ -68,6 +123,46 @@ void X26Triplet::setObjectLocalIndex(int i)
|
|||||||
m_data = (((i / 13) & 0x07) << 4) | (i % 13);
|
m_data = (((i / 13) & 0x07) << 4) | (i % 13);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int X26Triplet::activePositionRow() const
|
||||||
|
{
|
||||||
|
return m_activePositionRow;
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::activePositionColumn() const
|
||||||
|
{
|
||||||
|
return m_activePositionColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::activePositionRow1p5() const
|
||||||
|
{
|
||||||
|
return m_activePositionRow1p5;
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26Triplet::activePositionColumn1p5() const
|
||||||
|
{
|
||||||
|
return m_activePositionColumn1p5;
|
||||||
|
}
|
||||||
|
|
||||||
|
X26Triplet::X26TripletError X26Triplet::error() const
|
||||||
|
{
|
||||||
|
return m_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool X26Triplet::reservedMode() const
|
||||||
|
{
|
||||||
|
return m_reservedMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool X26Triplet::reservedData() const
|
||||||
|
{
|
||||||
|
return m_reservedData;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool X26Triplet::activePosition1p5Differs() const
|
||||||
|
{
|
||||||
|
return m_activePosition1p5Differs;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void X26TripletList::updateInternalData()
|
void X26TripletList::updateInternalData()
|
||||||
{
|
{
|
||||||
@@ -282,6 +377,35 @@ void X26TripletList::replace(int i, const X26Triplet &value)
|
|||||||
updateInternalData();
|
updateInternalData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void X26TripletList::removeLast()
|
||||||
|
{
|
||||||
|
m_list.removeLast();
|
||||||
|
}
|
||||||
|
|
||||||
|
const X26Triplet &X26TripletList::at(int i) const
|
||||||
|
{
|
||||||
|
return m_list.at(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool X26TripletList::isEmpty() const
|
||||||
|
{
|
||||||
|
return m_list.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void X26TripletList::reserve(int alloc)
|
||||||
|
{
|
||||||
|
m_list.reserve(alloc);
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26TripletList::size() const
|
||||||
|
{
|
||||||
|
return m_list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
const QList<int> &X26TripletList::objects(int t) const
|
||||||
|
{
|
||||||
|
return m_objects[t];
|
||||||
|
};
|
||||||
|
|
||||||
X26TripletList::ActivePosition::ActivePosition()
|
X26TripletList::ActivePosition::ActivePosition()
|
||||||
{
|
{
|
||||||
@@ -293,6 +417,21 @@ void X26TripletList::ActivePosition::reset()
|
|||||||
m_row = m_column = -1;
|
m_row = m_column = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int X26TripletList::ActivePosition::row() const
|
||||||
|
{
|
||||||
|
return m_row; // return (m_row == -1) ? 0 : m_row;
|
||||||
|
}
|
||||||
|
|
||||||
|
int X26TripletList::ActivePosition::column() const
|
||||||
|
{
|
||||||
|
return m_column; // return (m_column == -1) ? 0 : m_column;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool X26TripletList::ActivePosition::isDeployed() const
|
||||||
|
{
|
||||||
|
return m_row != -1;
|
||||||
|
}
|
||||||
|
|
||||||
bool X26TripletList::ActivePosition::setRow(int row)
|
bool X26TripletList::ActivePosition::setRow(int row)
|
||||||
{
|
{
|
||||||
if (row < m_row)
|
if (row < m_row)
|
||||||
|
|||||||
@@ -36,13 +36,13 @@ public:
|
|||||||
|
|
||||||
X26Triplet(int address, int mode, int data);
|
X26Triplet(int address, int mode, int data);
|
||||||
|
|
||||||
int address() const { return m_address; }
|
int address() const;
|
||||||
int mode() const { return m_mode; }
|
int mode() const;
|
||||||
int modeExt() const { return (m_address >= 40) ? m_mode : (m_mode | 0x20); }
|
int modeExt() const;
|
||||||
int data() const { return m_data; }
|
int data() const;
|
||||||
int addressRow() const { return (m_address == 40) ? 24 :m_address-40; }
|
int addressRow() const;
|
||||||
int addressColumn() const { return (m_address); }
|
int addressColumn() const;
|
||||||
bool isRowTriplet() const { return (m_address >= 40); }
|
bool isRowTriplet() const;
|
||||||
|
|
||||||
void setAddress(int address);
|
void setAddress(int address);
|
||||||
void setMode(int mode);
|
void setMode(int mode);
|
||||||
@@ -50,23 +50,23 @@ public:
|
|||||||
void setAddressRow(int addressRow);
|
void setAddressRow(int addressRow);
|
||||||
void setAddressColumn(int addressColumn);
|
void setAddressColumn(int addressColumn);
|
||||||
|
|
||||||
int objectSource() const { return (m_address & 0x18) >> 3; }
|
int objectSource() const;
|
||||||
|
|
||||||
int objectLocalDesignationCode() const { return (((m_address & 0x01) << 3) | (m_data >> 4)); }
|
int objectLocalDesignationCode() const;
|
||||||
int objectLocalTripletNumber() const { return m_data & 0x0f; }
|
int objectLocalTripletNumber() const;
|
||||||
int objectLocalIndex() const { return objectLocalDesignationCode() * 13 + objectLocalTripletNumber(); }
|
int objectLocalIndex() const;
|
||||||
void setObjectLocalDesignationCode(int i);
|
void setObjectLocalDesignationCode(int i);
|
||||||
void setObjectLocalTripletNumber(int i);
|
void setObjectLocalTripletNumber(int i);
|
||||||
void setObjectLocalIndex(int i);
|
void setObjectLocalIndex(int i);
|
||||||
|
|
||||||
int activePositionRow() const { return m_activePositionRow; }
|
int activePositionRow() const;
|
||||||
int activePositionColumn() const { return m_activePositionColumn; }
|
int activePositionColumn() const;
|
||||||
int activePositionRow1p5() const { return m_activePositionRow1p5; }
|
int activePositionRow1p5() const;
|
||||||
int activePositionColumn1p5() const { return m_activePositionColumn1p5; }
|
int activePositionColumn1p5() const;
|
||||||
X26TripletError error() const { return m_error; }
|
X26TripletError error() const;
|
||||||
bool reservedMode() const { return m_reservedMode; }
|
bool reservedMode() const;
|
||||||
bool reservedData() const { return m_reservedData; }
|
bool reservedData() const;
|
||||||
bool activePosition1p5Differs() const { return m_activePosition1p5Differs; }
|
bool activePosition1p5Differs() const;
|
||||||
|
|
||||||
friend class X26TripletList;
|
friend class X26TripletList;
|
||||||
|
|
||||||
@@ -91,14 +91,13 @@ public:
|
|||||||
void insert(int i, const X26Triplet &value);
|
void insert(int i, const X26Triplet &value);
|
||||||
void removeAt(int i);
|
void removeAt(int i);
|
||||||
void replace(int i, const X26Triplet &value);
|
void replace(int i, const X26Triplet &value);
|
||||||
|
void removeLast();
|
||||||
|
const X26Triplet &at(int i) const;
|
||||||
|
bool isEmpty() const;
|
||||||
|
void reserve(int alloc);
|
||||||
|
int size() const;
|
||||||
|
|
||||||
void removeLast() { m_list.removeLast(); }
|
const QList<int> &objects(int t) const;
|
||||||
|
|
||||||
const X26Triplet &at(int i) const { return m_list.at(i); }
|
|
||||||
bool isEmpty() const { return m_list.isEmpty(); }
|
|
||||||
void reserve(int alloc) { m_list.reserve(alloc); }
|
|
||||||
int size() const { return m_list.size(); }
|
|
||||||
const QList<int> &objects(int t) const { return m_objects[t]; };
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateInternalData();
|
void updateInternalData();
|
||||||
@@ -111,11 +110,9 @@ private:
|
|||||||
public:
|
public:
|
||||||
ActivePosition();
|
ActivePosition();
|
||||||
void reset();
|
void reset();
|
||||||
// int row() const { return (m_row == -1) ? 0 : m_row; }
|
int row() const;
|
||||||
// int column() const { return (m_column == -1) ? 0 : m_column; }
|
int column() const;
|
||||||
int row() const { return m_row; }
|
bool isDeployed() const;
|
||||||
int column() const { return m_column; }
|
|
||||||
bool isDeployed() const { return m_row != -1; }
|
|
||||||
bool setRow(int);
|
bool setRow(int);
|
||||||
bool setColumn(int);
|
bool setColumn(int);
|
||||||
// bool setRowAndColumn(int, int);
|
// bool setRowAndColumn(int, int);
|
||||||
|
|||||||
Reference in New Issue
Block a user