Ankündigung

Einklappen
Keine Ankündigung bisher.

Suche LBS19001072 - LBS19001075

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Suche LBS19001072 - LBS19001075

    Hallo,

    suche die LBS19001072 - LBS19001075. Diese sind leider nicht mehr im Download verfügbar. Kann die jemand einmal bereitstellen oder weiß einer näheres warum die nicht mehr im Download sind?

    Grüße

    #2
    19001072:
    PHP-Code:
    ###[DEF]###
    [name        = Json Decoder (20x) with Keys    ]

    [e#1        = Key1    ]
    [e#2        = Key2    ]
    [e#3        = Key3    ]
    [e#4        = Key4    ]
    [e#5        = Key5    ]
    [e#6        = Key6    ]
    [e#7        = Key7    ]
    [e#8        = Key8    ]
    [e#9        = Key9    ]
    [e#10        = Key10    ]
    [e#11        = Key11    ]
    [e#12        = Key12    ]
    [e#13        = Key13    ]
    [e#14        = Key14    ]
    [e#15        = Key15    ]
    [e#16        = Key16    ]
    [e#17        = Key17    ]
    [e#18        = Key18]
    [e#19        = Key19    ]
    [e#20        = Key20    ]
    [e#21        = JSON string    ]
    [e#22        = Log level #init=8 ]

    [a#1        = Value1    ]
    [a#2        = Value2    ]
    [a#3        = Value3    ]
    [a#4        = Value4    ]
    [a#5        = Value5    ]
    [a#6        = Value6    ]
    [a#7        = Value7    ]
    [a#8        = Value8    ]
    [a#9        = Value9    ]
    [a#10        = Value10    ]
    [a#11        = Value11    ]
    [a#12        = Value12    ]
    [a#13        = Value13    ]
    [a#14        = Value14    ]
    [a#15        = Value15    ]
    [a#16        = Value16    ]
    [a#17        = Value17    ]
    [a#18        = Value18]
    [a#19        = Value19    ]
    [a#20        = Value20    ]

    [v#100    = 0.1 ]                            # Version
    [v#101    = 19001072 ]                  # LBS No.
    [v#102    = JSON Decoder (20x)]          # LBS Name
    [v#103    = 0 ]                              # Log Level

    ###[/DEF]###


    ###[HELP]###
    This LBS takes a JSON string on E21 and outputs values on A1-A20 for corresponding matching keys on E1-E20.
    Outputs are only updated if the input JSON string on E21 is updated.
    If the output value for a given key would be an array, then this array is JSON-encoded again.
    The JSON-encoded output string is finally set on the corresponding output which can be connected to another instance of this LBS
    for further processing the next depth level of the original JSON string.

    E1-E20: JSON keys
    E21: JSON input string
    E22: Enable Logging (0-none|1-emerg|2-alert|3-crit|4-err|5-warning|6-notice|7-info|8-debug)

    V100: Version
    V101: LBS Number
    V102: Log file name
    V103: Log level

    ###[/HELP]###

    ###[LBS]###
    <?

    function LB_LBSID_logging($id, $msg, $var = NULL, $priority = 8)
    {
        $E = logic_getInputs($id);
        $logLevel = logic_getVar($id, 103);
        if (is_int($priority) && $priority <= $logLevel && $priority > 0) {
            $logLevelNames = array(
                'none',
                'emerg',
                'alert',
                'crit',
                'err',
                'warning',
                'notice',
                'info',
                'debug'
            );
            $version = logic_getVar($id, 100);
            $lbsNo = logic_getVar($id, 101);
            $logName = logic_getVar($id, 102) . '  ---  LBS' . $lbsNo;
            strpos($_SERVER['SCRIPT_NAME'], $lbsNo) ? $scriptname = 'EXE' . $lbsNo : $scriptname = 'LBS' . $lbsNo;
            writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version] id=".$id.":\t" . $msg);
            if (is_object($var))
                $var = get_object_vars($var); // transfer object into array
            if (is_array($var)) // print out array
            {
                writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT START ================");
                foreach ($var as $index => $line)
                    writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . $index . " => " . $line);
                writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT  END  ================");
            }
        }
    }

    function LB_LBSID($id) {
      if (!function_exists('json_last_error_msg')) {
          function json_last_error_msg() {
              static $ERRORS = array(
                  JSON_ERROR_NONE => 'No error',
                  JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
                  JSON_ERROR_STATE_MISMATCH => 'State mismatch (invalid or malformed JSON)',
                  JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded',
                  JSON_ERROR_SYNTAX => 'Syntax error',
                  JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded'
              );

              $error = json_last_error();
              return isset($ERRORS[$error]) ? $ERRORS[$error] : 'Unknown error';
          }
      }
        
        $E=logic_getInputs($id);
            
        logic_setVar($id, 103, $E[22]['value']); // set loglevel to #VAR 103
        LB_LBSID_logging($id, 'JSON Decoder LBS started');

        if ($E[21]['refresh']==1) {    

                // Convert JSON string to associative array
                $input_json = (string)$E[21]['value'];
                $input_array = json_decode($input_json, true);
                if (json_last_error() === JSON_ERROR_NONE) {

                        // Only do something if the JSON string was not empty
                        if (is_array($input_array)) {
                                LB_LBSID_logging($id, 'Result array: ', $input_array);

                                for ($i = 1; $i <= 20; $i++)  {
                                    $key = $E[$i]['value'];
                                    if (array_key_exists($key, $input_array)) {
                                            $value = $input_array[$key];
                                            // Is this an array? Yes, then we reached the next depth level and we just output an new JSON string.
                                            // In this way, multiple LBS instances can be cascaded to decode each depth level.
                                            if(is_array($value)) {
                                                $json_value = json_encode($value);
                                                logic_setOutput($id, $i, $json_value);
                                            }
                                            else {
                                                logic_setOutput($id, $i, $value);
                                            }
                                    }
                                    else {
                                        $value = '';
                                        logic_setOutput($id, $i, $value);
                                    }
                                }
                        }
                    
                }
                else {
                        LB_LBSID_logging($id, 'JSON decode failed: '.json_last_error_msg());
                }

        }

        LB_LBSID_logging($id, 'JSON Decoder LBS stopped');
    }
    ?>
    ###[/LBS]###


    ###[EXEC]###
    <?
    ?>
    ###[/EXEC]###
    19001073:
    PHP-Code:
    ###[DEF]###
    [name        = Json Decoder (10x) with Keys    ]

    [e#1        = Key1    ]
    [e#2        = Key2    ]
    [e#3        = Key3    ]
    [e#4        = Key4    ]
    [e#5        = Key5    ]
    [e#6        = Key6    ]
    [e#7        = Key7    ]
    [e#8        = Key8    ]
    [e#9        = Key9    ]
    [e#10        = Key10    ]
    [e#11        = JSON string    ]
    [e#12        = Log level #init=8 ]

    [a#1        = Value1    ]
    [a#2        = Value2    ]
    [a#3        = Value3    ]
    [a#4        = Value4    ]
    [a#5        = Value5    ]
    [a#6        = Value6    ]
    [a#7        = Value7    ]
    [a#8        = Value8    ]
    [a#9        = Value9    ]
    [a#10        = Value10    ]

    [v#100    = 0.1 ]                            # Version
    [v#101    = 19001073 ]                  # LBS No.
    [v#102    = JSON Decoder (10x)]          # LBS Name
    [v#103    = 0 ]                              # Log Level

    ###[/DEF]###


    ###[HELP]###
    This LBS takes a JSON string on E11 and outputs values on A1-A10 for corresponding matching keys on E1-E10.
    Outputs are only updated if the input JSON string on E11 is updated.
    If the output value for a given key would be an array, then this array is JSON-encoded again.
    The JSON-encoded output string is finally set on the corresponding output which can be connected to another instance of this LBS
    for further processing the next depth level of the original JSON string.

    E1-E10: JSON keys
    E11: JSON input string
    E12: Enable Logging (0-none|1-emerg|2-alert|3-crit|4-err|5-warning|6-notice|7-info|8-debug)

    V100: Version
    V101: LBS Number
    V102: Log file name
    V103: Log level

    ###[/HELP]###

    ###[LBS]###
    <?

    function LB_LBSID_logging($id, $msg, $var = NULL, $priority = 8)
    {
        $E = logic_getInputs($id);
        $logLevel = logic_getVar($id, 103);
        if (is_int($priority) && $priority <= $logLevel && $priority > 0) {
            $logLevelNames = array(
                'none',
                'emerg',
                'alert',
                'crit',
                'err',
                'warning',
                'notice',
                'info',
                'debug'
            );
            $version = logic_getVar($id, 100);
            $lbsNo = logic_getVar($id, 101);
            $logName = logic_getVar($id, 102) . '  ---  LBS' . $lbsNo;
            strpos($_SERVER['SCRIPT_NAME'], $lbsNo) ? $scriptname = 'EXE' . $lbsNo : $scriptname = 'LBS' . $lbsNo;
            writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version] id=".$id.":\t" . $msg);
            if (is_object($var))
                $var = get_object_vars($var); // transfer object into array
            if (is_array($var)) // print out array
            {
                writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT START ================");
                foreach ($var as $index => $line)
                    writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . $index . " => " . $line);
                writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT  END  ================");
            }
        }
    }

    function LB_LBSID($id) {
      if (!function_exists('json_last_error_msg')) {
          function json_last_error_msg() {
              static $ERRORS = array(
                  JSON_ERROR_NONE => 'No error',
                  JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
                  JSON_ERROR_STATE_MISMATCH => 'State mismatch (invalid or malformed JSON)',
                  JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded',
                  JSON_ERROR_SYNTAX => 'Syntax error',
                  JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded'
              );

              $error = json_last_error();
              return isset($ERRORS[$error]) ? $ERRORS[$error] : 'Unknown error';
          }
      }
        
        $E=logic_getInputs($id);
            
        logic_setVar($id, 103, $E[12]['value']); // set loglevel to #VAR 103
        LB_LBSID_logging($id, 'JSON Decoder LBS started');

        if ($E[11]['refresh']==1) {    

                // Convert JSON string to associative array
                $input_json = (string)$E[11]['value'];
                $input_array = json_decode($input_json, true);
                if (json_last_error() === JSON_ERROR_NONE) {

                        // Only do something if the JSON string was not empty
                        if (is_array($input_array)) {
                                LB_LBSID_logging($id, 'Result array: ', $input_array);

                                for ($i = 1; $i <= 10; $i++)  {
                                    $key = $E[$i]['value'];
                                    if (array_key_exists($key, $input_array)) {
                                            $value = $input_array[$key];
                                            // Is this an array? Yes, then we reached the next depth level and we just output an new JSON string.
                                            // In this way, multiple LBS instances can be cascaded to decode each depth level.
                                            if(is_array($value)) {
                                                $json_value = json_encode($value);
                                                logic_setOutput($id, $i, $json_value);
                                            }
                                            else {
                                                logic_setOutput($id, $i, $value);
                                            }
                                    }
                                    else {
                                        $value = '';
                                        logic_setOutput($id, $i, $value);
                                    }
                                }
                        }
                    
                }
                else {
                        LB_LBSID_logging($id, 'JSON decode failed: '.json_last_error_msg());
                }

        }

        LB_LBSID_logging($id, 'JSON Decoder LBS stopped');
    }
    ?>
    ###[/LBS]###


    ###[EXEC]###
    <?
    ?>
    ###[/EXEC]###
    190074:
    PHP-Code:
    ###[DEF]###
    [name        = Json Decoder (5x) with Keys    ]

    [e#1        = Key1    ]
    [e#2        = Key2    ]
    [e#3        = Key3    ]
    [e#4        = Key4    ]
    [e#5        = Key5    ]
    [e#6        = JSON string    ]
    [e#7        = Log level #init=8 ]

    [a#1        = Value1    ]
    [a#2        = Value2    ]
    [a#3        = Value3    ]
    [a#4        = Value4    ]
    [a#5        = Value5    ]

    [v#100    = 0.1 ]                            # Version
    [v#101    = 19001074 ]                  # LBS No.
    [v#102    = JSON Decoder (5x)]          # LBS Name
    [v#103    = 0 ]                              # Log Level

    ###[/DEF]###


    ###[HELP]###
    This LBS takes a JSON string on E6 and outputs values on A1-A5 for corresponding matching keys on E1-E5.
    Outputs are only updated if the input JSON string on E6 is updated.
    If the output value for a given key would be an array, then this array is JSON-encoded again.
    The JSON-encoded output string is finally set on the corresponding output which can be connected to another instance of this LBS
    for further processing the next depth level of the original JSON string.

    E1-E5: JSON keys
    E6: JSON input string
    E7: Enable Logging (0-none|1-emerg|2-alert|3-crit|4-err|5-warning|6-notice|7-info|8-debug)

    V100: Version
    V101: LBS Number
    V102: Log file name
    V103: Log level

    ###[/HELP]###

    ###[LBS]###
    <?

    function LB_LBSID_logging($id, $msg, $var = NULL, $priority = 8)
    {
        $E = logic_getInputs($id);
        $logLevel = logic_getVar($id, 103);
        if (is_int($priority) && $priority <= $logLevel && $priority > 0) {
            $logLevelNames = array(
                'none',
                'emerg',
                'alert',
                'crit',
                'err',
                'warning',
                'notice',
                'info',
                'debug'
            );
            $version = logic_getVar($id, 100);
            $lbsNo = logic_getVar($id, 101);
            $logName = logic_getVar($id, 102) . '  ---  LBS' . $lbsNo;
            strpos($_SERVER['SCRIPT_NAME'], $lbsNo) ? $scriptname = 'EXE' . $lbsNo : $scriptname = 'LBS' . $lbsNo;
            writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version] id=".$id.":\t" . $msg);
            if (is_object($var))
                $var = get_object_vars($var); // transfer object into array
            if (is_array($var)) // print out array
            {
                writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT START ================");
                foreach ($var as $index => $line)
                    writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . $index . " => " . $line);
                writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT  END  ================");
            }
        }
    }

    function LB_LBSID($id) {
      if (!function_exists('json_last_error_msg')) {
          function json_last_error_msg() {
              static $ERRORS = array(
                  JSON_ERROR_NONE => 'No error',
                  JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
                  JSON_ERROR_STATE_MISMATCH => 'State mismatch (invalid or malformed JSON)',
                  JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded',
                  JSON_ERROR_SYNTAX => 'Syntax error',
                  JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded'
              );

              $error = json_last_error();
              return isset($ERRORS[$error]) ? $ERRORS[$error] : 'Unknown error';
          }
      }
        
        $E=logic_getInputs($id);
            
        logic_setVar($id, 103, $E[7]['value']); // set loglevel to #VAR 103
        LB_LBSID_logging($id, 'JSON Decoder LBS started');

        if ($E[6]['refresh']==1) {    

                // Convert JSON string to associative array
                $input_json = (string)$E[6]['value'];
                $input_array = json_decode($input_json, true);
                if (json_last_error() === JSON_ERROR_NONE) {

                        // Only do something if the JSON string was not empty
                        if (is_array($input_array)) {
                                LB_LBSID_logging($id, 'Result array: ', $input_array);

                                for ($i = 1; $i <= 5; $i++)  {
                                    $key = $E[$i]['value'];
                                    if (array_key_exists($key, $input_array)) {
                                            $value = $input_array[$key];
                                            // Is this an array? Yes, then we reached the next depth level and we just output an new JSON string.
                                            // In this way, multiple LBS instances can be cascaded to decode each depth level.
                                            if(is_array($value)) {
                                                $json_value = json_encode($value);
                                                logic_setOutput($id, $i, $json_value);
                                            }
                                            else {
                                                logic_setOutput($id, $i, $value);
                                            }
                                    }
                                    else {
                                        $value = '';
                                        logic_setOutput($id, $i, $value);
                                    }
                                }
                        }
                    
                }
                else {
                        LB_LBSID_logging($id, 'JSON decode failed: '.json_last_error_msg());
                }

        }

        LB_LBSID_logging($id, 'JSON Decoder LBS stopped');
    }
    ?>
    ###[/LBS]###


    ###[EXEC]###
    <?
    ?>
    ###[/EXEC]###
    19001075:
    PHP-Code:
    ###[DEF]###
    [name        = Json Decoder (1x) with Keys    ]

    [e#1        = Key1    ]
    [e#2        = JSON string    ]
    [e#3        = Log level #init=8 ]

    [a#1        = Value1    ]

    [v#100    = 0.1 ]                            # Version
    [v#101    = 19001075 ]                  # LBS No.
    [v#102    = JSON Decoder (1x)]          # LBS Name
    [v#103    = 0 ]                              # Log Level

    ###[/DEF]###


    ###[HELP]###
    This LBS takes a JSON string on E2 and outputs a value on A1 for the corresponding matching key on E1.
    Outputs are only updated if the input JSON string on E2 is updated.
    If the output value for a given key would be an array, then this array is JSON-encoded again.
    The JSON-encoded output string is finally set on the corresponding output which can be connected to another instance of this LBS
    for further processing the next depth level of the original JSON string.

    E1: JSON keys
    E2: JSON input string
    E3: Enable Logging (0-none|1-emerg|2-alert|3-crit|4-err|5-warning|6-notice|7-info|8-debug)

    V100: Version
    V101: LBS Number
    V102: Log file name
    V103: Log level

    ###[/HELP]###

    ###[LBS]###
    <?

    function LB_LBSID_logging($id, $msg, $var = NULL, $priority = 8)
    {
        $E = logic_getInputs($id);
        $logLevel = logic_getVar($id, 103);
        if (is_int($priority) && $priority <= $logLevel && $priority > 0) {
            $logLevelNames = array(
                'none',
                'emerg',
                'alert',
                'crit',
                'err',
                'warning',
                'notice',
                'info',
                'debug'
            );
            $version = logic_getVar($id, 100);
            $lbsNo = logic_getVar($id, 101);
            $logName = logic_getVar($id, 102) . '  ---  LBS' . $lbsNo;
            strpos($_SERVER['SCRIPT_NAME'], $lbsNo) ? $scriptname = 'EXE' . $lbsNo : $scriptname = 'LBS' . $lbsNo;
            writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version] id=".$id.":\t" . $msg);
            if (is_object($var))
                $var = get_object_vars($var); // transfer object into array
            if (is_array($var)) // print out array
            {
                writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT START ================");
                foreach ($var as $index => $line)
                    writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t" . $index . " => " . $line);
                writeToCustomLog($logName, str_pad($logLevelNames[$logLevel], 7), $scriptname . " [v$version]:\t================ ARRAY/OBJECT  END  ================");
            }
        }
    }

    function LB_LBSID($id) {
      if (!function_exists('json_last_error_msg')) {
          function json_last_error_msg() {
              static $ERRORS = array(
                  JSON_ERROR_NONE => 'No error',
                  JSON_ERROR_DEPTH => 'Maximum stack depth exceeded',
                  JSON_ERROR_STATE_MISMATCH => 'State mismatch (invalid or malformed JSON)',
                  JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded',
                  JSON_ERROR_SYNTAX => 'Syntax error',
                  JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded'
              );

              $error = json_last_error();
              return isset($ERRORS[$error]) ? $ERRORS[$error] : 'Unknown error';
          }
      }
        
        $E=logic_getInputs($id);
            
        logic_setVar($id, 103, $E[3]['value']); // set loglevel to #VAR 103
        LB_LBSID_logging($id, 'JSON Decoder LBS started');

        if ($E[2]['refresh']==1) {    

                // Convert JSON string to associative array
                $input_json = (string)$E[2]['value'];
                $input_array = json_decode($input_json, true);
                if (json_last_error() === JSON_ERROR_NONE) {

                        // Only do something if the JSON string was not empty
                        if (is_array($input_array)) {
                                LB_LBSID_logging($id, 'Result array: ', $input_array);

                                for ($i = 1; $i <= 1; $i++)  {
                                    $key = $E[$i]['value'];
                                    if (array_key_exists($key, $input_array)) {
                                            $value = $input_array[$key];
                                            // Is this an array? Yes, then we reached the next depth level and we just output an new JSON string.
                                            // In this way, multiple LBS instances can be cascaded to decode each depth level.
                                            if(is_array($value)) {
                                                $json_value = json_encode($value);
                                                logic_setOutput($id, $i, $json_value);
                                            }
                                            else {
                                                logic_setOutput($id, $i, $value);
                                            }
                                    }
                                    else {
                                        $value = '';
                                        logic_setOutput($id, $i, $value);
                                    }
                                }
                        }
                    
                }
                else {
                        LB_LBSID_logging($id, 'JSON decode failed: '.json_last_error_msg());
                }

        }

        LB_LBSID_logging($id, 'JSON Decoder LBS stopped');
    }
    ?>
    ###[/LBS]###


    ###[EXEC]###
    <?
    ?>
    ###[/EXEC]###

    Kommentar


      #3
      Super danke dir ;-)

      Kommentar


        #4
        Vielleicht will einer die LBS wieder einstellen? Ich würde das auch übernehmen. Bleibt aber die Frage, warum der Autor sie rausgenommen hat und ob wir sein geistiges Eigentum als unseres Ausgeben können. Weiß noch jemand wer die LBS geschrieben hat? Ich meine mich zu erinnern, dass es Nanosonde war, aber vielleicht liege ich da falsch.
        Gruß
        Stefan

        Kommentar


          #5
          Vielleicht hilft ja der JSON Extractor LBS.

          Kommentar

          Lädt...
          X