Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fe-vmm-tbl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nice
dev-epics-modules
fe-vmm-tbl
Commits
b959f593
Commit
b959f593
authored
2 months ago
by
Marco Filho
Browse files
Options
Downloads
Patches
Plain Diff
Add acquire and isAcquiring records.
parent
91cd4ece
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
Major refactor
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
vmmTblApp/Db/vmm_tbl.template
+20
-0
20 additions, 0 deletions
vmmTblApp/Db/vmm_tbl.template
vmmTblApp/src/vmm_tbl.cpp
+33
-17
33 additions, 17 deletions
vmmTblApp/src/vmm_tbl.cpp
vmmTblApp/src/vmm_tbl.h
+2
-0
2 additions, 0 deletions
vmmTblApp/src/vmm_tbl.h
with
55 additions
and
17 deletions
vmmTblApp/Db/vmm_tbl.template
+
20
−
0
View file @
b959f593
...
...
@@ -4,9 +4,29 @@ record(bo, "$(P)$(R)Acquire-S") {
field(ZNAM, "Done")
field(ONAM, "Acquire")
field(DTYP, "asynInt32")
field(FLNK, "$(P)$(R)IsAcquiring-R")
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))VMM_FEN_ACQUIRE")
}
record(bi, "$(P)$(R)IsAcquiring-R") {
field(DESC, "Is VMM FEN Acquiring ?")
field(VAL, "0")
field(ZNAM, "Idle")
field(ONAM, "Acquiring")
field(DTYP, "asynInt32")
field(SCAN, "I/O Intr")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))VMM_FEN_ACQUIRING")
}
record(waveform, "$(P)$(R)IOCMessage-R") {
field(DESC, "General message from IOC driver")
field(DTYP, "asynOctetRead")
field(NELM, "256")
field(FTVL, "CHAR")
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))IOC_MESSAGE")
field(SCAN, "I/O Intr")
}
record(ai, "$(P)$(R)RegBankVersion-R"){
field(DESC, "Register bank version")
field(PINI, "YES")
...
...
This diff is collapsed.
Click to expand it.
vmmTblApp/src/vmm_tbl.cpp
+
33
−
17
View file @
b959f593
...
...
@@ -29,7 +29,7 @@ asynStatus VMMTbl::readInt32(asynUser *pasynUser, epicsInt32 *value) {
int
tmp_val
;
bool
tmp_val_bool
;
uint8_t
tmp_val_uint8
;
int
param_index
,
hyb_index
,
vmm_index
;
int
param_index
=
0
,
hyb_index
,
vmm_index
;
if
(
function
<
FIRST_VMM_PARAM
)
{
return
asynPortDriver
::
readInt32
(
pasynUser
,
value
);
...
...
@@ -39,7 +39,14 @@ asynStatus VMMTbl::readInt32(asynUser *pasynUser, epicsInt32 *value) {
vmmStatus
result
=
this
->
pVmmAPI
->
getRegBankVersion
(
val
);
if
(
result
!=
vmmSuccess
)
status
=
asynError
;
*
value
=
val
;
param_index
=
10000
;
/// \todo So endOfReadInt32 won't return asynError; Maybe improve mechanism?
goto
endOfReadInt32
;
}
if
(
function
==
vmmIsAcquiring_
)
{
vmmStatus
result
=
this
->
pVmmAPI
->
isAcquiring
(
tmp_val_bool
);
printf
(
"Is acquiring: %d
\n
"
,
tmp_val_bool
);
if
(
result
!=
vmmSuccess
)
status
=
asynError
;
*
value
=
tmp_val_bool
;
goto
endOfReadInt32
;
}
...
...
@@ -110,7 +117,7 @@ asynStatus VMMTbl::readOctet(asynUser *pasynUser, char *value,
int
status
=
asynSuccess
;
int
function
=
pasynUser
->
reason
;
std
::
string
read
=
""
;
/* If this parameter belongs to a base class call its method */
if
(
function
<
FIRST_VMM_PARAM
)
{
status
=
asynPortDriver
::
readOctet
(
pasynUser
,
value
,
nChars
,
nActual
,
...
...
@@ -152,10 +159,10 @@ asynStatus VMMTbl::readOctet(asynUser *pasynUser, char *value,
callParamCallbacks
();
return
asynSuccess
;
}
asynStatus
VMMTbl
::
createParamAndStoreInVector
(
std
::
string
paramName
,
asynParamType
typ
,
asynStatus
VMMTbl
::
createParamAndStoreInVector
(
std
::
string
paramName
,
asynParamType
typ
,
std
::
vector
<
int
>*
vectorToStore
){
int
paramIndex
;
...
...
@@ -174,8 +181,11 @@ asynStatus VMMTbl::createParamAndStoreInVector(std::string paramName, asynParamT
asynStatus
VMMTbl
::
createEpicsParams
()
{
createParam
(
"REG_BANK_VERSION"
,
asynParamInt32
,
&
vmmRegBankVersion
);
createParam
(
"VMM_FEN_ACQUIRE"
,
asynParamInt32
,
&
vmmAcquire_
);
createParam
(
"VMM_FEN_ACQUIRING"
,
asynParamInt32
,
&
vmmIsAcquiring_
);
createParam
(
"IOC_MESSAGE"
,
asynParamOctet
,
&
IOCMessage
);
std
::
tuple
<
std
::
string
,
asynParamType
,
std
::
vector
<
int
>*>
std
::
tuple
<
std
::
string
,
asynParamType
,
std
::
vector
<
int
>*>
hyb_params_to_create
[
7
]
=
{{
"_FW_VERSION"
,
asynParamOctet
,
&
vmmHybFwVersion_
},
{
"_ID"
,
asynParamOctet
,
&
vmmHybId_
},
{
"_GEOPOS"
,
asynParamOctet
,
&
vmmHybGeoPos_
},
...
...
@@ -196,7 +206,7 @@ asynStatus VMMTbl::createEpicsParams() {
}
std
::
vector
<
int
>
SC
,
SL
,
ST
,
STH
,
SM
,
SD
,
SMX
,
ADCIDX
,
ADCVAL
;
for
(
int
vmm
=
0
;
vmm
<
VMMS_PER_HYBRID
;
vmm
++
)
{
...
...
@@ -257,22 +267,28 @@ asynStatus VMMTbl::writeInt32(asynUser *pasynUser, epicsInt32 value) {
asynStatus
status
=
asynSuccess
;
vmmStatus
vmm_stat
;
bool
is_acquiring
;
int
function
=
pasynUser
->
reason
;
int
param_index
=
-
1
,
hyb_index
,
vmm_index
;
// if (function == vmmAcquire_) {
// if (value) pVmmAPI->acquire(true);
// else pVmmAPI->acquire(false);
// for (int hyb = 0; hyb < number_hybrids; hyb++)
// setIntegerParam(vmmHybLinkStatus_[hyb], std::stoi(pVmmAPI->checkLinkStatus(hyb)));
// }
int
param_index
=
0
,
hyb_index
,
vmm_index
;
if
(
function
<
FIRST_VMM_PARAM
)
{
return
asynPortDriver
::
writeInt32
(
pasynUser
,
value
);
}
if
(
function
==
vmmAcquire_
)
{
vmm_stat
=
this
->
pVmmAPI
->
isAcquiring
(
is_acquiring
);
if
(
is_acquiring
==
(
bool
)
value
)
{
setStringParam
(
IOCMessage
,
"Set to acquire/stop but already acquiring/stopped."
);
status
=
asynError
;
}
else
{
this
->
pVmmAPI
->
acquire
((
bool
)
value
);
}
goto
endOfWriteInt32
;
}
//Search for parameter in all parameter vectors. If found, execute correct function for specific hybrid.
param_index
=
VecUtils
::
getIndex
(
vmmHybSkew_
,
function
);
if
(
param_index
>=
0
)
{
...
...
This diff is collapsed.
Click to expand it.
vmmTblApp/src/vmm_tbl.h
+
2
−
0
View file @
b959f593
...
...
@@ -35,6 +35,8 @@ protected:
int
vmmMonitorValueVMM0_
;
int
vmmMonitorValueVMM1_
;
int
vmmAcquire_
;
int
vmmIsAcquiring_
;
int
IOCMessage
;
std
::
vector
<
int
>
vmmHybFwVersion_
;
std
::
vector
<
int
>
vmmHybId_
;
std
::
vector
<
int
>
vmmHybGeoPos_
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment