xCPS
Protected Member Functions | Protected Attributes | Friends | List of all members
CommSystem Class Reference

#include <CommSystem.h>

Collaboration diagram for CommSystem:
Collaboration graph

Protected Member Functions

 CommSystem ()
 
void writeOutput_add (int output, int cardnumber)
 
void writeOutput_sub (int output, int cardnumber)
 
U32 readInput (int channelnumber)
 

Protected Attributes

I16 _Card0
 
I16 _Card1
 
I16 _Card2
 
I16 _Read0
 
int _out0
 
int _out1
 
int _out2
 
U32 _in0
 
U32 _in1
 

Friends

class xCPS
 
class IndexTable
 
class Turner
 
class PickPlace
 
class Band
 
class Stopper
 
class Switch
 
class Arm
 
class Sensor
 
class Separator
 

Detailed Description

Author
Max Houwing
Date
November 26th, 2015

This class handles all of the communication of the xCPS system. Usage of this class is not necessary, since all of the component classes contain code that writes to and reads from this class already. There are two methods that handle writing: writeOutput_add and _sub. This has been done to avoid passing an argument that controls what the function needs to do, instead there is one function for adding to the current output of the system (_add) and one for removing a bit from the output (_sub). Furthermore, the readInput method returns the entire bit stream of that particular channel number, leaving it up to user to retrieve the relevant bit.

Warning
It is strongly advised to not use this class, and instead using the (other) component classes to write, and the sensor_isUp() method (or relevant function inside a component class) to read.

Constructor & Destructor Documentation

CommSystem::CommSystem ( )
protected

Register all cards seperately, this is done to simplify possible error tracking

Member Function Documentation

U32 CommSystem::readInput ( int  channelnumber)
protected

Reads the (sensor) input from the specified channel number. There are only 2 channel numbers: 0 and 1.

void CommSystem::writeOutput_add ( int  output,
int  cardnumber 
)
protected

Writes the output by first ORing with the current output value.

void CommSystem::writeOutput_sub ( int  output,
int  cardnumber 
)
protected

Removes from the output by 'subbing' from the current output value.


The documentation for this class was generated from the following files: