CORE POS - IS4C
The CORE POS front end
|
Public Member Functions | |
javascriptFile () | |
SavePortConfiguration ($portName) | |
SaveDirectoryConfiguration ($absPath) | |
ReadFromScale () | |
WriteToScale ($str) | |
ReadReset () | |
PHP Module for talking to hardware
This class deals with reading and writing to hardware devices that PHP can't talk to directly. Normally this means "scanner scale". All drivers should provide a ScaleDriverWrapper subclass.
Modules that extend this class must at least define ReadFromScale and WriteToScale.
ScaleDriverWrapper::javascriptFile | ( | ) |
Javascript used to interact with scale driver. Default is poll-scale.js.
Javascript file must provide a function named pollScale.
ScaleDriverWrapper::ReadFromScale | ( | ) |
Reads available scale and scanner input Function should print a JSON object with two fields: 'scale' is an HTML string to display current scale weight/status 'scans' is a string representing a UPC Use scaledisplaymsg() to generate scale HTML. This ensures appropriate weight-related session variables are updated.
ScaleDriverWrapper::ReadReset | ( | ) |
Clear all pending input
If the driver has been running in the backgounrd and the browser hasn't, there could be a lot of accumulated weight data. POS uses this method to discard everything on startup.
ScaleDriverWrapper::SaveDirectoryConfiguration | ( | $absPath) |
This method updates the driver code or configuration with the specified path
$absPath | is the top of IT CORE, should have trailing slash not used much See the SavePortConfiguration() method for details. |
ScaleDriverWrapper::SavePortConfiguration | ( | $portName) |
This method updates the driver code or configuration with the specified port name.
$portName | a serial port device name e.g., /dev/ttyS0 or COM1 Not used much In practice it's kind of a mess. The driver code has to be browser-writable for this to work and in many cases the driver also needs to be recompiled. Browser-based driver configuration just doesn't work very well, so if your implementation skips this method that's probably fine. |
ScaleDriverWrapper::WriteToScale | ( | $str) |
Sends output to the scale.
$str | the output Currently supported messages (not case sensitive):
|