Overview
In directory database/shell there is a file sourceEXAMPLE.
Before you can start the example database you must create a file source.
To do this copy sourceEXAMPLE to source and
edit it so that EPICSV4 is defined correctly.
The database can then be started as follows:
mrk> pwd
/home/epicsv4/master/exampleJava/database/shell
mrk> ./exampleDatabase
The example database has the following PVRecords:
PVRushort
PVRdumbPowerSupply
PVRstring
PVRint
PVRdouble03Array
PVRdouble02
PVRushortArray
PVRdouble01
PVRstructureArray
PVRuint
PVRdouble02Array
PVRbyteArray
PVRhelloPutGet
PVRshort
PVRulongArray
PVRshortArray
PVRdoubleArray
PVRremoveRecord
PVRdouble05Array
PVRubyteArray
PVRrestrictedUnionArray
PVRlong
PVRbooleanArray
PVRulong
PVRfloat
PVRdouble
PVRintArray
PVRlongArray
PVRrestrictedUnion
PVRenum
PVRdouble04Array
PVRdouble01Array
PVRhelloRPC
PVRboolean
PVRstringArray
PVRbyte
PVRubyte
PVRfloatArray
PVRdouble05
PVRdouble04
PVRdouble03
PVRtraceRecord
PVRuintArray
PVRvariantUnion
PVRvariantUnionArray
database/src/org/epics/exampleJava/exampleDatabase
This directory has the following files:
- ExampleHelloRecord.java
- Code for an example that is accessed via channelPutGet
- ExampleHelloRPC.java
- Code for an example that is accesed via channelRPC
- ExampleDatabase..java
- Code that creates many PVRecords.
Most are soft records but also exampleHello and exampleHelloRPC.
The code is described in the following sub - section.
It also has the main program
ExampleDatabase.java
This has a number of private methods:
- createRecords
- Given a scalarType this creates an NTScalar and an NTScalarArray record
of the specified type.
- createStructureArrayRecord
- Creates a record with a value field that is a structureArray.
- createRestrictedUnionRecord
- Creates a record with a value field that is a regulav.
- createVariantUnionRecord
- Creates a record with a value field that a structureArray.
- createRestrictedUnionArrayRecord
- Creates a record with a value field that a structureArray.
- createVariantUnionArrayRecord
- Creates a record with a value field that a structureArray.
- createDumbPowerSupplyRecord
- Creates a record with a value field that a structureArray.
ExampleDatabase::main
creates all the PVRecords that make up the
example database.
It:
- createRecords
- This is called for each scalarType.
- addRecord for PVRenum
- Creates PVRenum
- createStructureArrayRecord
- Creates PVRstructureArray
- createRestrictedUnionRecord
- Creates PVRrestrictedUnion
- createVariantUnionRecord
- Creates PVRvariantUnion
- createRestrictedUnionArrayRecord
- Creates PVRrestrictedUnionArray
- createVariantUnionArrayRecord
- Creates PVRvariantUnionArray
- createDumbPowerSupplyRecord
- Creates PVRdumbPowerSupply
- addRecord for PVRhelloPutGet
- Creates PVRhelloPutGet
- registerService for helloRPC
- Creates helloRPC