Skip to content

Commit

Permalink
organize directoies
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodriguez committed Nov 6, 2023
1 parent e7b276a commit 127476c
Show file tree
Hide file tree
Showing 46 changed files with 55 additions and 149 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion platform/panduza_platform/devices/hanmatek/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .hm310t import DeviceHanmatekHm310t
from .hm310t.dev_hm310t import DeviceHanmatekHm310t

PZA_DEVICES_LIST= [
DeviceHanmatekHm310t
Expand Down
52 changes: 0 additions & 52 deletions platform/panduza_platform/devices/hanmatek/hm310t.py

This file was deleted.

34 changes: 34 additions & 0 deletions platform/panduza_platform/devices/hanmatek/hm310t/dev_hm310t.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from core.platform_device import PlatformDevice

USBID_VENDOR="1a86"
USBID_MODEL="7523"
TTY_BASE="/dev/ttyUSB"

from .itf_hanmatek_hm310t_bpc import InterfaceHanmatekHm310tBpc
from .itf_hanmatek_hm310t_ammeter import InterfaceHanmatekHM310tAmmeter

class DeviceHanmatekHm310t(PlatformDevice):
"""Power Supply From Hanmatek
"""

def _PZA_DEV_config(self):
"""
"""
return {
"family": "PSU",
"model": "Hm310t",
"manufacturer": "Hanmatek"
}

# ---

async def _PZA_DEV_mount_interfaces(self):
"""
"""
self.mount_interface(
InterfaceHanmatekHm310tBpc(name=f":channel_0:_ctrl")
)
self.mount_interface(
InterfaceHanmatekHM310tAmmeter(name=f":channel_0:_am")
)

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from meta_drivers.ammeter import MetaDriverAmmeter
from connectors.modbus_client_serial import ConnectorModbusClientSerial

class DriverHM310tAmmeter(MetaDriverAmmeter):
class InterfaceHanmatekHM310tAmmeter(MetaDriverAmmeter):
"""
"""

Expand All @@ -18,18 +18,13 @@ async def _PZA_DRV_loop_init(self):
"""Driver initialization
"""

# Load settings
assert_that(tree, has_key("settings"))
settings = tree["settings"]
assert_that(settings, instance_of(dict))

# Checks
assert_that(settings, has_key("usb_vendor"))
assert_that(settings, has_key("usb_model"))
assert_that(settings, has_key("serial_baudrate"))
assert_that(self.settings, has_key("usb_vendor"))
assert_that(self.settings, has_key("usb_model"))
assert_that(self.settings, has_key("serial_baudrate"))

# Get the gate
self.modbus = await ConnectorModbusClientSerial.Get(**settings)
self.modbus = await ConnectorModbusClientSerial.Get(**self.settings)

#
self.modbus_unit = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def int_to_state_string(v_int):
position = val_list.index(v_int)
return key_list[position]

class DrvHanmatekHm310tBpc(MetaDriverBpc):
class InterfaceHanmatekHm310tBpc(MetaDriverBpc):
""" Driver to manage the HM310T power supply
"""

Expand All @@ -35,18 +35,13 @@ async def _PZA_DRV_loop_init(self):
"""Driver initialization
"""

# Load settings
assert_that(tree, has_key("settings"))
settings = tree["settings"]
assert_that(settings, instance_of(dict))

# Checks
assert_that(settings, has_key("usb_vendor"))
assert_that(settings, has_key("usb_model"))
assert_that(settings, has_key("serial_baudrate"))
assert_that(self.settings, has_key("usb_vendor"))
assert_that(self.settings, has_key("usb_model"))
assert_that(self.settings, has_key("serial_baudrate"))

# Get the gate
self.modbus = await ConnectorModbusClientSerial.Get(**settings)
self.modbus = await ConnectorModbusClientSerial.Get(**self.settings)

#
self.modbus_unit = 1
Expand Down
2 changes: 1 addition & 1 deletion platform/panduza_platform/devices/korad/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .ka3005 import DeviceKoradKA3005P
from .ka3005.dev_ka3005 import DeviceKoradKA3005P

PZA_DEVICES_LIST= [
DeviceKoradKA3005P
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

from core.platform_device import PlatformDevice

from .itf_korad_ka3005p_bpc import InterfaceKoradKa3005pBPC
from .itf_korad_ka3005p_ammeter import InterfaceKoradKa3005pAmmeter
from .itf_korad_ka3005p_voltmeter import InterfaceKoradKa3005pVoltmeter


class DeviceKoradKA3005P(PlatformDevice):
"""Power Supply From Korad
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

COMMAND_TIME_LOCK=0.1

class DrvKoradKa3005pAmmeter(MetaDriverAmmeter):
class InterfaceKoradKa3005pAmmeter(MetaDriverAmmeter):
# =============================================================================
# FROM MetaDriverAmmeter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

COMMAND_TIME_LOCK=0.1

class DrvKoradKa3005pBPC(MetaDriverBpc):
class InterfaceKoradKa3005pBPC(MetaDriverBpc):
# =============================================================================
# FROM MetaDriverBpc

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

COMMAND_TIME_LOCK=0.1

class DrvKoradKa3005pVoltmeter(MetaDriverVoltmeter):
class InterfaceKoradKa3005pVoltmeter(MetaDriverVoltmeter):
# =============================================================================
# FROM MetaDriverVoltmeter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from .itf_platform import InterfacePanduzaPlatform

import asyncio

class DevicePanduzaServer(PlatformDevice):
"""Represent the machine on which the platform is running
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ async def _PZA_DRV_loop_init(self):
"""From PlatformDriver
"""

self.log.info("!!! inin interface ???????????????????????????")


# Set command handlers
self.__cmd_handlers = {
Expand Down
2 changes: 1 addition & 1 deletion platform/panduza_platform/devices/tenma/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .t722710 import DeviceTenma722710
from .t722710.t722710 import DeviceTenma722710

PZA_DEVICES_LIST= [
DeviceTenma722710
Expand Down
3 changes: 0 additions & 3 deletions platform/panduza_platform/drivers/README.md

This file was deleted.

Empty file.
9 changes: 0 additions & 9 deletions platform/panduza_platform/drivers/ammeter/__init__.py

This file was deleted.

19 changes: 0 additions & 19 deletions platform/panduza_platform/drivers/ammeter/__init__.py.orig

This file was deleted.

9 changes: 0 additions & 9 deletions platform/panduza_platform/drivers/bpc/__init__.py

This file was deleted.

15 changes: 0 additions & 15 deletions platform/panduza_platform/drivers/bpc/__init__.py.orig

This file was deleted.

6 changes: 0 additions & 6 deletions platform/panduza_platform/drivers/platform/__init__.py

This file was deleted.

5 changes: 0 additions & 5 deletions platform/panduza_platform/drivers/voltmeter/__init__.py

This file was deleted.

0 comments on commit 127476c

Please sign in to comment.