Unverified Commit df1d6c42 authored by Giuseppe Carboni's avatar Giuseppe Carboni Committed by GitHub
Browse files

Several SRT Active Surface improvements (#601)

* Fix #481, implemented the `SRTActiveSurfaceUSDServer::getStatus()` method (#483)

This method returns in a long variable passed by reference, the last known status of the actuator without any call to the actual hardware. This is a measure to prevent occupying the LAN socket in case of tracking. Since during the tracking process the status is updated every time the USD has to move to a different position, I think is safe to assume that the returned status has been read no more than a couple seconds before.

* Fix #484, sped up the SRT Active Surface GUI Client loop (#485)

Also, some global variables that were used for some methods syncrhonization were replaced by some new methods parameters. The old implementation could cause some issues when setting the color of a USD if a user clicks on another USD.

* Fix #487, added a `WorkingThreadTime` parameter to SRT AS Boss (#488)

* Fix #487, added a `WorkingThreadTime` parameter to SRT AS Boss

Also, the working thread has been slightly modified in order to take exactly `WorkingThreadTime` to be executed. The standard ACS implementation sets the thread to sleep for the given time, but the total execution time for each iteration becomes `Tex + Tsl` with `Tsl` equal to `WorkingThreadTime`, and `Tex` the total time of execution of a single `runLoop()` method. With this default implementation the total time for each iteration easily exceeds `WorkingThreadTime`. With the new implementation, `Tex` is taken into account so that `Tsl = WorkingThreadTime - Tex`. In this way the total time for each iteration is indeed `WorkingThreadTime` (with fluctuations due to the CPU clock, of course).

* Fix #487, refined thread sleep strategy

* Fix #493, used ENUM for USD profile checking (#494)

* Fix #493, used ENUM for USD profile checking

* Fixed a small indentation issue

* Fix #493, updated GUI behavior to use the ENUM value instead of plain int

* Fix #487, moved the start time acquisition after the SecureArea lock (#495)

When the SecureArea is not locked by any other thread, locking it requires virtually no time (a few microseconds). So now the locking elapsed time is not taken into account anymore. In this way the total execution time for a single iteration is equal to Tlock + Texecution, with Tlock usually negligible, or greater than a second whenever a new profile is chosen (due to a Wait(1000000) in the other locking thread).

* Fix #486, replaced `SRTActiveSurfaceSectorThread::run()` with `::runLoop()` (#496)

The `run()` method used to loop to activate all USDs internally, in case the component gets released , the loop prevented the thread from stopping causing a timeout in the release procedure.

* Fix #491, SRT AS Boss, moved the `reset` method into `onewayAction` (#498)

Also, some files were rewritten in order to fix some indentation issues and improve readability

* Fix #497, removed references to SRTActiveSurfaceBossWatchingThread (#499)

This kind of thread was not used anymore but was compiled alongside the other classes of the SRTActiveSurfaceBoss. I removed any reference but I kept the original files and commented the unnecessary methods in order to keep track of it for eventual future use.

* Updated CHANGELOG.md with SRT Active Surface improvements

* Fixed some typos in CHANGELOG.md

* Fix #447, the SRT AS GUI has been reworked in order to account for some latency

Now the SRT Active Surface GUI Client asks for the complete status of the active surface, instead of asking a single USD status at a time. This results on fewer calls to the AS Boss component, leaving more CPU time for the Boss' Working Thread (when in tracking mode). This allows us to consider shortening the working thread period (now it's 0.5 seconds) in order to achieve higher precision.
Also, the code of the GUI Client has been significally simplified by reusing the same code for all the actuator buttons (previously each one had its own methods).
parent 3334adf8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -47,3 +47,4 @@ SRT/Clients/SRTActiveSurfaceGUIClient/src/moc_SRTActiveSurfaceCore.cpp
SRT/Clients/SRTActiveSurfaceGUIClient/src/moc_SRTActiveSurfaceGUIui.cpp
SRT/Errors/SRTActiveSurfaceErrors/idl/ASErrors.idl
SRT/Interfaces/SRTActiveSurfaceInterface/idl/SRTActiveSurfaceBoss.idl
SRT/Interfaces/SRTActiveSurfaceInterface/idl/SRTActiveSurfaceCommon.idl
+5 −5
Original line number Diff line number Diff line
@@ -85,9 +85,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/
## [discos1.0.5] - 
## Added
    issue #504 - added credits clause (regarding INAF data ownership) to fits files headers
   issue #518 - KBand receivers cryo temperature read wrongly with connection problems. More information:
    https://github.com/discos/discos/issues/518#issuecomment-590838480
   issue #533 - New Fitszilla versione 1.21 online. The user offsets related keywords added to the primary header.
    issue #518 - KBand receivers cryo temperature read wrongly with connection problems. More information: https://github.com/discos/discos/issues/518#issuecomment-590838480
    issue #533 - New Fitszilla version 1.21 online. The user offsets related keywords added to the primary header.
    issue #556 - Added API to send emails to local system administrators. This feature is now exploted when a servo system oscillation is detected at Noto and Medicina
