From 1b92f30f6dfa27392ffd8460ebeb17c17550db7b Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 18 Dec 2019 09:00:24 +0200 Subject: version 1.4.6.1 PMR: thread load and power down reporting. fix USB driver large files bug. ids pressure relief. some looking into the thread load sequence --- .../ContinueThreadLoadingRequest.pb-c.c | 92 ++++++++++++++++++ .../ContinueThreadLoadingRequest.pb-c.h | 72 ++++++++++++++ .../ContinueThreadLoadingResponse.pb-c.c | 105 +++++++++++++++++++++ .../ContinueThreadLoadingResponse.pb-c.h | 74 +++++++++++++++ .../ThreadLoading/StartThreadLoadingRequest.pb-c.c | 72 ++++++++++++++ .../ThreadLoading/StartThreadLoadingRequest.pb-c.h | 70 ++++++++++++++ .../StartThreadLoadingResponse.pb-c.c | 105 +++++++++++++++++++++ .../StartThreadLoadingResponse.pb-c.h | 74 +++++++++++++++ .../PMR/ThreadLoading/ThreadLoadingState.pb-c.c | 47 +++++++++ .../PMR/ThreadLoading/ThreadLoadingState.pb-c.h | 48 ++++++++++ 10 files changed, 759 insertions(+) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ThreadLoadingState.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ThreadLoadingState.pb-c.h (limited to 'Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading') diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.c new file mode 100644 index 000000000..2fc811bf7 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ContinueThreadLoadingRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ContinueThreadLoadingRequest.pb-c.h" +void continue_thread_loading_request__init + (ContinueThreadLoadingRequest *message) +{ + static const ContinueThreadLoadingRequest init_value = CONTINUE_THREAD_LOADING_REQUEST__INIT; + *message = init_value; +} +size_t continue_thread_loading_request__get_packed_size + (const ContinueThreadLoadingRequest *message) +{ + assert(message->base.descriptor == &continue_thread_loading_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t continue_thread_loading_request__pack + (const ContinueThreadLoadingRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &continue_thread_loading_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t continue_thread_loading_request__pack_to_buffer + (const ContinueThreadLoadingRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &continue_thread_loading_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ContinueThreadLoadingRequest * + continue_thread_loading_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ContinueThreadLoadingRequest *) + protobuf_c_message_unpack (&continue_thread_loading_request__descriptor, + allocator, len, data); +} +void continue_thread_loading_request__free_unpacked + (ContinueThreadLoadingRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &continue_thread_loading_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor continue_thread_loading_request__field_descriptors[1] = +{ + { + "ProcessParameters", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(ContinueThreadLoadingRequest, processparameters), + &process_parameters__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned continue_thread_loading_request__field_indices_by_name[] = { + 0, /* field[0] = ProcessParameters */ +}; +static const ProtobufCIntRange continue_thread_loading_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor continue_thread_loading_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ContinueThreadLoadingRequest", + "ContinueThreadLoadingRequest", + "ContinueThreadLoadingRequest", + "", + sizeof(ContinueThreadLoadingRequest), + 1, + continue_thread_loading_request__field_descriptors, + continue_thread_loading_request__field_indices_by_name, + 1, continue_thread_loading_request__number_ranges, + (ProtobufCMessageInit) continue_thread_loading_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.h new file mode 100644 index 000000000..e37669179 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.h @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ContinueThreadLoadingRequest.proto */ + +#ifndef PROTOBUF_C_ContinueThreadLoadingRequest_2eproto__INCLUDED +#define PROTOBUF_C_ContinueThreadLoadingRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "ProcessParameters.pb-c.h" + +typedef struct _ContinueThreadLoadingRequest ContinueThreadLoadingRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ContinueThreadLoadingRequest +{ + ProtobufCMessage base; + ProcessParameters *processparameters; +}; +#define CONTINUE_THREAD_LOADING_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&continue_thread_loading_request__descriptor) \ + , NULL } + + +/* ContinueThreadLoadingRequest methods */ +void continue_thread_loading_request__init + (ContinueThreadLoadingRequest *message); +size_t continue_thread_loading_request__get_packed_size + (const ContinueThreadLoadingRequest *message); +size_t continue_thread_loading_request__pack + (const ContinueThreadLoadingRequest *message, + uint8_t *out); +size_t continue_thread_loading_request__pack_to_buffer + (const ContinueThreadLoadingRequest *message, + ProtobufCBuffer *buffer); +ContinueThreadLoadingRequest * + continue_thread_loading_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void continue_thread_loading_request__free_unpacked + (ContinueThreadLoadingRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ContinueThreadLoadingRequest_Closure) + (const ContinueThreadLoadingRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor continue_thread_loading_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ContinueThreadLoadingRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.c new file mode 100644 index 000000000..aa61cd30e --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ContinueThreadLoadingResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ContinueThreadLoadingResponse.pb-c.h" +void continue_thread_loading_response__init + (ContinueThreadLoadingResponse *message) +{ + static const ContinueThreadLoadingResponse init_value = CONTINUE_THREAD_LOADING_RESPONSE__INIT; + *message = init_value; +} +size_t continue_thread_loading_response__get_packed_size + (const ContinueThreadLoadingResponse *message) +{ + assert(message->base.descriptor == &continue_thread_loading_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t continue_thread_loading_response__pack + (const ContinueThreadLoadingResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &continue_thread_loading_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t continue_thread_loading_response__pack_to_buffer + (const ContinueThreadLoadingResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &continue_thread_loading_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ContinueThreadLoadingResponse * + continue_thread_loading_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ContinueThreadLoadingResponse *) + protobuf_c_message_unpack (&continue_thread_loading_response__descriptor, + allocator, len, data); +} +void continue_thread_loading_response__free_unpacked + (ContinueThreadLoadingResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &continue_thread_loading_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor continue_thread_loading_response__field_descriptors[2] = +{ + { + "State", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(ContinueThreadLoadingResponse, has_state), + offsetof(ContinueThreadLoadingResponse, state), + &thread_loading_state__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ErrorReason", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(ContinueThreadLoadingResponse, errorreason), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned continue_thread_loading_response__field_indices_by_name[] = { + 1, /* field[1] = ErrorReason */ + 0, /* field[0] = State */ +}; +static const ProtobufCIntRange continue_thread_loading_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor continue_thread_loading_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "ContinueThreadLoadingResponse", + "ContinueThreadLoadingResponse", + "ContinueThreadLoadingResponse", + "", + sizeof(ContinueThreadLoadingResponse), + 2, + continue_thread_loading_response__field_descriptors, + continue_thread_loading_response__field_indices_by_name, + 1, continue_thread_loading_response__number_ranges, + (ProtobufCMessageInit) continue_thread_loading_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h new file mode 100644 index 000000000..ae83a671f --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ContinueThreadLoadingResponse.proto */ + +#ifndef PROTOBUF_C_ContinueThreadLoadingResponse_2eproto__INCLUDED +#define PROTOBUF_C_ContinueThreadLoadingResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "ThreadLoadingState.pb-c.h" + +typedef struct _ContinueThreadLoadingResponse ContinueThreadLoadingResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ContinueThreadLoadingResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_state; + ThreadLoadingState state; + char *errorreason; +}; +#define CONTINUE_THREAD_LOADING_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&continue_thread_loading_response__descriptor) \ + , 0, THREAD_LOADING_STATE__None, NULL } + + +/* ContinueThreadLoadingResponse methods */ +void continue_thread_loading_response__init + (ContinueThreadLoadingResponse *message); +size_t continue_thread_loading_response__get_packed_size + (const ContinueThreadLoadingResponse *message); +size_t continue_thread_loading_response__pack + (const ContinueThreadLoadingResponse *message, + uint8_t *out); +size_t continue_thread_loading_response__pack_to_buffer + (const ContinueThreadLoadingResponse *message, + ProtobufCBuffer *buffer); +ContinueThreadLoadingResponse * + continue_thread_loading_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void continue_thread_loading_response__free_unpacked + (ContinueThreadLoadingResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ContinueThreadLoadingResponse_Closure) + (const ContinueThreadLoadingResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor continue_thread_loading_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ContinueThreadLoadingResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingRequest.pb-c.c new file mode 100644 index 000000000..505d8e416 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartThreadLoadingRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StartThreadLoadingRequest.pb-c.h" +void start_thread_loading_request__init + (StartThreadLoadingRequest *message) +{ + static const StartThreadLoadingRequest init_value = START_THREAD_LOADING_REQUEST__INIT; + *message = init_value; +} +size_t start_thread_loading_request__get_packed_size + (const StartThreadLoadingRequest *message) +{ + assert(message->base.descriptor == &start_thread_loading_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t start_thread_loading_request__pack + (const StartThreadLoadingRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &start_thread_loading_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t start_thread_loading_request__pack_to_buffer + (const StartThreadLoadingRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &start_thread_loading_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StartThreadLoadingRequest * + start_thread_loading_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StartThreadLoadingRequest *) + protobuf_c_message_unpack (&start_thread_loading_request__descriptor, + allocator, len, data); +} +void start_thread_loading_request__free_unpacked + (StartThreadLoadingRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &start_thread_loading_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define start_thread_loading_request__field_descriptors NULL +#define start_thread_loading_request__field_indices_by_name NULL +#define start_thread_loading_request__number_ranges NULL +const ProtobufCMessageDescriptor start_thread_loading_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StartThreadLoadingRequest", + "StartThreadLoadingRequest", + "StartThreadLoadingRequest", + "", + sizeof(StartThreadLoadingRequest), + 0, + start_thread_loading_request__field_descriptors, + start_thread_loading_request__field_indices_by_name, + 0, start_thread_loading_request__number_ranges, + (ProtobufCMessageInit) start_thread_loading_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingRequest.pb-c.h new file mode 100644 index 000000000..a21a7ba7f --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartThreadLoadingRequest.proto */ + +#ifndef PROTOBUF_C_StartThreadLoadingRequest_2eproto__INCLUDED +#define PROTOBUF_C_StartThreadLoadingRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StartThreadLoadingRequest StartThreadLoadingRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StartThreadLoadingRequest +{ + ProtobufCMessage base; +}; +#define START_THREAD_LOADING_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&start_thread_loading_request__descriptor) \ + } + + +/* StartThreadLoadingRequest methods */ +void start_thread_loading_request__init + (StartThreadLoadingRequest *message); +size_t start_thread_loading_request__get_packed_size + (const StartThreadLoadingRequest *message); +size_t start_thread_loading_request__pack + (const StartThreadLoadingRequest *message, + uint8_t *out); +size_t start_thread_loading_request__pack_to_buffer + (const StartThreadLoadingRequest *message, + ProtobufCBuffer *buffer); +StartThreadLoadingRequest * + start_thread_loading_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void start_thread_loading_request__free_unpacked + (StartThreadLoadingRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StartThreadLoadingRequest_Closure) + (const StartThreadLoadingRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor start_thread_loading_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StartThreadLoadingRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.c new file mode 100644 index 000000000..01a110489 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartThreadLoadingResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StartThreadLoadingResponse.pb-c.h" +void start_thread_loading_response__init + (StartThreadLoadingResponse *message) +{ + static const StartThreadLoadingResponse init_value = START_THREAD_LOADING_RESPONSE__INIT; + *message = init_value; +} +size_t start_thread_loading_response__get_packed_size + (const StartThreadLoadingResponse *message) +{ + assert(message->base.descriptor == &start_thread_loading_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t start_thread_loading_response__pack + (const StartThreadLoadingResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &start_thread_loading_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t start_thread_loading_response__pack_to_buffer + (const StartThreadLoadingResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &start_thread_loading_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StartThreadLoadingResponse * + start_thread_loading_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StartThreadLoadingResponse *) + protobuf_c_message_unpack (&start_thread_loading_response__descriptor, + allocator, len, data); +} +void start_thread_loading_response__free_unpacked + (StartThreadLoadingResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &start_thread_loading_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor start_thread_loading_response__field_descriptors[2] = +{ + { + "State", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(StartThreadLoadingResponse, has_state), + offsetof(StartThreadLoadingResponse, state), + &thread_loading_state__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ErrorReason", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StartThreadLoadingResponse, errorreason), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned start_thread_loading_response__field_indices_by_name[] = { + 1, /* field[1] = ErrorReason */ + 0, /* field[0] = State */ +}; +static const ProtobufCIntRange start_thread_loading_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor start_thread_loading_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StartThreadLoadingResponse", + "StartThreadLoadingResponse", + "StartThreadLoadingResponse", + "", + sizeof(StartThreadLoadingResponse), + 2, + start_thread_loading_response__field_descriptors, + start_thread_loading_response__field_indices_by_name, + 1, start_thread_loading_response__number_ranges, + (ProtobufCMessageInit) start_thread_loading_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.h new file mode 100644 index 000000000..559f04bb9 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StartThreadLoadingResponse.proto */ + +#ifndef PROTOBUF_C_StartThreadLoadingResponse_2eproto__INCLUDED +#define PROTOBUF_C_StartThreadLoadingResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "ThreadLoadingState.pb-c.h" + +typedef struct _StartThreadLoadingResponse StartThreadLoadingResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StartThreadLoadingResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_state; + ThreadLoadingState state; + char *errorreason; +}; +#define START_THREAD_LOADING_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&start_thread_loading_response__descriptor) \ + , 0, THREAD_LOADING_STATE__None, NULL } + + +/* StartThreadLoadingResponse methods */ +void start_thread_loading_response__init + (StartThreadLoadingResponse *message); +size_t start_thread_loading_response__get_packed_size + (const StartThreadLoadingResponse *message); +size_t start_thread_loading_response__pack + (const StartThreadLoadingResponse *message, + uint8_t *out); +size_t start_thread_loading_response__pack_to_buffer + (const StartThreadLoadingResponse *message, + ProtobufCBuffer *buffer); +StartThreadLoadingResponse * + start_thread_loading_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void start_thread_loading_response__free_unpacked + (StartThreadLoadingResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StartThreadLoadingResponse_Closure) + (const StartThreadLoadingResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor start_thread_loading_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StartThreadLoadingResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ThreadLoadingState.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ThreadLoadingState.pb-c.c new file mode 100644 index 000000000..bf926cdfa --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ThreadLoadingState.pb-c.c @@ -0,0 +1,47 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ThreadLoadingState.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ThreadLoadingState.pb-c.h" +static const ProtobufCEnumValue thread_loading_state__enum_values_by_number[7] = +{ + { "None", "THREAD_LOADING_STATE__None", 0 }, + { "Preparing", "THREAD_LOADING_STATE__Preparing", 1 }, + { "ReadyForLoading", "THREAD_LOADING_STATE__ReadyForLoading", 2 }, + { "PreparationError", "THREAD_LOADING_STATE__PreparationError", 3 }, + { "Finalizing", "THREAD_LOADING_STATE__Finalizing", 4 }, + { "FinalizationError", "THREAD_LOADING_STATE__FinalizationError", 5 }, + { "Completed", "THREAD_LOADING_STATE__Completed", 6 }, +}; +static const ProtobufCIntRange thread_loading_state__value_ranges[] = { +{0, 0},{0, 7} +}; +static const ProtobufCEnumValueIndex thread_loading_state__enum_values_by_name[7] = +{ + { "Completed", 6 }, + { "FinalizationError", 5 }, + { "Finalizing", 4 }, + { "None", 0 }, + { "PreparationError", 3 }, + { "Preparing", 1 }, + { "ReadyForLoading", 2 }, +}; +const ProtobufCEnumDescriptor thread_loading_state__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "ThreadLoadingState", + "ThreadLoadingState", + "ThreadLoadingState", + "", + 7, + thread_loading_state__enum_values_by_number, + 7, + thread_loading_state__enum_values_by_name, + 1, + thread_loading_state__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ThreadLoadingState.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ThreadLoadingState.pb-c.h new file mode 100644 index 000000000..4a08ce913 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ThreadLoadingState.pb-c.h @@ -0,0 +1,48 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ThreadLoadingState.proto */ + +#ifndef PROTOBUF_C_ThreadLoadingState_2eproto__INCLUDED +#define PROTOBUF_C_ThreadLoadingState_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _ThreadLoadingState { + THREAD_LOADING_STATE__None = 0, + THREAD_LOADING_STATE__Preparing = 1, + THREAD_LOADING_STATE__ReadyForLoading = 2, + THREAD_LOADING_STATE__PreparationError = 3, + THREAD_LOADING_STATE__Finalizing = 4, + THREAD_LOADING_STATE__FinalizationError = 5, + THREAD_LOADING_STATE__Completed = 6 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(THREAD_LOADING_STATE) +} ThreadLoadingState; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor thread_loading_state__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ThreadLoadingState_2eproto__INCLUDED */ -- cgit v1.3.1 From 39c91b49017808b41d36d28406b5f78f06ab0e39 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 19 Dec 2019 15:59:40 +0200 Subject: fix thread loading messaging, IDS - fix gradient job end bug, thread - huge --- .../ContinueThreadLoadingResponse.pb-c.c | 43 +++------------------ .../ContinueThreadLoadingResponse.pb-c.h | 6 +-- .../Embedded_SW/Embedded/Modules/IDS/IDS_maint.c | 3 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 44 ++++++++-------------- .../Embedded/Modules/Thread/ThreadLoad.c | 31 ++++++++------- .../Embedded/Modules/Thread/Thread_print.c | 6 +-- 6 files changed, 43 insertions(+), 90 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading') diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.c index aa61cd30e..4e7244306 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.c @@ -52,42 +52,9 @@ void continue_thread_loading_response__free_unpacked assert(message->base.descriptor == &continue_thread_loading_response__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor continue_thread_loading_response__field_descriptors[2] = -{ - { - "State", - 1, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_ENUM, - offsetof(ContinueThreadLoadingResponse, has_state), - offsetof(ContinueThreadLoadingResponse, state), - &thread_loading_state__descriptor, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "ErrorReason", - 2, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(ContinueThreadLoadingResponse, errorreason), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, -}; -static const unsigned continue_thread_loading_response__field_indices_by_name[] = { - 1, /* field[1] = ErrorReason */ - 0, /* field[0] = State */ -}; -static const ProtobufCIntRange continue_thread_loading_response__number_ranges[1 + 1] = -{ - { 1, 0 }, - { 0, 2 } -}; +#define continue_thread_loading_response__field_descriptors NULL +#define continue_thread_loading_response__field_indices_by_name NULL +#define continue_thread_loading_response__number_ranges NULL const ProtobufCMessageDescriptor continue_thread_loading_response__descriptor = { PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, @@ -96,10 +63,10 @@ const ProtobufCMessageDescriptor continue_thread_loading_response__descriptor = "ContinueThreadLoadingResponse", "", sizeof(ContinueThreadLoadingResponse), - 2, + 0, continue_thread_loading_response__field_descriptors, continue_thread_loading_response__field_indices_by_name, - 1, continue_thread_loading_response__number_ranges, + 0, continue_thread_loading_response__number_ranges, (ProtobufCMessageInit) continue_thread_loading_response__init, NULL,NULL,NULL /* reserved[123] */ }; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h index ae83a671f..8d9a98326 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h @@ -14,7 +14,6 @@ PROTOBUF_C__BEGIN_DECLS # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. #endif -#include "ThreadLoadingState.pb-c.h" typedef struct _ContinueThreadLoadingResponse ContinueThreadLoadingResponse; @@ -27,13 +26,10 @@ typedef struct _ContinueThreadLoadingResponse ContinueThreadLoadingResponse; struct _ContinueThreadLoadingResponse { ProtobufCMessage base; - protobuf_c_boolean has_state; - ThreadLoadingState state; - char *errorreason; }; #define CONTINUE_THREAD_LOADING_RESPONSE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&continue_thread_loading_response__descriptor) \ - , 0, THREAD_LOADING_STATE__None, NULL } + } /* ContinueThreadLoadingResponse methods */ diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c index c49fd81f0..41452cbad 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_maint.c @@ -476,7 +476,7 @@ uint32_t IDS_Dispenser_Alarm_On (uint8_t DispenserId) if (Extended_Motor_Param == true) Power_Step_01_Dispenser_Mode(DispenserId,Voltage); //status |= MotorSetMicroStep(MotorId, KeepMicrostep[DispenserId]); - status |= MotorStop(DispenserId, Hard_Hiz); + status |= MotorStop(MotorId, Hard_Hiz); IDS_Dispenser_Init(DispenserId); JobEndReason = JOB_OUT_OF_DYE; return status; @@ -509,7 +509,6 @@ uint32_t IDS_Check_Pressure_Callback(uint32_t DispenserId, uint32_t ReadValue) if (GetDispenserPressure(DispenserId)>3.0) { Report("Pulling dispenser down to reduce pressure",__FILE__,DispenserId,(int)(GetDispenserPressure(DispenserId)*100),RpWarning,200,0); - MotorMove(HW_Motor_Id,1-MotorsCfg[HW_Motor_Id].directionthreadwize,200*MotorsCfg[HW_Motor_Id].microstep); } return OK; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 3af6416cb..9fdcaaf1f 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -81,7 +81,7 @@ int lInterSegmentLength = 0; uint32_t InterSegmentStartWFCFDispensers; uint32_t WFCF = 80; bool EnableCleaning = true; - +bool JobEndSequence = false; void IDS_Dispenser_SetPreSegmentWFCFValues(double dispenserpresegmentwfcf, double ids_presegment_wfcf_timebeforesegment) { if (ids_presegment_wfcf_timebeforesegment) @@ -228,7 +228,7 @@ JobDescriptionFileBrushStop *FirstBrushStop = NULL; int brushCounter = 0; - GeneralHwReady = false; + //GeneralHwReady = false; for (Dispenser_i = 0;Dispenser_i0.1)&&(feedertension<1.5)) { Report("Setting pressure from RML feeder tension",__FILE__,__LINE__,(int)(feedertension*100),RpWarning,(int)(DispenserPreparePressure*100),0); @@ -733,7 +734,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) } else { - /**/if (AutoHoming_Config >= AutoHoming_JobEnd_PowerOn_off) + if (AutoHoming_Config >= AutoHoming_JobEnd_PowerOn_off) { if ((HomingActive[i] == false)&&(PrimingActive[i] == false)) { @@ -744,26 +745,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) { Report("Inactive dispenser already homing",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); } - }/**/ - /*if ((HomingActive[i] == false)&&(PrimingActive[i] == false)) - { - Report("Inactive dispenser open valve",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); - Control3WayValvesWithCallback (i, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer - Report("Homing Inactive dispenser",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); - IDS_HomeDispenser (i, 1000 , NULL); - } - else - { - Report("Inactive dispenser already homing",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); - } - }*/ - //if ((HomingActive[i] == false)&&(PrimingActive[i] == false)) - //{ - // Report("Inactive dispenser open valve",__FILE__,i,HomingActive[i],RpWarning,PrimingActive[i],0); - // Control3WayValvesWithCallback (i, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer - //} - //ControlIdtoInactiveDispenserId[Dispenser_i] = AddControlCallback( IDS_Check_Pressure_Callback, eOneMinute,TemplateDataReadCBFunction ,0, 0, 0 ); - + } } } if (NumOfActiveDispensers) @@ -1401,6 +1383,12 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) int n_dispensers = 0; JobSegment* Segment = (void *)IfIndex; + if (JobEndSequence == true) + { + Report("JobEndSequence",__FILE__,__LINE__,(int)JobBrushStopId,RpWarning,(int)SegmentNumOfBrushStops,0); + SafeRemoveControlCallback(BrushStopControlId,IDSBrushStopRestartCallback); + BrushStopControlId = 0Xff; + } if (uploadstrategy == JOB_UPLOAD_STRATEGY__Default) { Dispensers = Segment->brushstops[JobBrushStopId]->dispensers; @@ -1464,10 +1452,10 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) #endif IDS_Cleaning_Stop_Cleaning_Solution(NULL); SegmentNumOfBrushStops = Segment->n_brushstops; - BrushStopTime = Segment->length/SegmentNumOfBrushStops; //brushstop in meters + BrushStopTime = Segment->length*1000/(double)SegmentNumOfBrushStops; //brushstop in meters //brushstop in millisecond BrushStopTime = ((BrushStopTime*100)/dyeingspeed);//brushstop in seconds - BrushStopTime *= 1000; //brushstop in millisecond - Report("IDSSegmentState",__FILE__,__LINE__,(int)BrushStopTime,RpWarning,(int)SegmentNumOfBrushStops,0); + //BrushStopTime *= 1000; + Report("IDSSegmentState",__FILE__,__LINE__,(int)(BrushStopTime*1000),RpWarning,(int)SegmentNumOfBrushStops,0); if (uploadstrategy == JOB_UPLOAD_STRATEGY__Default) { Dispensers = Segment->brushstops[JobBrushStopId]->dispensers; @@ -1557,7 +1545,7 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) if (FileBrushStop) FreeBrushStopFileData(FileBrushStop); FileBrushStop = NULL; - + JobEndSequence = true; lInterSegmentLength = (dryerbufferCentimeters*1000/dyeingspeed); lInterSegmentLength-=(lInterSegmentLength%100); //round to a 100 multiplication InterSegmentStepsCount = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 373e4bbd9..13b98bcb0 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -445,7 +445,7 @@ MotorSetMaxSpeed (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1, 500); // MotorMovetoLimitSwitch (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, 500, Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1], Thread_Load_HomingCallback,25000); - MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, (2000*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].microstep), Thread_Load_HomingCallback,20000); + MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_LDANCER1, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].directionthreadwize, (5000*MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_LDANCER1].microstep), Thread_Load_HomingCallback,20000); return OK; } @@ -607,7 +607,7 @@ CallbackCounter++; Report("Thread_Load_Dryer_Loading",__FILE__,__LINE__,LoadStages,RpMessage,CallbackCounter,0); MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize, - numberOfSteps, Thread_Load_Dryer_Loading_Callback, 100000); + numberOfSteps-400, Thread_Load_Dryer_Loading_Callback, 100000); //Keep Notation How Many Rotations In The Dryer //LoadArmInfo.LoadArmBackLash = 0; @@ -1079,7 +1079,6 @@ uint32_t ThreadLoadingReport(void) MessageContainer responseContainer; bool last = false; StartThreadLoadingResponse response = START_THREAD_LOADING_RESPONSE__INIT; - ContinueThreadLoadingResponse Cresponse = CONTINUE_THREAD_LOADING_RESPONSE__INIT; if (ThreadLoadingToken[0] == 0) return OK; @@ -1093,7 +1092,6 @@ uint32_t ThreadLoadingReport(void) if (LoadStages == THREAD_LOAD_INITIAL_TENSION) { response.state = THREAD_LOADING_STATE__ReadyForLoading; - last = true; } } else @@ -1101,32 +1099,30 @@ uint32_t ThreadLoadingReport(void) response.state = THREAD_LOADING_STATE__PreparationError; response.errorreason = LoadErrorMsg; } - responseContainer = createContainer(MESSAGE_TYPE__StartThreadLoadingResponse, ThreadLoadingToken, last, &response, &start_thread_loading_response__pack, &start_thread_loading_response__get_packed_size); - responseContainer.continuous = true; } else if (MessageState == 2) { - Cresponse.has_state = true; + response.has_state = true; if (LoadStatus == OK) { - Cresponse.state = THREAD_LOADING_STATE__Finalizing; + response.state = THREAD_LOADING_STATE__Finalizing; if (LoadStages >= THREAD_LOAD_JOG_THREAD) { - Cresponse.state = THREAD_LOADING_STATE__Completed; + response.state = THREAD_LOADING_STATE__Completed; last = true; } } else { - Cresponse.state = THREAD_LOADING_STATE__FinalizationError; - Cresponse.errorreason = LoadErrorMsg; + response.state = THREAD_LOADING_STATE__FinalizationError; + response.errorreason = LoadErrorMsg; } - responseContainer = createContainer(MESSAGE_TYPE__ContinueThreadLoadingResponse, ThreadLoadingToken, last, &Cresponse, &continue_thread_loading_response__pack, &continue_thread_loading_response__get_packed_size); - responseContainer.continuous = true; } else return ERROR; //------------------------------------------------------------------------------------------- + responseContainer = createContainer(MESSAGE_TYPE__StartThreadLoadingResponse, ThreadLoadingToken, last, &response, &start_thread_loading_response__pack, &start_thread_loading_response__get_packed_size); + responseContainer.continuous = true; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); size_t container_size = message_container__pack(&responseContainer, container_buffer); my_free(responseContainer.data.data); @@ -1149,9 +1145,16 @@ uint32_t StartThreadLoadingFunc(MessageContainer* requestContainer) uint32_t ContinueThreadLoadingFunc(MessageContainer* requestContainer) { ContinueThreadLoadingRequest *request = continue_thread_loading_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); - ustrncpy (ThreadLoadingToken, requestContainer->token,36); + ContinueThreadLoadingResponse Cresponse = CONTINUE_THREAD_LOADING_RESPONSE__INIT; + MessageContainer responseContainer; MessageState = 2; ThreadLoadingReport(); + responseContainer = createContainer(MESSAGE_TYPE__ContinueThreadLoadingResponse, requestContainer->token, true, &Cresponse, &continue_thread_loading_response__pack, &continue_thread_loading_response__get_packed_size); + responseContainer.continuous = false; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + SendChars((char*)container_buffer, container_size); return OK; } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index f0331b4bc..dd31e9cda 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -722,6 +722,9 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) JobCounter = 0; TotalProcessedLength = 0.0; PoolerTotalProcessedLength = 0.0; + InitialProcess = true; + initialpos = 0xFFFF; + Poolerinitialpos = 0xFFFF; PrepareState = true; AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_BREAK,false); AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_TENSION_CONTROL_FAILURE_PULLER_DANCER,false); @@ -853,9 +856,6 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) #endif PrepareReady(Module_Thread,ModuleDone); //set 3 dancers to the profile positions - InitialProcess = true; - initialpos = 0xFFFF; - Poolerinitialpos = 0xFFFF; return OK; } -- cgit v1.3.1 From e1a2dde7fe9c728dfb3247b34d89b947b4132fd2 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 23 Dec 2019 10:54:31 +0200 Subject: support stop loading message and some fixes to the thread loading --- .../Embedded_SW/Embedded/Communication/Container.c | 3 + .../Communication/PMR/Common/MessageType.pb-c.c | 14 +- .../Communication/PMR/Common/MessageType.pb-c.h | 4 +- .../PMR/MachineStatus/MachineState.pb-c.c | 4 +- .../PMR/MachineStatus/MachineState.pb-c.h | 2 +- .../PMR/MachineStatus/MachineStatus.pb-c.h | 2 +- .../ThreadLoading/StopThreadLoadingRequest.pb-c.c | 72 +++++++ .../ThreadLoading/StopThreadLoadingRequest.pb-c.h | 70 ++++++ .../ThreadLoading/StopThreadLoadingResponse.pb-c.c | 72 +++++++ .../ThreadLoading/StopThreadLoadingResponse.pb-c.h | 70 ++++++ .../Embedded/Drivers/Motors/MotorActions.c | 37 ++-- .../Embedded/Drivers/SSI_Comm/Dancer/Dancer.c | 1 + .../Embedded/Drivers/SSI_Comm/Dancer/Dancer.h | 2 +- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 6 +- .../Embedded/Modules/Control/MillisecTask.c | 2 +- .../Embedded/Modules/Diagnostics/Diagnostics.c | 6 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 11 +- .../Embedded/Modules/Stubs_Handler/Progress.c | 14 ++ .../Embedded/Modules/Thread/ThreadLoad.c | 234 ++++++++++++++++++--- .../Embedded/Modules/Thread/Thread_Winder.c | 6 +- .../Embedded/Modules/Thread/Thread_ex.h | 1 + .../Embedded/Modules/Thread/Thread_init.c | 2 +- 22 files changed, 566 insertions(+), 69 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.h (limited to 'Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading') diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 220a83110..eed14b2e7 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -470,6 +470,9 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__ContinueThreadLoadingRequest: ContinueThreadLoadingFunc(requestContainer); break; + case MESSAGE_TYPE__StopThreadLoadingRequest: + StopThreadLoadingFunc(requestContainer); + break; default: //unsupported message type !! LOG_ERROR (requestContainer->type,"unsupported message type"); diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c index 11b3ec7b2..9bfdc7232 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.c @@ -7,7 +7,7 @@ #endif #include "MessageType.pb-c.h" -static const ProtobufCEnumValue message_type__enum_values_by_number[237] = +static const ProtobufCEnumValue message_type__enum_values_by_number[239] = { { "None", "MESSAGE_TYPE__None", 0 }, { "ErrorResponse", "MESSAGE_TYPE__ErrorResponse", 1 }, @@ -246,11 +246,13 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[237] = { "StartThreadLoadingResponse", "MESSAGE_TYPE__StartThreadLoadingResponse", 11001 }, { "ContinueThreadLoadingRequest", "MESSAGE_TYPE__ContinueThreadLoadingRequest", 11002 }, { "ContinueThreadLoadingResponse", "MESSAGE_TYPE__ContinueThreadLoadingResponse", 11003 }, + { "StopThreadLoadingRequest", "MESSAGE_TYPE__StopThreadLoadingRequest", 11004 }, + { "StopThreadLoadingResponse", "MESSAGE_TYPE__StopThreadLoadingResponse", 11005 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 2},{1000, 104},{2000, 121},{3000, 167},{4000, 177},{5000, 185},{6000, 189},{7000, 195},{8000, 219},{9000, 225},{10000, 229},{11000, 233},{0, 237} +{0, 0},{3, 2},{1000, 104},{2000, 121},{3000, 167},{4000, 177},{5000, 185},{6000, 189},{7000, 195},{8000, 219},{9000, 225},{10000, 229},{11000, 233},{0, 239} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[237] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[239] = { { "AbortJobRequest", 169 }, { "AbortJobResponse", 170 }, @@ -377,6 +379,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[237] = { "StopEventsNotificationResponse", 154 }, { "StopMachineStatusUpdateRequest", 227 }, { "StopMachineStatusUpdateResponse", 228 }, + { "StopThreadLoadingRequest", 237 }, + { "StopThreadLoadingResponse", 238 }, { "StubAbortJobRequest", 100 }, { "StubAbortJobResponse", 101 }, { "StubCartridgeReadRequest", 6 }, @@ -497,9 +501,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "MessageType", "MessageType", "", - 237, + 239, message_type__enum_values_by_number, - 237, + 239, message_type__enum_values_by_name, 13, message_type__value_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h index 1989c473a..3c6bbc146 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/MessageType.pb-c.h @@ -256,7 +256,9 @@ typedef enum _MessageType { MESSAGE_TYPE__StartThreadLoadingRequest = 11000, MESSAGE_TYPE__StartThreadLoadingResponse = 11001, MESSAGE_TYPE__ContinueThreadLoadingRequest = 11002, - MESSAGE_TYPE__ContinueThreadLoadingResponse = 11003 + MESSAGE_TYPE__ContinueThreadLoadingResponse = 11003, + MESSAGE_TYPE__StopThreadLoadingRequest = 11004, + MESSAGE_TYPE__StopThreadLoadingResponse = 11005 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(MESSAGE_TYPE) } MessageType; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineState.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineState.pb-c.c index 0cfa95c0e..e3753082e 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineState.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineState.pb-c.c @@ -9,7 +9,7 @@ #include "MachineState.pb-c.h" static const ProtobufCEnumValue machine_state__enum_values_by_number[7] = { - { "Initializing", "MACHINE_STATE__Initializing", 0 }, + { "PowerUp", "MACHINE_STATE__PowerUp", 0 }, { "Ready", "MACHINE_STATE__Ready", 1 }, { "Sleep", "MACHINE_STATE__Sleep", 2 }, { "Error", "MACHINE_STATE__Error", 3 }, @@ -23,8 +23,8 @@ static const ProtobufCIntRange machine_state__value_ranges[] = { static const ProtobufCEnumValueIndex machine_state__enum_values_by_name[7] = { { "Error", 3 }, - { "Initializing", 0 }, { "PowerOff", 4 }, + { "PowerUp", 0 }, { "PreparingJob", 5 }, { "Ready", 1 }, { "RunningJob", 6 }, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineState.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineState.pb-c.h index 32fa5f56f..bbb414d42 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineState.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineState.pb-c.h @@ -20,7 +20,7 @@ PROTOBUF_C__BEGIN_DECLS /* --- enums --- */ typedef enum _MachineState { - MACHINE_STATE__Initializing = 0, + MACHINE_STATE__PowerUp = 0, MACHINE_STATE__Ready = 1, MACHINE_STATE__Sleep = 2, MACHINE_STATE__Error = 3, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.h index 0777f8855..a8a54eb13 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/MachineStatus/MachineStatus.pb-c.h @@ -37,7 +37,7 @@ struct _MachineStatus }; #define MACHINE_STATUS__INIT \ { PROTOBUF_C_MESSAGE_INIT (&machine_status__descriptor) \ - , 0, MACHINE_STATE__Initializing, 0,NULL, 0, 0 } + , 0, MACHINE_STATE__PowerUp, 0,NULL, 0, 0 } /* MachineStatus methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.c new file mode 100644 index 000000000..7087a56e7 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StopThreadLoadingRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StopThreadLoadingRequest.pb-c.h" +void stop_thread_loading_request__init + (StopThreadLoadingRequest *message) +{ + static const StopThreadLoadingRequest init_value = STOP_THREAD_LOADING_REQUEST__INIT; + *message = init_value; +} +size_t stop_thread_loading_request__get_packed_size + (const StopThreadLoadingRequest *message) +{ + assert(message->base.descriptor == &stop_thread_loading_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stop_thread_loading_request__pack + (const StopThreadLoadingRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stop_thread_loading_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stop_thread_loading_request__pack_to_buffer + (const StopThreadLoadingRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stop_thread_loading_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StopThreadLoadingRequest * + stop_thread_loading_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StopThreadLoadingRequest *) + protobuf_c_message_unpack (&stop_thread_loading_request__descriptor, + allocator, len, data); +} +void stop_thread_loading_request__free_unpacked + (StopThreadLoadingRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stop_thread_loading_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define stop_thread_loading_request__field_descriptors NULL +#define stop_thread_loading_request__field_indices_by_name NULL +#define stop_thread_loading_request__number_ranges NULL +const ProtobufCMessageDescriptor stop_thread_loading_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StopThreadLoadingRequest", + "StopThreadLoadingRequest", + "StopThreadLoadingRequest", + "", + sizeof(StopThreadLoadingRequest), + 0, + stop_thread_loading_request__field_descriptors, + stop_thread_loading_request__field_indices_by_name, + 0, stop_thread_loading_request__number_ranges, + (ProtobufCMessageInit) stop_thread_loading_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.h new file mode 100644 index 000000000..0c9e6d894 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StopThreadLoadingRequest.proto */ + +#ifndef PROTOBUF_C_StopThreadLoadingRequest_2eproto__INCLUDED +#define PROTOBUF_C_StopThreadLoadingRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StopThreadLoadingRequest StopThreadLoadingRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StopThreadLoadingRequest +{ + ProtobufCMessage base; +}; +#define STOP_THREAD_LOADING_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stop_thread_loading_request__descriptor) \ + } + + +/* StopThreadLoadingRequest methods */ +void stop_thread_loading_request__init + (StopThreadLoadingRequest *message); +size_t stop_thread_loading_request__get_packed_size + (const StopThreadLoadingRequest *message); +size_t stop_thread_loading_request__pack + (const StopThreadLoadingRequest *message, + uint8_t *out); +size_t stop_thread_loading_request__pack_to_buffer + (const StopThreadLoadingRequest *message, + ProtobufCBuffer *buffer); +StopThreadLoadingRequest * + stop_thread_loading_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stop_thread_loading_request__free_unpacked + (StopThreadLoadingRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StopThreadLoadingRequest_Closure) + (const StopThreadLoadingRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stop_thread_loading_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StopThreadLoadingRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.c new file mode 100644 index 000000000..69b3c91f4 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StopThreadLoadingResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StopThreadLoadingResponse.pb-c.h" +void stop_thread_loading_response__init + (StopThreadLoadingResponse *message) +{ + static const StopThreadLoadingResponse init_value = STOP_THREAD_LOADING_RESPONSE__INIT; + *message = init_value; +} +size_t stop_thread_loading_response__get_packed_size + (const StopThreadLoadingResponse *message) +{ + assert(message->base.descriptor == &stop_thread_loading_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stop_thread_loading_response__pack + (const StopThreadLoadingResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stop_thread_loading_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stop_thread_loading_response__pack_to_buffer + (const StopThreadLoadingResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stop_thread_loading_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StopThreadLoadingResponse * + stop_thread_loading_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StopThreadLoadingResponse *) + protobuf_c_message_unpack (&stop_thread_loading_response__descriptor, + allocator, len, data); +} +void stop_thread_loading_response__free_unpacked + (StopThreadLoadingResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stop_thread_loading_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define stop_thread_loading_response__field_descriptors NULL +#define stop_thread_loading_response__field_indices_by_name NULL +#define stop_thread_loading_response__number_ranges NULL +const ProtobufCMessageDescriptor stop_thread_loading_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StopThreadLoadingResponse", + "StopThreadLoadingResponse", + "StopThreadLoadingResponse", + "", + sizeof(StopThreadLoadingResponse), + 0, + stop_thread_loading_response__field_descriptors, + stop_thread_loading_response__field_indices_by_name, + 0, stop_thread_loading_response__number_ranges, + (ProtobufCMessageInit) stop_thread_loading_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.h new file mode 100644 index 000000000..69803107b --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StopThreadLoadingResponse.proto */ + +#ifndef PROTOBUF_C_StopThreadLoadingResponse_2eproto__INCLUDED +#define PROTOBUF_C_StopThreadLoadingResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StopThreadLoadingResponse StopThreadLoadingResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StopThreadLoadingResponse +{ + ProtobufCMessage base; +}; +#define STOP_THREAD_LOADING_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stop_thread_loading_response__descriptor) \ + } + + +/* StopThreadLoadingResponse methods */ +void stop_thread_loading_response__init + (StopThreadLoadingResponse *message); +size_t stop_thread_loading_response__get_packed_size + (const StopThreadLoadingResponse *message); +size_t stop_thread_loading_response__pack + (const StopThreadLoadingResponse *message, + uint8_t *out); +size_t stop_thread_loading_response__pack_to_buffer + (const StopThreadLoadingResponse *message, + ProtobufCBuffer *buffer); +StopThreadLoadingResponse * + stop_thread_loading_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stop_thread_loading_response__free_unpacked + (StopThreadLoadingResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StopThreadLoadingResponse_Closure) + (const StopThreadLoadingResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stop_thread_loading_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StopThreadLoadingResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c index 54a7b1219..08ffac91f 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c @@ -183,6 +183,9 @@ uint32_t MotorMoveWithCallback (TimerMotors_t MotorId,bool direction, uint32_t S //call driver action to device id with the parameter //SetMotorSpeed (deviceId, parameter); MotorCallback[MotorId] = callback; + MotorTimeout[MotorId] = 0; + MotorTimeLag[MotorId] = 20; + MotorTimeLimit[MotorId] = timeout; //MotorStop(MotorId,Hard_Hiz ); MotorMove(MotorId,direction,Steps ); @@ -261,6 +264,7 @@ uint32_t MotorVerifiedCallBackFunction(uint32_t IfIndex, uint32_t ArmPosition) / MotorControlCallback[MotorId] = 0; MotorControlId[MotorId] = 0xFF; MotorStop(MotorId,Hard_Hiz ); + /* Task_sleep(5); MotorMove(MotorId,DrierBackLashDirection,DryerBackLash ); Report("Motor to stopper move to backlash",__FILE__,MotorId,DryerBackLash,RpWarning,DrierBackLashDirection,0); @@ -269,15 +273,17 @@ uint32_t MotorVerifiedCallBackFunction(uint32_t IfIndex, uint32_t ArmPosition) / MotorStop(MotorId,Hard_Stop ); Task_sleep(5); Read_Dryer_ENC_Position(); //trigger the next call - Task_sleep(5); - DrierZeroPosition = Read_Dryer_ENC_Position(); //trigger the next call - MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CENTER,DrierZeroPosition); + Task_sleep(5);*/ +// MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CENTER,DrierZeroPosition); Report("MotorVerifiedCallBackFunction",__FILE__,__LINE__,DrierZeroPosition,RpWarning,DryerBackLash,0); //call the module callback if (MotorCallback[MotorId]) MotorCallback[MotorId](MotorId,ArmPosition); + MotorSetDirection(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize); + MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,NULL,1000); + DrierZeroPosition = Read_Dryer_ENC_Position(); //trigger the next call } else @@ -319,11 +325,11 @@ uint32_t MotorMoveToStopper (TimerMotors_t MotorId,bool direction, uint32_t Spee memset(ArmSamples,0,sizeof(ArmSamples)); ArmSamplePointer = 0; Read_Dryer_ENC_Position(); - Task_sleep(20); - Initialcurrentposition = Control_Read_Dryer_Position(0,0); + Task_sleep(10); + Initialcurrentposition = Read_Dryer_ENC_Position(); cycles = 0; - StoredMotorPosition[MotorId] = MotorGetPosition(MotorId); - Report("MotorMoveToStopper initial position",__FILE__,__LINE__,StoredMotorPosition[MotorId],RpWarning,Speed,0); + StoredMotorPosition[MotorId] = Read_Dryer_ENC_Position(); + Report("MotorMoveToStopper initial position",__FILE__,__LINE__,StoredMotorPosition[MotorId],RpWarning,Initialcurrentposition,0); MotorSetSpeed (MotorId, Speed); MotorControlId[MotorId] = AddControlCallback(NULL, MotorVerifiedCallBackFunction, 20,Control_Read_Dryer_Position,(IfTypeMotors*0x100+MotorId), MotorId, 0 ); MotorControlCallback[MotorId] = MotorVerifiedCallBackFunction; @@ -350,7 +356,7 @@ uint32_t MotorMoveToDrierPositionCallBackFunction(uint32_t IfIndex, uint32_t Rea //CallbackCalls = 0; } Read_Dryer_ENC_Position(); - if (abs(ReadValue - DrierZeroPosition)<5) + if (abs(ReadValue - DrierZeroPosition)<1) { Report("MotorMoveToDrierPosition end",__FILE__,__LINE__,DrierZeroPosition,RpWarning,ReadValue,0); //stop this control loop @@ -396,10 +402,11 @@ uint32_t MotorMovetoEncoderPosition (TimerMotors_t MotorId, callback_fptr callb callback(MotorId,0); return OK; } + //Report("MotorMovetoEncoderPosition direction",__FILE__,__LINE__,direction,RpWarning,15,0); //MotorSetDirection( MotorId, direction); - MotorSetSpeed (MotorId, 50); + MotorSetSpeed (MotorId, 30); MotorControlId[MotorId] = AddControlCallback(NULL, MotorMoveToDrierPositionCallBackFunction, 2,Control_Read_Dryer_Position,(IfTypeMotors*0x100+MotorId), MotorId, 0 ); MotorControlCallback[MotorId] = MotorMoveToDrierPositionCallBackFunction; return MotorControlId[MotorId]; @@ -436,9 +443,10 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO MotorId = Control_Read_Dryer_Position(0,0); Report("MotorMoveCallBackFunction",__FILE__,__LINE__,DrierZeroPosition,RpWarning,MotorId,0); } - MotorId = IfIndex&0xFF; - if (BusyFlag == NOTBUSY) + MotorTimeout[MotorId]+=MotorTimeLag[MotorId]; + + if ((BusyFlag == NOTBUSY)||((MotorTimeout[MotorId]>=MotorTimeLimit[MotorId])&&(MotorTimeLimit[MotorId]>0))) { /*if (MotorId == HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM) { @@ -451,10 +459,15 @@ uint32_t MotorMoveCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO MotorControlId[MotorId] = 0xFF; //possibly: start regular control (speed etc) //uint32_t ControlId = AddControlCallback(NULL,ControlCBFunction Callback, eOneMillisecond, (IfTypeMotors*0x100+MotorId), deviceId, Parameter ); - + if ((MotorTimeout[MotorId]>=MotorTimeLimit[MotorId])&&(MotorTimeLimit[MotorId]>0)) + { + Report("motor timeout",__FILE__,__LINE__,MotorId,RpMessage,MotorTimeout[MotorId],0); + } //call the module callback if (MotorCallback[MotorId]) + { MotorCallback[MotorId](MotorId,BusyFlag); + } } return OK; diff --git a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c index de2ceb698..b2be0d407 100644 --- a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c +++ b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.c @@ -82,6 +82,7 @@ uint32_t Read_Dryer_ENC_Position () // must call FPGA_SSI_Dryer_ENC_Transnit first! FPGA_SSI_Dryer_ENC_Receive(); FPGA_SSI_Dryer_ENC_Transnit(); + //REPORT_MSG(Dryer_ENC.Position,"Read_Dryer_ENC_Position"); return Dryer_ENC.Position; } uint32_t Control_Read_Dryer_Position(HardwareDancerType DancerId, uint32_t Parameter1) diff --git a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h index 2b3b33dff..33a961c58 100644 --- a/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h +++ b/Software/Embedded_SW/Embedded/Drivers/SSI_Comm/Dancer/Dancer.h @@ -10,7 +10,7 @@ #include "PMR/Hardware/HardwareDancerType.pb-c.h" uint32_t Read_Dancer_Position (HardwareDancerType DancerId); -uint32_t Control_Read_Dancer_Position(HardwareDancerType DancerId, uint32_t Parameter1, uint32_t Parameter2); +uint32_t Control_Read_Dancer_Position(HardwareDancerType DancerId, uint32_t Parameter1); uint32_t Read_Dryer_ENC_Position (); uint32_t Control_Read_Dryer_Position(uint32_t DryerID, uint32_t Parameter1); diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index eea72d6b5..5c16bda14 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -1114,7 +1114,8 @@ uint32_t AlarmHandlingLoop(uint32_t tick) if ((doubleValue >= (float)(AlarmItem[Alarm_i].AlarmValue*CurrentAlarmHighLimit)) || (doubleValue <= (float)(AlarmItem[Alarm_i].AlarmValue*CurrentAlarmLowLimit))) { Status = true; - ReportWithPackageFilter(AlarmFilter,"OverCurrent Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,AlarmItem[Alarm_i].EventType, RpMessage, (int)(doubleValue*100), 0); + if (AlarmState[Alarm_i].Status == false) + ReportWithPackageFilter(AlarmFilter,"OverCurrent Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,(int)(AlarmItem[Alarm_i].AlarmValue*100), RpMessage, (int)(doubleValue*100), 0); } } else @@ -1122,7 +1123,8 @@ uint32_t AlarmHandlingLoop(uint32_t tick) if (doubleValue <= 0.1) { Status = true; - ReportWithPackageFilter(AlarmFilter,"loop break Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,AlarmItem[Alarm_i].EventType, RpMessage, (int)(doubleValue*100), 0); + if (AlarmState[Alarm_i].Status == false) + ReportWithPackageFilter(AlarmFilter,"loop break Alarm ON ", __FILE__,AlarmItem[Alarm_i].DeviceId,(int)(AlarmItem[Alarm_i].AlarmValue*100), RpMessage, (int)(doubleValue*100), 0); } } diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 1605092e5..fb3fd1afb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -442,7 +442,7 @@ uint32_t MillisecLoop(uint32_t tick) /*else if(Sensor_i < MAX_HEAD_CARD_TEMP_SENS_ID) - move to the function control_HeadCard_PT100 { //HeadCard_Toggle_PT100(Sensor_i); - //deley?? + //delay?? //HeadADCPT100_SendReadDataCommand(Sensor_i); } else if(Sensor_i < MAX_WHS_CARD_TEMP_SENS_ID) diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 6b2cf0021..61767c2d6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -386,9 +386,9 @@ void DiagnosticTenMsecCollection(void) /*if (JobIsActive()== false) return;*/ - DiagnosticLoadDancer(WINDER_DANCER,Control_Read_Dancer_Position(WINDER_DANCER, 0,0)); - DiagnosticLoadDancer(POOLER_DANCER,Control_Read_Dancer_Position(POOLER_DANCER, 0,0)); - DiagnosticLoadDancer(FEEDER_DANCER,Control_Read_Dancer_Position(FEEDER_DANCER, 0,0)); + DiagnosticLoadDancer(WINDER_DANCER,Control_Read_Dancer_Position(WINDER_DANCER, 0)); + DiagnosticLoadDancer(POOLER_DANCER,Control_Read_Dancer_Position(POOLER_DANCER, 0)); + DiagnosticLoadDancer(FEEDER_DANCER,Control_Read_Dancer_Position(FEEDER_DANCER, 0)); DiagnosticLoadDancerError(WINDER_DANCER,ThreadGetMotorCalculatedError(WINDER_DANCER)); DiagnosticLoadDancerError(POOLER_DANCER,ThreadGetMotorCalculatedError(POOLER_DANCER)); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 9fdcaaf1f..28bb191fe 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -1308,6 +1308,7 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) uint32_t SegmentNumOfBrushStops = 0; double BrushStopTime = 0; +uint32_t BrushStopCounter = 0; void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers) { @@ -1383,6 +1384,13 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) int n_dispensers = 0; JobSegment* Segment = (void *)IfIndex; + if(BrushStopCounter++ < BrushStopTime) + { + return OK; + } + BrushStopCounter = 0; + + if (JobEndSequence == true) { Report("JobEndSequence",__FILE__,__LINE__,(int)JobBrushStopId,RpWarning,(int)SegmentNumOfBrushStops,0); @@ -1478,7 +1486,8 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) JobBrushStopId++; if ((BrushStopTime)&&(SegmentNumOfBrushStops > 1)) { - BrushStopControlId = AddControlCallback(NULL, IDSBrushStopRestartCallback, BrushStopTime,TemplateDataReadCBFunction ,SegmentDetails, 0, 0 ); + BrushStopCounter = BrushStopTime+10; //move the IDS brush stop handling to highest priority in timing + BrushStopControlId = AddControlCallback(NULL, IDSBrushStopRestartCallback, eOneMillisecond,TemplateDataReadCBFunction ,SegmentDetails, 0, 0 ); if (BrushStopControlId == 0xFF) { Report("Add control callback failed",__FILE__,__LINE__,(int)BrushStopTime,RpWarning,(int)0,0); diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 45cc80dff..6fd2e0eb1 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -14,6 +14,7 @@ #include "drivers/adc_sampling/adc.h" #include "drivers/Heater/TemperatureSensor.h" #include "drivers/ADC_Sampling/adc.h" +#include "drivers/Flash_ram/MCU_E2Prom.h" #include "Drivers/I2C_Communication/Head_Card/PT100/Head_PT100_ADC.h" #include "Drivers/I2C_Communication/Head_Card/Fan/fan_click.h" @@ -252,6 +253,19 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.progress = (double)OK; response.has_progress = true; + } + else + if(request->amount == 0xB1) //fast refresh for pressure + { + LOG_ERROR(request->delay,"Set loading arm center"); + Read_Dryer_ENC_Position(); + Task_sleep(500); + Read_Dryer_ENC_Position(); + Task_sleep(500); + + response.progress = (double)MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CENTER,Read_Dryer_ENC_Position(0,0)); + response.has_progress = true; + } else if((request->amount == 0xDF) && (request->delay == 0xDF)) //Power off diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 13b98bcb0..f3eb9cb60 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -40,6 +40,8 @@ #include "PMR/ThreadLoading/StartThreadLoadingResponse.pb-c.h" #include "PMR/ThreadLoading/ContinueThreadLoadingRequest.pb-c.h" #include "PMR/ThreadLoading/ContinueThreadLoadingResponse.pb-c.h" +#include "PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.h" +#include "PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.h" //#include //#include @@ -86,6 +88,7 @@ uint32_t ThreadLoadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue); uint32_t Thread_Load_Dryer_UnLoading(void); uint32_t ThreadLoadingReport(void); + bool ThreadLoaded(void); typedef struct { @@ -115,7 +118,7 @@ //uint32_t Bytes = 0; //FRESULT Fresult = FR_OK; REPORT_MSG(LoadStages, "Thread Load State Machine step"); - + load.color = BLINK; LoadStatus = OK; LoadArmInfo.LoadArmBackLash = MCU_E2PromDryerBacklashRead(); REPORT_MSG(LoadArmInfo.LoadArmBackLash, "Thread Load MCU_E2PromDryerBacklashRead"); @@ -125,8 +128,10 @@ //EEPROM_STORAGE_DRYER_CYCLES MCU_E2PromRead(EEPROM_STORAGE_DRYER_CYCLES,&LoadArmInfo.LoadArmRounds); - if (LoadArmInfo.LoadArmRounds <= 2) - LoadArmInfo.LoadArmRounds = 20; + Read_Dryer_ENC_Position(); + + //if (LoadArmInfo.LoadArmRounds <= 2) + // LoadArmInfo.LoadArmRounds = 20; Report("MotorMovetoEncoderPosition",__FILE__,__LINE__,LoadArmInfo.LoadArmRounds,RpWarning,LoadArmInfo.LoadArmBackLash,0); /*Fresult = f_mkdir(SW_INFO_DIR); @@ -225,7 +230,7 @@ WinderControlId = 0xFF; } - MotorStop(HARDWARE_MOTOR_TYPE__MOTO_SCREW,Hard_Hiz); + MotorAbortMovetoLimitSwitch(HARDWARE_MOTOR_TYPE__MOTO_SCREW); /*Task_sleep(5) MotorStop(ThreadMotorIdToMotorId[FEEDER_MOTOR],Hard_Hiz); MotorStop(ThreadMotorIdToMotorId[FEEDER_MOTOR],Hard_Hiz);*/ @@ -301,7 +306,6 @@ if (CallbackCounter) { CallbackCounter--; - load.color = BLINK; if (ReadValue != LIMIT) { //returned with a timeout @@ -321,7 +325,6 @@ else { LoadStages++; - load.color = colorON; if (LoadStages == THREAD_LOAD_CLOSE_DANCERS) { MotorSetKvalHold(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, keepkvalhold); @@ -332,7 +335,7 @@ } else { - load.color = fastBILNK; + load.color = colorON; ThreadLoadingReport(); } } @@ -402,6 +405,7 @@ uint32_t Thread_Load_Initial_Tension(void) //Check Spool Presence, run Winder Until Break Sensor Is Identifieing Movement For A Second { REPORT_MSG(LoadStages, "Thread Load State Machine step"); + load.color = BLINK; if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT) { REPORT_MSG(LIMIT, "No cone in winder"); @@ -525,30 +529,57 @@ } float numberOfSteps = 0; float numberOfCycles = 0; + uint32_t DrierPrevLocation = 0; uint32_t Thread_Load_Dryer_Loading_Callback(uint32_t MotorId, uint32_t ReadValue) { numberOfCycles++; - //Report("Thread_Load_Dryer_Loading_Callback",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0); - //Report("Thread_Load_Dryer_Loading_Callback details",__FILE__,(int)(TotalLoadedLen),numberOfCycles,RpMessage,CallbackCounter,0); - if (LoadStages != THREAD_LOAD_DRYER_LOADING) - { - return OK; - } - if (numberOfCycles20 )&&(ReadValue == NOTBUSY)) { - MotorMoveWithCallback (HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM, MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM].directionthreadwize, - numberOfSteps, Thread_Load_Dryer_Loading_Callback, 100000); + DrierPrevLocation = temp; + //Report("Thread_Load_Dryer_Loading_Callback",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0); + //Report("Thread_Load_Dryer_Loading_Callback details",__FILE__,(int)(TotalLoadedLen),numberOfCycles,RpMessage,CallbackCounter,0); + if (LoadStages != THREAD_LOAD_DRYER_LOADING) + { + return OK; + } + if (numberOfCycles20 )&&(ReadValue == NOTBUSY)) + { + DrierPrevLocation = temp; + //Report("Thread_Load_Dryer_Loading_Callback",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0); + //Report("Thread_Load_Dryer_Loading_Callback details",__FILE__,(int)(TotalLoadedLen),numberOfCycles,RpMessage,CallbackCounter,0); + if (LoadStages != THREAD_LOAD_SET_LOAD_ARM_TO_START_POSITION) + { + return OK; + } + if (numberOfCyclesdata.len, requestContainer->data.data); ustrncpy (ThreadLoadingToken, requestContainer->token,36); MessageState = 1; + Report("StartThreadLoadingFunc",__FILE__,__LINE__,0,RpWarning,(int)LoadStages,0); ThreadLoadingReport(); return OK; @@ -1149,6 +1287,14 @@ uint32_t ContinueThreadLoadingFunc(MessageContainer* requestContainer) MessageContainer responseContainer; MessageState = 2; ThreadLoadingReport(); + if (request->processparameters) + { + dryerbufferlength = request->processparameters->dryerbufferlength; + LoadArmInfo.LoadArmRounds = (int)(request->processparameters->dryerbufferlength); + + } + Report("ContinueThreadLoadingFunc",__FILE__,__LINE__,(int)(request->processparameters->dryerbufferlength),RpWarning,(int)LoadStages,0); + responseContainer = createContainer(MESSAGE_TYPE__ContinueThreadLoadingResponse, requestContainer->token, true, &Cresponse, &continue_thread_loading_response__pack, &continue_thread_loading_response__get_packed_size); responseContainer.continuous = false; uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); @@ -1158,3 +1304,21 @@ uint32_t ContinueThreadLoadingFunc(MessageContainer* requestContainer) return OK; } +uint32_t StopThreadLoadingFunc(MessageContainer* requestContainer) +{ + StopThreadLoadingRequest *request = stop_thread_loading_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); + StopThreadLoadingResponse Cresponse = STOP_THREAD_LOADING_RESPONSE__INIT; + MessageContainer responseContainer; + MessageState = 2; + Thread_Load_End(); + Report("StopThreadLoadingFunc",__FILE__,__LINE__,(int)(request->processparameters->dryerbufferlength),RpWarning,(int)LoadStages,0); + + responseContainer = createContainer(MESSAGE_TYPE__StopThreadLoadingResponse, requestContainer->token, true, &Cresponse, &stop_thread_loading_response__pack, &stop_thread_loading_response__get_packed_size); + responseContainer.continuous = false; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + SendChars((char*)container_buffer, container_size); + return OK; + +} diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 4db985954..f0b709ff2 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -143,9 +143,9 @@ uint32_t Winder_Prepare(void *JobDetails) if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT) { REPORT_MSG(LIMIT, "No cone in winder"); - // PrepareReady(Module_Winder,ModuleFail); - // AlarmHandlingSetAlarm(EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST,true); - // return ERROR; + PrepareReady(Module_Winder,ModuleFail); + AlarmHandlingSetAlarm(EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST,true); + return ERROR; } #ifdef READ_SCREW_ENCODER diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h index cc0bf6c77..dd9395248 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h @@ -76,6 +76,7 @@ void ThreadLoadRequest(MessageContainer* requestContainer); uint32_t StartThreadLoadingFunc(MessageContainer* requestContainer); uint32_t ContinueThreadLoadingFunc(MessageContainer* requestContainer); +uint32_t StopThreadLoadingFunc(MessageContainer* requestContainer); uint32_t Thread_Load_End(void); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index 0df950f34..fb3b78752 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -170,7 +170,7 @@ uint32_t StoreDancerConfigMessage() Dancers[Dancer_i].has_zeropoint = true; Dancers[Dancer_i].hardwaredancertype = Dancer_i; Dancers[Dancer_i].has_hardwaredancertype = true; - DancerConfig.dancers[Dancer_i]->zeropoint=Control_Read_Dancer_Position(Dancer_i,0,0); + DancerConfig.dancers[Dancer_i]->zeropoint=Control_Read_Dancer_Position(Dancer_i,0); DancerConfig.n_dancers++; DancersCfg[Dancer_i].zeropoint = DancerConfig.dancers[Dancer_i]->zeropoint; } -- cgit v1.3.1