Михаил Капелько il y a 11 mois
Parent
révision
55e0afa2a5
2 fichiers modifiés avec 5 ajouts et 4 suppressions
  1. +4
    -3
      Utilities/platform/2/generation/pipeSource.py
  2. +1
    -1
      Utilities/platform/2/generation/sectionGeneratedPipes.py

+ 4
- 3
Utilities/platform/2/generation/pipeSource.py Voir le fichier

@@ -1,6 +1,6 @@
from generation.isNotKeyword import *

def pipeSource(name, entity):
def pipeSource(name, entity, structure):
props = entity.pipes[name]
if "vm" in props:
return "core.vm." + name
@@ -16,8 +16,9 @@ def pipeSource(name, entity):
src = "core." + src
# Обращение к константе шины.
elif src.startswith("K."):
key = src
src = "Bus.events.compactMap { Bus.convertKeyValue(" + key + ".rawValue, $0) }.map { (k: String, v: String) in v }.eraseToAnyPublisher()"
busKey = src
busValueType = structure.model.fields[name][0]
src = f"Bus.events.compactMap { Bus.convertKeyValue({busKey}.rawValue, \$0) }.map { (k: String, v: {busValueType}) in v }.eraseToAnyPublisher()"
# Значение по умолчанию.
elif src == default:
return default + "." + name


+ 1
- 1
Utilities/platform/2/generation/sectionGeneratedPipes.py Voir le fichier

@@ -26,7 +26,7 @@ def sectionGeneratedPipes(entity, sub, c):
shortSrc = shortenName(key)

# SRC.
src = pipeSource(key, entity)
src = pipeSource(key, entity, c.structure)

fmtPipe = pipeFormat(fmtExRecent, fmtRecent, fmtSet, fmtToggle, fmtToggleNil, key, entity)
for fmt in fmtPipe:


Chargement…
Annuler
Enregistrer