Skip to content

Commit

Permalink
Merge pull request #747 from slaclab/ESCRYODET-683
Browse files Browse the repository at this point in the history
Map all epics floats to be doubles
  • Loading branch information
slacrherbst authored Oct 22, 2020
2 parents b47f044 + f28a642 commit 102403a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/rogue/protocols/epicsV3/Value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,8 @@ void rpe::Value::initGdd(std::string typeStr, bool isEnum, uint32_t count) {
bitSize, epicsName_.c_str(),typeStr.c_str());
}

// 32-bit Float
else if ( typeStr == "float" or typeStr == "Float32" ) {
log_->info("Detected 32-bit float %s: typeStr=%s", epicsName_.c_str(),typeStr.c_str());
epicsType_ = aitEnumFloat32;
fSize_ = 4;
}

// 64-bit float
else if ( typeStr == "Float64" ) {
// Treat all floats as 64-bit
else if ( (typeStr.find("float") == 0) || ( typeStr.find("Double") == 0 ) || ( typeStr.find("Float") == 0 )) {
log_->info("Detected 64-bit float %s: typeStr=%s", epicsName_.c_str(),typeStr.c_str());
epicsType_ = aitEnumFloat64;
fSize_ = 8;
Expand Down
5 changes: 5 additions & 0 deletions tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ def parseBuildStamp(var, val):
mode = 'RW',
value = ''))

self.add(pr.LocalVariable(
name = 'TestFloatConv',
mode = 'RO',
value = 614.4))

@self.command(hidden=False,value='',retValue='')
def TestCommand(arg):
return('Got {}'.format(arg))
Expand Down

0 comments on commit 102403a

Please sign in to comment.