C_runtime/service/erpc_PLCObject_common.hpp
author Edouard Tisserant <edouard@beremiz.fr>
Thu, 05 Dec 2024 13:56:59 +0100
changeset 4060 d2f5eb3c7d6e
parent 4058 5472b88bbc9d
permissions -rw-r--r--
py_ext: fix CSV Writer

fix POU logic :
- SAVE is a BOOL
- invocation of py_eval on rising edge of SAVE
- remove save python argument

fix python:
- use no encoding for file open (python2)
- re-use detected dialect if any
- use no "rt+" and truncate since no need to re-sniff dialect for output file
- return "OK" instead of "#SUCCESS", preventing POU logic to ACK result
- support creating new line if writing just after last line
- support appending data on short rows

fix example:
- use a HMI:Button to trigger CSV write instead of HMI:Input +1
- reload CSVs on on each new CSV opened in file browser
- add display of CSV write output
/*
 * Generated by erpcgen 1.13.0 on Fri Nov 22 15:03:08 2024.
 *
 * AUTOGENERATED - DO NOT EDIT
 */


#if !defined(_erpc_PLCObject_common_hpp_)
#define _erpc_PLCObject_common_hpp_


#include <cstddef>
#include <cstdint>

#include "erpc_version.h"

#if 11300 != ERPC_VERSION_NUMBER
#error "The generated shim code version is different to the rest of eRPC code."
#endif


#if !defined(ERPC_TYPE_DEFINITIONS_ERPC_PLCOBJECT)
#define ERPC_TYPE_DEFINITIONS_ERPC_PLCOBJECT

// Enumerators data types declarations
typedef enum PLCstatus_enum
{
    Empty = 0,
    Stopped = 1,
    Started = 2,
    Broken = 3,
    Disconnected = 4
} PLCstatus_enum;

// Aliases data types declarations
typedef struct binary_t binary_t;
typedef struct PSKID PSKID;
typedef struct PLCstatus PLCstatus;
typedef struct trace_sample trace_sample;
typedef struct list_trace_sample_1_t list_trace_sample_1_t;
typedef struct TraceVariables TraceVariables;
typedef struct extra_file extra_file;
typedef struct list_extra_file_1_t list_extra_file_1_t;
typedef struct trace_order trace_order;
typedef struct list_trace_order_1_t list_trace_order_1_t;
typedef struct log_message log_message;

// Structures/unions data types declarations
struct binary_t
{
    uint8_t * data;
    uint32_t dataLength;
};

struct PSKID
{
    char * ID;
    char * PSK;
};

struct PLCstatus
{
    PLCstatus_enum PLCstatus;
    uint32_t logcounts[4];
};

struct trace_sample
{
    uint32_t tick;
    binary_t TraceBuffer;
};

struct list_trace_sample_1_t
{
    trace_sample * elements;
    uint32_t elementsCount;
};

struct TraceVariables
{
    PLCstatus_enum PLCstatus;
    list_trace_sample_1_t traces;
};

struct extra_file
{
    char * fname;
    binary_t blobID;
};

struct list_extra_file_1_t
{
    extra_file * elements;
    uint32_t elementsCount;
};

struct trace_order
{
    uint32_t idx;
    binary_t force;
};

struct list_trace_order_1_t
{
    trace_order * elements;
    uint32_t elementsCount;
};

struct log_message
{
    char * msg;
    uint32_t tick;
    uint32_t sec;
    uint32_t nsec;
};


#endif // ERPC_TYPE_DEFINITIONS_ERPC_PLCOBJECT


#endif // _erpc_PLCObject_common_hpp_