## Fixed
    issue #518 - In case of communication error we set a dummy value (100000) for the temperature properties, and the related timestamp keeps the value of the last communication timestamp.
@@ -101,3 +100,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/
    issue #448 - Added Sky Offsets to calibration tool client
    issue #585 - Fixed misshandled schedule with NULL as backend (Dry Run)
## Changed
    issues #481, #484, #486, #487, #491, #493, #497. SRT Active Surface module has been improved in order to speed up its booting time and optimize its overall behavior
+10 −1
Original line number Diff line number Diff line
<?xml version='1.0' encoding='ISO-8859-1'?>
<SRTActiveSurfaceBoss xmlns="urn:schemas-cosylab-com:SRTActiveSurfaceBoss:1.0" xmlns:baci="urn:schemas-cosylab-com:BACI:1.0" xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" WatchingThreadTime="200000" RepetitionCacheTime="2000000" RepetitionExpireTime="5000000" profile="4">
<SRTActiveSurfaceBoss
        xmlns="urn:schemas-cosylab-com:SRTActiveSurfaceBoss:1.0"
        xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
        xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        WatchingThreadTime="200000"
        WorkingThreadTime="500000"
        RepetitionCacheTime="2000000"
        RepetitionExpireTime="5000000"
        profile="4">
	<status />
	<enabled />
	<pprofile />
+6 −11
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ class SRTActiveSurfaceCore : public QThread

	    bool monitor;
        int theCircle, theActuator, theRadius;
        const char* theActuatorStatusColorString;
	    QString ActuatorActualPosition_str;
	    QString ActuatorCommandedPosition_str;
	    QString mm_ActuatorActualPosition_str;
@@ -72,21 +71,17 @@ class SRTActiveSurfaceCore : public QThread
        int ActuatorStatusCammLabelCode;
        int ActuatorStatusLoopLabelCode;
        int ActuatorStatusCalLabelCode;
        int ASstatusCode;
        int asProfileCode;

	    bool callfromfunction, fromRun;

    signals:
        int setGUIActuatorColor(int, int, const char*);
        int setGUIAllActuators();
        int setGUIcircleORradius();
        int setGUIActuator();
        int setGUIActuatorColor(int, int, bool, bool);
        int setGUIAllActuators(bool callfromfunction = false);
        int setGUIcircleORradius(bool callfromfunction = false);
        int setGUIActuator(bool callfromfunction = false);
        int setGUIActuatorStatusEnblLabel();
        int setGUIActuatorValues();
        int setGUIActuatorStatusLabels();
        int setGUIasStatusCode();
        int setGUIasProfileCode();
        int setGUIasStatusCode(int);
        int setGUIasProfileCode(int);
        
	private:
	    ActiveSurface::SRTActiveSurfaceBoss_var tASBoss;
+9 −1253

File changed.

Preview size limit exceeded, changes collapsed.

Loading