To Do List:
Antenna Layer
Masd layer
Other
Debug levels
Using Debug class
Debug levels
Sync Box
Running the Sync Box
Commands
Sync Box data Rate
General Information
Mce
Running the Mce
Re-set the Mce:
Commands
General Information
README notes
Far Future
Things to combine
Things to delete
Computers
Notes from Walt, January 7, 2009
More notes from Walt and Steve Benton, January 7, 2009
Reading out bbc_pci frame numbers
Control Layer modifications
Mediator Layer modifications
Notes:
Antenna Layer modifications
Notes
Files List (incomplete)
MASD code
Notes
New Files (Incomplete, I think this list is no longer necessary)

To Do List:

-

Antenna Layer

- Zero buffer for Pmac
  - Timig lag between SyncBox interrupts and sampling
HK
  - Clean up DataBase, NetDataParse once we know what registers we want.
  - Gps in Antenna Layer

Masd layer

- FrameBoard
  - Re-initialzie arrays after writing slow frame.
Commands
  - MASD_COMMAND_PIPE in devicemap.h

Other

Debug levels

Using Debug class

In binary (ex bin_AntennaControl.cc), set debug level
  Debug::setLevel(Program::getiParameter("debuglevel"))
  Debug::addLevel(Debug::DEBUG11)

Anywhere,
  if(Debug::debugging(Debug::DEBUG11)) { }
  DBPRINT(bool, level, statement);

Debug levels

DEBUG1

DEBUG_CAN

DEBUG2

init script
GenericMasterTask
DEBUG_CALTERT

DEBUG3

lots of stuff
DEBUG_SIGNAL
scanner connection

DEBUG4

Mce commands
Tracker
DEBUG_DELAY -> GenericMasterTask, Location.cc, SignalTask.cc

DEBUG5

util/common/Coordinates

Masd frame packing timing
Antenna frame packing timing

DEBUG6

DEBUG_PMACK

DEBUG7

DEBUG_TRACKER
mediator/Scanner
  - serviceMsgQ

Antenna Layer - general open

DEBUG8

DEBUG_IFMOD

Antenna Layer Frame Packing

Masd Layer Frame Packing

DEBUG9

DEBUG10

mediator/Scanner
  - Deal with Antenna and Mce threads
  - Pack frames
mediator/Master
  - everything
masd/MasdMonitor
  - packFrame

DEBUG11

Antenna Layer:
antenna/control/bicep SyncBox stuff.
Masd Layer:
Threads

Sync Box

Running the Sync Box

The Sync Box is controled from a gtkterm:

$ gtkterm &

Synco> ?

Set the Number of Rows:
  nr #
Set the Row Length:
  rl #
Set the free-run mode:
  fr #

The data rate is calculated from these three: see "Sync Box data Rate"

Commands

Commands:
  - h help
  - ? get Manco Status
  - rl n set Row_Len, n=1 to 4095
  - nr n set Num_Rows, n=1 to 63
  - rt set RTS_Mode
  - fr n set FreeRun Mode n=1 to 4095
  - fn n set Frame Sequence Number, n=0 to 2^32-1
  - st stop
  - go enable Manchout
  - dpa pwr diable all
  - dpu n pwr disable unit, n=0 to 7
  - epu n pwer enable unit, n=0 to 7
  - pof get ACDCU_onoff cntl byte
  - ps get ACDCU status
  - re Reset all to defaults

Note Row_Len is 1/2 of the value for the MCE, i.e.
Row_Len(Sync) = 50 > Row_Len(MCE) 100

Use (?) to get the current settings.

Sync Box data Rate

Set the DV pulse rate as follows:
Rate = 50Mhz / (2*Row_Len * Num_Row * FRun_Count )

Thus, to get 100 HZ:
rl 50
nr 50
fr 100

For now, Walt seems to like:
rl = 50
nr = 33
fr = 75

General Information

Sync Box device node: /dev/ttyUSB0

Mce

Running the Mce

Re-set the Mce:

$ mce_reset_clean

Set the Mce to run off of sync box pulses:

$ mce_clock_mode 1 2 2

