*-----------------------------------------------------------------------------
*  Python
*-----------------------------------------------------------------------------
*  Modul-Beschreibung
*
*
*-----------------------------------------------------------------------------

#define /s    KL_Speicher_Camera                       K +30
#define /s    KL_Speicher_Browser                      K +20

#define /s    KS_PY_TNC_Mail_Pfad                      S"PLC:\\PYTHON\\tncMail.py"
#define /s    KS_PY_Masken_Pfad                        S"PLC:\\PYTHON\\pyMasks.py"
#define /s    KS_PY_Softkey_Menu_Left_Pfad             S"PLC:\\PYTHON\\softkeyMenuLeft.py"

#define /s    ML_TNC_Mail_initialisiert                M
#define /s    ML_Python_Masken_initialisiert           M
#define /s    ML_Python_SoftkeyMenuLeft_initialisiert  M

#define /s    BL_Identifier_TNC_Mail                   B
#define /s    BL_Identifier_Python_Masken              B
#define /s    BL_Identifier_Python_SoftkeyMenuLeft     B
#define /s    BL_Submit_Ident_Monitor                  B

#define /s    DL_Fehler_TNC_Mail                       D
#define /s    DL_Fehler_Python_Masken                  D
#define /s    DL_Fehler_Python_SoftkeyMenuLeft         D

#define /s    DL_Exit_TNC_Mail                         D
#define /s    DL_Exit_Python_Masken                    D
#define /s    DL_Exit_Python_SoftkeyMenuLeft           D

#include Mac_Lib.inc

GLOBAL Python

;----------------------------
LBL Python
;----------------------------

#if CFG_TNC_Mail = "aktiv"
  LN     ML_TNC_Mail_initialisiert
  IFT
    RPLY   BL_Identifier_TNC_Mail
    ==     K+0
    IFT
      SUBM   TNC_Mail_Submit
      =      BL_Identifier_TNC_Mail
      ==     K+0
      S      PN_Fehler_Submit_Spawn_Queue_voll
    ENDI
  ENDI
#endif

#if CFG_Python_Masks = "aktiv"
  LN     ML_Python_Masken_initialisiert
  AN     PN_Fehler_Python_Masken
  IFT
    RPLY   BL_Identifier_Python_Masken
    ==     K+0
    IFT
      SUBM   Python_Masken_Submit
      =      BL_Identifier_Python_Masken
      ==     K+0
      S      PN_Fehler_Submit_Spawn_Queue_voll
    ENDI
  ENDI
#endif

#if CFG_Python_SoftkeyMenuLeft = "aktiv"
  LN     ML_Python_SoftkeyMenuLeft_initialisiert
  AN     PN_Fehler_SoftkeyMenuLeft_Masken
  IFT
    RPLY   BL_Identifier_Python_SoftkeyMenuLeft
    ==     K+0
    IFT
      SUBM   Python_SoftkeyMenuLeft_Submit
      =      BL_Identifier_Python_SoftkeyMenuLeft
      ==     K+0
      S      PN_Fehler_Submit_Spawn_Queue_voll
    ENDI
  ENDI
#endif


  L      MG_Impuls_1_min
  IFT
    RPLY   BL_Submit_Ident_Monitor
    ==     K+0
    IFT
      SUBM   Prozess_Monitor
      =      BL_Submit_Ident_Monitor
      ==     K+0
      S      PN_Fehler_Submit_Spawn_Queue_voll
    ENDI
  ENDI

EM

