Skip to content

Commit

Permalink
Change C8 Update bit generation logic to be dependent on source pages.
Browse files Browse the repository at this point in the history
If C8 bit is set in a loaded page transmit it once and clear the bit in memory (only transmit update once). This puts the generation of update under editorial control.
Previous behaviour was to generate an update bit any time a file changed (or transmit continuously if present in input file)
  • Loading branch information
ZXGuesser committed Aug 10, 2020
1 parent 3608a8e commit ece7ddd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 44 deletions.
15 changes: 8 additions & 7 deletions packetmag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,14 @@ Packet* PacketMag::GetPacket(Packet* p)
_region=_page->GetRegion();
}

// If the page has changed, then set the update bit.
// This is by request of Nate. It isn't a feature required in ETSI
if (_page->Changed())
{
_status|=PAGESTATUS_C8_UPDATE;

_status|=PAGESTATUS_C4_ERASEPAGE; // also set the erase flag
// Handle pages with update bit set in a useful way.
// This isn't defined by the specification.
if (_status & PAGESTATUS_C8_UPDATE){
// Clear update bit in stored page so that update flag is only transmitted once
_page->SetPageStatus(_status & ~PAGESTATUS_C8_UPDATE);

// Also set the erase flag in output. This will allow left over rows in adaptive transmission to be cleared without leaving the erase flag set causing flickering.
_status|=PAGESTATUS_C4_ERASEPAGE;
}
}

Expand Down
12 changes: 1 addition & 11 deletions ttxline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@

TTXLine::TTXLine(std::string const& line, bool validateLine):
m_textline(validate(line)),
_nextLine(nullptr),
_changed(false)
_nextLine(nullptr)

{
if (!validateLine)
Expand All @@ -49,10 +48,6 @@ TTXLine::~TTXLine()

void TTXLine::Setm_textline(std::string const& val, bool validateLine)
{
if (m_textline.compare(val)!=0) // changed flag is used to set the C8 flag
{
_changed=true;
}
if (validateLine)
m_textline = validate(val);
else
Expand Down Expand Up @@ -110,11 +105,6 @@ char TTXLine::SetCharAt(int x,int code)
{
char c=m_textline[x];
code=code & 0x7f;
// If the existing character is changed, then set the changed flag.
if (c!=code)
{
_changed=true;
}
m_textline[x]=code;
return c;
}
Expand Down
4 changes: 0 additions & 4 deletions ttxline.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,13 @@ class TTXLine

void Dump();

bool GetChanged(){bool temp=_changed;_changed=false;return temp;}; /// Get the changed status (and clear the flag)

protected:
private:
std::string validate(std::string const& test);

std::string m_textline;
TTXLine* _nextLine;
// If SetLine or SetChar can set the changed flag.
// The changed flag is used to set the C8 flag and then is reset.
bool _changed; /// If the line contents has changed. Set by SetLine or SetChar

};

Expand Down
16 changes: 0 additions & 16 deletions ttxpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,6 @@ TTXPage::TTXPage(std::string filename) :
// std::cerr << "Finished reading page. Loaded=" << m_Loaded << std::endl;
}

bool TTXPage::Changed()
{
bool changed=_fileChanged; // begin with file change state
_fileChanged=false; // clear the flag
for (uint8_t row=1;row<=MAXROW;row++)
{
TTXLine* line=GetRow(row);
if (line!=nullptr && line->GetChanged())
{
changed=true;
// Could break here BUT the changed state in the other rows must be cleared
}
}
return changed;
}

void TTXPage::m_Init()
{
m_region=0;
Expand Down
6 changes: 0 additions & 6 deletions ttxpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,6 @@ class TTXPage
* Warning. Only deep copies the top page. Not for carousels (yet)
*/
void Copy(TTXPage* src);

/** \brief Check if any line in the page has changed.
* This can only be called once as it will clear the changed state.
* This is NOT the same as pageChanged.
*/
bool Changed();

void SetFileChangedFlag(){_fileChanged=true;};

Expand Down

0 comments on commit ece7ddd

Please sign in to comment.