From abfc25d09d9b50833559f54f8323afb5eb4d87bf Mon Sep 17 00:00:00 2001
From: Doug Boulware <dboulware@ntia.doc.gov>
Date: Wed, 14 Feb 2024 15:47:59 -0700
Subject: [PATCH 01/10] use RemoveRayInitialization actions branch.

---
 pyproject.toml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pyproject.toml b/pyproject.toml
index fab5f10..e67b1dd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -41,7 +41,7 @@ classifiers = [
 dependencies = [
     "environs>=9.5.0",
     "tekrsa-api-wrap>=1.3.2",
-    "scos_actions @ git+https://github.com/NTIA/scos-actions@8.0.0",
+    "scos_actions @ git+https://github.com/NTIA/scos-actions@RemoveRayInitialization",
 ]
 
 [project.optional-dependencies]

From 084e21d5c6309c395581e0f3c7a25470d2b86f63 Mon Sep 17 00:00:00 2001
From: Doug Boulware <dboulware@ntia.doc.gov>
Date: Thu, 15 Feb 2024 13:05:34 -0700
Subject: [PATCH 02/10] Add SystemExit and RuntimeException actions.

---
 src/scos_tekrsa/discover/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/scos_tekrsa/discover/__init__.py b/src/scos_tekrsa/discover/__init__.py
index b17a35a..c2966aa 100644
--- a/src/scos_tekrsa/discover/__init__.py
+++ b/src/scos_tekrsa/discover/__init__.py
@@ -1,6 +1,8 @@
 import logging
 
 from scos_actions.actions.monitor_sigan import MonitorSignalAnalyzer
+from scos_actions.actions.runtime_exception import RuntimeException
+from scos_actions.actions.system_exit_action import SystemExitAction
 from scos_actions.discover import init
 
 from scos_tekrsa.settings import CONFIG_DIR, DEVICE_MODEL
@@ -29,6 +31,8 @@
     ACTION_DEFINITIONS_DIR = CONFIG_DIR / "actions-500-600"
 logger.debug(f"Action configs directory: {ACTION_DEFINITIONS_DIR}")
 actions["monitor_tekrsa"] = MonitorSignalAnalyzer(parameters={"name": "monitor_tekrsa"})
+actions["system_exit"] = SystemExitAction()
+actions["runtime_exception"] = RuntimeException()
 logger.debug("Created Monitor SIGAN action")
 # Pass new radio to existing action classes with new SDR specific yaml files
 logger.debug("Initializing yaml actions")

From 6743e0ebfeee40c04116c8eb9a1cdba4f4001131 Mon Sep 17 00:00:00 2001
From: Doug Boulware <dboulware@ntia.doc.gov>
Date: Thu, 15 Feb 2024 14:37:20 -0700
Subject: [PATCH 03/10] add segfault action.

---
 src/scos_tekrsa/discover/__init__.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/scos_tekrsa/discover/__init__.py b/src/scos_tekrsa/discover/__init__.py
index c2966aa..af29ba8 100644
--- a/src/scos_tekrsa/discover/__init__.py
+++ b/src/scos_tekrsa/discover/__init__.py
@@ -3,6 +3,7 @@
 from scos_actions.actions.monitor_sigan import MonitorSignalAnalyzer
 from scos_actions.actions.runtime_exception import RuntimeException
 from scos_actions.actions.system_exit_action import SystemExitAction
+from scos_actions.actions.seg_fault import SegFault
 from scos_actions.discover import init
 
 from scos_tekrsa.settings import CONFIG_DIR, DEVICE_MODEL
@@ -33,6 +34,7 @@
 actions["monitor_tekrsa"] = MonitorSignalAnalyzer(parameters={"name": "monitor_tekrsa"})
 actions["system_exit"] = SystemExitAction()
 actions["runtime_exception"] = RuntimeException()
+actions["Segfault"] = SegFault()
 logger.debug("Created Monitor SIGAN action")
 # Pass new radio to existing action classes with new SDR specific yaml files
 logger.debug("Initializing yaml actions")

From df06cbd22c6678c510b6e53cbb19a785cfdef292 Mon Sep 17 00:00:00 2001
From: Doug Boulware <dboulware@ntia.doc.gov>
Date: Thu, 15 Feb 2024 15:48:01 -0700
Subject: [PATCH 04/10] catch BaseException in tekrsa init.

---
 src/scos_tekrsa/hardware/tekrsa_sigan.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/scos_tekrsa/hardware/tekrsa_sigan.py b/src/scos_tekrsa/hardware/tekrsa_sigan.py
index c2a8fb1..e69d65a 100644
--- a/src/scos_tekrsa/hardware/tekrsa_sigan.py
+++ b/src/scos_tekrsa/hardware/tekrsa_sigan.py
@@ -53,7 +53,7 @@ def __init__(
             self._capture_time = None
             self.connect()
 
-        except Exception as error:
+        except BaseException as error:
             logger.error(
                 f"Unable to initialize sigan: {error}.\nAttempting to power cycle and reconnect..."
             )

From 25f9908e38675941a40ea25e32e09b149887ba65 Mon Sep 17 00:00:00 2001
From: Doug Boulware <dboulware@ntia.doc.gov>
Date: Fri, 16 Feb 2024 08:39:21 -0700
Subject: [PATCH 05/10] Remove power cycling of sigan.

---
 src/scos_tekrsa/hardware/tekrsa_sigan.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/scos_tekrsa/hardware/tekrsa_sigan.py b/src/scos_tekrsa/hardware/tekrsa_sigan.py
index e69d65a..c349427 100644
--- a/src/scos_tekrsa/hardware/tekrsa_sigan.py
+++ b/src/scos_tekrsa/hardware/tekrsa_sigan.py
@@ -57,7 +57,6 @@ def __init__(
             logger.error(
                 f"Unable to initialize sigan: {error}.\nAttempting to power cycle and reconnect..."
             )
-            self.power_cycle_and_connect()
 
     def get_constraints(self):
         self.min_frequency = self.rsa.CONFIG_GetMinCenterFreq()

From d1f7406e953c6ffd442634cbb06b41c7cbd0ec0f Mon Sep 17 00:00:00 2001
From: Doug Boulware <dboulware@ntia.doc.gov>
Date: Wed, 28 Feb 2024 10:28:27 -0700
Subject: [PATCH 06/10] Use renamed actions and remove seg fault action.

---
 src/scos_tekrsa/discover/__init__.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/scos_tekrsa/discover/__init__.py b/src/scos_tekrsa/discover/__init__.py
index af29ba8..d9f6d0b 100644
--- a/src/scos_tekrsa/discover/__init__.py
+++ b/src/scos_tekrsa/discover/__init__.py
@@ -1,9 +1,8 @@
 import logging
 
 from scos_actions.actions.monitor_sigan import MonitorSignalAnalyzer
-from scos_actions.actions.runtime_exception import RuntimeException
+from scos_actions.actions.runtime_error_action import RuntimeErrorAction
 from scos_actions.actions.system_exit_action import SystemExitAction
-from scos_actions.actions.seg_fault import SegFault
 from scos_actions.discover import init
 
 from scos_tekrsa.settings import CONFIG_DIR, DEVICE_MODEL
@@ -33,8 +32,7 @@
 logger.debug(f"Action configs directory: {ACTION_DEFINITIONS_DIR}")
 actions["monitor_tekrsa"] = MonitorSignalAnalyzer(parameters={"name": "monitor_tekrsa"})
 actions["system_exit"] = SystemExitAction()
-actions["runtime_exception"] = RuntimeException()
-actions["Segfault"] = SegFault()
+actions["runtime_exception"] = RuntimeErrorAction()
 logger.debug("Created Monitor SIGAN action")
 # Pass new radio to existing action classes with new SDR specific yaml files
 logger.debug("Initializing yaml actions")

From fe2ccbc04a2aa9eedd948ee737aa7bdb5e925686 Mon Sep 17 00:00:00 2001
From: Doug Boulware <dboulware@ntia.doc.gov>
Date: Thu, 29 Feb 2024 14:37:15 -0700
Subject: [PATCH 07/10] Remove loading of SystemExit and RuntimeError actions.

---
 src/scos_tekrsa/discover/__init__.py | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/scos_tekrsa/discover/__init__.py b/src/scos_tekrsa/discover/__init__.py
index d9f6d0b..b17a35a 100644
--- a/src/scos_tekrsa/discover/__init__.py
+++ b/src/scos_tekrsa/discover/__init__.py
@@ -1,8 +1,6 @@
 import logging
 
 from scos_actions.actions.monitor_sigan import MonitorSignalAnalyzer
-from scos_actions.actions.runtime_error_action import RuntimeErrorAction
-from scos_actions.actions.system_exit_action import SystemExitAction
 from scos_actions.discover import init
 
 from scos_tekrsa.settings import CONFIG_DIR, DEVICE_MODEL
@@ -31,8 +29,6 @@
     ACTION_DEFINITIONS_DIR = CONFIG_DIR / "actions-500-600"
 logger.debug(f"Action configs directory: {ACTION_DEFINITIONS_DIR}")
 actions["monitor_tekrsa"] = MonitorSignalAnalyzer(parameters={"name": "monitor_tekrsa"})
-actions["system_exit"] = SystemExitAction()
-actions["runtime_exception"] = RuntimeErrorAction()
 logger.debug("Created Monitor SIGAN action")
 # Pass new radio to existing action classes with new SDR specific yaml files
 logger.debug("Initializing yaml actions")

From dc5bca8aaa475c00e772778d136d5fe4c0f43a04 Mon Sep 17 00:00:00 2001
From: Doug Boulware <dboulware@ntia.doc.gov>
Date: Wed, 6 Mar 2024 15:30:51 -0700
Subject: [PATCH 08/10] scos-actions 8.0.1. Move instance variables into
 __init__.

---
 pyproject.toml                           |  2 +-
 src/scos_tekrsa/hardware/tekrsa_sigan.py | 29 +++++++++++++++---------
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index e67b1dd..e8e2de1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -41,7 +41,7 @@ classifiers = [
 dependencies = [
     "environs>=9.5.0",
     "tekrsa-api-wrap>=1.3.2",
-    "scos_actions @ git+https://github.com/NTIA/scos-actions@RemoveRayInitialization",
+    "scos_actions @ git+https://github.com/NTIA/scos-actions@8.0.1",
 ]
 
 [project.optional-dependencies]
diff --git a/src/scos_tekrsa/hardware/tekrsa_sigan.py b/src/scos_tekrsa/hardware/tekrsa_sigan.py
index c349427..d4de71c 100644
--- a/src/scos_tekrsa/hardware/tekrsa_sigan.py
+++ b/src/scos_tekrsa/hardware/tekrsa_sigan.py
@@ -24,6 +24,7 @@ def __init__(
         sigan_cal: Calibration = None,
         switches: Optional[Dict[str, WebRelay]] = None,
     ):
+
         try:
             super().__init__(sensor_cal, sigan_cal, switches)
             logger.debug("Initializing Tektronix RSA Signal Analyzer")
@@ -51,12 +52,22 @@ def __init__(
             self.sensor_calibration_data = None
             self.sigan_calibration_data = None
             self._capture_time = None
+            self._reference_level = None
+            self._frequency = None
+            self._iq_bandwidth = None
+            self._sample_rate = None
+            self._attenuation = None
+            self._preamp_enable = None
+            self._api_version = None
+            self._firmware_version = None
             self.connect()
 
         except BaseException as error:
             logger.error(
-                f"Unable to initialize sigan: {error}.\nAttempting to power cycle and reconnect..."
+                f"Unable to initialize sigan: {error}."
             )
+            self._is_available = False
+            self._model = "NONE: Failed to connect to TekRSA"
 
     def get_constraints(self):
         self.min_frequency = self.rsa.CONFIG_GetMinCenterFreq()
@@ -84,16 +95,12 @@ def connect(self):
                 logger.exception("API Wrapper not loaded - disabling signal analyzer.")
                 self._is_available = False
                 raise import_error
-            try:
-                logger.debug("Initializing ")
-                self.rsa = rsa_api.RSA()
-                # Connect to device using API wrapper
-                self.rsa.DEVICE_SearchAndConnect()
-            except Exception as e:
-                self._is_available = False
-                self._model = "NONE: Failed to connect to TekRSA"
-                logger.exception("Unable to connect to TEKRSA")
-                raise e
+
+            logger.debug("Initializing ")
+            self.rsa = rsa_api.RSA()
+            # Connect to device using API wrapper
+            self.rsa.DEVICE_SearchAndConnect()
+
         # Finish setup with either real or Mock RSA device
         self._model = self.rsa.DEVICE_GetNomenclature()
         self._firmware_version = self.rsa.DEVICE_GetFWVersion()

From b841df0a9071735e0d7e534bfa7c39eda91603f2 Mon Sep 17 00:00:00 2001
From: Doug Boulware <dboulware@ntia.doc.gov>
Date: Wed, 6 Mar 2024 15:51:25 -0700
Subject: [PATCH 09/10] restore logging of import error in connect.

---
 src/scos_tekrsa/hardware/tekrsa_sigan.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/scos_tekrsa/hardware/tekrsa_sigan.py b/src/scos_tekrsa/hardware/tekrsa_sigan.py
index d4de71c..dcbfb18 100644
--- a/src/scos_tekrsa/hardware/tekrsa_sigan.py
+++ b/src/scos_tekrsa/hardware/tekrsa_sigan.py
@@ -60,12 +60,13 @@ def __init__(
             self._preamp_enable = None
             self._api_version = None
             self._firmware_version = None
+            self.max_iq_bandwidth = None
+            self.min_iq_bandwidth = None
+            self.overload = None
             self.connect()
 
         except BaseException as error:
-            logger.error(
-                f"Unable to initialize sigan: {error}."
-            )
+            logger.error(f"Unable to initialize sigan: {error}.")
             self._is_available = False
             self._model = "NONE: Failed to connect to TekRSA"
 
@@ -88,14 +89,12 @@ def connect(self):
             self.rsa = MockRSA(randomize_values=random)
         else:
             try:
-                # Load API wrapper
-                logger.debug("Loading RSA API wrapper")
                 import rsa_api
             except ImportError as import_error:
                 logger.exception("API Wrapper not loaded - disabling signal analyzer.")
                 self._is_available = False
+                self._model = "NONE: Failed to connect to TekRSA"
                 raise import_error
-
             logger.debug("Initializing ")
             self.rsa = rsa_api.RSA()
             # Connect to device using API wrapper

From 369f14dd1f15fee5b45b74c20dc601053657dd0a Mon Sep 17 00:00:00 2001
From: Doug Boulware <dboulware@ntia.doc.gov>
Date: Mon, 11 Mar 2024 08:02:31 -0600
Subject: [PATCH 10/10] increment version.

---
 src/scos_tekrsa/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/scos_tekrsa/__init__.py b/src/scos_tekrsa/__init__.py
index 2fe5fde..3a223dd 100644
--- a/src/scos_tekrsa/__init__.py
+++ b/src/scos_tekrsa/__init__.py
@@ -1 +1 @@
-__version__ = "5.0.1"
+__version__ = "5.0.2"