#if CFG_TNC_Mail = "aktiv"
;----------------------------
LBL TNC_Mail_Submit

  PS     S"TNC_MAIL"                   ;Prozess Name
  CM     9297                          ;Status einer Python-Instanz abfragen
  PLW
  ==     KG_Py_Python_Prozess_aktiv
  IFF
    PS     KG_Py_Mode_asynchron        ;Mode
    PS     KG_Py_Speicher_8_MB         ;Speichergröße
    PS     KS_PY_TNC_Mail_Pfad         ;Script Name Python
    PS     S"TNC_MAIL"                 ;Prozess Name
    L      ML_TNC_Mail_initialisiert
    IFT
      PS     S"None"                   ;Parameter
    ELSE
      PS     S"INIT"                   ;Parameter
    ENDI
    CM     9295                        ;Starten eines Python-Prozesses
    PL     DL_Fehler_TNC_Mail          ;Fehlercode
    PL     DL_Exit_TNC_Mail            ;Exit-Code Python

    M_Modul_Fehler_anzeigen
  ENDI

  LN     ML_TNC_Mail_initialisiert
  S      ML_TNC_Mail_initialisiert
EM
#endif

#if CFG_Python_Masks = "aktiv"
;----------------------------
LBL Python_Masken_Submit

  PS     S"PY_MASKS"                   ;Prozess Name
  CM     9297                          ;Status einer Python-Instanz abfragen
  PLW
  ==     KG_Py_Python_Prozess_aktiv
  IFF
    PS     KG_Py_Mode_asynchron        ;Mode
    L      KG_Py_Speicher_10_MB

#if CFG_Workspace_Camera = "aktiv"
    +      KL_Speicher_Camera
#endif

#if CFG_Web_Browser = "aktiv"
    +      KL_Speicher_Browser
#endif
    PSW                                ;Speichergröße
    PS     KS_PY_Masken_Pfad           ;Script Name Python
    PS     S"PY_MASKS"                 ;Prozess Name
    PS     S""                         ;Parameter
    CM     9295                        ;Starten eines Python-Prozesses
    PL     DL_Fehler_Python_Masken     ;Fehlercode
    PL     DL_Exit_Python_Masken       ;Exit-Code Python

    M_Modul_Fehler_anzeigen
  ENDI

  LN     ML_Python_Masken_initialisiert
  S      ML_Python_Masken_initialisiert
EM


#endif

#if CFG_Python_SoftkeyMenuLeft = "aktiv"
;----------------------------
LBL Python_SoftkeyMenuLeft_Submit

  PS     S"SK_MENU_LEFT"               ;Prozess Name
  CM     9297                          ;Status einer Python-Instanz abfragen
  PLW
  ==     KG_Py_Python_Prozess_aktiv
  IFF
    PS     KG_Py_Mode_asynchron        ;Mode
    PS     KG_Py_Speicher_8_MB         ;Speichergröße
    PS     KS_PY_Softkey_Menu_Left_Pfad ;Script Name Python
    PS     S"SK_MENU_LEFT"             ;Prozess Name
    PS     S"None"                     ;Parameter
    CM     9295                        ;Starten eines Python-Prozesses
    PL     DL_Fehler_Python_SoftkeyMenuLeft ;Fehlercode
    PL     DL_Exit_Python_SoftkeyMenuLeft ;Exit-Code Python

    M_Modul_Fehler_anzeigen
  ENDI

  LN     ML_Python_SoftkeyMenuLeft_initialisiert
  S      ML_Python_SoftkeyMenuLeft_initialisiert
EM
#endif


;----------------------------
LBL Prozess_Monitor
  L      ML_Python_Masken_initialisiert
  IFT
    PS     S"PY_MASKS"
    CM     9297                        ;Status einer Python-Instanz abfragen
    PLW
    ==     KG_Py_Python_Prozess_nicht_aktiv
    IFT
      L      MG_Eins_Merker
      R      ML_Python_Masken_initialisiert
      S      PN_Fehler_Python_Masken
    ENDI
  ENDI

  L      ML_Python_SoftkeyMenuLeft_initialisiert
  IFT
    PS     S"SK_MENU_LEFT"
    CM     9297                        ;Status einer Python-Instanz abfragen
    PLW
    ==     KG_Py_Python_Prozess_nicht_aktiv
    IFT
      L      MG_Eins_Merker
      R      ML_Python_SoftkeyMenuLeft_initialisiert
      S      PN_Fehler_SoftkeyMenuLeft_Masken
    ENDI
  ENDI
EM