Run:
./mce_pipe_acq [#frames] [readout cards] [data rate] [#rows]
Note: data rate and #rows Must match the sync box fr!

$ ./mce_pipe_acq 1000 1 75 33

Re-set the Mce:

$ mce_cmd -x mce_reset
$ mce_cmd -x mce_dsp_reset
$ mce_cmd -x fakestop
$ mce_cmd -x empty

Commands

mce_cmd
mce_reset_clean
mce_make_config
mce_reconfig
mce_clock_mode 1 2 2

General Information

scripts: mce_pipe_acq
on bicep32 in /home/bicep/

Device Nodes:

Device nodes are: mce_cmd0, mce_data0, mce_dsp0, mcelog

bicep@bicep32:~$ ls -l /dev/ |grep mce
crw-rw-r-- 1 root mce 247, 0 2009-03-19 19:32 mce_cmd0
crw-rw-r-- 1 root mce 246, 0 2009-03-19 19:32 mce_data0
crw-rw-r-- 1 root mce 248, 0 2009-03-19 19:32 mce_dsp0
crw-rw---- 1 root root 10, 227 2009-03-19 16:41 mcelog

Device Nodes: set up in /etc/rc.local with the following:
modprobe mce_dsp
/usr/mce/bin/mas_mknodes
sudo -u bicep /usr/mce/bin/maslog_server

Named Pipes:
These are set within mce_pipe_acq. Currently, they are:
/data/cryo/mas_data_pipe
/data/cryo/mas_data_pipe.run

README notes

Basic Running
Need to define the following in bashrc (or tcshrc):
export GCP_DIR=/home/bicep/gcp/control

DEBUG types: what they are used for.

Far Future

Things to combine

Here is a list of code that could is almost identically copied from the Antenna layer to the Masd layer that I think I could combine.

BicepShare.h, cc
Board stuff
  - Board.h
  - FrameBoard.h

Things to delete

antenna/control/BicepShare
BicepPmacLock class


Computers

Notes from Walt, January 7, 2009

Hi guys,

Here's the status of all the systems we've been working on at bicep1.  Is
there somewhere that this sort of info should be logged?  The summary is:

       MCE, sync box, BBC PCI card - checked out & working
       Symmetricom card for GPS - needs new software kit or 32-bit server
       Blast bus - not tested

Details:

* bicep1: moved to desk in south-east corner of Bicep 2 work area in the high
bay.  I tested the fit in the electronics rack, and found that the computer's
case is ~4" longer than the rack is deep, so it's geometrically impossible to
mount.  We will either have to use a deeper rack or a smaller form-factor
server for deployment.

* MCE: Working, firmware on all cards is current.  Fully hooked up to bicep1
and to the sync box.  Currently, the power supply is still the one borrowed
from Spider.  (When Spider wants it back, we can fetch the MCE power supply
from JPL).  I'm leaving the MCE powered off for now, so please ask if you
would like to do remote tests.

* Sync box: hooked up to MCE (via fiber), bicep1 (via serial interface), and
BBC PCI card (via three-way cable).  Control works correctly through serial
terminal, and frame number readout works correctly through bbc_pci driver.
I'm leaving the sync box powered on and free-running.  Will check what
happens when the frame number wraps around.

* BBC PCI card: installed in bicep1.  The physical situation of this card is
very delicate!  It doesn't screw into the case, and has a re-entrant power
cable.  Extreme care is needed when moving bicep1.  I have already popped a
switch off one of our three copies (this switch is needed only for JTAG
programming mode, so the card will still work properly).  The bbc_pci driver
is compiled from Steve Benton's current CVS and installed.  With the
test_bbcpci test program, I can verify that communication over PCI bus and to
the sync box are working.  It should now be possible for Kyle to get sync box
frame numbers into GCP.

* Blast bus: Still powered off and with no cards in it.

* Symmetricom card: Symmetricom has sent the latest 32-bit driver only.  To
get the latest 64 bit drivers, we will have to place a new software kit
order.  I can place the order now; otherwise, we can bump bicep1 back down to
a 32 bit kernel.  For now, I'll test it out on our spare 32-bit machine.

- Walter

More notes from Walt and Steve Benton, January 7, 2009

Excellent.  I can now read out sync box frame numbers through the pci card,
using test_bbcpci, and it responds correctly when I control the sync box over
the serial port interface.  Kyle, the hardware and bbcpci driver are now
working and ready for you to work on importing them into GCP.  For now, I'll
leave the sync box powered on.  Let me know when you want the MCE crate
itself powered on for any tests.

- Walt

On Tuesday 06 January 2009 20:41:49 Steve Benton wrote:
> Walt Ogburn wrote:
> > Hi Steve,
> >
> > Now that test_bbcpci is working, the next step should be to get frame
> > numbers from the sync box.  A sample of test_bbcpci output is
> >
> > 6e79 5f803cf4 1 00f83cf4 .... .... **** *... ..** **.. **** .*.. a8ff3cf4
> > 6e7a 5f8100f8 1 00f83cf4 .... .... **** *... ..** **.. **** .*.. a8ff3cf4
> > 6e7b 4001b002 1 00f83cf4 .... .... **** *... ..** **.. **** .*.. a8ff3cf4
> > 6e7d 5f803cf5 1 00f83cf5 .... .... **** *... ..** **.. **** .*.* a8ff3cf5
> > 6e7e 5f8100f8 1 00f83cf5 .... .... **** *... ..** **.. **** .*.* a8ff3cf5
> > 6e7f 4001b002 1 00f83cf5 .... .... **** *... ..** **.. **** .*.* a8ff3cf5
> > 6e81 5f803cf6 1 00f83cf6 .... .... **** *... ..** **.. **** .**. a8ff3cf6
> > 6e82 5f8100f8 1 00f83cf6 .... .... **** *... ..** **.. **** .**. a8ff3cf6
> > 6e83 4001b002 1 00f83cf6 .... .... **** *... ..** **.. **** .**. a8ff3cf6
> > 6e85 5f803cf7 1 00f83cf7 .... .... **** *... ..** **.. **** .*** a8ff3cf7
> > 6e86 5f8100f8 1 00f83cf7 .... .... **** *... ..** **.. **** .*** a8ff3cf7
> > 6e87 4001b002 1 00f83cf7 .... .... **** *... ..** **.. **** .*** a8ff3cf7
> >
> > You mentioned in December that column 3 should have the frame number; but
> > this is output as only a single hex character, 4 bits.  Shouldn't the
> > frame number be a 32-bit word?  I suspect that column 4 may be the frame
> > number instead, since it is the right length and since it increments.
> > However, it seems to increment in the same way regardless of the state of
> > the sync box: connected, disconnected, power on, power off.
>
> You're right on both counts: column 4 is the frame number, and it isn't
> behaving right. The card is currently set to internal counting mode. To
> change to external (snyc box) mode, you need to switch the ioctl
> statements at line 72 (also, I've fixed the frame rate, I think the one
> commented out originally is wrong...but it doesn't really matter in the
> test program):
>
> steve@parker:~/bbcpci$ cvs diff test_bbcpci.c
> Index: test_bbcpci.c
> ===================================================================
> RCS file: /var/cvs/bbcpci/test_bbcpci.c,v
> retrieving revision 1.4
> diff -r1.4 test_bbcpci.c
> 72,76c72,76
> < //  ioctl(fp, BBCPCI_IOC_EXT_SER_ON);
> < //  ioctl(fp, BBCPCI_IOC_IRQ_RATE, 1);
> < //  ioctl(fp, BBCPCI_IOC_FRAME_RATE, 1);
> <   ioctl(fp, BBCPCI_IOC_EXT_SER_OFF);
> <   ioctl(fp, BBCPCI_IOC_IRQ_RATE, 320000);
> ---
>
>  >   ioctl(fp, BBCPCI_IOC_EXT_SER_ON);
>  >   ioctl(fp, BBCPCI_IOC_IRQ_RATE, 1);
>  >   ioctl(fp, BBCPCI_IOC_FRAME_RATE, 2);
>  >   //ioctl(fp, BBCPCI_IOC_EXT_SER_OFF);
>  >   //ioctl(fp, BBCPCI_IOC_IRQ_RATE, 320000);
>
> Also, like I mentioned before, the ioctl command for getting the serial
> number (that test_bbcpci uses) works but isn't necessary. The PCI card
> forces the serial number into the frame (which is why two of the words
> in test_bbcpci are changed). In mcplib it is accessed by BB_getIndex().
>
> -Steve

Reading out bbc_pci frame numbers

Kyle,

I'll put something together under spuder.  (I'm trying to track down the astro
sysadmins for a password reset...)

On bicep1, I have my own copy of the bbc code under ~reuben/benton/.  You can
find test_bbcpci at ~reuben/benton/bbcpci.  You should probably check out
your own copy of the bbcpci and bbcsync packages from Steve Benton's CVS
repository; you should have instructions on this in a couple of e-mails from
Steve in December.

The output of test_bbcpci is just a dump, like this:

