From: Benjamin Braatz Date: Wed, 3 Feb 2021 14:42:04 +0000 (+0100) Subject: Hotfixes during testing X-Git-Url: http://git.graph-it.com/?a=commitdiff_plain;h=0a1f7c292a7b28189340884a3e109674d59b59a1;p=graphit%2Fschaltschrank.git Hotfixes during testing --- diff --git a/conf.json b/conf.json index a65a0fd..ed75b0d 100644 --- a/conf.json +++ b/conf.json @@ -20,10 +20,10 @@ "address": 32, "interrupt pin": 4, "pins": - [ [ "E1-1", "T1-18", "Schwungrad" ], [ "E1-2", "T1-19", "Takt" ], - [ "E1-3", "T1-20", "Öldruck" ], [ "E1-4", "T1-21", "Bruchplatte" ], - [ "E1-5", "T1-22", "Bruchplatte Einzug" ], [ "E1-6", "T1-23" ], - [ "E1-7", "T1-24" ], [ "E1-8", "T1-25" ] ] }, + [ [ "E1-1", "T1-18" ], [ "E1-2", "T1-19" ], + [ "E1-3", "T1-20" ], [ "E1-4", "T1-21" ], + [ "E1-5", "T1-22" ], [ "E1-6", "T1-23" ], + [ "E1-7", "T1-24" ], [ "E1-8", "T1-25", "Schwungrad" ] ] }, { "name": "E2", "type": "input", "address": 33, @@ -31,15 +31,15 @@ "pins": [ [ "E2-1", "T1-26" ], [ "E2-2", "T1-27" ], [ "E2-3", "T1-28" ], [ "E2-4", "T1-29" ], - [ "E2-5", "T1-30" ], [ "E2-6", "T1-31" ], - [ "E2-7", "T1-32" ], [ "E2-8", "T1-33" ] ] }, + [ "E2-5", "T1-30", "Takt" ], [ "E2-6", "T1-31", "Öldruck" ], + [ "E2-7", "T1-32", "Bruchplatte" ], [ "E2-8", "T1-33", "Bruchplatte Einzug" ] ] }, { "name": "E3", "type": "input", "address": 34, "interrupt pin": 27, "pins": [ [ "E3-1", "T2-1" ], [ "E3-2", "T2-2", "Notaus" ], - [ "E3-3", "T2-3", "Stop" ], [ "E3-4", "T2-4", "Dauerlauf" ], + [ "E3-3", "T2-3", "Stop" ], [ "E3-4", "T2-4", "Tippen" ], [ "E3-5", "T2-5", "Schmierung" ], [ "E3-6", "T2-6", "Vorlauf" ], [ "E3-7", "T2-7", "Rücklauf" ], [ "E3-8", "T2-8" ] ] }, { "name": "E4", diff --git a/gmodbus/hitachi.py b/gmodbus/hitachi.py index ef9374e..5b02f89 100644 --- a/gmodbus/hitachi.py +++ b/gmodbus/hitachi.py @@ -15,11 +15,11 @@ class SJP1Fu(): # AA115 = 01, 14-43 await self.__protocol.write_register(12015, 1) # AC120 = 0.5 s, 14-44 - await self.__protocol.write_register(12220, 0.5) + await self.__protocol.write_register(12220, 1) # bA122 = 02, 14-53 await self.__protocol.write_register(13022, 2) - # bA123 = 35 A, 14-53 - await self.__protocol.write_register(13023, 35) + # bA123 = 50 A, 14-53 + await self.__protocol.write_register(13023, 50) # bA124 = 5 s, 14-53 await self.__protocol.write_register(13024, 5) # Cb40 = 01, 14-58 @@ -28,7 +28,7 @@ class SJP1Fu(): await self.__protocol.write_register(15102, 11) # Hb103 = 4, 14-64 await self.__protocol.write_register(15103, 4) - # bA124 = 22.5A Motorschutz ??? + # bC110 = 22.5A Motorschutz ??? async def set_frequency(self, frequency: int) -> None: # Page 532 / 14-41 @@ -167,6 +167,7 @@ SJP1FU_REGISTERS = { 'conf': { 'min': 0, 'max': 23, + 'unit': '', 'scale': 1, }, }, diff --git a/schaltschrank/config.py b/schaltschrank/config.py index b042fe9..388a7c2 100644 --- a/schaltschrank/config.py +++ b/schaltschrank/config.py @@ -32,6 +32,7 @@ async def process_configuration(conf, queues): for pin_name in pin_names: pins[pin_name] = pin pin.on('change', callback_factory(pin_name)) + pins['T1-1'].value = True fu = None if 'modbus' in conf: modbus_conf = conf['modbus'] diff --git a/schaltschrank/websocket.py b/schaltschrank/websocket.py index a118dca..f2a3632 100644 --- a/schaltschrank/websocket.py +++ b/schaltschrank/websocket.py @@ -24,7 +24,8 @@ async def process_command(command, pins, fu, queue): 'settable': pin.settable, 'value': pin.value, 'changed': False}) elif command['command'] == 'setparameters': - await fu.set_parameters() + pass + #await fu.set_parameters() elif command['command'] == 'setfrequency': await fu.set_frequency(command['value']) elif command['command'] == 'getfrequency': @@ -50,7 +51,7 @@ async def event_handler(websocket, path, pins, fu, queue): event = await queue.get() message = json.dumps(event) await websocket.send(message) - if event['event'] == 'pinstate' and event['changed']: + if event['event'] == 'pinstate': okay = ( pins['Zentralschmierung'].value and pins['Ölpumpe'].value and pins['Schwungrad'].value and @@ -61,36 +62,36 @@ async def event_handler(websocket, path, pins, fu, queue): active = await fu.inverter_active if active: await fu.stop_inverter() - if event['value']: + if event['changed'] and event['value']: if event['pin'] == 'Notaus': await fu.stop_inverter() pins['Zentralschmierung'].value = False pins['Ölpumpe'].value = False elif event['pin'] == 'Stop': await fu.stop_inverter() - pins['Zentralschmierung'].value = False - pins['Ölpumpe'].value = False elif event['pin'] == 'Schmierung': pins['Zentralschmierung'].value = True pins['Ölpumpe'].value = True elif event['pin'] == 'Vorlauf': - if not pins['Dauerlauf'].value: - await fu.set_parameters() - await fu.set_frequency(5) - await fu.start_inverter() - await asyncio.sleep(1) - await fu.stop_inverter() - else: - await fu.set_parameters() - await fu.set_frequency(20) - await fu.start_inverter() + if pins['Öllampe'].value: + if pins['Tippen'].value: + #await fu.set_parameters() + await fu.set_frequency(25) + await fu.start_inverter() + await asyncio.sleep(1) + await fu.stop_inverter() + else: + #await fu.set_parameters() + await fu.set_frequency(50) + await fu.start_inverter() elif event['pin'] == 'Rücklauf': - if not pins['Dauerlauf'].value: - await fu.set_parameters() - await fu.set_frequency(-5) - await fu.start_inverter() - await asyncio.sleep(1) - await fu.stop_inverter() + if pins['Öllampe'].value: + if pins['Tippen'].value: + #await fu.set_parameters() + await fu.set_frequency(-25) + await fu.start_inverter() + await asyncio.sleep(1) + await fu.stop_inverter() queue.task_done() diff --git a/web/index.html b/web/index.html index 1b8e1cf..9b4b5bb 100644 --- a/web/index.html +++ b/web/index.html @@ -36,7 +36,7 @@ ws.addEventListener('open', function (event) { ws.send(JSON.stringify({command: 'getpin', pin: 'Notaus'})) ws.send(JSON.stringify({command: 'getpin', pin: 'Stop'})) - ws.send(JSON.stringify({command: 'getpin', pin: 'Dauerlauf'})) + ws.send(JSON.stringify({command: 'getpin', pin: 'Tippen'})) ws.send(JSON.stringify({command: 'getpin', pin: 'Schmierung'})) ws.send(JSON.stringify({command: 'getpin', pin: 'Vorlauf'})) ws.send(JSON.stringify({command: 'getpin', pin: 'Rücklauf'})) @@ -49,17 +49,13 @@ ws.send(JSON.stringify({command: 'getpin', pin: 'Bruchplatte'})) ws.send(JSON.stringify({command: 'getpin', pin: 'Bruchplatte Einzug'})) }) - var parameter_button = document.getElementById('setparameters') - parameter_button.addEventListener('click', function (event) { - ws.send(JSON.stringify({command: 'setparameters'})) - })

ControlPi

Kontrollfeld

Notaus
Stop
-
Dauerlauf
+
Tippen
Schmierung
Vorlauf
Rücklauf
@@ -78,9 +74,5 @@
Bruchplatte
Bruchplatte Einzug
-
-

FU

- -