Store page numbers in Page classes

Although the document class keeps the page number, the sub pages may
need to know the page number as well. For example X/27 packets
contain relative magazine numbers which need the current page number
to calculate the actual page numbers referenced.
This commit is contained in:
G.K.MacGregor
2020-09-18 17:37:16 +01:00
parent 02d8fba193
commit 4cd080ab0e
3 changed files with 18 additions and 1 deletions

View File

@@ -23,6 +23,7 @@
PageBase::PageBase()
{
m_pageNumber = 0x8ff;
m_pageFunction = PFLOP;
m_packetCoding = PC7bit;
// We use nullptrs to keep track of allocated packets, so initialise them this way
@@ -34,6 +35,7 @@ PageBase::PageBase()
PageBase::PageBase(const PageBase &other)
{
setPageNumber(other.pageNumber());
setPageFunction(other.pageFunction());
setPacketCoding(other.packetCoding());
for (int i=0; i<8; i++)
@@ -50,6 +52,11 @@ PageBase::~PageBase()
delete m_packets[i];
}
void PageBase::setPageNumber(int newPageNumber)
{
m_pageNumber = newPageNumber;
}
QByteArray PageBase::packet(int packetNumber, int designationCode) const
{
int arrayIndex = packetNumber;