27ae 5f80116a 1 0000116b .... .... .... .... ...* ...* .**. *.** dc6a116a
27af 5f810000 1 0000116b .... .... .... .... ...* ...* .**. *.** dc6a116a
27b0 4001b002 1 0000116b .... .... .... .... ...* ...* .**. *.** dc6a116a
27b2 5f80116c 1 0000116d .... .... .... .... ...* ...* .**. **.* dc6a116c
27b3 5f810000 1 0000116d .... .... .... .... ...* ...* .**. **.* dc6a116c
27b4 4001b002 1 0000116d .... .... .... .... ...* ...* .**. **.* dc6a116c
27b6 5f80116e 1 0000116f .... .... .... .... ...* ...* .**. **** dc6a116e
27b7 5f810000 1 0000116f .... .... .... .... ...* ...* .**. **** dc6a116e
27b8 4001b002 1 0000116f .... .... .... .... ...* ...* .**. **** dc6a116e
27ba 5f801170 1 00001171 .... .... .... .... ...* ...* .*** ...* dc6a1170
27bb 5f810000 1 00001171 .... .... .... .... ...* ...* .*** ...* dc6a1170
27bc 4001b002 1 00001171 .... .... .... .... ...* ...* .*** ...* dc6a1170

Column 4 is the frame number from the sync box.  You shouldn't need to do
anything with the bbcpci kernel driver, which is now installed and working.
But test_bbcpci and the bbcsync driver should get you started on how to
handle the frame numbers.

- Walt

Control Layer modifications

gcp/control/code/unix/libunix_src/specific/specificregs.c

Antenna Layer changes

Add a new RegBlockTemp for the SyncBox in the Antenna Layer:
static RegBlockTemp bicepSyncBox[] = {
  RegBlockTemp("The SyncBox Frame number",
                "fast_frameNumber", REG_FAST|REG_UINT, 0, 1, NSAMPLESPERFRAME),

  RegBlockTemp("The SyncBox Frame Number indexing slow frames",
                "slow_frameNumber", REG_UINT, 0, 1),

};


_Add this block to bicep_antenna_boards_[]:_
  {"syncBox", bicepSyncBox, ARRAY_DIM(BicepSyncBox), {0x0},
    "Frame number from the Sync Box and BlastBus PCI card"},
    "Frame number from the Sync Box and BlastBus PCI card"},

MASD changes

Add several temporary, toy registers for the mce:
static RegBlockTemp bicepMce[] = {

  RegBlockTemp("Test of reading run files",
                "mceRunFileTest", REG_FLOAT|REG_PREAVG|REG_FAST, 0, 1),

  RegBlockTemp("Test of reading data files",
                "mceDataFileTest", REG_FLOAT|REG_PREAVG|REG_FAST, 0, 1),

  RegBlockTemp("Bitmask of received flags for all boxes",
                "received", REG_FAST|REG_UINT, 0, 1, NSAMPLESPERFRAME),
};

Add the mce board:
staticRegBoardTemp bicep_mce_board[] = {
  {"mceBoard", bicepMce, ARRAY_DIM(bicepMce), {0x0},
    "BICEP mce receiver"},
};

Create a template for the mce:
staticRegTemplate bicep_mce_template {

> bicep_mce_board, ARRAY_DIM(bicep_mce_board) > }; > > _Declare a method for returning the mce template:_ > RegTemplate* specificMceTemplate() > { > return &bicep_mce_template; > } > > _Add mce to the template for the entire array:_ > static RegTemp bicep_regtemplates[] {

  {"array", &bicep_array_template, "General array boards"},
  {"antenna0", &bicep_antenna_template, "Boards of the antenna"},
  {"mce0", &bicep_mce_template, "Boards of the mce"},
};

gcp/control/code/unix/libunix_src/common/genericregs.c (modified)

RegTemplate* specificMceTemplate();
New Methods
  - RegMap *new_MceRegMap(void);
  - long net_MceRegMap_size(void);
  - int net_put_MceRegmap(gcp::control::Netbuf *net);

gcp/control/code/unix/libunix_src/specific/rtcnetcoms.h, c (modified)

rtcnetcoms.h
L26
ANT_NET_ID_MSG
MCE_NET_ID_MSG

struct RtcNetMsg {
  NetUint mces; (add)
}

typedef struct {
  NetMask mces; (add)
}

struct RtcNetCmd {
  NetMask mces; (add)
}

rtcnetcoms.c
static const NetObjMember datasystem_cmd_members[] = {
  {"mces", offsetof(NetDataSystemCmd, mces), NET_MASK, 1}, (add)
}


Mediator Layer modifications

Notes:

ArcFileConverter - modify -> ??
ArrayFrameBuffer - modify -> ??
util/common/NetMsgHandler
control/code/unix/libunix_src/bicep/rtcnetcoms.h, cc - modify RtcNetMsg


Control:
mediator/bicep/Scanner.cc
  - fill in sendFlagMceMsg(...)
mediator/bicep/MceControlMsg.h
  - inline void packFlagMceMsg(...);

gcp/mediator/specific/MceConsumer.h, cc (new)

Modeled after gcp/mediator/specific/AntennaConsumerNormal.h, cc

MceConsumer
derrived from GenericTask< ScannerMsg >
Fields:
  - Scanner* parent_
  - static MceConsumer* consumer_
  - int nMce_
  - gcp::util::TcpListener* listener_
  - gcp::util::NetCommHandler temporaryHandler_
  - std::vector connectedHandlers_
  - gcp::util::TimeVal startTime_
  - gcp::util::timeVal timer_
  - struct timeval* timeOut_
  - std::string mceRegisterName_
Methods:
  - void connectTcpIp()
  - void serviceMsgQ()
  - void listen(bool listenVar)
  - void initializeConnection()
  - void terminateconnection(gcp::util::NetHandler* str)
  - void terminateConnection(gcp::util::NetCommHandler* str)
  - void finalizeConnection()
  - void sendGreetingMsg()
  - bool timeOut()
  - static NET_READ_HANDLER(netMsgReadHandler)
  - static NET_SEND_HANDLER(netMsgSentHandler)
  - static NET_ERROR_HANDLER(netMsgErrorHandler)
  - static NET_READ_HANDLER(netMceDataFrameReadHandler)
  - static NET_ERROR_HANDLER(netMceDataFrameErrorHandler)

gcp/mediator/bicep/MceControl.h, cc (new)

MceControl : GenericTask< MceControlMsg >
Fields:
  - Control* parent_
  - static MceControl* control_
  - int nMce_
  - gcp::util::TcpListener* listener_
  - gcp::util::NetCommHandler temporaryHandler_
  - std::vector< gcp::util::NetCommHandler* > connectedHandlers_
  - std::list< MceControlMsg >::iterator initScriptIter_
  - bool recordingInitScript_
  - init InProgress_
  - enum InitState [UNINITIALIZED, INITIALIZING, INITIALIZED]
  - vector< InitState > mceInitState_
  - enum ConnectedState [ DISCONNECTED, PENDING, CONNECTED]
  - vector< ConnectedState > mceConnectState_
  - vector< bool > sendPending_
  - int nConnected_
  - gcp::util::timeVal startTime_
  - gcp::util::timeVal timer_
  - struct timeval* timeOut_
  - unsigned int pending_
  -
Methods:
  - void setPending(unsigned imce, bool pending)
  - bool haveControlConnection(unsigned short imce)
  - void connectTcpIp()
  - void processMsg(MceControlMsg* taskMsg)
  - void sendRtcNetCmd(MceControlMsg* msg)
  - static NET_SEND_HANDLER(netMsgSentHandler)
  - static NET_SEND_HANDLER(netCmdSentHandler)
  - static NET_ERROR_HANDLER(netErrorHandler)
  - void setInitState(InitState state)
  - void recordInitMsg(MceControlMsg* msg)
  - void beginInitScript()
  - void sendNextInitMsg()
  - void endInitScript()
  - bool haveMcesReady()
  - void flagMce(MceControlMsg* msg)
  - bool listening()
  - void serviceMsgQ()
  - void initializeconnection()
  - void terminateConnection(gcp::util::NetcommHandler8 str, bool shutdown=true)
  - void terminateconnection(unsigned short imce, bool shutdown=true)
  - void forwardNetMsg(gcp::util::NetMsg* msg)
  - void sendMceGreetingMsg(gcp::util::NetCommHandler* netHandler)
  - static NET_READ_HANDLER(processTempraryNetMsg)
  - static NET_READ_HANDLER(processNetMsg)
  - void ilsten(bool restartListening)
  - bool timedOut()
  - void startRecordingInitScript()
  - void stopRecordingInitScript()

gcp/mediator/bicep/MceControlMsg.h (new)

MceControlMsg : GenericTaskMsg
Fields:
  - enum MsgType type
  - union {
    - struct {unsigned mce, bool flag} flagMce
    - struct {bool start} init
    - struct {NetCmdId opcode, RtcNetCmd cmd} netCmd
  } body
  - MceNum::Id mces
  - bool init_
Methods:
  - MasdMasterMsg* getMasterMsg()
  - packBeginInitMsg()
  - packEndInitMsg()
  - packInitMsg()
  - packFlagMceMsg(unsigned mce, bool flag)
  - packRtcNetCmdMsg(RtcNetCmd* cmd, NetCmdId opcode)
  - initialize()

gcp/util/common/NetMceDataFrameHandler (new)

NetMceDataFrameHandler : NetHandler
Derrived class of NetHandler
Fields:
  - MceDataFrameManager frame_;
Methods:
  - setMce(gcp::util::MceNum::Id mceId)
  - unsigned int getMce()
  - MceDataFrameManager* getFrame()

gcp/util/common/MceDataFrameManager (new)

MceDataFrameManager : RegMapDataFrameManager
derrived from RegMapDataFrameManager
Fields:
  - MceDataFrame* mceFrame_
Methods:
  - setMce(gcp::util::MceNum::Id mceId)
  - getMceIntId()
  - getMce()
  - initialize(bool archiveOnly=false)
  - operator=(RegMapDataFrameManager& fm);
  - operator=(AntennaDataFrameManager& fm);

gcp/util/common/MceDataFrame (new)

MceDataFrame : DataFrameNormal
derrived from DataFrameNormal
Fields:
  - gcp::util::MceNum mceNum_
Methods:
  - virtual void setMce(unsigned int)
  - virtual void setMce(gcp::util::MceNum::Id mceId)
  - virtual void setMce(const gcp::util::MceNum& mceNum)
  - MceNum getMce()
  - unsigned getMceIntId()
  - unsigned char* data()
  - operator=(DataFrameNormal& frame);
  - operator=(MceDataFrame& frame);

gcp/util/common/MceFrameBuffer (new)

This is effectively a wrapper class for FrameBuffer

/gcp/util/common/MceNum (new)

MceNum
enum Id {
  MCENONE, MCE0, MCE1, MCE2, MCE3, MCE4, MCE5, MCE6, MCE7, MCEMAX, MCEALL
  } id_
Fields:
  - static const unsigned int NMCE = 8
  - static const unsigned int NBASE = (NMCE*(NMCE-1))/2
