Model Railroad System  2.2.2
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
lcc::ConfigMemory Class Reference

Configure memory. More...

Public Member Functions

 ConfigMemory (name,...)
 Construct a memory config dialog. More...
 
 _Close ()
 Close and destroy the dialog box. More...
 
 _Read ()
 Bound to the Read button. More...
 
 _Write ()
 Bound to the Write button. More...
 
 _getAddressRange (thespace)
 Get the address range of the specified space. More...
 
 _Dump ()
 Bound to the Dump button. More...
 
 _dumpAsText (thespace, startaddress, endaddress)
 Dump a space as text (typically the CDI). More...
 
 _dumpAsHex (thespace, startaddress, endaddress)
 Dump a space as hex (typically the configuration memory). More...
 
 _Restore ()
 Bound to the Restore button. More...
 

Private Member Functions

 _datagramhandler (command, sourcenid,...)
 Datagram message handler. More...
 
 _messagehandler (message)
 Message handler – handle incoming messages. More...
 
 _readmemory (_space, _address, length, status_var)
 Method to read a block of configuration memory. More...
 
 _writememory (_space, _address, databuffer)
 Write a block of data to configuration memory. More...
 
 putdebug (message)
 Print message using debug output, if any. More...
 

Private Attributes

 readlist
 Read list. More...
 
 writelist
 Write list. More...
 
 count
 Byte count. More...
 
 address
 Start address. More...
 
 space
 Space select. More...
 
 _ioComplete
 I/O Completion Flag. More...
 
 olddatagramhandler
 Old datagram handler. More...
 
 oldgeneralmessagehandler
 Old general message handler. More...
 
 datagrambuffer
 Datagram message buffer. More...
 
 _datagramrejecterror
 Last datagram rejection error. More...
 
 writeReplyCheck
 Flag to check for a write reply. More...
 

Static Private Attributes

static _spaces
 Space values. More...
 

Detailed Description

Configure memory.

Create a dialog box that reads and writes the configuration memory of an OpenLCB node.

Options:

Constructor & Destructor Documentation

◆ ConfigMemory()

lcc::ConfigMemory::ConfigMemory ( name  ,
  ... 
)

Construct a memory config dialog.

Parameters
namePathname of the widget.
...Options:
  • -destnid Node ID to send to.
  • -transport LCC Transport object.

Member Function Documentation

◆ _Close()

lcc::ConfigMemory::_Close ( )

Close and destroy the dialog box.

◆ _datagramhandler()

lcc::ConfigMemory::_datagramhandler ( command  ,
sourcenid  ,
  ... 
)
private

Datagram message handler.

This method is called when a datagram type message arrives.

Parameters
commandOne of datagramreceivedok, datagramrejected, or datagramcontent.
sourcenidThe Node ID of the node sending the datagram.
...The data buffer, if any.
  • -debugprint A function to handle debug output.

◆ _Dump()

lcc::ConfigMemory::_Dump ( )

Bound to the Dump button.

Dump the configuration memory to a file. Either as text (if space is CDI) or Hex (if space is NOT CDI).

◆ _dumpAsHex()

lcc::ConfigMemory::_dumpAsHex ( thespace  ,
startaddress  ,
endaddress   
)

Dump a space as hex (typically the configuration memory).

Dump a device's memory as a hex file. This is typically the device's configuration memory.

Parameters
thespaceThe space.
startaddressThe start address
endaddressThe end address

◆ _dumpAsText()

lcc::ConfigMemory::_dumpAsText ( thespace  ,
startaddress  ,
endaddress   
)

Dump a space as text (typically the CDI).

Dump a device's memory as a text file. This is typically the device's CDI.

Parameters
thespaceThe space.
startaddressThe start address
endaddressThe end address

◆ _getAddressRange()

lcc::ConfigMemory::_getAddressRange ( thespace  )

Get the address range of the specified space.

This performs a Get Address Space Information Command and then returns the address range info.

Parameters
thespaceThe space.

◆ _messagehandler()

lcc::ConfigMemory::_messagehandler ( message  )
private

Message handler – handle incoming messages.

Certain messages are processed:

Initialization Complete Messages – This is a possible response to freeze, unfreeze, reset, or reinitialize commands.

◆ _Read()

lcc::ConfigMemory::_Read ( )

Bound to the Read button.

Read a block of memory and display the results.

◆ _readmemory()

lcc::ConfigMemory::_readmemory ( _space  ,
_address  ,
length  ,
status_var   
)
private

Method to read a block of configuration memory.

Read a block of memory, return the data bytes. The variable named by the status_var is side effected with the status code.

Parameters
_spaceThe memory space to read from.
_addressThe address to start reading from.
lengthThe number of bytes to read.
status_varThe name of a status variable.
Returns
The data block read.

◆ _Restore()

lcc::ConfigMemory::_Restore ( )

Bound to the Restore button.

Reload configuration memory from a hex dump file.

◆ _Write()

lcc::ConfigMemory::_Write ( )

Bound to the Write button.

Write a block of memory.

◆ _writememory()

lcc::ConfigMemory::_writememory ( _space  ,
_address  ,
databuffer   
)
private

Write a block of data to configuration memory.

This method writes a block of memory to configuration memory of an OpenLCB node.

Parameters
_spaceThe memory space to write to.
_addressThe address to start writing to.
databufferThe list of bytes to write.
Returns
The result status: 0 if successful, otherwise an error code.

◆ putdebug()

lcc::ConfigMemory::putdebug ( message  )
private

Print message using debug output, if any.

Parameters
messageThe message to print.

Member Data Documentation

◆ _datagramrejecterror

lcc::ConfigMemory::_datagramrejecterror
private

Last datagram rejection error.

◆ _ioComplete

lcc::ConfigMemory::_ioComplete
private

I/O Completion Flag.

◆ _spaces

lcc::ConfigMemory::_spaces
staticprivate

Space values.

◆ address

lcc::ConfigMemory::address
private

Start address.

◆ count

lcc::ConfigMemory::count
private

Byte count.

◆ datagrambuffer

lcc::ConfigMemory::datagrambuffer
private

Datagram message buffer.

◆ olddatagramhandler

lcc::ConfigMemory::olddatagramhandler
private

Old datagram handler.

◆ oldgeneralmessagehandler

lcc::ConfigMemory::oldgeneralmessagehandler
private

Old general message handler.

◆ readlist

lcc::ConfigMemory::readlist
private

Read list.

◆ space

lcc::ConfigMemory::space
private

Space select.

◆ writelist

lcc::ConfigMemory::writelist
private

Write list.

◆ writeReplyCheck

lcc::ConfigMemory::writeReplyCheck
private

Flag to check for a write reply.