support for alarm status, timeStamp.userTag, and alarm limits
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
<body>
|
||||
<h1 style="text-align: center">EPICS pvDataCPP<br />
|
||||
2011.05.11</h1>
|
||||
2011.10.20</h1>
|
||||
|
||||
<p>TODO</p>
|
||||
<ul>
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
<div class="toc">
|
||||
<ul>
|
||||
<li><a href="#L45">Preface</a>
|
||||
<li><a href="#L45">Preface</a>
|
||||
<ul>
|
||||
<li><a href="#L72">pvData</a>
|
||||
<li><a href="#L72">pvData</a>
|
||||
<ul>
|
||||
<li><a href="#L76">Introspection</a></li>
|
||||
<li><a href="#L144">Data</a></li>
|
||||
@@ -37,33 +37,33 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L307">Introduction</a></li>
|
||||
<li><a href="#L399">PVData Meta Language</a>
|
||||
<li><a href="#L399">PVData Meta Language</a>
|
||||
<ul>
|
||||
<li><a href="#L405">Definition</a></li>
|
||||
<li><a href="#L604">Example</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L616">PV - User Description</a>
|
||||
<li><a href="#L616">PV - User Description</a>
|
||||
<ul>
|
||||
<li><a href="#L620">Overview</a></li>
|
||||
<li><a href="#L661">pvType</a></li>
|
||||
<li><a href="#L697">Process Variable Reflection</a>
|
||||
<li><a href="#L697">Process Variable Reflection</a>
|
||||
<ul>
|
||||
<li><a href="#L705">Type Description</a></li>
|
||||
<li><a href="#L835">Reflection Description</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L1050">Standard Fields</a></li>
|
||||
<li><a href="#L1134">PVField - Data Interfaces</a>
|
||||
<li><a href="#L1134">PVField - Data Interfaces</a>
|
||||
<ul>
|
||||
<li><a href="#L1138">PVField</a></li>
|
||||
<li><a href="#L1248">PVAuxInfo</a></li>
|
||||
<li><a href="#L1282">PVScalar and extensions</a>
|
||||
<li><a href="#L1282">PVScalar and extensions</a>
|
||||
<ul>
|
||||
<li><a href="#L1286">Primitive PVField types</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L1292">PVArray and Extensions</a>
|
||||
<li><a href="#L1292">PVArray and Extensions</a>
|
||||
<ul>
|
||||
<li><a href="#L1331">PVArray Extensions</a></li>
|
||||
</ul>
|
||||
@@ -77,10 +77,10 @@
|
||||
<li><a href="#L1550">Convert</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L1620">Namespace and Memory Management</a>
|
||||
<li><a href="#L1620">Namespace and Memory Management</a>
|
||||
<ul>
|
||||
<li><a href="#L1624">Namespace</a></li>
|
||||
<li><a href="#L1675">Memory Managemment</a>
|
||||
<li><a href="#L1675">Memory Managemment</a>
|
||||
<ul>
|
||||
<li><a href="#L1677">NoDefaultMethods</a></li>
|
||||
</ul>
|
||||
@@ -90,36 +90,36 @@
|
||||
<li><a href="#L1693">Other code in this project</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L1701">Examples</a>
|
||||
<li><a href="#L1701">Examples</a>
|
||||
<ul>
|
||||
<li><a href="#L1705">Accessing PVData</a></li>
|
||||
<li><a href="#L1724">Creating PVData</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L1744">Property</a>
|
||||
<li><a href="#L1744">Property</a>
|
||||
<ul>
|
||||
<li><a href="#L1748">Definition of Property</a></li>
|
||||
<li><a href="#L1760">Standard Properties</a></li>
|
||||
<li><a href="#L1841">Overview of Property Support</a></li>
|
||||
<li><a href="#L1861">timeStamp</a>
|
||||
<li><a href="#L1861">timeStamp</a>
|
||||
<ul>
|
||||
<li><a href="#L1885">timeStamp.h</a></li>
|
||||
<li><a href="#L1989">pvTimeStamp.h</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L2029">alarm</a>
|
||||
<li><a href="#L2029">alarm</a>
|
||||
<ul>
|
||||
<li><a href="#L2056">alarm.h</a></li>
|
||||
<li><a href="#L2103">pvAlarm.h</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L2143">control</a>
|
||||
<li><a href="#L2143">control</a>
|
||||
<ul>
|
||||
<li><a href="#L2165">control.h</a></li>
|
||||
<li><a href="#L2197">pvControl.h</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L2237">display</a>
|
||||
<li><a href="#L2237">display</a>
|
||||
<ul>
|
||||
<li><a href="#L2259">display.h</a></li>
|
||||
<li><a href="#L2321">pvDisplay.h</a></li>
|
||||
@@ -129,7 +129,7 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L2437">PVData Factories</a></li>
|
||||
<li><a href="#L2470">Miscellanous Classes</a>
|
||||
<li><a href="#L2470">Miscellanous Classes</a>
|
||||
<ul>
|
||||
<li><a href="#L2474">Overview</a></li>
|
||||
<li><a href="#L2566">BitSet</a></li>
|
||||
@@ -139,7 +139,7 @@
|
||||
<li><a href="#L2735">Executor</a></li>
|
||||
<li><a href="#L2766">Linked List</a></li>
|
||||
<li><a href="#L2880">Lock and Mutex</a></li>
|
||||
<li><a href="#L2896">Message Queue</a>
|
||||
<li><a href="#L2896">Message Queue</a>
|
||||
<ul>
|
||||
<li><a href="#L2898">Definitions</a></li>
|
||||
<li><a href="#L2902">MessageQueue</a></li>
|
||||
@@ -151,7 +151,7 @@
|
||||
<li><a href="#L3052">CDRMonitor - Monitor and Report Construction and
|
||||
Destruction</a></li>
|
||||
<li><a href="#L3058">Status</a></li>
|
||||
<li><a href="#L3105">Thread</a>
|
||||
<li><a href="#L3105">Thread</a>
|
||||
<ul>
|
||||
<li><a href="#L3107">ThreadPriority</a></li>
|
||||
<li><a href="#L3111">Thread</a></li>
|
||||
@@ -162,7 +162,7 @@
|
||||
<li><a href="#L3251">Queue</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#L3314">pvMisc</a>
|
||||
<li><a href="#L3314">pvMisc</a>
|
||||
<ul>
|
||||
<li><a href="#L3318">BitSetUtil</a></li>
|
||||
<li><a href="#L3348">MultiChoice</a></li>
|
||||
@@ -2297,7 +2297,8 @@ stack. For example the following is permitted:</p>
|
||||
<p>A timeStamp is represented by the following structure</p>
|
||||
<pre>structure timeStamp
|
||||
int64 secondsPartEpoch
|
||||
int32 nanoSeconds</pre>
|
||||
int32 nanoSeconds
|
||||
int32 userTag</pre>
|
||||
|
||||
<p>The Epoch is the posix epoch, i.e. Jan 1, 1970 00:00:00 UTC. Both the
|
||||
seconds and nanoSeconds are signed integers and thus can be negative. Since the
|
||||
@@ -2338,6 +2339,8 @@ public:
|
||||
int64 getSecondsPastEpoch();
|
||||
int64 getEpicsSecondsPastEpoch() const;
|
||||
int32 getNanoSeconds() const;
|
||||
int32 getUserTag() const;
|
||||
void setUserTag(int userTag);
|
||||
void put(int64 secondsPastEpoch,int32 nanoSeconds = 0);
|
||||
void put(int64 milliseconds);
|
||||
void getCurrent();
|
||||
@@ -2377,6 +2380,12 @@ public:
|
||||
00:00:00 UTC as the epoch.</dd>
|
||||
<dt style="font-family: courier;">getNanoSeconds</dt>
|
||||
<dd>Get the number of nanoSeconds. This is always normalized.</dd>
|
||||
<dt><span
|
||||
style="font-family: Courier New,Courier,monospace">getUserTag</span></dt>
|
||||
<dd>Get the userTag.</dd>
|
||||
<dt><span
|
||||
style="font-family: Courier New,Courier,monospace">setUserTag</span></dt>
|
||||
<dd>Set the userTag.</dd>
|
||||
<dt style="font-family: courier;">put(int64 secondsPastEpoch,int32
|
||||
nanoSeconds = 0)</dt>
|
||||
<dd>Set the timeStamp value. If necessary it will be normalized.</dd>
|
||||
@@ -2464,13 +2473,14 @@ public:
|
||||
<p>An alarm structure is defined as follows:</p>
|
||||
<pre>structure alarm
|
||||
int32 severity
|
||||
int32 status
|
||||
String message</pre>
|
||||
|
||||
<p>Note that severity is NOT defined as an enumerated structure. The reason is
|
||||
performance, i. e. prevent passing the array of choice strings everywhere. The
|
||||
file <span style="font-family: courier;">alarm.h</span> provides the choice
|
||||
strings. Thus all code that needs to know about alarms share the exact same
|
||||
choice strings.</p>
|
||||
<p>Note that neither severity or status is defined as an enumerated structure.
|
||||
The reason is performance, i. e. prevent passing the array of choice strings
|
||||
everywhere. The file <span style="font-family: courier;">alarm.h</span>
|
||||
provides the choice strings. Thus all code that needs to know about alarms
|
||||
share the exact same choice strings.</p>
|
||||
|
||||
<p>Two header files are provided for manipulating alarms: <span
|
||||
style="font-family: courier;">alarm.h</span> and <span
|
||||
@@ -2483,15 +2493,27 @@ Alarm as defined by <span style="font-family: courier;">alarm.h</span></p>
|
||||
|
||||
<h4 id="L2056">alarm.h</h4>
|
||||
<pre>enum AlarmSeverity {
|
||||
noAlarm,minorAlarm,majorAlarm,invalidAlarm
|
||||
noAlarm,minorAlarm,majorAlarm,invalidAlarm,undefinedAlarm
|
||||
};
|
||||
|
||||
enum AlarmStatus {
|
||||
noStatus,deviceStatus,driverStatus,recordStatus,
|
||||
dbStatus,confStatus,undefinedStatus,clientStatus
|
||||
};
|
||||
|
||||
|
||||
class AlarmSeverityFunc {
|
||||
public:
|
||||
static AlarmSeverity getSeverity(int value);
|
||||
static StringArray getSeverityNames();
|
||||
};
|
||||
|
||||
|
||||
enum AlarmStatus {
|
||||
noStatus,deviceStatus,driverStatus,recordStatus,
|
||||
dbStatus,confStatus,undefinedStatus,clientStatus
|
||||
};
|
||||
|
||||
class Alarm {
|
||||
public:
|
||||
Alarm();
|
||||
@@ -2500,11 +2522,11 @@ public:
|
||||
void setMessage(String value);
|
||||
AlarmSeverity getSeverity() const;
|
||||
void setSeverity(AlarmSeverity value);
|
||||
AlarmStatus getStatus() const;
|
||||
void setStatus(AlarmStatus value);
|
||||
};</pre>
|
||||
|
||||
<p>Alarm Severity defines the possible alarm severities</p>
|
||||
|
||||
<p>AlarmSeverity has the methods:</p>
|
||||
<p>Alarm Severity defines the possible alarm severities:</p>
|
||||
<dl>
|
||||
<dt style="font-family: courier;">getSeverity</dt>
|
||||
<dd>Get the alarm severity corresponding to the integer value.</dd>
|
||||
@@ -2512,6 +2534,16 @@ public:
|
||||
<dd>Get the array of severity choices.</dd>
|
||||
</dl>
|
||||
|
||||
<p>Alarm Status defines the possible choices for alarm status:</p>
|
||||
<dl>
|
||||
<dt><span
|
||||
style="font-family: Courier New,Courier,monospace">getStatus</span></dt>
|
||||
<dd>Get the alarm status corresponding to the integer value.</dd>
|
||||
<dt><span
|
||||
style="font-family: Courier New,Courier,monospace">getStatusNames</span></dt>
|
||||
<dd>Get the array of status choices.</dd>
|
||||
</dl>
|
||||
|
||||
<p>Alarm has the methods:</p>
|
||||
<dl>
|
||||
<dt style="font-family: courier;">Alarm</dt>
|
||||
@@ -2525,6 +2557,12 @@ public:
|
||||
<dd>Get the severity.</dd>
|
||||
<dt style="font-family: courier;">setSeverity</dt>
|
||||
<dd>Set the severity.</dd>
|
||||
<dt><span
|
||||
style="font-family: Courier New,Courier,monospace">getStatus</span></dt>
|
||||
<dd>Get the status.</dd>
|
||||
<dt><span
|
||||
style="font-family: Courier New,Courier,monospace">setStatus</span></dt>
|
||||
<dd>Set the status.</dd>
|
||||
</dl>
|
||||
|
||||
<h4 id="L2103">pvAlarm.h</h4>
|
||||
|
||||
@@ -41,17 +41,19 @@ static StructureConstPtr enumeratedAlarmField;
|
||||
|
||||
|
||||
static void createAlarm() {
|
||||
FieldConstPtrArray fields = new FieldConstPtr[2];
|
||||
FieldConstPtrArray fields = new FieldConstPtr[3];
|
||||
fields[0] = fieldCreate->createScalar(String("severity"),pvInt);
|
||||
fields[1] = fieldCreate->createScalar(String("message"),pvString);
|
||||
alarmField = fieldCreate->createStructure(String("alarm"),2,fields);
|
||||
fields[1] = fieldCreate->createScalar(String("status"),pvInt);
|
||||
fields[2] = fieldCreate->createScalar(String("message"),pvString);
|
||||
alarmField = fieldCreate->createStructure(String("alarm"),3,fields);
|
||||
}
|
||||
|
||||
static void createTimeStamp() {
|
||||
FieldConstPtrArray fields = new FieldConstPtr[2];
|
||||
FieldConstPtrArray fields = new FieldConstPtr[3];
|
||||
fields[0] = fieldCreate->createScalar(String("secondsPastEpoch"),pvLong);
|
||||
fields[1] = fieldCreate->createScalar(String("nanoSeconds"),pvInt);
|
||||
timeStampField = fieldCreate->createStructure(String("timeStamp"),2,fields);
|
||||
fields[2] = fieldCreate->createScalar(String("userTag"),pvInt);
|
||||
timeStampField = fieldCreate->createStructure(String("timeStamp"),3,fields);
|
||||
}
|
||||
|
||||
static void createDisplay() {
|
||||
|
||||
@@ -12,18 +12,19 @@
|
||||
#include <pv/alarm.h>
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
const size_t severityCount = 4;
|
||||
const size_t severityCount = 5;
|
||||
static String severityNames[severityCount] =
|
||||
{
|
||||
String("none"),
|
||||
String("minor"),
|
||||
String("major"),
|
||||
String("invalid")
|
||||
String("NONE"),
|
||||
String("MINOR"),
|
||||
String("MAJOR"),
|
||||
String("INVALID"),
|
||||
String("UNDEFINED")
|
||||
};
|
||||
|
||||
AlarmSeverity AlarmSeverityFunc::getSeverity(int value)
|
||||
{
|
||||
if(value<0 || value>3) {
|
||||
if(value<0 || value>4) {
|
||||
throw std::logic_error(String("getSeverity value is illegal"));
|
||||
}
|
||||
switch (value) {
|
||||
@@ -31,6 +32,7 @@ AlarmSeverity AlarmSeverityFunc::getSeverity(int value)
|
||||
case 1: return minorAlarm;
|
||||
case 2: return majorAlarm;
|
||||
case 3: return invalidAlarm;
|
||||
case 4: return undefinedAlarm;
|
||||
}
|
||||
throw std::logic_error(String("should never get here"));
|
||||
}
|
||||
@@ -47,6 +49,58 @@ AlarmSeverity Alarm::getSeverity() const
|
||||
case 1: return minorAlarm;
|
||||
case 2: return majorAlarm;
|
||||
case 3: return invalidAlarm;
|
||||
case 4: return undefinedAlarm;
|
||||
}
|
||||
throw std::logic_error(String("should never get here"));
|
||||
}
|
||||
|
||||
const size_t statusCount = 8;
|
||||
static String statusNames[statusCount] =
|
||||
{
|
||||
String("NONE"),
|
||||
String("DEVICE"),
|
||||
String("DRIVER"),
|
||||
String("RECORD"),
|
||||
String("DB"),
|
||||
String("CONF"),
|
||||
String("UNDEFINED"),
|
||||
String("CLIENT")
|
||||
};
|
||||
|
||||
AlarmStatus AlarmStatusFunc::getStatus(int value)
|
||||
{
|
||||
if(value<0 || value>7) {
|
||||
throw std::logic_error(String("getStatus value is illegal"));
|
||||
}
|
||||
switch (value) {
|
||||
case 0: return noStatus;
|
||||
case 1: return deviceStatus;
|
||||
case 2: return driverStatus;
|
||||
case 3: return recordStatus;
|
||||
case 4: return dbStatus;
|
||||
case 5: return confStatus;
|
||||
case 6: return undefinedStatus;
|
||||
case 7: return clientStatus;
|
||||
}
|
||||
throw std::logic_error(String("should never get here"));
|
||||
}
|
||||
|
||||
StringArray AlarmStatusFunc::getStatusNames()
|
||||
{
|
||||
return statusNames;
|
||||
}
|
||||
|
||||
AlarmStatus Alarm::getStatus() const
|
||||
{
|
||||
switch(status) {
|
||||
case 0: return noStatus;
|
||||
case 1: return deviceStatus;
|
||||
case 2: return driverStatus;
|
||||
case 3: return recordStatus;
|
||||
case 4: return dbStatus;
|
||||
case 5: return confStatus;
|
||||
case 6: return undefinedStatus;
|
||||
case 7: return clientStatus;
|
||||
}
|
||||
throw std::logic_error(String("should never get here"));
|
||||
}
|
||||
|
||||
@@ -11,9 +11,15 @@
|
||||
namespace epics { namespace pvData {
|
||||
|
||||
enum AlarmSeverity {
|
||||
noAlarm,minorAlarm,majorAlarm,invalidAlarm
|
||||
noAlarm,minorAlarm,majorAlarm,invalidAlarm,undefinedAlarm
|
||||
};
|
||||
|
||||
enum AlarmStatus {
|
||||
noStatus,deviceStatus,driverStatus,recordStatus,
|
||||
dbStatus,confStatus,undefinedStatus,clientStatus
|
||||
};
|
||||
|
||||
|
||||
extern const size_t severityCount;
|
||||
class AlarmSeverityFunc {
|
||||
public:
|
||||
@@ -21,16 +27,26 @@ public:
|
||||
static StringArray getSeverityNames();
|
||||
};
|
||||
|
||||
extern const size_t statusCount;
|
||||
class AlarmStatusFunc {
|
||||
public:
|
||||
static AlarmStatus getStatus(int value);
|
||||
static StringArray getStatusNames();
|
||||
};
|
||||
|
||||
class Alarm {
|
||||
public:
|
||||
Alarm() : severity(0), message(String("")) {}
|
||||
Alarm() : severity(0),status(0), message(String("")) {}
|
||||
//default constructors and destructor are OK
|
||||
String getMessage() const {return message;}
|
||||
void setMessage(String value) {message = value;}
|
||||
AlarmSeverity getSeverity() const;
|
||||
void setSeverity(AlarmSeverity value) {severity = value;}
|
||||
AlarmStatus getStatus() const;
|
||||
void setStatus(AlarmStatus value) { status = value;}
|
||||
private:
|
||||
int32 severity;
|
||||
int32 status;
|
||||
String message;
|
||||
};
|
||||
|
||||
|
||||
@@ -45,12 +45,18 @@ bool PVAlarm::attach(PVField *pvField)
|
||||
pvField->message(noAlarmFound,errorMessage);
|
||||
return false;
|
||||
}
|
||||
pvSeverity = pvInt;
|
||||
pvInt = pvStructure->getIntField(String("status"));
|
||||
if(pvInt==0) {
|
||||
pvField->message(noAlarmFound,errorMessage);
|
||||
return false;
|
||||
}
|
||||
pvStatus = pvInt;
|
||||
PVString *pvString = pvStructure->getStringField(String("message"));
|
||||
if(pvInt==0) {
|
||||
pvField->message(noAlarmFound,errorMessage);
|
||||
return false;
|
||||
}
|
||||
pvSeverity = pvInt;
|
||||
pvMessage = pvString;
|
||||
return true;
|
||||
}
|
||||
@@ -58,6 +64,7 @@ bool PVAlarm::attach(PVField *pvField)
|
||||
void PVAlarm::detach()
|
||||
{
|
||||
pvSeverity = 0;
|
||||
pvStatus = 0;
|
||||
pvMessage = 0;
|
||||
}
|
||||
|
||||
@@ -73,6 +80,7 @@ void PVAlarm::get(Alarm & alarm) const
|
||||
throw std::logic_error(notAttached);
|
||||
}
|
||||
alarm.setSeverity(AlarmSeverityFunc::getSeverity(pvSeverity->get()));
|
||||
alarm.setStatus(AlarmStatusFunc::getStatus(pvStatus->get()));
|
||||
alarm.setMessage(pvMessage->get());
|
||||
}
|
||||
|
||||
@@ -83,6 +91,7 @@ bool PVAlarm::set(Alarm const & alarm)
|
||||
}
|
||||
if(pvSeverity->isImmutable() || pvMessage->isImmutable()) return false;
|
||||
pvSeverity->put(alarm.getSeverity());
|
||||
pvStatus->put(alarm.getStatus());
|
||||
pvMessage->put(alarm.getMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace epics { namespace pvData {
|
||||
|
||||
class PVAlarm {
|
||||
public:
|
||||
PVAlarm() : pvSeverity(0),pvMessage(0) {}
|
||||
PVAlarm() : pvSeverity(0),pvStatus(0),pvMessage(0) {}
|
||||
//default constructors and destructor are OK
|
||||
//returns (false,true) if pvField(isNot, is valid enumerated structure
|
||||
//An automatic detach is issued if already attached.
|
||||
@@ -28,6 +28,7 @@ public:
|
||||
bool set(Alarm const & alarm);
|
||||
private:
|
||||
PVInt *pvSeverity;
|
||||
PVInt *pvStatus;
|
||||
PVString *pvMessage;
|
||||
};
|
||||
|
||||
|
||||
@@ -53,19 +53,26 @@ bool PVTimeStamp::attach(PVField *pvField)
|
||||
pvField->message(noTimeStamp,errorMessage);
|
||||
return false;
|
||||
}
|
||||
pvSecs = pvLong;
|
||||
PVInt *pvInt = pvStructure->getIntField(String("nanoSeconds"));
|
||||
if(pvLong==0) {
|
||||
pvField->message(noTimeStamp,errorMessage);
|
||||
return false;
|
||||
}
|
||||
pvSecs = pvLong;
|
||||
pvNano = pvInt;
|
||||
pvInt = pvStructure->getIntField(String("userTag"));
|
||||
if(pvInt==0) {
|
||||
pvField->message(noTimeStamp,errorMessage);
|
||||
return false;
|
||||
}
|
||||
pvUserTag = pvInt;
|
||||
return true;
|
||||
}
|
||||
|
||||
void PVTimeStamp::detach()
|
||||
{
|
||||
pvSecs = 0;
|
||||
pvUserTag = 0;
|
||||
pvNano = 0;
|
||||
}
|
||||
|
||||
@@ -80,15 +87,17 @@ void PVTimeStamp::get(TimeStamp & timeStamp) const
|
||||
throw std::logic_error(notAttached);
|
||||
}
|
||||
timeStamp.put(pvSecs->get(),pvNano->get());
|
||||
timeStamp.setUserTag(pvUserTag->get());
|
||||
}
|
||||
|
||||
bool PVTimeStamp::set(TimeStamp const & timeStamp)
|
||||
{
|
||||
if(pvSecs==0 || pvNano==0) {
|
||||
if(pvSecs==0 || pvNano==0 || pvUserTag==0) {
|
||||
throw std::logic_error(notAttached);
|
||||
}
|
||||
if(pvSecs->isImmutable() || pvNano->isImmutable()) return false;
|
||||
pvSecs->put(timeStamp.getSecondsPastEpoch());
|
||||
pvUserTag->put(timeStamp.getUserTag());
|
||||
pvNano->put(timeStamp.getNanoSeconds());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace epics { namespace pvData {
|
||||
|
||||
class PVTimeStamp {
|
||||
public:
|
||||
PVTimeStamp() : pvSecs(0),pvNano(0) {}
|
||||
PVTimeStamp() : pvSecs(0),pvUserTag(0), pvNano(0) {}
|
||||
//default constructors and destructor are OK
|
||||
//This class should not be extended
|
||||
|
||||
@@ -29,6 +29,7 @@ public:
|
||||
bool set(TimeStamp const & timeStamp);
|
||||
private:
|
||||
PVLong* pvSecs;
|
||||
PVInt* pvUserTag;
|
||||
PVInt* pvNano;
|
||||
};
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ int32 microSecPerSec = milliSecPerSec*milliSecPerSec;
|
||||
int32 nanoSecPerSec = milliSecPerSec*microSecPerSec;
|
||||
int64 posixEpochAtEpicsEpoch = POSIX_TIME_AT_EPICS_EPOCH;
|
||||
|
||||
TimeStamp::TimeStamp(int64 secondsPastEpoch,int32 nanoSeconds)
|
||||
: secondsPastEpoch(secondsPastEpoch),nanoSeconds(nanoSeconds)
|
||||
TimeStamp::TimeStamp(int64 secondsPastEpoch,int32 nanoSeconds,int32 userTag)
|
||||
: secondsPastEpoch(secondsPastEpoch),nanoSeconds(nanoSeconds),userTag(userTag)
|
||||
{
|
||||
normalize();
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ extern int64 posixEpochAtEpicsEpoch;
|
||||
class TimeStamp {
|
||||
public:
|
||||
TimeStamp()
|
||||
:secondsPastEpoch(0),nanoSeconds(0) {}
|
||||
TimeStamp(int64 secondsPastEpoch,int32 nanoSeconds = 0);
|
||||
:secondsPastEpoch(0), nanoSeconds(0), userTag(0) {}
|
||||
TimeStamp(int64 secondsPastEpoch,int32 nanoSeconds = 0,int32 userTag = 0);
|
||||
//default constructors and destructor are OK
|
||||
//This class should not be extended
|
||||
void normalize();
|
||||
@@ -32,6 +32,8 @@ public:
|
||||
return secondsPastEpoch - posixEpochAtEpicsEpoch;
|
||||
}
|
||||
int32 getNanoSeconds() const {return nanoSeconds;}
|
||||
int32 getUserTag() const {return userTag;}
|
||||
void setUserTag(int userTag) {this->userTag = userTag;}
|
||||
void put(int64 secondsPastEpoch,int32 nanoSeconds = 0) {
|
||||
this->secondsPastEpoch = secondsPastEpoch;
|
||||
this->nanoSeconds = nanoSeconds;
|
||||
@@ -56,6 +58,7 @@ private:
|
||||
static int64 diffInt(TimeStamp const &left,TimeStamp const &right );
|
||||
int64 secondsPastEpoch;
|
||||
int32 nanoSeconds;
|
||||
int32 userTag;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--- testBaseExceptionGold 2011-04-27 13:11:55.000000000 -0400
|
||||
+++ testBaseException 2011-09-22 08:15:26.000000000 -0400
|
||||
+++ testBaseException 2011-10-21 08:41:54.000000000 -0400
|
||||
@@ -1,37 +1,46 @@
|
||||
+
|
||||
+
|
||||
|
||||
@@ -24,10 +24,12 @@ structure value
|
||||
double value
|
||||
structure alarm
|
||||
int severity
|
||||
int status
|
||||
string message
|
||||
structure timeStamp
|
||||
long secondsPastEpoch
|
||||
int nanoSeconds
|
||||
int userTag
|
||||
structure display
|
||||
string description
|
||||
string format
|
||||
@@ -60,22 +62,27 @@ structure value
|
||||
double value
|
||||
structure alarm
|
||||
int severity
|
||||
int status
|
||||
string message
|
||||
structure power
|
||||
double value
|
||||
structure alarm
|
||||
int severity
|
||||
int status
|
||||
string message
|
||||
structure current
|
||||
double value
|
||||
structure alarm
|
||||
int severity
|
||||
int status
|
||||
string message
|
||||
structure alarm
|
||||
int severity
|
||||
int status
|
||||
string message
|
||||
structure timeStamp
|
||||
long secondsPastEpoch
|
||||
int nanoSeconds
|
||||
pvField: totalConstruct 47 totalDestruct 47
|
||||
field: totalConstruct 120 totalDestruct 120
|
||||
int userTag
|
||||
pvField: totalConstruct 49 totalDestruct 49
|
||||
field: totalConstruct 122 totalDestruct 122
|
||||
|
||||
@@ -24,10 +24,12 @@ structure value
|
||||
double value
|
||||
structure alarm
|
||||
int severity
|
||||
int status
|
||||
string message
|
||||
structure timeStamp
|
||||
long secondsPastEpoch
|
||||
int nanoSeconds
|
||||
int userTag
|
||||
structure display
|
||||
string description
|
||||
string format
|
||||
@@ -60,22 +62,27 @@ structure value
|
||||
double value
|
||||
structure alarm
|
||||
int severity
|
||||
int status
|
||||
string message
|
||||
structure power
|
||||
double value
|
||||
structure alarm
|
||||
int severity
|
||||
int status
|
||||
string message
|
||||
structure current
|
||||
double value
|
||||
structure alarm
|
||||
int severity
|
||||
int status
|
||||
string message
|
||||
structure alarm
|
||||
int severity
|
||||
int status
|
||||
string message
|
||||
structure timeStamp
|
||||
long secondsPastEpoch
|
||||
int nanoSeconds
|
||||
pvField: totalConstruct 47 totalDestruct 47
|
||||
field: totalConstruct 120 totalDestruct 120
|
||||
int userTag
|
||||
pvField: totalConstruct 49 totalDestruct 49
|
||||
field: totalConstruct 122 totalDestruct 122
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
|
||||
Time test
|
||||
diff 25.975918 milliSeconds
|
||||
time per iteration 25.975918 microseconds
|
||||
time per addTail/removeHead 0.012988 microseconds
|
||||
diff 26.014862 milliSeconds
|
||||
time per iteration 26.014862 microseconds
|
||||
time per addTail/removeHead 0.013007 microseconds
|
||||
|
||||
Time test locked
|
||||
diff 180.990311 milliSeconds
|
||||
time per iteration 180.990311 microseconds
|
||||
time per addTail/removeHead 0.090495 microseconds
|
||||
diff 207.007364 milliSeconds
|
||||
time per iteration 207.007364 microseconds
|
||||
time per addTail/removeHead 0.103504 microseconds
|
||||
|
||||
Time std::list test
|
||||
diff 634.817044 milliSeconds
|
||||
time per iteration 634.817044 microseconds
|
||||
time per addTail/removeHead 0.317409 microseconds
|
||||
diff 633.793804 milliSeconds
|
||||
time per iteration 633.793804 microseconds
|
||||
time per addTail/removeHead 0.316897 microseconds
|
||||
|
||||
Time std::list test locked
|
||||
diff 801.805946 milliSeconds
|
||||
time per iteration 801.805946 microseconds
|
||||
time per addTail/removeHead 0.400903 microseconds
|
||||
diff 787.046498 milliSeconds
|
||||
time per iteration 787.046498 microseconds
|
||||
time per addTail/removeHead 0.393523 microseconds
|
||||
|
||||
@@ -29,4 +29,4 @@ structure parent
|
||||
structure child2
|
||||
string Jane Bad Girl
|
||||
pvField: totalConstruct 15 totalDestruct 15
|
||||
field: totalConstruct 108 totalDestruct 108
|
||||
field: totalConstruct 110 totalDestruct 110
|
||||
|
||||
@@ -29,4 +29,4 @@ structure parent
|
||||
structure child2
|
||||
string Jane Bad Girl
|
||||
pvField: totalConstruct 15 totalDestruct 15
|
||||
field: totalConstruct 108 totalDestruct 108
|
||||
field: totalConstruct 110 totalDestruct 110
|
||||
|
||||
@@ -4,10 +4,12 @@ structure value
|
||||
double value 0
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
display display
|
||||
string description
|
||||
string format
|
||||
@@ -23,26 +25,28 @@ structure value
|
||||
double low 0
|
||||
double high 0
|
||||
double minStep 0
|
||||
value offset 0 next 20 number 20
|
||||
value offset 0 next 22 number 22
|
||||
value offset 1 next 2 number 1
|
||||
alarm offset 2 next 5 number 3
|
||||
alarm offset 2 next 6 number 4
|
||||
severity offset 3 next 4 number 1
|
||||
message offset 4 next 5 number 1
|
||||
timeStamp offset 5 next 8 number 3
|
||||
secondsPastEpoch offset 6 next 7 number 1
|
||||
nanoSeconds offset 7 next 8 number 1
|
||||
display offset 8 next 15 number 7
|
||||
description offset 9 next 10 number 1
|
||||
format offset 10 next 11 number 1
|
||||
units offset 11 next 12 number 1
|
||||
limit offset 12 next 15 number 3
|
||||
low offset 13 next 14 number 1
|
||||
high offset 14 next 15 number 1
|
||||
control offset 15 next 20 number 5
|
||||
limit offset 16 next 19 number 3
|
||||
low offset 17 next 18 number 1
|
||||
high offset 18 next 19 number 1
|
||||
minStep offset 19 next 20 number 1
|
||||
status offset 4 next 5 number 1
|
||||
message offset 5 next 6 number 1
|
||||
timeStamp offset 6 next 10 number 4
|
||||
secondsPastEpoch offset 7 next 8 number 1
|
||||
nanoSeconds offset 8 next 9 number 1
|
||||
userTag offset 9 next 10 number 1
|
||||
display offset 10 next 17 number 7
|
||||
description offset 11 next 12 number 1
|
||||
format offset 12 next 13 number 1
|
||||
units offset 13 next 14 number 1
|
||||
limit offset 14 next 17 number 3
|
||||
low offset 15 next 16 number 1
|
||||
high offset 16 next 17 number 1
|
||||
control offset 17 next 22 number 5
|
||||
limit offset 18 next 21 number 3
|
||||
low offset 19 next 20 number 1
|
||||
high offset 20 next 21 number 1
|
||||
minStep offset 21 next 22 number 1
|
||||
pvAuxInfo: totalConstruct 1 totalDestruct 1
|
||||
pvField: totalConstruct 22 totalDestruct 22
|
||||
field: totalConstruct 97 totalDestruct 97
|
||||
pvField: totalConstruct 24 totalDestruct 24
|
||||
field: totalConstruct 99 totalDestruct 99
|
||||
|
||||
@@ -4,10 +4,12 @@ structure value
|
||||
double value 0
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
display display
|
||||
string description
|
||||
string format
|
||||
@@ -23,26 +25,28 @@ structure value
|
||||
double low 0
|
||||
double high 0
|
||||
double minStep 0
|
||||
value offset 0 next 20 number 20
|
||||
value offset 0 next 22 number 22
|
||||
value offset 1 next 2 number 1
|
||||
alarm offset 2 next 5 number 3
|
||||
alarm offset 2 next 6 number 4
|
||||
severity offset 3 next 4 number 1
|
||||
message offset 4 next 5 number 1
|
||||
timeStamp offset 5 next 8 number 3
|
||||
secondsPastEpoch offset 6 next 7 number 1
|
||||
nanoSeconds offset 7 next 8 number 1
|
||||
display offset 8 next 15 number 7
|
||||
description offset 9 next 10 number 1
|
||||
format offset 10 next 11 number 1
|
||||
units offset 11 next 12 number 1
|
||||
limit offset 12 next 15 number 3
|
||||
low offset 13 next 14 number 1
|
||||
high offset 14 next 15 number 1
|
||||
control offset 15 next 20 number 5
|
||||
limit offset 16 next 19 number 3
|
||||
low offset 17 next 18 number 1
|
||||
high offset 18 next 19 number 1
|
||||
minStep offset 19 next 20 number 1
|
||||
status offset 4 next 5 number 1
|
||||
message offset 5 next 6 number 1
|
||||
timeStamp offset 6 next 10 number 4
|
||||
secondsPastEpoch offset 7 next 8 number 1
|
||||
nanoSeconds offset 8 next 9 number 1
|
||||
userTag offset 9 next 10 number 1
|
||||
display offset 10 next 17 number 7
|
||||
description offset 11 next 12 number 1
|
||||
format offset 12 next 13 number 1
|
||||
units offset 13 next 14 number 1
|
||||
limit offset 14 next 17 number 3
|
||||
low offset 15 next 16 number 1
|
||||
high offset 16 next 17 number 1
|
||||
control offset 17 next 22 number 5
|
||||
limit offset 18 next 21 number 3
|
||||
low offset 19 next 20 number 1
|
||||
high offset 20 next 21 number 1
|
||||
minStep offset 21 next 22 number 1
|
||||
pvAuxInfo: totalConstruct 1 totalDestruct 1
|
||||
pvField: totalConstruct 22 totalDestruct 22
|
||||
field: totalConstruct 97 totalDestruct 97
|
||||
pvField: totalConstruct 24 totalDestruct 24
|
||||
field: totalConstruct 99 totalDestruct 99
|
||||
|
||||
@@ -5,10 +5,12 @@ structure top
|
||||
double value 0
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure valueAlarm
|
||||
boolean active false
|
||||
double lowAlarmLimit 0
|
||||
@@ -35,10 +37,12 @@ structure boolean
|
||||
boolean value true
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
structure valueAlarm
|
||||
boolean active false
|
||||
int falseSeverity 0
|
||||
@@ -48,10 +52,12 @@ structure byte
|
||||
byte value 127
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -79,10 +85,12 @@ structure short
|
||||
short value 32767
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -110,10 +118,12 @@ structure int
|
||||
int value -2147483648
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -141,10 +151,12 @@ structure long
|
||||
long value -9223372032559808513
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -172,10 +184,12 @@ structure float
|
||||
float value 1.123e+08
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -203,10 +217,12 @@ structure double
|
||||
double value 1.123e+35
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -234,75 +250,93 @@ structure string
|
||||
string value this is a string
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
|
||||
testScalarArray
|
||||
structure boolean
|
||||
boolean[] value [true,false,true]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure byte
|
||||
byte[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure short
|
||||
short[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure int
|
||||
int[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure long
|
||||
long[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure float
|
||||
float[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure double
|
||||
double[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure string
|
||||
string[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
pvField: totalConstruct 302 totalDestruct 302
|
||||
field: totalConstruct 139 totalDestruct 139
|
||||
int userTag 0
|
||||
pvField: totalConstruct 336 totalDestruct 336
|
||||
field: totalConstruct 141 totalDestruct 141
|
||||
|
||||
@@ -5,10 +5,12 @@ structure top
|
||||
double value 0
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure valueAlarm
|
||||
boolean active false
|
||||
double lowAlarmLimit 0
|
||||
@@ -35,10 +37,12 @@ structure boolean
|
||||
boolean value true
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
structure valueAlarm
|
||||
boolean active false
|
||||
int falseSeverity 0
|
||||
@@ -48,10 +52,12 @@ structure byte
|
||||
byte value 127
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -79,10 +85,12 @@ structure short
|
||||
short value 32767
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -110,10 +118,12 @@ structure int
|
||||
int value -2147483648
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -141,10 +151,12 @@ structure long
|
||||
long value -9223372032559808513
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -172,10 +184,12 @@ structure float
|
||||
float value 1.123e+08
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -203,10 +217,12 @@ structure double
|
||||
double value 1.123e+35
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
display display
|
||||
string description this is a description
|
||||
string format f10.2
|
||||
@@ -234,75 +250,93 @@ structure string
|
||||
string value this is a string
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 0
|
||||
string message messageForAlarm
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 123456789
|
||||
int nanoSeconds 1000000
|
||||
int userTag 0
|
||||
|
||||
testScalarArray
|
||||
structure boolean
|
||||
boolean[] value [true,false,true]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure byte
|
||||
byte[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure short
|
||||
short[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure int
|
||||
int[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure long
|
||||
long[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure float
|
||||
float[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure double
|
||||
double[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
structure string
|
||||
string[] value [0,1,2]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
pvField: totalConstruct 302 totalDestruct 302
|
||||
field: totalConstruct 139 totalDestruct 139
|
||||
int userTag 0
|
||||
pvField: totalConstruct 336 totalDestruct 336
|
||||
field: totalConstruct 141 totalDestruct 141
|
||||
|
||||
@@ -6,87 +6,104 @@ structure powerSupply
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure powerSupply
|
||||
structure voltage
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure powerSupply
|
||||
structure voltage
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure powerSupply
|
||||
structure voltage
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure powerSupply
|
||||
structure voltage
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
after remove 0,1,3structure powerSupply
|
||||
structure[] value
|
||||
null
|
||||
@@ -96,16 +113,19 @@ after remove 0,1,3structure powerSupply
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
null
|
||||
structure powerSupply
|
||||
@@ -113,23 +133,28 @@ after remove 0,1,3structure powerSupply
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
after compressstructure powerSupply
|
||||
structure[] value
|
||||
structure powerSupply
|
||||
@@ -137,38 +162,46 @@ after compressstructure powerSupply
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure powerSupply
|
||||
structure voltage
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
pvField: totalConstruct 88 totalDestruct 88
|
||||
field: totalConstruct 102 totalDestruct 102
|
||||
int userTag 0
|
||||
pvField: totalConstruct 105 totalDestruct 105
|
||||
field: totalConstruct 104 totalDestruct 104
|
||||
|
||||
@@ -6,87 +6,104 @@ structure powerSupply
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure powerSupply
|
||||
structure voltage
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure powerSupply
|
||||
structure voltage
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure powerSupply
|
||||
structure voltage
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure powerSupply
|
||||
structure voltage
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
after remove 0,1,3structure powerSupply
|
||||
structure[] value
|
||||
null
|
||||
@@ -96,16 +113,19 @@ after remove 0,1,3structure powerSupply
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
null
|
||||
structure powerSupply
|
||||
@@ -113,23 +133,28 @@ after remove 0,1,3structure powerSupply
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
after compressstructure powerSupply
|
||||
structure[] value
|
||||
structure powerSupply
|
||||
@@ -137,38 +162,46 @@ after compressstructure powerSupply
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure powerSupply
|
||||
structure voltage
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure power
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
structure current
|
||||
double value 0
|
||||
structure alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
pvField: totalConstruct 88 totalDestruct 88
|
||||
field: totalConstruct 102 totalDestruct 102
|
||||
int userTag 0
|
||||
pvField: totalConstruct 105 totalDestruct 105
|
||||
field: totalConstruct 104 totalDestruct 104
|
||||
|
||||
@@ -2,10 +2,12 @@ structure value
|
||||
double value 0
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
display display
|
||||
string description
|
||||
string format
|
||||
@@ -24,12 +26,14 @@ structure value
|
||||
string[] choices [0,1,2,3]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
testAlarm
|
||||
message testMessage severity major
|
||||
message testMessage severity MAJOR status CLIENT
|
||||
testTimeStamp
|
||||
testControl
|
||||
low 1.000000 high 10.000000
|
||||
@@ -43,10 +47,12 @@ structure value
|
||||
double value 0
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 7
|
||||
string message testMessage
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 32
|
||||
display display
|
||||
string description testDescription
|
||||
string format %f10.0
|
||||
@@ -66,9 +72,11 @@ structure value
|
||||
string[] choices [0,1,2,3]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
pvField: totalConstruct 30 totalDestruct 30
|
||||
field: totalConstruct 99 totalDestruct 99
|
||||
int userTag 0
|
||||
pvField: totalConstruct 34 totalDestruct 34
|
||||
field: totalConstruct 101 totalDestruct 101
|
||||
|
||||
@@ -1 +1 @@
|
||||
2011.09.22 08:15:32 297500698 nanoSeconds isDst true
|
||||
2011.10.21 08:41:59 266990875 nanoSeconds isDst true userTag 32
|
||||
|
||||
@@ -2,10 +2,12 @@ structure value
|
||||
double value 0
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
display display
|
||||
string description
|
||||
string format
|
||||
@@ -24,12 +26,14 @@ structure value
|
||||
string[] choices [0,1,2,3]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 0
|
||||
testAlarm
|
||||
message testMessage severity major
|
||||
message testMessage severity MAJOR status CLIENT
|
||||
testTimeStamp
|
||||
testControl
|
||||
low 1.000000 high 10.000000
|
||||
@@ -43,10 +47,12 @@ structure value
|
||||
double value 0
|
||||
alarm alarm
|
||||
int severity 2
|
||||
int status 7
|
||||
string message testMessage
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
int userTag 32
|
||||
display display
|
||||
string description testDescription
|
||||
string format %f10.0
|
||||
@@ -66,9 +72,11 @@ structure value
|
||||
string[] choices [0,1,2,3]
|
||||
alarm alarm
|
||||
int severity 0
|
||||
int status 0
|
||||
string message
|
||||
timeStamp timeStamp
|
||||
long secondsPastEpoch 0
|
||||
int nanoSeconds 0
|
||||
pvField: totalConstruct 30 totalDestruct 30
|
||||
field: totalConstruct 99 totalDestruct 99
|
||||
int userTag 0
|
||||
pvField: totalConstruct 34 totalDestruct 34
|
||||
field: totalConstruct 101 totalDestruct 101
|
||||
|
||||
@@ -1 +1 @@
|
||||
time per call 35.942059 microseconds
|
||||
time per call 37.044874 microseconds
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
current 1316693731 343782420 milliSec 1316693731343
|
||||
2011.09.22 08:15:31 343782420 nanoSeconds isDst true
|
||||
current 1319200918 391667584 milliSec 1319200918391
|
||||
2011.10.21 08:41:58 391667584 nanoSeconds isDst true
|
||||
fromTime_t
|
||||
current 1316693731 0 milliSec 1316693731000
|
||||
2011.09.22 08:15:31 0 nanoSeconds isDst true
|
||||
current 1319200918 0 milliSec 1319200918000
|
||||
2011.10.21 08:41:58 0 nanoSeconds isDst true
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
one requested 0.400000 diff 0.400292 seconds
|
||||
two requested 0.200000 diff 0.200304 seconds
|
||||
one requested 0.200000 diff 0.200222 seconds
|
||||
two requested 0.400000 diff 0.400264 seconds
|
||||
one requested 0.000000 diff 0.000075 seconds
|
||||
two requested 0.000000 diff 0.000100 seconds
|
||||
one requested 0.400000 diff 0.400280 seconds
|
||||
two requested 0.200000 diff 0.200272 seconds
|
||||
one requested 0.200000 diff 0.200357 seconds
|
||||
two requested 0.400000 diff 0.400289 seconds
|
||||
one requested 0.000000 diff 0.000028 seconds
|
||||
two requested 0.000000 diff 0.000044 seconds
|
||||
|
||||
@@ -92,14 +92,17 @@ static void testAlarm(FILE * fd,FILE *auxfd)
|
||||
Alarm al;
|
||||
al.setMessage(String("testMessage"));
|
||||
al.setSeverity(majorAlarm);
|
||||
al.setStatus(clientStatus);
|
||||
result = pvAlarm.set(al);
|
||||
assert(result);
|
||||
pvAlarm.get(alarm);
|
||||
assert(al.getMessage().compare(alarm.getMessage())==0);
|
||||
assert(al.getSeverity()==alarm.getSeverity());
|
||||
assert(al.getStatus()==alarm.getStatus());
|
||||
String message = alarm.getMessage();
|
||||
String severity = AlarmSeverityFunc::getSeverityNames()[alarm.getSeverity()];
|
||||
fprintf(fd," message %s severity %s\n",message.c_str(),severity.c_str());
|
||||
String status = AlarmStatusFunc::getStatusNames()[alarm.getStatus()];
|
||||
fprintf(fd," message %s severity %s status %s\n",message.c_str(),severity.c_str(),status.c_str());
|
||||
}
|
||||
|
||||
static void testTimeStamp(FILE * fd,FILE *auxfd)
|
||||
@@ -117,21 +120,24 @@ static void testTimeStamp(FILE * fd,FILE *auxfd)
|
||||
assert(result);
|
||||
TimeStamp ts;
|
||||
ts.getCurrent();
|
||||
ts.setUserTag(32);
|
||||
result = pvTimeStamp.set(ts);
|
||||
assert(result);
|
||||
pvTimeStamp.get(timeStamp);
|
||||
assert(ts.getSecondsPastEpoch()==timeStamp.getSecondsPastEpoch());
|
||||
assert(ts.getNanoSeconds()==timeStamp.getNanoSeconds());
|
||||
assert(ts.getUserTag()==timeStamp.getUserTag());
|
||||
time_t tt;
|
||||
timeStamp.toTime_t(tt);
|
||||
struct tm ctm;
|
||||
memcpy(&ctm,localtime(&tt),sizeof(struct tm));
|
||||
fprintf(auxfd,
|
||||
"%4.4d.%2.2d.%2.2d %2.2d:%2.2d:%2.2d %d nanoSeconds isDst %s\n",
|
||||
"%4.4d.%2.2d.%2.2d %2.2d:%2.2d:%2.2d %d nanoSeconds isDst %s userTag %d\n",
|
||||
ctm.tm_year+1900,ctm.tm_mon + 1,ctm.tm_mday,
|
||||
ctm.tm_hour,ctm.tm_min,ctm.tm_sec,
|
||||
timeStamp.getNanoSeconds(),
|
||||
(ctm.tm_isdst==0) ? "false" : "true");
|
||||
(ctm.tm_isdst==0) ? "false" : "true",
|
||||
timeStamp.getUserTag());
|
||||
timeStamp.put(0,0);
|
||||
pvTimeStamp.set(timeStamp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user