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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user