Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Mising tsmode -> tsquality.
Browse files Browse the repository at this point in the history
  • Loading branch information
emgre committed Jun 20, 2019
1 parent bc56488 commit 2cc5d98
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions cpp/lib/include/opendnp3/master/HeaderInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ class HeaderInfo
HeaderInfo()
: gv(GroupVariation::UNKNOWN),
qualifier(QualifierCode::UNDEFINED),
tsmode(TimestampQuality::INVALID),
tsquality(TimestampQuality::INVALID),
isEventVariation(false),
flagsValid(false),
headerIndex(0)
{
}

HeaderInfo(GroupVariation gv_, QualifierCode qualifier_, TimestampQuality tsmode_, uint32_t headerIndex_)
HeaderInfo(GroupVariation gv_, QualifierCode qualifier_, TimestampQuality tsquality_, uint32_t headerIndex_)
: gv(gv_),
qualifier(qualifier_),
tsmode(tsmode_),
tsquality(tsquality_),
isEventVariation(IsEvent(gv_)),
flagsValid(HasFlags(gv_)),
headerIndex(headerIndex_)
Expand All @@ -60,7 +60,7 @@ class HeaderInfo
/// The qualifier code enumeration for the header
QualifierCode qualifier;
/// Enumeration that provides information about the validity of timestamps on the associated objects
TimestampQuality tsmode;
TimestampQuality tsquality;
/// True if the specfied variation is an event variation
bool isEventVariation;
/// True if the flags on the value were present on underlying type, false if online is just assumed
Expand Down
4 changes: 2 additions & 2 deletions cpp/lib/include/opendnp3/master/PrintingSOEHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ class PrintingSOEHandler final : public ISOEHandler
return oss.str();
}

static std::string GetTimeString(TimestampQuality tsmode)
static std::string GetTimeString(TimestampQuality tsquality)
{
std::ostringstream oss;
switch (tsmode)
switch (tsquality)
{
case (TimestampQuality::SYNCHRONIZED):
return "synchronized";
Expand Down
4 changes: 2 additions & 2 deletions cpp/lib/src/master/MeasurementHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ class MeasurementHandler final : public IAPDUHandler
}

template<class T>
IINField LoadValues(const HeaderRecord& record, TimestampQuality tsmode, const ICollection<Indexed<T>>& values)
IINField LoadValues(const HeaderRecord& record, TimestampQuality tsquality, const ICollection<Indexed<T>>& values)
{
this->CheckForTxStart();
HeaderInfo info(record.enumeration, record.GetQualifierCode(), tsmode, record.headerIndex);
HeaderInfo info(record.enumeration, record.GetQualifierCode(), tsquality, record.headerIndex);
this->pSOEHandler->Process(info, values);
return IINField();
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/tests/unit/TestMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ TEST_CASE(SUITE("ReceiveCTOSynchronized"))
auto record = t.meas->binarySOE[7];
bool equal = record.meas == Binary(true, Flags(0x01), DNPTime(0x04, TimestampQuality::SYNCHRONIZED)); // timestamp is 4
REQUIRE(equal);
REQUIRE(record.info.tsmode == TimestampQuality::SYNCHRONIZED);
REQUIRE(record.info.tsquality == TimestampQuality::SYNCHRONIZED);
}

TEST_CASE(SUITE("ReceiveCTOUnsynchronized"))
Expand All @@ -594,7 +594,7 @@ TEST_CASE(SUITE("ReceiveCTOUnsynchronized"))
auto record = t.meas->binarySOE[7];
bool equal = record.meas == Binary(true, Flags(0x01), DNPTime(0x04, TimestampQuality::UNSYNCHRONIZED)); // timestamp is 4
REQUIRE(equal);
REQUIRE(record.info.tsmode == TimestampQuality::UNSYNCHRONIZED);
REQUIRE(record.info.tsquality == TimestampQuality::UNSYNCHRONIZED);
}

TEST_CASE(SUITE("ReceiveIINinResponses"))
Expand Down
6 changes: 3 additions & 3 deletions cpp/tests/unit/TestMeasurementHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ TEST_CASE(SUITE("parses g121v1 correctly"))

auto& stat = soe.securityStatSOE[2];

REQUIRE(stat.info.tsmode == TimestampQuality::INVALID);
REQUIRE(stat.info.tsquality == TimestampQuality::INVALID);
REQUIRE(stat.info.gv == GroupVariation::Group121Var1);
REQUIRE_FALSE(stat.info.isEventVariation);
REQUIRE(stat.meas.value.count == 8);
Expand All @@ -74,7 +74,7 @@ TEST_CASE(SUITE("parses g122v1 correctly"))

auto& stat = soe.securityStatSOE[3];

REQUIRE(stat.info.tsmode == TimestampQuality::INVALID);
REQUIRE(stat.info.tsquality == TimestampQuality::INVALID);
REQUIRE(stat.info.gv == GroupVariation::Group122Var1);
REQUIRE(stat.meas.value.count == 8);
REQUIRE(stat.meas.value.assocId == 7);
Expand All @@ -93,7 +93,7 @@ TEST_CASE(SUITE("parses g122v2 correctly"))

auto& stat = soe.securityStatSOE[3];

REQUIRE(stat.info.tsmode == TimestampQuality::SYNCHRONIZED);
REQUIRE(stat.info.tsquality == TimestampQuality::SYNCHRONIZED);
REQUIRE(stat.info.gv == GroupVariation::Group122Var2);
REQUIRE(stat.info.isEventVariation);
REQUIRE(stat.meas.value.count == 8);
Expand Down
2 changes: 1 addition & 1 deletion dotnet/CLRAdapter/src/SOEHandlerAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Automatak
HeaderInfo ^ ConvertHeaderInfo(const opendnp3::HeaderInfo& info)
{
return gcnew HeaderInfo((GroupVariation)info.gv, (QualifierCode)info.qualifier,
(TimestampQuality)info.tsmode, info.isEventVariation, info.flagsValid,
(TimestampQuality)info.tsquality, info.isEventVariation, info.flagsValid,
info.headerIndex);
}

Expand Down
4 changes: 2 additions & 2 deletions java/cpp/adapters/SOEHandlerAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ LocalRef<jobject> SOEHandlerAdapter::Convert(JNIEnv* env, const opendnp3::Header
{
auto gv = jni::JCache::GroupVariation.fromType(env, GroupVariationSpec::to_type(info.gv));
auto qc = jni::JCache::QualifierCode.fromType(env, QualifierCodeSpec::to_type(info.qualifier));
auto tsmode = jni::JCache::TimestampQuality.fromType(env, static_cast<jint>(info.tsmode));
auto tsquality = jni::JCache::TimestampQuality.fromType(env, static_cast<jint>(info.tsquality));
jboolean isEvent = static_cast<jboolean>(info.isEventVariation);
jboolean flagsValid = static_cast<jboolean>(info.flagsValid);
jint headerIndex = info.headerIndex;

return jni::JCache::HeaderInfo.init6(env, gv, qc, tsmode, isEvent, flagsValid, headerIndex);
return jni::JCache::HeaderInfo.init6(env, gv, qc, tsquality, isEvent, flagsValid, headerIndex);
}

0 comments on commit 2cc5d98

Please sign in to comment.