# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. import unittest from lsst.ts import salobj from lsst.ts.weatherstation import csc index_gen = salobj.index_generator() class CscTestCase(salobj.BaseCscTestCase, unittest.IsolatedAsyncioTestCase): def basic_make_csc(self, initial_state, config_dir, simulation_mode, **kwargs): return csc.CSC( index=next(index_gen), initial_state=initial_state, config_dir=config_dir, simulation_mode=simulation_mode, ) async def test_standard_state_transitions(self): async with self.make_csc(initial_state=salobj.State.STANDBY, config_dir=None,
import glob import os import pathlib import yaml import unittest import numpy as np from lsst.ts import salobj from lsst.ts import genericcamera STD_TIMEOUT = 2 # standard command timeout (sec) LONG_TIMEOUT = 20 # timeout for starting SAL components (sec) TEST_CONFIG_DIR = pathlib.Path(__file__).parents[1].joinpath("tests", "data", "config") port_generator = salobj.index_generator(imin=3200) class CscTestCase(salobj.BaseCscTestCase, unittest.IsolatedAsyncioTestCase): def flush_take_image_events(self): self.remote.evt_startTakeImage.flush() self.remote.evt_startShutterOpen.flush() self.remote.evt_endShutterOpen.flush() self.remote.evt_startIntegration.flush() self.remote.evt_endIntegration.flush() self.remote.evt_startShutterClose.flush() self.remote.evt_endShutterClose.flush() self.remote.evt_startReadout.flush() self.remote.evt_endReadout.flush() self.remote.evt_endTakeImage.flush()
import time import re import asyncio from collections import defaultdict import enum import numpy as np from .base_dimm import BaseDIMM, DIMMStatus from lsst.ts.salobj import index_generator __all__ = ["AstelcoDIMM", "AstelcoCommand"] index_gen = index_generator() _LOCAL_HOST = "127.0.0.1" _DEFAULT_PORT = 65432 def return_string(): return str _CmdType = defaultdict(return_string) _CmdType["1"] = int _CmdType["2"] = float