Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
bengineerd committed Sep 13, 2023
1 parent e7a86db commit 9c952d5
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 56 deletions.
19 changes: 16 additions & 3 deletions python/pyrogue/_Variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,9 +1042,22 @@ def __init__(self, *,
listData = VariableListData(numValues,valueBits,valueStride)

# Setup C++ Base class
rim.Variable.__init__(self,self._name,self._mode,self._minimum,self._maximum,
offset, bitOffset, bitSize, overlapEn, verify,
self._bulkOpEn, self._updateNotify, self._base, listData, retryCount)
rim.Variable.__init__(
self,
self._name,
self._mode,
self._minimum,
self._maximum,
offset,
bitOffset,
bitSize,
overlapEn,
verify,
self._bulkOpEn,
self._updateNotify,
self._base,
listData,
retryCount)


##############################
Expand Down
109 changes: 56 additions & 53 deletions src/rogue/interfaces/memory/Variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,65 +43,68 @@ namespace bp = boost::python;
#endif

//! Class factory which returns a pointer to a Variable (VariablePtr)
rim::VariablePtr rim::Variable::create(std::string name,
std::string mode,
double minimum,
double maximum,
uint64_t offset,
std::vector<uint32_t> bitOffset,
std::vector<uint32_t> bitSize,
bool overlapEn,
bool verify,
bool bulkOpEn,
bool updateNotify,
uint32_t modelId,
bool byteReverse,
bool bitReverse,
uint32_t binPoint,
uint32_t numValues,
uint32_t valueBits,
uint32_t valueStride,
uint32_t retryCount) {
rim::VariablePtr v = std::make_shared<rim::Variable>(name,
mode,
minimum,
maximum,
offset,
bitOffset,
bitSize,
overlapEn,
verify,
bulkOpEn,
updateNotify,
modelId,
byteReverse,
bitReverse,
binPoint,
numValues,
valueBits,
valueStride,
retryCount);
rim::VariablePtr rim::Variable::create(
std::string name,
std::string mode,
double minimum,
double maximum,
uint64_t offset,
std::vector<uint32_t> bitOffset,
std::vector<uint32_t> bitSize,
bool overlapEn,
bool verify,
bool bulkOpEn,
bool updateNotify,
uint32_t modelId,
bool byteReverse,
bool bitReverse,
uint32_t binPoint,
uint32_t numValues,
uint32_t valueBits,
uint32_t valueStride,
uint32_t retryCount) {
rim::VariablePtr v = std::make_shared<rim::Variable>(
name,
mode,
minimum,
maximum,
offset,
bitOffset,
bitSize,
overlapEn,
verify,
bulkOpEn,
updateNotify,
modelId,
byteReverse,
bitReverse,
binPoint,
numValues,
valueBits,
valueStride,
retryCount);
return (v);
}

// Setup class for use in python
void rim::Variable::setup_python() {
#ifndef NO_PYTHON
bp::class_<rim::VariableWrap, rim::VariableWrapPtr, boost::noncopyable>("Variable",
bp::init<std::string,
std::string,
bp::object,
bp::object,
uint64_t,
bp::object,
bp::object,
bool,
bool,
bool,
bool,
bp::object,
bp::object,
uint32_t>())
bp::class_<rim::VariableWrap, rim::VariableWrapPtr, boost::noncopyable>(
"Variable",
bp::init<std::string,
std::string,
bp::object,
bp::object,
uint64_t,
bp::object,
bp::object,
bool,
bool,
bool,
bool,
bp::object,
bp::object,
uint32_t>())
.def("_varBytes", &rim::Variable::varBytes)
.def("_offset", &rim::Variable::offset)
.def("_shiftOffsetDown", &rim::Variable::shiftOffsetDown)
Expand Down

0 comments on commit 9c952d5

Please sign in to comment.