Skip to content
Snippets Groups Projects
Commit ebc67c74 authored by Marco Filho's avatar Marco Filho
Browse files

Add SC, SL, STH, SM and SMX parameters.

Didn't add SD because the mechanism is a bit different.
parent 9fcb1f57
No related branches found
No related tags found
1 merge request!7Major refactor
......@@ -286,6 +286,24 @@ asynStatus VMMTbl::readInt8Array(asynUser *pasynUser, epicsInt8 *value, size_t n
if (function < FIRST_VMM_PARAM) return asynPortDriver::readInt8Array(pasynUser, value, nElements, nIn);
found_param = VecUtils::getIndex(vmmSC_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
status |= (int)this->pVmmAPI->getSC(hyb_index, vmm_index, i, data);
value[i] = data;
}
goto endOfReadInt8Array;
}
found_param = VecUtils::getIndex(vmmSL_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
status |= (int)this->pVmmAPI->getSL(hyb_index, vmm_index, i, data);
value[i] = data;
}
goto endOfReadInt8Array;
}
found_param = VecUtils::getIndex(vmmST_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
......@@ -295,6 +313,33 @@ asynStatus VMMTbl::readInt8Array(asynUser *pasynUser, epicsInt8 *value, size_t n
goto endOfReadInt8Array;
}
found_param = VecUtils::getIndex(vmmSTH_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
status |= (int)this->pVmmAPI->getSTH(hyb_index, vmm_index, i, data);
value[i] = data;
}
goto endOfReadInt8Array;
}
found_param = VecUtils::getIndex(vmmSM_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
status |= (int)this->pVmmAPI->getSM(hyb_index, vmm_index, i, data);
value[i] = data;
}
goto endOfReadInt8Array;
}
found_param = VecUtils::getIndex(vmmSMX_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
status |= (int)this->pVmmAPI->getSMX(hyb_index, vmm_index, i, data);
value[i] = data;
}
goto endOfReadInt8Array;
}
endOfReadInt8Array:
if (found_param != 0) {
asynPrint(pasynUserSelf, ASYN_TRACE_ERROR,
......@@ -328,6 +373,22 @@ asynStatus VMMTbl::writeInt8Array(asynUser *pasynUser, epicsInt8 *value, size_t
if (function < FIRST_VMM_PARAM) return asynPortDriver::writeInt8Array(pasynUser, value, nElements);
found_param = VecUtils::getIndex(vmmSC_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
status |= (int)this->pVmmAPI->setSC(hyb_index, vmm_index, i, (bool)value[i]);
}
goto endOfWriteInt8Array;
}
found_param = VecUtils::getIndex(vmmSL_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
status |= (int)this->pVmmAPI->setSL(hyb_index, vmm_index, i, (bool)value[i]);
}
goto endOfWriteInt8Array;
}
found_param = VecUtils::getIndex(vmmST_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
......@@ -336,6 +397,30 @@ asynStatus VMMTbl::writeInt8Array(asynUser *pasynUser, epicsInt8 *value, size_t
goto endOfWriteInt8Array;
}
found_param = VecUtils::getIndex(vmmSTH_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
status |= (int)this->pVmmAPI->setSTH(hyb_index, vmm_index, i, (bool)value[i]);
}
goto endOfWriteInt8Array;
}
found_param = VecUtils::getIndex(vmmSM_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
status |= (int)this->pVmmAPI->setSM(hyb_index, vmm_index, i, (bool)value[i]);
}
goto endOfWriteInt8Array;
}
found_param = VecUtils::getIndex(vmmSMX_, function, hyb_index, vmm_index);
if (found_param == 0) {
for (size_t i = 0; i < nElements; i++) {
status |= (int)this->pVmmAPI->setSMX(hyb_index, vmm_index, i, (bool)value[i]);
}
goto endOfWriteInt8Array;
}
endOfWriteInt8Array:
status |= (int)doCallbacksInt8Array(value, nElements, function, 0); // Comparing different statuses, yes.
if (found_param != 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment