Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CYBERSTARx1000
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango devices
MeasureInstruments
CYBERSTARx1000
Commits
067b71ab
Commit
067b71ab
authored
Mar 18, 2019
by
Xavier ELATTAOUI
Browse files
Options
Downloads
Patches
Plain Diff
CI-1058 : device starts in any case
parent
ccdfe375
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pom.xml
+1
-1
1 addition, 1 deletion
pom.xml
src/CYBERSTARx1000.cpp
+41
-33
41 additions, 33 deletions
src/CYBERSTARx1000.cpp
with
42 additions
and
34 deletions
pom.xml
+
1
−
1
View file @
067b71ab
...
...
@@ -8,7 +8,7 @@
</parent>
<groupId>
fr.soleil.device
</groupId>
<artifactId>
CYBERSTARx1000-${aol}-${mode}
</artifactId>
<version>
1.3.11
-SNAPSHOT
</version>
<version>
1.3.11
</version>
<packaging>
nar
</packaging>
<name>
CYBERSTARx1000
</name>
<description>
CYBERSTARx1000 device
</description>
...
...
This diff is collapsed.
Click to expand it.
src/CYBERSTARx1000.cpp
+
41
−
33
View file @
067b71ab
...
...
@@ -236,30 +236,6 @@ namespace CYBERSTARx1000_ns
mySerial
=
0
;
// initialize write part of attributes
try
{
read_upper
();
read_lower
();
}
catch
(
Tango
::
DevFailed
&
e
)
{
this
->
init_device_done
=
false
;
ERROR_STREAM
<<
"CYBERSTARx1000::init_device() caught DevFailed trying to call read_upper() or read_lower() ["
<<
e
<<
"]"
<<
std
::
endl
;
return
;
}
catch
(...)
{
this
->
init_device_done
=
false
;
ERROR_STREAM
<<
"CYBERSTARx1000::init_device() caught (...) trying to call read_upper() or read_lower() "
<<
std
::
endl
;
return
;
}
attr_scaUpperThreshold_write
=
(
*
attr_scaUpperThreshold_read
);
attr_scaLowerThreshold_write
=
(
*
attr_scaLowerThreshold_read
);
attr_windowWidth_write
=
attr_scaUpperThreshold_write
-
attr_scaLowerThreshold_write
;
attr_windowCenterPosition_write
=
attr_scaLowerThreshold_write
+
attr_windowWidth_write
/
2
;
try
{
this
->
init_proxy_Serialline
();
...
...
@@ -272,7 +248,6 @@ namespace CYBERSTARx1000_ns
<<
e
<<
"]"
<<
std
::
endl
;
return
;
}
catch
(...)
{
...
...
@@ -282,11 +257,34 @@ namespace CYBERSTARx1000_ns
<<
"check properties, restart device"
<<
"]"
<<
std
::
endl
;
return
;
}
if
(
mySerial
)
{
try
{
read_upper
();
read_lower
();
attr_scaUpperThreshold_write
=
(
*
attr_scaUpperThreshold_read
);
attr_scaLowerThreshold_write
=
(
*
attr_scaLowerThreshold_read
);
attr_windowWidth_write
=
attr_scaUpperThreshold_write
-
attr_scaLowerThreshold_write
;
attr_windowCenterPosition_write
=
attr_scaLowerThreshold_write
+
attr_windowWidth_write
/
2
;
this
->
init_device_done
=
true
;
}
catch
(
Tango
::
DevFailed
&
e
)
{
this
->
init_device_done
=
false
;
ERROR_STREAM
<<
"CYBERSTARx1000::init_device() caught DevFailed trying to call read_upper() or read_lower() ["
<<
e
<<
"]"
<<
std
::
endl
;
}
catch
(...)
{
this
->
init_device_done
=
false
;
ERROR_STREAM
<<
"CYBERSTARx1000::init_device() caught (...) trying to call read_upper() or read_lower() "
<<
std
::
endl
;
}
}
}
//+----------------------------------------------------------------------------
//
// method : CYBERSTARx1000::get_device_property()
...
...
@@ -345,10 +343,10 @@ namespace CYBERSTARx1000_ns
ERROR_STREAM
<<
"Property SerialProxyName missing - fix and restart device"
<<
std
::
endl
;
this
->
properties_missing
=
true
;
set_status
(
"SerialProxyName Property not set [fix and restart device]
\n
"
);
Tango
::
Except
::
throw_exception
(
/*
Tango::Except::throw_exception(
(const char*) "TANGO_CONFIGURATION_ERROR",
(const char*) "SerialProxyName property is empty",
(
const
char
*
)
"CYBERSTARx1000::get_device_property()"
);
(const char*) "CYBERSTARx1000::get_device_property()");
*/
}
if
(
maxThreshold
==
-
1
)
...
...
@@ -356,10 +354,10 @@ namespace CYBERSTARx1000_ns
ERROR_STREAM
<<
"Property maxThreshold missing or not set properly- fix and restart device"
<<
std
::
endl
;
set_status
(
"MaxThreshold Property not set [fix and restart device]
\n
"
);
this
->
properties_missing
=
true
;
Tango
::
Except
::
throw_exception
(
/*
Tango::Except::throw_exception(
(const char*) "TANGO_CONFIGURATION_ERROR",
(const char*) "MaxThreshold property = -1 (default value)",
(
const
char
*
)
"CYBERSTARx1000::get_device_property()"
);
(const char*) "CYBERSTARx1000::get_device_property()");
*/
}
}
//+----------------------------------------------------------------------------
...
...
@@ -1125,14 +1123,24 @@ namespace CYBERSTARx1000_ns
{
DEBUG_STREAM
<<
"CYBERSTARx1000::dev_state(): entering... !"
<<
endl
;
if
(
!
init_device_done
||
properties_missing
||
communication_failed
)
if
(
properties_missing
)
{
set_state
(
Tango
::
FAULT
);
set_status
(
"Critical proprt(ies)y missing."
);
return
Tango
::
FAULT
;
}
if
(
communication_failed
)
if
(
!
init_device_done
)
{
set_state
(
Tango
::
FAULT
);
set_status
(
"Device initialization failed"
);
return
Tango
::
FAULT
;
}
if
(
communication_failed
)
{
set_state
(
Tango
::
FAULT
);
set_status
(
"communication failed"
);
return
Tango
::
FAULT
;
}
Tango
::
DevState
argout
;
...
...
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