Methods:
  - bool isValidSingleMce()
  - static bool isValidSingleMce(Id mceId)
  - std::string getMceName()
  - std::string getString()
  - std::string getLoggerPrefix()
  - unsigned int getDelayEngineIntId()
  - unsigned int getIntId()
  - Id getId(
  - unsigned short getDcMceIndex()
  - unsigned short getDcNodeIndex()
  - unsigned int getMceMax()
  - void set(AntNum::Id id)
  - bool isSet(unsigned id)
  - bool isSet(MceNum::Id id)
  - bool isSet(MceNum& mceNum)
  - bool isSet(MceNum* mceNum)
  - void setId(MceNum::Id)
  - void setId(unsigned int id)
  - void setId(const MceNum& mceNum)
  - void setIdFromHost()
  - static MceNum::Id intToMceId(unsigned int imce)
  - static unsigned idToInt(MceNum::Id id)
  - std::string printMceSet()
  - std::string printMceSet(MceNum::Id id)
  - const MceNum operator+(const MceNum& rx)
  - bool operator<(const MceNum rx)
  - bool operator>(const MceNum rx)
  - bool operator>=(const MceNum rx)
  - bool operator==(const MceNum rx)
  - const MceNum& operator++()
  - const AntNum operator++(int)
  - friend std::ostream& operator<<(std::ostream& os, const MceNum& rx)
  - friend std::ostringstream& operator<<(std::ostringstream& os, const MceNum& rx);
  - friend MceNum::Id operator+(const MceNum::Id id1, const MceNum::Id id2)
  - friend MceNum::Id operator-(const MceNum::Id id1, const MceNum::Id id2)
  - frield bool isValidMce(unsigned int mce)
  - frield bool isValidMceSet(MceNum::Id mces)
  - frield std::string printMceSet(MceNum::Id mcex)
  - friend MceNum::Id intToMceId(unsigned int imce)
  - friend unsigned idToInt(MceNum::Id id)
  - void checkMaxMce()
Friend declarations
  - bool isValidMce(unsigned int mce)
  - std::string printMceSet(MceNum::Id mces)

gcp/mediator/MceNetCmdForwarder.h, cc (new)

Fields:
  - Control* parent_
Methods:
  - void forwardNetCmd(gcp::util::NetCmd* netCmd)

gcp/util/bicep/MceNetCmdForwarder.h, cc (new)

Fields:
  [none]
Methods:
  - virtual void forwardNetCmd(gcp::util::NetCmd* netCmd);
  - virtual void forwardControlNetCmd(gcp::util::NetCmd* netCmd)

gcp/mediator/bicep/Control.h, cc (modified)

Control
Modified Fields:
  - MceControl* mceControl_ (new)

Modified Methods:
  - Control::Control (modified)
    add Mce thread

  - CONTROL_TASK_FWD_FN(forwardMceControlMsg) (new)
  - void sendMceInitMsg(bool start) (new)

Other Changes:

Control.h

L45
class MceControl;

L148
      gcp::util::NetCommHandlerBase* netCommHandlerptr_;

L167
      static THREAD_START(startMceControl);

L206
      static THREAD_CLEAN(cleanMceControl);

L245
      static THREAD_PING(pingMceControl);

Control.cc


"gcp/util/common/MceNum.h"


"gcp/mediator/bicep/MceControl.h"



gcp/mediator/bicep/ControlMsg.h (modified)

Modified Fields:

gcp/mediator/bicep/TransNetCmdForwarder.h

Modified Fields:
  -
Modified Methods:
  - Constructor
    mceForwarder_
  //- void forwardMceNetCmd(gcp::util::NetCmd* netCmd) (new)
  - void forwardMceControlMsg(ControlMsg* msg) (new)

gcp/util/bicep/ArrayNetCmdForwarder (modified)

Modified Fields:
  - NetCmdForwarder* mceForwarder_ (new)

Modified Methods:
  - Constructor
  - Destructor
  - forwardNetCmd(gcp::util::NetCmd* netCmd)
    Edit this later, when we actually have commands to send down.
  - forwardMceNetCmd(gcp::util::NetCmd* netCmd) (new)

/gcp/mediator/specific/Scanner (modified)

Scanner.h
New Fields:
  - MceConsumer* mceConsumer_
  - unsigned nMce_
  - std::vector nArchiveMce_
  - std::vector mceStartSlots_
  - std::vector mceRecSlots_
  - unsigned mceReceivedLast_
  - unsigned mceReceivedCurrent_
  // - std::string mceBoardName_
  // - std::string mceRegisterName_
New Methods:
  - packMceFrame(gcp::util::MceDataFrameManager* frame)
  - static THREAD_START(startMceConsumer)
  - static THREAD_CLEAN(cleanMceConsumer)
  - void initMceResources()
  - setMceReceived(bool received, gcp::util::ArrayDataFrameManager* frame=0)
  - setMceReceived(unsigned imce, bool received, gcp::util::ArrayDataFrameManager* frame=0)
  - bool mceChangedState()
  - void reportMceStateChange()
  - void sendFlagMceMsg(unsigned mce, bool flag)
Modified Methods:
  - reportStateChanged()

Other Changes:
L 14

"gcp/util/common/MceDataFrameManager.h"


L36
namespace util {
  class MceDataFrameManager
}

L49
    class MceConsumer;

L92
    friend class MceConsumer;

Scanner.cc
L5

"gcp/util/common/MceDataFrameManager.h"


L13

"gcp/mediator/bicep/MceConsumer.h"


L63
mceConsumer_ = 0;

L76
threads_.push_back(new Thread(&startAntennaConsumer,
                              &cleanAntennaConsumer,
                              0, "AntennaConsumer"));

L93
initMceResources();

L239
void Scanner::initMceResources() { ... }

L450
void Scanner::setMceReceived(...) { ... }

L459
void Scanner::setMceReceived(...) { ... }

L491
void Scanner::packMceFrame(...) { ... }

L623
bool Scanner::mceChangedState() { ... }

L628
void Scanner::reportStateChanged()
{
  code to report mce changed state
}

L748
THREAD_START(Scanner::startMceConsumer) { ... }

L806
THREAD_CLEAN(Scanner::cleanMceConsumer) { ... }

L948
void Scanner::sendFlagMceMsg(unsigned mce, bool flag) { ... }

util/common/Ports.h (modified)

# define TRANS_MCE_CONTROL_PORT 451+PORT_OFFSET
  # define TRANS_MCE_SCANNER_PORT 452+PORT_OFFSET

util/common/ArrayDataFrameManager.h, cc (modified)

New Methods
  - void writeMceRegMap(MceDataFrameManager& fm, bool lockFrame)
  - ArrRegMap* findMceRegMap(MceDataFrameManager& fm)

gcp/util/common/NetMsg.h (modified)

L12
# include "gcp/util/common/MceNum.h"
Modified Fields:
  - MsgType [ ANT_ID, MCE_ID ] (modified)

New Methods:
  - inline packGreetingMsg(unsigned int rxType, ...) (modified)
      added switch on rxType
  - inline void setMceId(MceNum::Id mceId);
  - inline packMceIdMsg(unsigned int id)

gcp/util/common/NetCommHandler.h, cc

NetCommHandler

Modified Fields:
  - enum RxType [ ANT=0, MCE=1, GRABBER=2 ] rxType_ (new)
  - MceNum mceNum_ (new)

Modified Methods:
  - constructor (modified)
      mceNum_.setId(MceNum::MCENONE);
  - void setRxType(int rxType) (new)
  - inline unsigned getIntId() (modified)
      switch over rxType_

gcp/util/common/NetMsgHandler.h, cc (modified)

NetMsgHandler : NetHandler

Modified Fields:
  - enum RxType [ ANT=0, MCE=1, GRABBER=2 ] rxType_ (new)

Modified Methods:
  - NetMsgHandler::NetMsgHandler(int rxType) (modified)
  - void setRxType(int rxType) (new)
  - packNetMsg(NetMsg* msg) (modified)
      Add switch depending on rxType
  - packGreetingMsg() (modified)
      Add switch depending on rxType
  - packMceIdMsg(unsigned int mce)
  - readNetMsg()
      Add switch depending on rxType

gcp/util/common/NetCmdHandler.h, cc (modified)

NetCmdHandler : NetHandler

Modified Fields:
  - enum RxType [ ANT=0, MCE=1, GRABBER=2 ] rxType_ (new)

Modified Methods:
  - void setRxType(int rxType) (new)
  - void packNetCmd(rtc, opcode) (modified)
      Add switch depending on rxType (ANT, GRABBER, MCE)
  - void readNetCmd() (modified)
      Add switch depending on rxType

Antenna Layer modifications

Notes

Files List (incomplete)

antenna/control/bicep/AntennaRx.h, cc (modified)

AntennaRx

Field:
  - bool simSync_ (new)

Methods:
  - bool simSync() (new)

antenna/control/bicep/AntennaMaster.h, cc (modified)

AntennaMaster
Fields:
  -
Methods:
AntennaMaster::AntennaMaster(...simSync,...)
add simSync

bool simSync()
{ return parent_-> simSync(); }

antenna/control/bicep/bin_AntennaControl.cc (modified)

Program::main(void)
add keyword "simSync"
add simSync to AntennaMaster constructor

antenna/control/bicep/DataBase.h, cc (modified)

DataBase

Fields:
  - SyncBoard* syncBox_ (new)
  - bool simSync_ (new)
  - NetDataParse* syncp_

  ~ Removed bool simData_
  ~ Removed NetDataBoard data_


Methods:

DataBase::DataBase(AntennaRx* parent) (modified)
  syncBox_ = 0;

  sync_ = new SyncBoard(parent_->simSync());

DataBase::DataBase(bool simPmac, book simGps, bool simSync) (modified)

DataBase::~DataBase()
  if(sync_ != 0) {
    delete sync_;
    sync_ = 0;
  }

bufferTimeData(unsigned iSamp) (modified)
{ timep_->readGpsTimeSample(iSamp); }

bufferFrameNumber(unsigned iSamp) (new)
{
  std::cout << "Frame number = " << frameNumber << std::endl;
}

bufferData(...) (removed)

bufferHKData(unsigned iSamp) (new) replaces bufferData() {
  bufferFrameNumber(unsigned iSamp);
  bufferPmacData(iSamp);
  bufferTimeData(iSamp);
}

writeBoxData() (removed)

writeData() (removed)

writeHKData() (new) replaces writeData() {
  writeFrameNumber();
  writePmacData();
  writeTimeData();
}

initParsers()
{
...
  syncp_ = new NetDataParse(share_, "sync");
  syncp_->init_sync_registers();
}

antenna/control/bicep/DataNew.cc (modified)

Methods:
serviceMsgQ()
  completely redo.

antenna/control/bicep/SyncBoard.h, cc (new)

SyncBoard
Fields:
  - bool simulate
  - int bbc_fd_
  - char* bbc_device_node_;

  - int frameNumber_current_
  - int frameNumber_prev_

Methods:
  - int readFrameNumber()

antenna/control/bicep/Test/tbbc_device_node.dat (new)

named pipe. Created with:
mkfifo tbbc_device_node.dat

MASD code

Notes

New Classes I need to define:
  - MasComms (PmacComms)
  - MasCommsMsg (PmacCommsMsg)
  - MasCommand (PmacCommand)

Classes to modify
  - util::NetHandler (from MasdMonitor)
  - control/code/unix/libunix_src/specific/devicemap.h (BOLO_DAT_NBOX)
Timing
  - MasdMaster::installTimers() needs to be driven by receiving sync box pulse.
Other:
  TRANS_MASD_CONTROL_PORT
  TRANS_MASD_SCANNER_PORT
  MceRx -> deal with Data, DataNew
  NCHAN (NetDataParse), number of detectors (pixels) per mce crate
  NMCE = 1 for now.
  NSAMPLESPERFRAME
  READFILE_SIZE
  DATAFILE_SIZE
  NET_INIT_CMD is still not working properly for mce initialization

Cleanup:
  - get rid of FrameSender in Antenna Layer
  - get rid of all Corba stuff
  - get rid of all SZA comments

New Files (Incomplete, I think this list is no longer necessary)

gcp/masd/bicep/MasdMaster.h, cc (new)

MasdMaster
derrived class of
  - GenericMasterTask< MasdMasterMsg >
  - BicepTask
Fields:
  - bool simData_;
  - static MasdMaster* master_;
  - gcp::util::MceNum* mceNum_;
  - std::string host_;
  - int cmdport_;
  - std::string cmdhost_;
  - const char* pipe_runfile_;
  - const char* pipe_data_;
  - const char* pipe_mas_;
  - const char* pipe_command_;
  - gcp::masd::MasdControl* controlTask_;
  - gcp::masd::MasdData* dataTask_;
  - gcp::masd::MasdMonitor* monitorTask_;
Methods:
  - restartServices()
  - SIGNALTASK_HANDLER_FN(doNothing)
  - SIGNALTASK_HANDLER_FN(sendSendHeartBeatMsg)
  - SIGNALTASK_HANDLER_FN(sendShutDownMsg)
  - SIGNALTASK_HANDLER_FN(sendPackDataFrameMsg)
  - sendPackDataFrameMsg()
  - SIGNALTASK_HANDLER_FUNCTION(sendDataStrobeMsg)
  - SIGNALTASK_HANDLER_FUNCTION(sendConnectControlMsg)
  - SIGNALTASK_HANDLER_FUNCTION(sendConnectScannerMsg)
  - sendAdoptBoardMsg(unsigned short, MasdTask::Id taskId)
  - MASDMASTER_TASK_FWD_FN(forwardMasterMsg)
  - BicepShare* getShare()
  - gcp::util::MceNum* getMce()
  - inline std::string host() {return host_;}
  - inline const char* runFilePipe()
  - inline const char* dataPipe()
  - inline const char* masPipe()
  - inline const char* commandPipe()
  - inline int cmdPort() {return cmdport_;}
  - inline std::string cmdHost() {return cmdhost_;}
  - inline bool simData() {return simData_;}
  - inline bool prio() {return prio_;};
  - THREAD_START(startMasdMonitor)
  - THREAD_START(startMasdControl)
  - THREAD_START(startMasdData)
  - THREAD_START(startMasdSignal);
  - static THREAD_CLEAN(cleanMasdMonitor);
  - static THREAD_CLEAN(cleanMasdControl);
  - static THREAD_CLEAN(cleanMasdData);
  - static THREAD_CLEAN(cleanMasdSignal);
  - static THREAD_PING(pingMasdControl);
  - static THREAD_PING(pingMasdMonitor);
  - static THREAD_PING(pingMasdData);
  - void processMsg(MasdMasterMsg* taskMsg);
  - static MASDMASTER_TASK_FWD_FN(fowardControlMsg);
  - static MASDMASTER_TASK_FWD_FN(forwardMonitorMsg);
  - static MASDMASTER_TASK_FWD_FN(forwardDataMsg);
  - static SIGNALTASK_HANDLER_FN(sendRestartMsg);
  - void sendHeartBeat();
  - void installTimers();
  - void installSignals();

masd/bicep/MasdTask.h (new)

MasdTask.h
Purpose:
  The following class just enumerates know masd tasks.
enum Id [ UNKNOWN, MASTER, MONITOR, DATA ]

masd/bicep/MasdMasterMsg.h (new)

MasdMasterMsg.h
enum MsgType [ CONTROL_MSG, CONTROL_CONNECTED, SCANNER_CONNECTED, MONITOR_MSG, DATA_MSG, SEND_HEARTBEAT ]
union {
  struct {bool connected} controlConnected
  struct {bool connected} scannerConnected
  MasdControlMsg controlMsg
  MasdMonitorMsg monitorMsg
  MasdDataMsg dataMsg
} body
Fields:
  - MsgType type
  - union body
Methods:
  - inline MasdControlMsg* getControlMsg()
  - inline MasdMonitorMsg* getMonitorMsg()
  - inline MasdDataMsg* getDataMsg()
  - inline void packSendHeartBeatMsg()
  - inline void packControlConnectedMsg(bool connected)
  - inline void packScannerConnectedMsg(bool connected)

masd/bicep/MasdControl.h, cc (new)

MasdControl

Fields:
  - static MasdControl* control_;
  - MasdMaster* parent_;
  - MasdNetCmeForwarder* forwarder_;
  - gcp::util::NetCommHandler netCommHandler_;
  - gcp::util::TcpClient client_;
  - FrameSender sender_;
  -
Methods:
  - FrameSender* getSender();
  - bool connect();
  - bool isConnected();
  - void disconnect();
  - void connectControl(bool reEnable);
  - void disconnectControl();
  - void serviceMsgQ();
  - void sendControlConnectedMsg(bool connected);
  - static LOG_HANDLER_FN(sendLogMsg);
  - static LOG_HANDLER_FN(sendErrMsg);
  - void processMsg(MasdControlMsg* msg);
  - void packNetMsg(MasdControlMsg* msg);
  - void sendGreeting();
  - static NET_READ_HANDLER(netCmdReadHandler);
  - static NET_SEND_HANDLER(netMsgReadHandler);
  - static NET_SEND_HANDLER(netMsgSentHandler);
  - static NET_ERROR_HANDLER(netErrorHandler);
  - void sendMceIdMsg();
  - void parseGreetingMsg(gcp::util::NetMsg* msg);

masd/bicep/MasdControlMsg.h (new)

MasdControlMsg.h
enum MsgType [ CONNECT, NETMSG ]
union { gcp::util::NetMsg networkMsg }
Fields:
  - MsgType type
  - union body
Methods:
  - inline gcp::util::NetMsg* getNetMsg()
  - inline void packConnectMsg()

masd/bicep/MasdMonitor.h, cc (new)

MasdMonitor
Derrived class of BicepTask, gcp::util::GenericTask< MasdMonitorMsg >
Fields:
  - Scanner* scanner_;
  - MasdMaster* parent_;
  - FrameSender* sender_;
  - std::string host_;
  - gcp::util::TcpClient client_;
  - gcp::util::NetMsgHandler netMsgHandler_;
  - bool connectionPending_;
  - gcp::util::NetHandler netDataFrameHandler_;
  - bool dispatchPending_;
  -
Methods:
  - void sendDispatchDataFrameMsg();
  - void processMsg(MasdMonitorMsg* taskMsg);
  - bool connect();
  - void disconnect();
  - void connectScanner(bool reEnable);
  - void disconnectScanner();
  - void serviceMsgQ();
  - static NET_READ_HANDLER(netMsgReadHandler);
  - static NET_SEND_HANDLER(netMsgSentHandler);
  - static NET_SEND_HANDLER(netDataFrameSentHandler);
  - static NET_ERROR_HANDLER(netErrorHandler);
  - void packNextFrame();
  - void dispatchNextFrame();
  - void packFrame(gcp::util::DataFrame* frame);
  - void sendScannerConnectedMsg(bool connected);
  - void sendMceIdMsg();
  - void parseGreetingMsg(gcp::util::NetMsg* msg);

masd/bicep/MasdMonitorMsg.h (new)

MasdMonitorMsg.h
enum MsgType [ CONNECT, FLAG_BOARD, PACK_DATAFRAME, DISPATCH_DATAFRAME ]
union {
  struct {
    unsigned short board
    bool flag
  } flagBoard
} body
Fields:
  - MsgType type
  - union body
Methods:
  - inline void packFlagBoardMsg(unsigned short board, bool flag)
  - inline void packPackDataFrameMsg()
  - inline void packDispatchDataFrameMsg()
  - inline void packDispatchDataFrameMsg()
  - ?? inline void packConnectMsg() ??

masd/bicep/Scanner.h, cc (new)

Fields:
  - double mceRunFileTest_
  - double mceDataFileTest_
  - unsigned int slowFrameTest_
  - BicepShare* share_
  - gcp::util::MceFrameBuffer fb_
  - FrameBoard* frame_
  - bool skipOne_
  - unsigned recordNumber_
Methods:
  - void packNextFrame()
  - gcp::util::DataFrameManager* dispatchNextFrame()
  - unsigned int getNframesInQueue()
  - list< Board* > listBoards()
  - void initialize()

masd/bicep/MceRx.h, cc (new)

MceRx
Derrived from BicepTask, GenericTask< MceRxMsg >

Fields:
  - int cmdport_;
  - std::string cmdhost_;
  - const char* pipe_runfile_;
  - const char* pipe_data_;
  - const char* pipe_mas_;
  - const char* pipe_command_;
  - DataBase* dataTask_;
  - CommandTask* commandTask_;
  - unsigned long count;
  - MasdMaster* parent_;
  - static MceRx* mceRx_;

Methods:
  - BicepShare* getShare();
  - gcp::util::MceNum* getMce();
  - void sendPackDataFrameMsg();
  - static THREAD_START(startData);
  - static THREAD_START(startCommand);
  - static THREAD_CLEAN(cleanData);
  - static THREAD_CLEAN(cleanCommand);
  - bool simData();
  - bool simSyncBox();
  - void processMsg(MceRxMsg* msg);
  - static MCERX_TASK_FWD_FN(forwardDataMsg);
  - static MCERX_TASK_FWD_FN(forwardCommandMsg);
  - static MCERX_TASK_FWD_FN(forwardMceRxMsg);

masd/bicep/MceRxMsg.h (new)

MceRxMsg.h
Derrived class of GenericTaskMsg
enum MsgType [ DATA_MSG, COMMAND_MSG, FLAG_BOARD, DATA_STROBE ]
union {
  struct {
    int box
    int nbox
    char channel3
    char protocol
    char command
    char parameters17
  }
  CommandMsg commandMsg
  DataMsg dataMsg
}

Fields:
  - Msg Type type
  - union body
Methods:
  - inline void packDataStrobeMsg()
  - inline CommandMsg* getCommandMsg()
  - inline DataMsg* getDataMsg()

masd/bicep/BicepShare.h, cc (new)

BicepShare
enum TimeOut [ NO_WAIT, WAIT_FOREVER ]
struct hostAddress{ char* name, char* address }
Fields:
  - static BicepShare* share;
  - static HostAddress host_address[];
  - unsigned* tmpbuf_;
  - std::string controlHost_;
  - BicepRegDb *regdb_;
  - BicepClock *clock_;
Methods:
  - BicepShare(std::string host)
  - static std::string hostIpAddress(std::string host);
  - static void pciBusErrorHandler(int sig);
  - static void pciSegvErrorHandler(int sig);
  - void grabRegs(TimeOut timeout);
  - void ungrabRegs();
  - void flagBoard(int board);
  - void unflagBoard(int board);
  - bool verifyBoard(int board);
  - double getLst(double utc);
  - double getTt(double lst);
  - double getUtc();
  - void setClock(unsigned long mjd, unsigned long sec, unsigned long nanoSeconds);
  - void setClock(gcp::util::TimeVal& time);
  - void setClock();
  - RegMapBoard* findRegMapBoard(std::string boardName);
  - void freezePmacReadout();
  - unsigned int getNboard();
  - unsigned int getNarchived();
  - unsigned int getNreg();
  - unsigned int getNbyte();
  - void packFrame(gcp::util::DataFrameManager* frame);
  - void getGpsTime(gcp::util::RegDate& regDate);

class BicepRegDb
Purpose: Access to the register database and its shadow registers is
          provided through an object of this type.
Fields:
  - RegMap *regmap_; // the BICEP register map
  - pthread_mutex_t guard_;
  - unsigned *shadow_; // Shadow and local register buffer
  - int nshadow_;

Methods:
  - void grabRegs(TimeOut timeout);
  - void ungrabRegs();
  - RegMapBoard* findRegMapBoard(std::string boardName);
  - void flagBoard(int board);
  - void unflagBoard(int board);
  - bool verifyBoard(int board);
  - unsigned* boardStatusReg(int board);

class BicepClock
I MAY NOT NEED THIS CLASS
Fields:
  - pthread_mutex_t guard_;
  - gcp::util::TimeVal time_;
Methods:
  - void setClock(unsigned long mjd, unsigned long sec, unsigned long nanoSeconds);
  - void setClock(gcp::util::TimeVal& time);
  - void setClock();
  - double getUtc();

masd/bicep/BicepTask.h, cc (new)

BicepTask

masd/bicep/Board.h, cc (new)

Fields:
  - BicepShare* share_;
  - RegMapBoard* board_;
  - bool hasBoard_;
Methods:
  - RegMapBlock* findReg(char* name);
  - bool isReachable();
  - virtual void reset() {};
  - int getIndex();
  - virtual void readReg(RegMapBlock* blk, unsigned int first,
            unsigned int nreg, unsigned int* value);
  - virtual void writeReg(RegMapBlock* blk, unsigned int first,
            unsigned int nreg, unsigned int* value);
  - virtual void writeReg(RegMapBlock* blk, unsigned int first,
            unsigned int nreg, bool* value);

masd/bicep/FrameBoard.h, cc (new)

FrameBoard
Derrived class of Board.
Fields:
  - RegMapBlock* nsnap_;
  - RegMapBlock* record_;
  - RegMapBlock* utc_;
  - RegMapBlock* lst_; (not used)
  - RegMapBlock* features_;
  - RegMapBlock* markSeq_;
  - RegMapBlock* walshstate_; (not used)
Methods:
  - void archiveRecordNumber(unsigned record);
  - void setTime();
  - void archiveTime(); Modified
  - void archiveFeatures(unsigned features, unsigned seq);
  - void archiveWalshState(unsigned walshState);
  - void archiveNsnap(unsigned nsnap);
  - void reset() {};

masd/bicep/NetDataBoard.h, cc (new)

NetDataBoard
struct RunFile {
  int runfileTest_
}
struct DataFile {
  int datafileTest_
}

Fields:
  - const char* pipe_runfile_
  - const char* pipe_data_;
  - const char* pipe_mas_;
  - const char* pipe_command_;
  - RunFile runfile_
  - DataFile dataFile_
  - char *runMessage_;
  - size_t runFileSize_;
  - int runFile_fd_;
  - char *dataMessage_;
  - size_t dataFileSize_;
  - int data_fd_;
  - gcp::util::FdSet fdSet_
  - fd_set read_set_
  - fd_set write_set_

Methods:
  - initRunFileReadPipe(const char* name)
  - initDataFileReadPipe(const char* name)
  - int readData();
  - initMasReadpipe(const char* name)
  - int readMas()
  - initCommandPipe(const char* name)
  - int writeCommand(char* buffer, int maxlen )
  - void words2components( unsigned char words[], double* s, double* c, double vmax )
  - void words2components2( unsigned char words[], double* s, double* c, double vmax )
  - void components2words( unsigned char words[], double* s, double* c, double vmax)
  - void armselect()
  - int waitselect()
Other Methods:
  - unsigned int double2unsigned(double x, double y, int z);
  - double unsigned2double(unsigned int x, double y, int z);
  - void commandparse( char* str, unsigned char* length, unsigned char* channel, char* protocol, char* command, char* parameters, unsigned char* chksum)

masd/bicep/NetDataParse.h, cc (new)

NetDataParse

Fields:
  - unsigned int* received;
  - int* runFileTest
  - int* dataFileTest;
  - RegMapBlock* received_
  - RegMapBlock* mceRunFileTest_
  - RegMapBlock* mceDataFileTest_
Methods:
  - void init_mce_registers()
  - void fake_mce_sample(unsigned nsample, NetDataBoard* data)
  - void read_mce_sample(unsigned nsample, NetDataBoard* data)
  - void pack_mce_frame()

masd/bicep/DataBase.h, cc (new)

DataBase
Fields:
  - MceRx* parent_
  - NetDataBoard* data_
  - NetDataParse* mce_
  - bool simData_
  - virtual void run() {}
  - void writeMceData()
  - void bufferMceData()

masd/bicep/Data.h, cc (new)

Data
Fields:
  - gcp::util::timeVal timeOut_
  - static const unsigned fastTimeOutMilliSeconds_ = 30
  - static const unsigned slowTimeOutSeconds_ = 1
  - bool readfile_received_
  - unsigned int nSample_
  - gcp::util::FdSet fdSet_
  - std::ofstream* fout_
Methods:
  - Data(MceRx* parent, bool dumpData=false)
  - Data(bool simData)
  - void run()
  - void serviceMsgQ()
  - void incrementSampleCount(unsigned& iSamp, int numRead)
  - void processMsg(DataMsg* msg)

masd/bicep/DataMsg.h (new)

DataMsg
This is basically a place holder for later.

masd/bicep/MasdNetCmdForwarder (new)

MasdNetCmdForwarder
Derrived from gcp::util::MasdNetCmdForwarder
Fields:
  - MasdMaster* parent_
Methods:
  - MasdNetCmdForwarder(MasdMaster* parent)
  - void forwardRxNetCmd(gcp::util::NetCme* netCmd)

util/bice;/MasdNetCmdForwarder.h (new)

MasdNetCmdForwarder
Fields:
  (none)
Methods:
  - virtual void forwardNetCmd(gcp::util::NetCmd* netCmd);
  - virtual void forwardControlNetCmd(gcp::util::NetCmd* netCmd);
  - virtual void forwardRxSimulatorNetCmd(gcp::util::NetCmd* netCmd);
  - virtual void forwardRxNetCmd(gcp::util::NetCmd* netCmd);
  - virtual void forwardScannerNetCmd(gcp::util::NetCmd* netCmd);
  - virtual void forwardBoardNetCmd(gcp::util::NetCmd* netCmd);