From 2a483c28e26dac9818ab179074613f84ea4b4762 Mon Sep 17 00:00:00 2001
From: Alessio Igor Bogani <alessio.bogani@elettra.eu>
Date: Tue, 6 Feb 2024 11:36:21 +0100
Subject: [PATCH] Allow commands execution on FAULT state

---
 src/USB2.xmi             | 3 ---
 src/USB2StateMachine.cpp | 9 +++------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/src/USB2.xmi b/src/USB2.xmi
index 8f5cd00..2b65443 100644
--- a/src/USB2.xmi
+++ b/src/USB2.xmi
@@ -41,7 +41,6 @@
         <type xsi:type="pogoDsl:VoidType"/>
       </argout>
       <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
-      <excludedStates>FAULT</excludedStates>
       <excludedStates>INIT</excludedStates>
     </commands>
     <commands name="Read" description="" execMethod="read" displayLevel="OPERATOR" polledPeriod="0">
@@ -52,7 +51,6 @@
         <type xsi:type="pogoDsl:CharArrayType"/>
       </argout>
       <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
-      <excludedStates>FAULT</excludedStates>
       <excludedStates>INIT</excludedStates>
     </commands>
     <commands name="ReadUntil" description="" execMethod="read_until" displayLevel="OPERATOR" polledPeriod="0">
@@ -63,7 +61,6 @@
         <type xsi:type="pogoDsl:CharArrayType"/>
       </argout>
       <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
-      <excludedStates>FAULT</excludedStates>
       <excludedStates>INIT</excludedStates>
     </commands>
     <attributes name="InputLength" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
diff --git a/src/USB2StateMachine.cpp b/src/USB2StateMachine.cpp
index b6975ba..a25b931 100644
--- a/src/USB2StateMachine.cpp
+++ b/src/USB2StateMachine.cpp
@@ -114,8 +114,7 @@ bool USB2::is_Reconnections_allowed(TANGO_UNUSED(Tango::AttReqType type))
 bool USB2::is_Write_allowed(TANGO_UNUSED(const CORBA::Any &any))
 {
 	//	Compare device state with not allowed states.
-	if (get_state()==Tango::FAULT ||
-		get_state()==Tango::INIT)
+	if (get_state()==Tango::INIT)
 	{
 	/*----- PROTECTED REGION ID(USB2::WriteStateAllowed) ENABLED START -----*/
 	
@@ -134,8 +133,7 @@ bool USB2::is_Write_allowed(TANGO_UNUSED(const CORBA::Any &any))
 bool USB2::is_Read_allowed(TANGO_UNUSED(const CORBA::Any &any))
 {
 	//	Compare device state with not allowed states.
-	if (get_state()==Tango::FAULT ||
-		get_state()==Tango::INIT)
+	if (get_state()==Tango::INIT)
 	{
 	/*----- PROTECTED REGION ID(USB2::ReadStateAllowed) ENABLED START -----*/
 	
@@ -154,8 +152,7 @@ bool USB2::is_Read_allowed(TANGO_UNUSED(const CORBA::Any &any))
 bool USB2::is_ReadUntil_allowed(TANGO_UNUSED(const CORBA::Any &any))
 {
 	//	Compare device state with not allowed states.
-	if (get_state()==Tango::FAULT ||
-		get_state()==Tango::INIT)
+	if (get_state()==Tango::INIT)
 	{
 	/*----- PROTECTED REGION ID(USB2::ReadUntilStateAllowed) ENABLED START -----*/
 	
-- 
GitLab