Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
e621
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs
ds
e621
Compare revisions
ec8f991a3d97381ff1613c0196d91d3b3d557c3e to d79b4a8c238a5769a41fe94694f59b8215553aae
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
cs/ds/e621
Select target project
No results found
d79b4a8c238a5769a41fe94694f59b8215553aae
Select Git revision
Swap
Target
cs/ds/e621
Select target project
cs/ds/e621
1 result
ec8f991a3d97381ff1613c0196d91d3b3d557c3e
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Add check_state()
· 20fa8c39
Alessio Igor Bogani
authored
4 months ago
20fa8c39
Update dependencies
· d79b4a8c
Alessio Igor Bogani
authored
4 months ago
d79b4a8c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
deps/usb2
+1
-1
1 addition, 1 deletion
deps/usb2
src/E621.cpp
+33
-48
33 additions, 48 deletions
src/E621.cpp
src/E621.h
+1
-0
1 addition, 0 deletions
src/E621.h
src/E621StateMachine.cpp
+0
-1
0 additions, 1 deletion
src/E621StateMachine.cpp
with
35 additions
and
50 deletions
usb2
@
dcc9934b
Compare
bbf88d71
...
dcc9934b
Subproject commit
bbf88d71ce04b87c7a3a2aa98996f91a5079bb4
7
Subproject commit
dcc9934b81c440a5737c26448a08527e88bd890
7
This diff is collapsed.
Click to expand it.
src/E621.cpp
View file @
d79b4a8c
...
...
@@ -261,8 +261,7 @@ void E621::init_device()
command
(
"SSN? A
\n
"
,
rep
);
strncpy
(
attr_SerialNumber_read
[
0
],
rep
.
c_str
(),
MAX_DEVSTRING_LENGTH
);
// TODO
// check_state();
check_state
();
}
catch
(
Tango
::
DevFailed
&
e
)
{
init_error
=
"Initialization failed: "
+
string
(
e
.
errors
[
0
].
desc
);
}
catch
(...)
{
...
...
@@ -306,62 +305,19 @@ void E621::always_executed_hook()
assert
(
false
);
return
;
}
///////////////////////////////////////////////////////////////////////////////////
// TODO Da rivedere!
set_state
(
Tango
::
ON
);
set_status
(
"The device is in ON state"
);
string
error
;
try
{
string
s
;
command
(
"I2C?
\n
"
,
s
);
// TODO
/* bit 0 (LSB):CHK_SEN0 timeout
bit 1:CHK_PEN0 timeout
bit 2:CHK_RSEN0 timeout
bit 3:CHK_RW0 timeout
bit 4:CHK_BF0 timeout
bit 5:CHK_BF1 timeout
bit 6:CHK_ACK0 timeout
bit 7: (MSB)SLAVE_BUSY timeout*/
#if 0
for (size_t i = 0; i < sai_output.size(); ++i) {
stringstream cmd;
cmd << "OVF? " << sai_output[i] << "\n";
string rep;
command(cmd.str(), rep);
int code;
convert(rep, code);
if (code != 0) {
set_state(Tango::FAULT);
set_status("The device is in FAULT state due overflow!");
return;
}
}
for (size_t i = 0; i < sai_output.size(); ++i) {
stringstream cmd;
cmd << "ONT? " << sai_output[i] << "\n";
string rep;
command(cmd.str(), rep);
int code;
convert(rep, code);
if (code != 1) {
set_state(Tango::MOVING);
set_status("The device is in MOVING state");
return;
}
}
#endif
///////////////////////////////////////////////////////////////////////////////////
check_state
();
}
catch
(
Tango
::
DevFailed
&
e
)
{
error
=
string
(
e
.
errors
[
0
].
desc
);
}
catch
(...)
{
error
=
"
u
nknown"
;
error
=
"
U
nknown
exception
"
;
}
if
(
!
error
.
empty
())
{
ERROR_STREAM
<<
error
<<
endl
;
set_state
(
Tango
::
FAULT
);
set_state
(
Tango
::
UNKNOWN
);
set_status
(
error
);
assert
(
false
);
}
...
...
@@ -646,6 +602,34 @@ void E621::check_init()
"E621::check_init()"
);
}
void
E621
::
check_state
()
{
set_state
(
Tango
::
ON
);
set_status
(
"The device is in ON state"
);
/* I2C? and OVF? doesn't seem useful so use ONT? only */
for
(
size_t
i
=
0
;
i
<
sai_output
.
size
();
++
i
)
{
stringstream
cmd
;
cmd
<<
"ONT? "
<<
sai_output
[
i
]
<<
"
\n
"
;
string
rep
;
command
(
cmd
.
str
(),
rep
);
/* Sometimes ONT? returns three characters which
* the first one is BELL that should be removed */
// if (rep[0] == 0x7)
// rep.erase(rep.begin());
/* ONT? reply is always two characters */
assert
(
rep
.
size
()
==
2
);
int
code
;
convert
(
rep
,
code
);
if
(
code
!=
1
)
{
set_state
(
Tango
::
MOVING
);
set_status
(
"The device is in MOVING state"
);
return
;
}
}
}
void
E621
::
_command
(
const
string
&
cmd
)
{
/* More than one command mnemonic per line is not allowed. (pag 34) */
...
...
@@ -655,6 +639,7 @@ void E621::_command(const string &cmd)
assert
(
cmd
.
size
()
<
26
);
write
(
cmd
);
/* When controlling the E-816, timing problems can occur if several commands
* are run in rapid sequence, resulting in lost commands. To prevent such
* communication errors, it is recommended that you include a certain wait time
...
...
This diff is collapsed.
Click to expand it.
src/E621.h
View file @
d79b4a8c
...
...
@@ -239,6 +239,7 @@ public:
// Additional Method prototypes
void
check_init
();
void
check_state
();
void
verify_command_execution
();
void
_command
(
const
string
&
cmd
);
void
command
(
const
string
&
cmd
);
...
...
This diff is collapsed.
Click to expand it.
src/E621StateMachine.cpp
View file @
d79b4a8c
...
...
@@ -42,7 +42,6 @@
// States | Description
//================================================================
// ON |
// FAULT |
// UNKNOWN |
// ALARM |
// MOVING |
...
...
This diff is collapsed.
Click to expand it.