Skip to content

Commit

Permalink
Revert "Create a second page list for each magazine to hold any "spec…
Browse files Browse the repository at this point in the history
…ial" pages which need to be transmitted on particular schedule (GPOP, POP, GDRCS, DRCS, MOT, and MIP pages)."

This reverts commit ff2d3bd.
  • Loading branch information
ZXGuesser committed Sep 17, 2017
1 parent 0e765c6 commit 7192856
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
1 change: 0 additions & 1 deletion filemonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ void FileMonitor::run()
// We need a mutex or semaphore to lock out this page while we do that
// lock
p->LoadPage(name); // What if this fails? We can see the bool. What to do ?
//TODO: If this was a normal page and is now a special page or vice versa we have loaded it into the wrong pagelist! FIX ME!
p->SetModifiedTime(attrib.st_mtime);
// unlock

Expand Down
18 changes: 4 additions & 14 deletions pagelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ int PageList::LoadPageList(std::string filepath)
q->GetPageCount(); // Use for the side effect of renumbering the subcodes

int mag=(q->GetPageNumber() >> 16) & 0x7;
PageFunction func = q->GetPageFunction();
if (func == GPOP || func == POP || func == GDRCS || func == DRCS || func == MOT || func == MIP){
_pageList[mag+8].push_back(*q); // put page in separate pageList for "special" pages
} else {
_pageList[mag].push_back(*q); // This copies. But we can't copy a mutex
}
_pageList[mag].push_back(*q); // This copies. But we can't copy a mutex
}
}
}
Expand Down Expand Up @@ -92,13 +87,8 @@ int PageList::LoadPageList(std::string filepath)

void PageList::AddPage(TTXPageStream* page)
{
int mag=(page->GetPageNumber() >> 16) & 0x7;
PageFunction func = page->GetPageFunction();
if (func == GPOP || func == POP || func == GDRCS || func == DRCS || func == MOT || func == MIP){
_pageList[mag+8].push_back(*page); // put page into separate pageList for "special" pages
} else {
_pageList[mag].push_back(*page); // put page into the normal page sequence
}
int mag=(page->GetPageNumber() >> 16) & 0x7;
_pageList[mag].push_back(*page);
}


Expand All @@ -107,7 +97,7 @@ TTXPageStream* PageList::Locate(std::string filename)
{
// This is called from the FileMonitor thread
// std::cerr << "[PageList::Locate] *** TODO *** " << filename << std::endl;
for (int mag=0;mag<16;mag++) // check both sets of page lists as it might be one of the special pages
for (int mag=0;mag<8;mag++)
{
//for (auto p : _pageList[mag])
for (std::list<TTXPageStream>::iterator p=_pageList[mag].begin();p!=_pageList[mag].end();++p)
Expand Down
2 changes: 1 addition & 1 deletion pagelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class PageList

private:
Configure* _configure; // The configuration object
std::list<TTXPageStream> _pageList[16]; /// The list of Pages in this service. Two lists per magazine (normal pages in lists 0-7, enhancement and magazine inventory and organisation table pages in 8-15)
std::list<TTXPageStream> _pageList[8]; /// The list of Pages in this service. One list per magazine
vbit::Mag* _mag[8];

// iterators through selected pages. (use the same iterator for D command and MD, L etc.)
Expand Down

0 comments on commit 7192856

Please sign in to comment.