-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Rodriguez
committed
Nov 14, 2023
1 parent
03a98d3
commit 07897bf
Showing
11 changed files
with
97 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
platform/panduza_platform/devices/tenma/t722710/itf_tenma_722710_ammeter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from hamcrest import assert_that, has_key, instance_of | ||
import asyncio | ||
from meta_drivers.ammeter import MetaDriverAmmeter | ||
from connectors.serial_tty import ConnectorSerialTty | ||
|
||
COMMAND_TIME_LOCK=0.1 | ||
|
||
class InterfaceTenma722710Ammeter(MetaDriverAmmeter): | ||
|
||
# --- | ||
|
||
def __init__(self, name=None, settings={}) -> None: | ||
"""Constructor | ||
""" | ||
self.settings = settings | ||
super().__init__(name=name) | ||
|
||
# --- | ||
|
||
async def _PZA_DRV_loop_init(self): | ||
"""Driver initialization | ||
""" | ||
|
||
# Get the Serial Connector | ||
self.serial_connector = await ConnectorSerialTty.Get(**self.settings) | ||
|
||
# | ||
self.channel = 1 | ||
|
||
# Call meta class BPC ini | ||
await super()._PZA_DRV_loop_init() | ||
|
||
# --- | ||
|
||
async def _PZA_DRV_AMMETER_read_measure_value(self): | ||
current = await self.serial_connector.write_and_read_until(f"IOUT{self.channel}?\n", time_lock_s=COMMAND_TIME_LOCK) | ||
return float(current) | ||
|
||
# --- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
platform/panduza_platform/devices/tenma/t722710/itf_tenma_722710_voltmeter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from hamcrest import assert_that, has_key, instance_of | ||
from meta_drivers.voltmeter import MetaDriverVoltmeter | ||
from connectors.serial_tty import ConnectorSerialTty | ||
|
||
|
||
COMMAND_TIME_LOCK=0.1 | ||
|
||
class InterfaceTenma722710Voltmeter(MetaDriverVoltmeter): | ||
|
||
# --- | ||
|
||
def __init__(self, name=None, settings={}) -> None: | ||
"""Constructor | ||
""" | ||
self.settings = settings | ||
super().__init__(name=name) | ||
|
||
# --- | ||
|
||
async def _PZA_DRV_loop_init(self): | ||
"""Driver initialization | ||
""" | ||
|
||
# Get the Serial Connector | ||
self.serial_connector = await ConnectorSerialTty.Get(**self.settings) | ||
|
||
# | ||
self.channel = 1 | ||
|
||
# Call meta class BPC ini | ||
await super()._PZA_DRV_loop_init() | ||
|
||
# --- | ||
|
||
async def _PZA_DRV_VOLTMETER_read_measure_value(self): | ||
voltage = await self.serial_connector.write_and_read_until(f"VOUT{self.channel}?\n", time_lock_s=COMMAND_TIME_LOCK) | ||
return float(voltage) | ||
|
||
# --- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters