Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lima-camera-frelon
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LimaGroup
Lima-camera-frelon
Commits
46052a0c
Commit
46052a0c
authored
Dec 05, 2018
by
Laurent Claustre
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'add_signed_regs' into 'master'
Add signed commands WeightValDFl/Sig See merge request
!5
parents
76fc27d8
64f45b84
Pipeline
#6786
passed with stages
in 6 minutes and 39 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
5 deletions
+30
-5
include/Frelon.h
include/Frelon.h
+2
-1
include/FrelonSerialLine.h
include/FrelonSerialLine.h
+1
-1
sip/Frelon.sip
sip/Frelon.sip
+1
-0
src/Frelon.cpp
src/Frelon.cpp
+8
-0
src/FrelonSerialLine.cpp
src/FrelonSerialLine.cpp
+18
-3
No files found.
include/Frelon.h
View file @
46052a0c
...
...
@@ -49,7 +49,7 @@ enum Reg {
SingleVertXfer
,
SingleHorzXfer
,
AllVertXfer
,
AllHorzXfer
,
ReadoutTime
,
TransferTime
,
CcdModesAvail
,
StatusSeqA
,
StatusAMTA
,
StatusAMTB
,
StatusAMTC
,
StatusAMTD
,
LookUpTable
,
ImagesPerEOF
,
LookUpTable
,
ImagesPerEOF
,
WeightValDFl
,
WeightValSig
,
};
typedef
std
::
map
<
Reg
,
std
::
string
>
RegStrMapType
;
...
...
@@ -58,6 +58,7 @@ extern RegStrMapType RegStrMap;
typedef
std
::
vector
<
Reg
>
RegListType
;
extern
RegListType
CacheableRegList
;
extern
RegListType
FloatRegList
;
extern
RegListType
SignedRegList
;
typedef
std
::
map
<
Reg
,
double
>
RegDoubleMapType
;
extern
RegDoubleMapType
RegSleepMap
;
...
...
include/FrelonSerialLine.h
View file @
46052a0c
...
...
@@ -37,7 +37,7 @@ class SerialLine : public HwSerialLine
public:
enum
MsgPart
{
MsgSync
,
MsgCmd
,
MsgVal
,
MsgDec
,
MsgReq
,
MsgTerm
,
MsgSync
,
MsgCmd
,
MsgVal
,
MsgDec
,
MsgReq
,
MsgTerm
,
MsgSign
,
};
enum
AnsPart
{
...
...
sip/Frelon.sip
View file @
46052a0c
...
...
@@ -69,6 +69,7 @@ public:
typedef std::vector<Reg> RegListType;
extern RegListType CacheableRegList;
extern RegListType FloatRegList;
extern RegListType SignedRegList;
typedef std::map<Reg, double> RegDoubleMapType;
extern RegDoubleMapType RegSleepMap;
...
...
src/Frelon.cpp
View file @
46052a0c
...
...
@@ -95,6 +95,8 @@ static const RegPair RegStrCList[] = {
RegPair
(
LookUpTable
,
"LUT"
),
RegPair
(
ImagesPerEOF
,
"NEF"
),
RegPair
(
WeightValDFl
,
"WVD"
),
RegPair
(
WeightValSig
,
"WVS"
),
};
RegStrMapType
lima
::
Frelon
::
RegStrMap
(
C_LIST_ITERS
(
RegStrCList
));
...
...
@@ -114,6 +116,12 @@ static Reg FloatRegCList[] = {
};
RegListType
lima
::
Frelon
::
FloatRegList
(
C_LIST_ITERS
(
FloatRegCList
));
static
Reg
SignedRegCList
[]
=
{
WeightValDFl
,
WeightValSig
,
};
RegListType
lima
::
Frelon
::
SignedRegList
(
C_LIST_ITERS
(
SignedRegCList
));
typedef
pair
<
Reg
,
double
>
RegSleepPair
;
static
const
RegSleepPair
RegSleepCList
[]
=
{
RegSleepPair
(
ConfigHD
,
2.0
),
...
...
src/FrelonSerialLine.cpp
View file @
46052a0c
...
...
@@ -110,6 +110,19 @@ void SerialLine::writeCmd(const string& buffer, bool no_wait)
m_curr_reg
=
it
->
first
;
}
bool
has_sign
=
!
msg_parts
[
MsgSign
].
empty
();
if
(
has_sign
)
{
bool
ok
=
false
;
if
(
reg_found
)
{
const
RegListType
&
list
=
SignedRegList
;
RegListType
::
const_iterator
end
=
list
.
end
();
ok
=
(
find
(
list
.
begin
(),
end
,
m_curr_reg
)
!=
end
);
}
if
(
!
ok
)
THROW_HW_ERROR
(
InvalidValue
)
<<
"Command "
<<
cmd
<<
" cannot be negative"
;
}
m_curr_cache
=
false
;
if
(
reg_found
&&
isRegCacheable
(
m_curr_reg
))
{
bool
is_req
=
!
msg_parts
[
MsgReq
].
empty
();
...
...
@@ -409,7 +422,8 @@ void SerialLine::splitMsg(const string& msg,
const
static
RegEx
re
(
"^(?P<sync>>)?"
"(?P<cmd>[A-Za-z]+)"
"((?P<req>
\\
?)|"
"(?P<val>[0-9]+(
\\
.(?P<dec>[0-9]+))?))?"
"(?P<val>(?P<sign>-?)[0-9]+"
"(
\\
.(?P<dec>[0-9]+))?))?"
"(?P<term>[
\r\n
]+)?$"
);
RegEx
::
FullNameMatchType
match
;
...
...
@@ -422,6 +436,7 @@ void SerialLine::splitMsg(const string& msg,
KeyPair
(
MsgSync
,
"sync"
),
KeyPair
(
MsgCmd
,
"cmd"
),
KeyPair
(
MsgVal
,
"val"
),
KeyPair
(
MsgDec
,
"dec"
),
KeyPair
(
MsgReq
,
"req"
),
KeyPair
(
MsgTerm
,
"term"
),
KeyPair
(
MsgSign
,
"sign"
),
};
const
KeyPair
*
it
,
*
end
=
C_LIST_END
(
key_list
);
for
(
it
=
key_list
;
it
!=
end
;
++
it
)
{
...
...
@@ -431,8 +446,8 @@ void SerialLine::splitMsg(const string& msg,
}
DEB_RETURN
()
<<
DEB_VAR2
(
msg_parts
[
MsgSync
],
msg_parts
[
MsgCmd
]);
DEB_RETURN
()
<<
DEB_VAR
3
(
msg_parts
[
MsgReq
],
msg_parts
[
MsgVal
],
msg_parts
[
MsgDec
]);
DEB_RETURN
()
<<
DEB_VAR
4
(
msg_parts
[
MsgReq
],
msg_parts
[
MsgSign
],
msg_parts
[
Msg
Val
],
msg_parts
[
Msg
Dec
]);
}
void
SerialLine
::
decodeFmtResp
(
const
string
&
ans
,
string
&
fmt_resp
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment