From 10ec78ea3dee66328ca50cd7bfbc2c6acd52264b Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 4 Oct 2018 11:34:57 +0300 Subject: Heater state in diagnostics. new error codes. --- .../Communication/PMR/Common/ErrorCode.pb-c.c | 36 +++-- .../Communication/PMR/Common/ErrorCode.pb-c.h | 10 +- .../Communication/PMR/Common/MessageType.pb-c.c | 74 +++++----- .../Communication/PMR/Common/MessageType.pb-c.h | 4 + .../PMR/Diagnostics/HeaterState.pb-c.c | 157 +++++++++++++++++++++ .../PMR/Diagnostics/HeaterState.pb-c.h | 83 +++++++++++ .../PMR/Diagnostics/HeaterType.pb-c.c | 45 ++++++ .../PMR/Diagnostics/HeaterType.pb-c.h | 47 ++++++ .../PMR/Diagnostics/SetBlowerStateRequest.pb-c.c | 118 ++++++++++++++++ .../PMR/Diagnostics/SetBlowerStateRequest.pb-c.h | 77 ++++++++++ .../PMR/Diagnostics/SetBlowerStateResponse.pb-c.c | 72 ++++++++++ .../PMR/Diagnostics/SetBlowerStateResponse.pb-c.h | 70 +++++++++ .../PMR/Diagnostics/SetHeaterStateRequest.pb-c.c | 118 ++++++++++++++++ .../PMR/Diagnostics/SetHeaterStateRequest.pb-c.h | 77 ++++++++++ .../PMR/Diagnostics/SetHeaterStateResponse.pb-c.c | 72 ++++++++++ .../PMR/Diagnostics/SetHeaterStateResponse.pb-c.h | 70 +++++++++ .../Diagnostics/StartDiagnosticsResponse.pb-c.c | 19 ++- .../Diagnostics/StartDiagnosticsResponse.pb-c.h | 5 +- .../Embedded_SW/Embedded/Drivers/Heater/Heater.c | 4 +- .../Embedded_SW/Embedded/Drivers/Heater/Heater.h | 2 +- Software/Embedded_SW/Embedded/Embedded.cfg | 2 +- .../Embedded/Modules/Control/MillisecTask.c | 1 + .../Embedded/Modules/Diagnostics/Diagnostics.c | 18 +++ .../Embedded_SW/Embedded/Modules/General/process.c | 17 ++- .../Embedded/Modules/Heaters/Heaters_ex.h | 4 + .../Embedded/Modules/Heaters/Heaters_print.c | 22 +++ .../Embedded/Modules/Thread/Thread_print.c | 2 +- .../Embedded/StateMachines/Printing/JobSTM.c | 4 +- .../Embedded/StateMachines/Printing/PrintingSTM.h | 5 +- 29 files changed, 1179 insertions(+), 56 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterState.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterState.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterType.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterType.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateResponse.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateResponse.pb-c.h (limited to 'Software/Embedded_SW/Embedded') diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/ErrorCode.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Common/ErrorCode.pb-c.c index 0c2344f54..5ed8450bc 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/ErrorCode.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/ErrorCode.pb-c.c @@ -7,7 +7,7 @@ #endif #include "ErrorCode.pb-c.h" -static const ProtobufCEnumValue error_code__enum_values_by_number[11] = +static const ProtobufCEnumValue error_code__enum_values_by_number[19] = { { "NONE", "ERROR_CODE__NONE", 0 }, { "GENERAL_ERROR", "ERROR_CODE__GENERAL_ERROR", 1 }, @@ -16,25 +16,41 @@ static const ProtobufCEnumValue error_code__enum_values_by_number[11] = { "UNAUTHORIZED_CONNECTION", "ERROR_CODE__UNAUTHORIZED_CONNECTION", 4 }, { "CONTINUOUS_RESPONSE_ABORTED", "ERROR_CODE__CONTINUOUS_RESPONSE_ABORTED", 5 }, { "JOB_FAILED", "ERROR_CODE__JOB_FAILED", 6 }, + { "INVALID_PARAMETER", "ERROR_CODE__INVALID_PARAMETER", 7 }, { "INVALID_UPLOAD_ID", "ERROR_CODE__INVALID_UPLOAD_ID", 1000 }, { "FILE_NOT_FOUND", "ERROR_CODE__FILE_NOT_FOUND", 1001 }, { "INVALID_PROCESS_ID", "ERROR_CODE__INVALID_PROCESS_ID", 1002 }, { "FILE_LENGTH_OUT_OF_RANGE", "ERROR_CODE__FILE_LENGTH_OUT_OF_RANGE", 1003 }, + { "JOB_UNSPECIFIED_ERROR", "ERROR_CODE__JOB_UNSPECIFIED_ERROR", 2000 }, + { "JOB_THREAD_BREAK", "ERROR_CODE__JOB_THREAD_BREAK", 2001 }, + { "JOB_WINDER_DANCER_FAIL", "ERROR_CODE__JOB_WINDER_DANCER_FAIL", 2002 }, + { "JOB_POOLER_DANCER_FAIL", "ERROR_CODE__JOB_POOLER_DANCER_FAIL", 2003 }, + { "JOB_FEEDER_DANCER_FAIL", "ERROR_CODE__JOB_FEEDER_DANCER_FAIL", 2004 }, + { "JOB_OUT_OF_DYE", "ERROR_CODE__JOB_OUT_OF_DYE", 2005 }, + { "JOB_OTHER_ALARM", "ERROR_CODE__JOB_OTHER_ALARM", 2006 }, }; static const ProtobufCIntRange error_code__value_ranges[] = { -{0, 0},{1000, 7},{0, 11} +{0, 0},{1000, 8},{2000, 12},{0, 19} }; -static const ProtobufCEnumValueIndex error_code__enum_values_by_name[11] = +static const ProtobufCEnumValueIndex error_code__enum_values_by_name[19] = { { "BAD_CRC", 2 }, { "CONTINUOUS_RESPONSE_ABORTED", 5 }, - { "FILE_LENGTH_OUT_OF_RANGE", 10 }, - { "FILE_NOT_FOUND", 8 }, + { "FILE_LENGTH_OUT_OF_RANGE", 11 }, + { "FILE_NOT_FOUND", 9 }, { "GENERAL_ERROR", 1 }, { "INVALID_DIGITAL_PIN_NUMBER", 3 }, - { "INVALID_PROCESS_ID", 9 }, - { "INVALID_UPLOAD_ID", 7 }, + { "INVALID_PARAMETER", 7 }, + { "INVALID_PROCESS_ID", 10 }, + { "INVALID_UPLOAD_ID", 8 }, { "JOB_FAILED", 6 }, + { "JOB_FEEDER_DANCER_FAIL", 16 }, + { "JOB_OTHER_ALARM", 18 }, + { "JOB_OUT_OF_DYE", 17 }, + { "JOB_POOLER_DANCER_FAIL", 15 }, + { "JOB_THREAD_BREAK", 13 }, + { "JOB_UNSPECIFIED_ERROR", 12 }, + { "JOB_WINDER_DANCER_FAIL", 14 }, { "NONE", 0 }, { "UNAUTHORIZED_CONNECTION", 4 }, }; @@ -45,11 +61,11 @@ const ProtobufCEnumDescriptor error_code__descriptor = "ErrorCode", "ErrorCode", "", - 11, + 19, error_code__enum_values_by_number, - 11, + 19, error_code__enum_values_by_name, - 2, + 3, error_code__value_ranges, NULL,NULL,NULL,NULL /* reserved[1234] */ }; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Common/ErrorCode.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Common/ErrorCode.pb-c.h index 0dea39047..c6c69bd2b 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Common/ErrorCode.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Common/ErrorCode.pb-c.h @@ -27,10 +27,18 @@ typedef enum _ErrorCode { ERROR_CODE__UNAUTHORIZED_CONNECTION = 4, ERROR_CODE__CONTINUOUS_RESPONSE_ABORTED = 5, ERROR_CODE__JOB_FAILED = 6, + ERROR_CODE__INVALID_PARAMETER = 7, ERROR_CODE__INVALID_UPLOAD_ID = 1000, ERROR_CODE__FILE_NOT_FOUND = 1001, ERROR_CODE__INVALID_PROCESS_ID = 1002, - ERROR_CODE__FILE_LENGTH_OUT_OF_RANGE = 1003 + ERROR_CODE__FILE_LENGTH_OUT_OF_RANGE = 1003, + ERROR_CODE__JOB_UNSPECIFIED_ERROR = 2000, + ERROR_CODE__JOB_THREAD_BREAK = 2001, + ERROR_CODE__JOB_WINDER_DANCER_FAIL = 2002, + ERROR_CODE__JOB_POOLER_DANCER_FAIL = 2003, + ERROR_CODE__JOB_FEEDER_DANCER_FAIL = 2004, + ERROR_CODE__JOB_OUT_OF_DYE = 2005, + ERROR_CODE__JOB_OTHER_ALARM = 2006 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(ERROR_CODE) } ErrorCode; 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 36339d7ff..888d4732c 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[169] = +static const ProtobufCEnumValue message_type__enum_values_by_number[173] = { { "None", "MESSAGE_TYPE__None", 0 }, { "ErrorResponse", "MESSAGE_TYPE__ErrorResponse", 1 }, @@ -150,6 +150,10 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[169] = { "StartEventsNotificationResponse", "MESSAGE_TYPE__StartEventsNotificationResponse", 2031 }, { "StopEventsNotificationRequest", "MESSAGE_TYPE__StopEventsNotificationRequest", 2032 }, { "StopEventsNotificationResponse", "MESSAGE_TYPE__StopEventsNotificationResponse", 2033 }, + { "SetHeaterStateRequest", "MESSAGE_TYPE__SetHeaterStateRequest", 2034 }, + { "SetHeaterStateResponse", "MESSAGE_TYPE__SetHeaterStateResponse", 2035 }, + { "SetBlowerStateRequest", "MESSAGE_TYPE__SetBlowerStateRequest", 2036 }, + { "SetBlowerStateResponse", "MESSAGE_TYPE__SetBlowerStateResponse", 2037 }, { "JobRequest", "MESSAGE_TYPE__JobRequest", 3000 }, { "JobResponse", "MESSAGE_TYPE__JobResponse", 3001 }, { "AbortJobRequest", "MESSAGE_TYPE__AbortJobRequest", 3002 }, @@ -180,20 +184,20 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[169] = { "KillProcessResponse", "MESSAGE_TYPE__KillProcessResponse", 7007 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 2},{1000, 98},{2000, 107},{3000, 141},{4000, 147},{5000, 151},{6000, 155},{7000, 161},{0, 169} +{0, 0},{3, 2},{1000, 98},{2000, 107},{3000, 145},{4000, 151},{5000, 155},{6000, 159},{7000, 165},{0, 173} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[169] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[173] = { - { "AbortJobRequest", 143 }, - { "AbortJobResponse", 144 }, + { "AbortJobRequest", 147 }, + { "AbortJobResponse", 148 }, { "CalculateRequest", 2 }, { "CalculateResponse", 3 }, - { "ConnectRequest", 157 }, - { "ConnectResponse", 158 }, + { "ConnectRequest", 161 }, + { "ConnectResponse", 162 }, { "DirectSynchronizationRequest", 103 }, { "DirectSynchronizationResponse", 104 }, - { "DisconnectRequest", 159 }, - { "DisconnectResponse", 160 }, + { "DisconnectRequest", 163 }, + { "DisconnectResponse", 164 }, { "DispenserAbortHomingRequest", 117 }, { "DispenserAbortHomingResponse", 118 }, { "DispenserAbortJoggingRequest", 123 }, @@ -203,23 +207,23 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[169] = { "DispenserJoggingRequest", 121 }, { "DispenserJoggingResponse", 122 }, { "ErrorResponse", 1 }, - { "ExecuteProcessRequest", 165 }, - { "ExecuteProcessResponse", 166 }, + { "ExecuteProcessRequest", 169 }, + { "ExecuteProcessResponse", 170 }, { "ExternalBridgeLoginRequest", 99 }, { "ExternalBridgeLoginResponse", 100 }, { "ExternalBridgeLogoutRequest", 101 }, { "ExternalBridgeLogoutResponse", 102 }, { "ExternalBridgeUdpDiscoveryPacket", 98 }, - { "FileChunkUploadRequest", 163 }, - { "FileChunkUploadResponse", 164 }, - { "FileUploadRequest", 161 }, - { "FileUploadResponse", 162 }, - { "JobRequest", 141 }, - { "JobResponse", 142 }, - { "KeepAliveRequest", 155 }, - { "KeepAliveResponse", 156 }, - { "KillProcessRequest", 167 }, - { "KillProcessResponse", 168 }, + { "FileChunkUploadRequest", 167 }, + { "FileChunkUploadResponse", 168 }, + { "FileUploadRequest", 165 }, + { "FileUploadResponse", 166 }, + { "JobRequest", 145 }, + { "JobResponse", 146 }, + { "KeepAliveRequest", 159 }, + { "KeepAliveResponse", 160 }, + { "KillProcessRequest", 171 }, + { "KillProcessResponse", 172 }, { "MotorAbortHomingRequest", 109 }, { "MotorAbortHomingResponse", 110 }, { "MotorAbortJoggingRequest", 115 }, @@ -235,18 +239,22 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[169] = { "ProgressResponse", 5 }, { "ResolveEventRequest", 133 }, { "ResolveEventResponse", 134 }, + { "SetBlowerStateRequest", 143 }, + { "SetBlowerStateResponse", 144 }, { "SetComponentValueRequest", 131 }, { "SetComponentValueResponse", 132 }, { "SetDigitalOutRequest", 125 }, { "SetDigitalOutResponse", 126 }, - { "StartDebugLogRequest", 147 }, - { "StartDebugLogResponse", 148 }, + { "SetHeaterStateRequest", 141 }, + { "SetHeaterStateResponse", 142 }, + { "StartDebugLogRequest", 151 }, + { "StartDebugLogResponse", 152 }, { "StartDiagnosticsRequest", 107 }, { "StartDiagnosticsResponse", 108 }, { "StartEventsNotificationRequest", 137 }, { "StartEventsNotificationResponse", 138 }, - { "StopDebugLogRequest", 149 }, - { "StopDebugLogResponse", 150 }, + { "StopDebugLogRequest", 153 }, + { "StopDebugLogResponse", 154 }, { "StopDiagnosticsRequest", 135 }, { "StopDiagnosticsResponse", 136 }, { "StopEventsNotificationRequest", 139 }, @@ -343,16 +351,16 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[169] = { "StubTivaWriteRegResponse", 79 }, { "StubValveRequest", 30 }, { "StubValveResponse", 31 }, - { "SystemResetRequest", 153 }, - { "SystemResetResponse", 154 }, + { "SystemResetRequest", 157 }, + { "SystemResetResponse", 158 }, { "ThreadAbortJoggingRequest", 129 }, { "ThreadAbortJoggingResponse", 130 }, { "ThreadJoggingRequest", 127 }, { "ThreadJoggingResponse", 128 }, - { "UploadHardwareConfigurationRequest", 151 }, - { "UploadHardwareConfigurationResponse", 152 }, - { "UploadProcessParametersRequest", 145 }, - { "UploadProcessParametersResponse", 146 }, + { "UploadHardwareConfigurationRequest", 155 }, + { "UploadHardwareConfigurationResponse", 156 }, + { "UploadProcessParametersRequest", 149 }, + { "UploadProcessParametersResponse", 150 }, }; const ProtobufCEnumDescriptor message_type__descriptor = { @@ -361,9 +369,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "MessageType", "MessageType", "", - 169, + 173, message_type__enum_values_by_number, - 169, + 173, message_type__enum_values_by_name, 9, 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 bc5f4286e..11e07a519 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 @@ -161,6 +161,10 @@ typedef enum _MessageType { MESSAGE_TYPE__StartEventsNotificationResponse = 2031, MESSAGE_TYPE__StopEventsNotificationRequest = 2032, MESSAGE_TYPE__StopEventsNotificationResponse = 2033, + MESSAGE_TYPE__SetHeaterStateRequest = 2034, + MESSAGE_TYPE__SetHeaterStateResponse = 2035, + MESSAGE_TYPE__SetBlowerStateRequest = 2036, + MESSAGE_TYPE__SetBlowerStateResponse = 2037, MESSAGE_TYPE__JobRequest = 3000, MESSAGE_TYPE__JobResponse = 3001, MESSAGE_TYPE__AbortJobRequest = 3002, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterState.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterState.pb-c.c new file mode 100644 index 000000000..50b089e64 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterState.pb-c.c @@ -0,0 +1,157 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HeaterState.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HeaterState.pb-c.h" +void heater_state__init + (HeaterState *message) +{ + static const HeaterState init_value = HEATER_STATE__INIT; + *message = init_value; +} +size_t heater_state__get_packed_size + (const HeaterState *message) +{ + assert(message->base.descriptor == &heater_state__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t heater_state__pack + (const HeaterState *message, + uint8_t *out) +{ + assert(message->base.descriptor == &heater_state__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t heater_state__pack_to_buffer + (const HeaterState *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &heater_state__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +HeaterState * + heater_state__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (HeaterState *) + protobuf_c_message_unpack (&heater_state__descriptor, + allocator, len, data); +} +void heater_state__free_unpacked + (HeaterState *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &heater_state__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor heater_state__field_descriptors[6] = +{ + { + "HeaterType", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(HeaterState, has_heatertype), + offsetof(HeaterState, heatertype), + &heater_type__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SetPoint", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HeaterState, has_setpoint), + offsetof(HeaterState, setpoint), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "CurrentValue", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HeaterState, has_currentvalue), + offsetof(HeaterState, currentvalue), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "IsActive", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(HeaterState, has_isactive), + offsetof(HeaterState, isactive), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "IsRampingUp", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(HeaterState, has_isrampingup), + offsetof(HeaterState, isrampingup), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "IsInSetPoint", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(HeaterState, has_isinsetpoint), + offsetof(HeaterState, isinsetpoint), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned heater_state__field_indices_by_name[] = { + 2, /* field[2] = CurrentValue */ + 0, /* field[0] = HeaterType */ + 3, /* field[3] = IsActive */ + 5, /* field[5] = IsInSetPoint */ + 4, /* field[4] = IsRampingUp */ + 1, /* field[1] = SetPoint */ +}; +static const ProtobufCIntRange heater_state__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 6 } +}; +const ProtobufCMessageDescriptor heater_state__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "HeaterState", + "HeaterState", + "HeaterState", + "", + sizeof(HeaterState), + 6, + heater_state__field_descriptors, + heater_state__field_indices_by_name, + 1, heater_state__number_ranges, + (ProtobufCMessageInit) heater_state__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterState.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterState.pb-c.h new file mode 100644 index 000000000..b0f3fa432 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterState.pb-c.h @@ -0,0 +1,83 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HeaterState.proto */ + +#ifndef PROTOBUF_C_HeaterState_2eproto__INCLUDED +#define PROTOBUF_C_HeaterState_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 "HeaterType.pb-c.h" + +typedef struct _HeaterState HeaterState; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _HeaterState +{ + ProtobufCMessage base; + protobuf_c_boolean has_heatertype; + HeaterType heatertype; + protobuf_c_boolean has_setpoint; + double setpoint; + protobuf_c_boolean has_currentvalue; + double currentvalue; + protobuf_c_boolean has_isactive; + protobuf_c_boolean isactive; + protobuf_c_boolean has_isrampingup; + protobuf_c_boolean isrampingup; + protobuf_c_boolean has_isinsetpoint; + protobuf_c_boolean isinsetpoint; +}; +#define HEATER_STATE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&heater_state__descriptor) \ + , 0, HEATER_TYPE__HeaterZone1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* HeaterState methods */ +void heater_state__init + (HeaterState *message); +size_t heater_state__get_packed_size + (const HeaterState *message); +size_t heater_state__pack + (const HeaterState *message, + uint8_t *out); +size_t heater_state__pack_to_buffer + (const HeaterState *message, + ProtobufCBuffer *buffer); +HeaterState * + heater_state__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void heater_state__free_unpacked + (HeaterState *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*HeaterState_Closure) + (const HeaterState *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor heater_state__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HeaterState_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterType.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterType.pb-c.c new file mode 100644 index 000000000..8f2ed0993 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterType.pb-c.c @@ -0,0 +1,45 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HeaterType.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HeaterType.pb-c.h" +static const ProtobufCEnumValue heater_type__enum_values_by_number[6] = +{ + { "HeaterZone1", "HEATER_TYPE__HeaterZone1", 0 }, + { "HeaterZone2", "HEATER_TYPE__HeaterZone2", 1 }, + { "HeaterZone3", "HEATER_TYPE__HeaterZone3", 2 }, + { "HeaterZone4", "HEATER_TYPE__HeaterZone4", 3 }, + { "HeaterZone5", "HEATER_TYPE__HeaterZone5", 4 }, + { "HeaterZone6", "HEATER_TYPE__HeaterZone6", 5 }, +}; +static const ProtobufCIntRange heater_type__value_ranges[] = { +{0, 0},{0, 6} +}; +static const ProtobufCEnumValueIndex heater_type__enum_values_by_name[6] = +{ + { "HeaterZone1", 0 }, + { "HeaterZone2", 1 }, + { "HeaterZone3", 2 }, + { "HeaterZone4", 3 }, + { "HeaterZone5", 4 }, + { "HeaterZone6", 5 }, +}; +const ProtobufCEnumDescriptor heater_type__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "HeaterType", + "HeaterType", + "HeaterType", + "", + 6, + heater_type__enum_values_by_number, + 6, + heater_type__enum_values_by_name, + 1, + heater_type__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterType.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterType.pb-c.h new file mode 100644 index 000000000..bef4859f4 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/HeaterType.pb-c.h @@ -0,0 +1,47 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HeaterType.proto */ + +#ifndef PROTOBUF_C_HeaterType_2eproto__INCLUDED +#define PROTOBUF_C_HeaterType_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 _HeaterType { + HEATER_TYPE__HeaterZone1 = 0, + HEATER_TYPE__HeaterZone2 = 1, + HEATER_TYPE__HeaterZone3 = 2, + HEATER_TYPE__HeaterZone4 = 3, + HEATER_TYPE__HeaterZone5 = 4, + HEATER_TYPE__HeaterZone6 = 5 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(HEATER_TYPE) +} HeaterType; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor heater_type__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HeaterType_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateRequest.pb-c.c new file mode 100644 index 000000000..6ad948128 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateRequest.pb-c.c @@ -0,0 +1,118 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetBlowerStateRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "SetBlowerStateRequest.pb-c.h" +void set_blower_state_request__init + (SetBlowerStateRequest *message) +{ + static const SetBlowerStateRequest init_value = SET_BLOWER_STATE_REQUEST__INIT; + *message = init_value; +} +size_t set_blower_state_request__get_packed_size + (const SetBlowerStateRequest *message) +{ + assert(message->base.descriptor == &set_blower_state_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t set_blower_state_request__pack + (const SetBlowerStateRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &set_blower_state_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t set_blower_state_request__pack_to_buffer + (const SetBlowerStateRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &set_blower_state_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +SetBlowerStateRequest * + set_blower_state_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (SetBlowerStateRequest *) + protobuf_c_message_unpack (&set_blower_state_request__descriptor, + allocator, len, data); +} +void set_blower_state_request__free_unpacked + (SetBlowerStateRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &set_blower_state_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor set_blower_state_request__field_descriptors[3] = +{ + { + "BlowerType", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(SetBlowerStateRequest, has_blowertype), + offsetof(SetBlowerStateRequest, blowertype), + &hardware_blower_type__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Voltage", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(SetBlowerStateRequest, has_voltage), + offsetof(SetBlowerStateRequest, voltage), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "IsActive", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(SetBlowerStateRequest, has_isactive), + offsetof(SetBlowerStateRequest, isactive), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned set_blower_state_request__field_indices_by_name[] = { + 0, /* field[0] = BlowerType */ + 2, /* field[2] = IsActive */ + 1, /* field[1] = Voltage */ +}; +static const ProtobufCIntRange set_blower_state_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor set_blower_state_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "SetBlowerStateRequest", + "SetBlowerStateRequest", + "SetBlowerStateRequest", + "", + sizeof(SetBlowerStateRequest), + 3, + set_blower_state_request__field_descriptors, + set_blower_state_request__field_indices_by_name, + 1, set_blower_state_request__number_ranges, + (ProtobufCMessageInit) set_blower_state_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateRequest.pb-c.h new file mode 100644 index 000000000..66e97097e --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateRequest.pb-c.h @@ -0,0 +1,77 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetBlowerStateRequest.proto */ + +#ifndef PROTOBUF_C_SetBlowerStateRequest_2eproto__INCLUDED +#define PROTOBUF_C_SetBlowerStateRequest_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 "HardwareBlowerType.pb-c.h" + +typedef struct _SetBlowerStateRequest SetBlowerStateRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _SetBlowerStateRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_blowertype; + HardwareBlowerType blowertype; + protobuf_c_boolean has_voltage; + double voltage; + protobuf_c_boolean has_isactive; + protobuf_c_boolean isactive; +}; +#define SET_BLOWER_STATE_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&set_blower_state_request__descriptor) \ + , 0, HARDWARE_BLOWER_TYPE__DefaultBlower, 0, 0, 0, 0 } + + +/* SetBlowerStateRequest methods */ +void set_blower_state_request__init + (SetBlowerStateRequest *message); +size_t set_blower_state_request__get_packed_size + (const SetBlowerStateRequest *message); +size_t set_blower_state_request__pack + (const SetBlowerStateRequest *message, + uint8_t *out); +size_t set_blower_state_request__pack_to_buffer + (const SetBlowerStateRequest *message, + ProtobufCBuffer *buffer); +SetBlowerStateRequest * + set_blower_state_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void set_blower_state_request__free_unpacked + (SetBlowerStateRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*SetBlowerStateRequest_Closure) + (const SetBlowerStateRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor set_blower_state_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_SetBlowerStateRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateResponse.pb-c.c new file mode 100644 index 000000000..c2a49685e --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetBlowerStateResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "SetBlowerStateResponse.pb-c.h" +void set_blower_state_response__init + (SetBlowerStateResponse *message) +{ + static const SetBlowerStateResponse init_value = SET_BLOWER_STATE_RESPONSE__INIT; + *message = init_value; +} +size_t set_blower_state_response__get_packed_size + (const SetBlowerStateResponse *message) +{ + assert(message->base.descriptor == &set_blower_state_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t set_blower_state_response__pack + (const SetBlowerStateResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &set_blower_state_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t set_blower_state_response__pack_to_buffer + (const SetBlowerStateResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &set_blower_state_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +SetBlowerStateResponse * + set_blower_state_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (SetBlowerStateResponse *) + protobuf_c_message_unpack (&set_blower_state_response__descriptor, + allocator, len, data); +} +void set_blower_state_response__free_unpacked + (SetBlowerStateResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &set_blower_state_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define set_blower_state_response__field_descriptors NULL +#define set_blower_state_response__field_indices_by_name NULL +#define set_blower_state_response__number_ranges NULL +const ProtobufCMessageDescriptor set_blower_state_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "SetBlowerStateResponse", + "SetBlowerStateResponse", + "SetBlowerStateResponse", + "", + sizeof(SetBlowerStateResponse), + 0, + set_blower_state_response__field_descriptors, + set_blower_state_response__field_indices_by_name, + 0, set_blower_state_response__number_ranges, + (ProtobufCMessageInit) set_blower_state_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateResponse.pb-c.h new file mode 100644 index 000000000..0668bfa02 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetBlowerStateResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetBlowerStateResponse.proto */ + +#ifndef PROTOBUF_C_SetBlowerStateResponse_2eproto__INCLUDED +#define PROTOBUF_C_SetBlowerStateResponse_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 _SetBlowerStateResponse SetBlowerStateResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _SetBlowerStateResponse +{ + ProtobufCMessage base; +}; +#define SET_BLOWER_STATE_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&set_blower_state_response__descriptor) \ + } + + +/* SetBlowerStateResponse methods */ +void set_blower_state_response__init + (SetBlowerStateResponse *message); +size_t set_blower_state_response__get_packed_size + (const SetBlowerStateResponse *message); +size_t set_blower_state_response__pack + (const SetBlowerStateResponse *message, + uint8_t *out); +size_t set_blower_state_response__pack_to_buffer + (const SetBlowerStateResponse *message, + ProtobufCBuffer *buffer); +SetBlowerStateResponse * + set_blower_state_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void set_blower_state_response__free_unpacked + (SetBlowerStateResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*SetBlowerStateResponse_Closure) + (const SetBlowerStateResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor set_blower_state_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_SetBlowerStateResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateRequest.pb-c.c new file mode 100644 index 000000000..9ab9ac030 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateRequest.pb-c.c @@ -0,0 +1,118 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetHeaterStateRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "SetHeaterStateRequest.pb-c.h" +void set_heater_state_request__init + (SetHeaterStateRequest *message) +{ + static const SetHeaterStateRequest init_value = SET_HEATER_STATE_REQUEST__INIT; + *message = init_value; +} +size_t set_heater_state_request__get_packed_size + (const SetHeaterStateRequest *message) +{ + assert(message->base.descriptor == &set_heater_state_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t set_heater_state_request__pack + (const SetHeaterStateRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &set_heater_state_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t set_heater_state_request__pack_to_buffer + (const SetHeaterStateRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &set_heater_state_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +SetHeaterStateRequest * + set_heater_state_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (SetHeaterStateRequest *) + protobuf_c_message_unpack (&set_heater_state_request__descriptor, + allocator, len, data); +} +void set_heater_state_request__free_unpacked + (SetHeaterStateRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &set_heater_state_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor set_heater_state_request__field_descriptors[3] = +{ + { + "HeaterType", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(SetHeaterStateRequest, has_heatertype), + offsetof(SetHeaterStateRequest, heatertype), + &heater_type__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SetPoint", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(SetHeaterStateRequest, has_setpoint), + offsetof(SetHeaterStateRequest, setpoint), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "IsActive", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(SetHeaterStateRequest, has_isactive), + offsetof(SetHeaterStateRequest, isactive), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned set_heater_state_request__field_indices_by_name[] = { + 0, /* field[0] = HeaterType */ + 2, /* field[2] = IsActive */ + 1, /* field[1] = SetPoint */ +}; +static const ProtobufCIntRange set_heater_state_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor set_heater_state_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "SetHeaterStateRequest", + "SetHeaterStateRequest", + "SetHeaterStateRequest", + "", + sizeof(SetHeaterStateRequest), + 3, + set_heater_state_request__field_descriptors, + set_heater_state_request__field_indices_by_name, + 1, set_heater_state_request__number_ranges, + (ProtobufCMessageInit) set_heater_state_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateRequest.pb-c.h new file mode 100644 index 000000000..6f2f30d8a --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateRequest.pb-c.h @@ -0,0 +1,77 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetHeaterStateRequest.proto */ + +#ifndef PROTOBUF_C_SetHeaterStateRequest_2eproto__INCLUDED +#define PROTOBUF_C_SetHeaterStateRequest_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 "HeaterType.pb-c.h" + +typedef struct _SetHeaterStateRequest SetHeaterStateRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _SetHeaterStateRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_heatertype; + HeaterType heatertype; + protobuf_c_boolean has_setpoint; + double setpoint; + protobuf_c_boolean has_isactive; + protobuf_c_boolean isactive; +}; +#define SET_HEATER_STATE_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&set_heater_state_request__descriptor) \ + , 0, HEATER_TYPE__HeaterZone1, 0, 0, 0, 0 } + + +/* SetHeaterStateRequest methods */ +void set_heater_state_request__init + (SetHeaterStateRequest *message); +size_t set_heater_state_request__get_packed_size + (const SetHeaterStateRequest *message); +size_t set_heater_state_request__pack + (const SetHeaterStateRequest *message, + uint8_t *out); +size_t set_heater_state_request__pack_to_buffer + (const SetHeaterStateRequest *message, + ProtobufCBuffer *buffer); +SetHeaterStateRequest * + set_heater_state_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void set_heater_state_request__free_unpacked + (SetHeaterStateRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*SetHeaterStateRequest_Closure) + (const SetHeaterStateRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor set_heater_state_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_SetHeaterStateRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateResponse.pb-c.c new file mode 100644 index 000000000..fcb3978d6 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetHeaterStateResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "SetHeaterStateResponse.pb-c.h" +void set_heater_state_response__init + (SetHeaterStateResponse *message) +{ + static const SetHeaterStateResponse init_value = SET_HEATER_STATE_RESPONSE__INIT; + *message = init_value; +} +size_t set_heater_state_response__get_packed_size + (const SetHeaterStateResponse *message) +{ + assert(message->base.descriptor == &set_heater_state_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t set_heater_state_response__pack + (const SetHeaterStateResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &set_heater_state_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t set_heater_state_response__pack_to_buffer + (const SetHeaterStateResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &set_heater_state_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +SetHeaterStateResponse * + set_heater_state_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (SetHeaterStateResponse *) + protobuf_c_message_unpack (&set_heater_state_response__descriptor, + allocator, len, data); +} +void set_heater_state_response__free_unpacked + (SetHeaterStateResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &set_heater_state_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define set_heater_state_response__field_descriptors NULL +#define set_heater_state_response__field_indices_by_name NULL +#define set_heater_state_response__number_ranges NULL +const ProtobufCMessageDescriptor set_heater_state_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "SetHeaterStateResponse", + "SetHeaterStateResponse", + "SetHeaterStateResponse", + "", + sizeof(SetHeaterStateResponse), + 0, + set_heater_state_response__field_descriptors, + set_heater_state_response__field_indices_by_name, + 0, set_heater_state_response__number_ranges, + (ProtobufCMessageInit) set_heater_state_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateResponse.pb-c.h new file mode 100644 index 000000000..e9582ae41 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/SetHeaterStateResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: SetHeaterStateResponse.proto */ + +#ifndef PROTOBUF_C_SetHeaterStateResponse_2eproto__INCLUDED +#define PROTOBUF_C_SetHeaterStateResponse_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 _SetHeaterStateResponse SetHeaterStateResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _SetHeaterStateResponse +{ + ProtobufCMessage base; +}; +#define SET_HEATER_STATE_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&set_heater_state_response__descriptor) \ + } + + +/* SetHeaterStateResponse methods */ +void set_heater_state_response__init + (SetHeaterStateResponse *message); +size_t set_heater_state_response__get_packed_size + (const SetHeaterStateResponse *message); +size_t set_heater_state_response__pack + (const SetHeaterStateResponse *message, + uint8_t *out); +size_t set_heater_state_response__pack_to_buffer + (const SetHeaterStateResponse *message, + ProtobufCBuffer *buffer); +SetHeaterStateResponse * + set_heater_state_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void set_heater_state_response__free_unpacked + (SetHeaterStateResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*SetHeaterStateResponse_Closure) + (const SetHeaterStateResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor set_heater_state_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_SetHeaterStateResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.c index e6e049662..faae634e9 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.c @@ -52,7 +52,7 @@ void start_diagnostics_response__free_unpacked assert(message->base.descriptor == &start_diagnostics_response__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor start_diagnostics_response__field_descriptors[3] = +static const ProtobufCFieldDescriptor start_diagnostics_response__field_descriptors[4] = { { "Monitors", @@ -90,16 +90,29 @@ static const ProtobufCFieldDescriptor start_diagnostics_response__field_descript 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "HeatersStates", + 4, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(StartDiagnosticsResponse, n_heatersstates), + offsetof(StartDiagnosticsResponse, heatersstates), + &heater_state__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned start_diagnostics_response__field_indices_by_name[] = { 2, /* field[2] = ComponentsStates */ 1, /* field[1] = DigitalInterfaceStates */ + 3, /* field[3] = HeatersStates */ 0, /* field[0] = Monitors */ }; static const ProtobufCIntRange start_diagnostics_response__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 3 } + { 0, 4 } }; const ProtobufCMessageDescriptor start_diagnostics_response__descriptor = { @@ -109,7 +122,7 @@ const ProtobufCMessageDescriptor start_diagnostics_response__descriptor = "StartDiagnosticsResponse", "", sizeof(StartDiagnosticsResponse), - 3, + 4, start_diagnostics_response__field_descriptors, start_diagnostics_response__field_indices_by_name, 1, start_diagnostics_response__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.h index fbdbc8c8d..fb6e2042f 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartDiagnosticsResponse.pb-c.h @@ -17,6 +17,7 @@ PROTOBUF_C__BEGIN_DECLS #include "DigitalInterfaceState.pb-c.h" #include "ValueComponentState.pb-c.h" #include "DiagnosticsMonitors.pb-c.h" +#include "HeaterState.pb-c.h" typedef struct _StartDiagnosticsResponse StartDiagnosticsResponse; @@ -34,10 +35,12 @@ struct _StartDiagnosticsResponse DigitalInterfaceState **digitalinterfacestates; size_t n_componentsstates; ValueComponentState **componentsstates; + size_t n_heatersstates; + HeaterState **heatersstates; }; #define START_DIAGNOSTICS_RESPONSE__INIT \ { PROTOBUF_C_MESSAGE_INIT (&start_diagnostics_response__descriptor) \ - , NULL, 0,NULL, 0,NULL } + , NULL, 0,NULL, 0,NULL, 0,NULL } /* StartDiagnosticsResponse methods */ diff --git a/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c b/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c index 2b132955a..469c16976 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c +++ b/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.c @@ -173,7 +173,7 @@ bool GetHeaterState (int HeaterId) assert(HeaterId < MAX_HEATERS_NUM); return portMap[HeaterId].Active; } -uint32_t HeaterBalanceLoadControlCBFunction(uint32_t IfIndex, uint32_t readValue) +/*uint32_t HeaterBalanceLoadControlCBFunction(uint32_t IfIndex, uint32_t readValue) { static int HeaterIndex = 0; int i; @@ -196,6 +196,6 @@ uint32_t HeaterBalanceLoadControlCBFunction(uint32_t IfIndex, uint32_t readValue HeaterIndex = 0; } return OK; -} +}*/ diff --git a/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.h b/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.h index 9f1d4a4e9..7ba026255 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.h +++ b/Software/Embedded_SW/Embedded/Drivers/Heater/Heater.h @@ -8,7 +8,7 @@ uint32_t ActivateHeater (int HeaterId); uint32_t DeActivateHeater (int HeaterId); bool GetHeaterState (int HeaterId); uint32_t HeaterSetTemperatureWithCallback (int HeaterId, uint32_t RequestedTemperature, callback_fptr callback); -uint32_t HeaterBalanceLoadControlCBFunction(uint32_t IfIndex, uint32_t readValue); +//uint32_t HeaterBalanceLoadControlCBFunction(uint32_t IfIndex, uint32_t readValue); #ifdef DEMO_TEMPERATURE uint32_t DemoTemperatureSensorRead(int SensorId); diff --git a/Software/Embedded_SW/Embedded/Embedded.cfg b/Software/Embedded_SW/Embedded/Embedded.cfg index a2edc6d56..2002b1d58 100644 --- a/Software/Embedded_SW/Embedded/Embedded.cfg +++ b/Software/Embedded_SW/Embedded/Embedded.cfg @@ -17,7 +17,7 @@ var Task = xdc.useModule('ti.sysbios.knl.Task'); //BIOS.heapSize = 30767; // bios heapmem //Memory.defaultHeapSize = 48767; -Program.heap = 50767; //sysmem +Program.heap = 50000; //sysmem Clock.timerId = 7; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 6f234e26a..9b4f945d8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -23,6 +23,7 @@ #include #include #include +#include "drivers/I2C_Communication/ADC_MUX/ADC_MUX.h" #include #include "drivers/adc_sampling/adc.h" diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index 934467277..4da305c33 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -37,6 +37,8 @@ #include #include #include +#include "PMR/Diagnostics/HeaterType.pb-c.h" +#include "PMR/Diagnostics/HeaterState.pb-c.h" #include #include "StateMachines/Printing/PrintingSTM.h" @@ -92,6 +94,8 @@ double MidTankpressure[MAX_SYSTEM_DISPENSERS][DIAGNOSTICS_LIMIT]; DoubleArray DispenserFreq[MAX_SYSTEM_DISPENSERS]; DoubleArray DiagnosticsDispenserPressure[MAX_SYSTEM_DISPENSERS]; +HeaterState **heatersstates; +HeaterState HeaterInfo[HEATER_TYPE__HeaterZone6+1]; /*double dispenser1motorfrequency[DIAGNOSTICS_LIMIT]; double dispenser2motorfrequency[DIAGNOSTICS_LIMIT]; double dispenser3motorfrequency[DIAGNOSTICS_LIMIT]; @@ -143,6 +147,12 @@ void DiagnosticsInit(void) double_array__init(&DispenserFreq[i]); double_array__init(&DiagnosticsDispenserPressure[i]); } + heatersstates = (HeaterState**)malloc(sizeof(HeaterState *)*(HEATER_TYPE__HeaterZone6+1)); + for(i=0;i<=HEATER_TYPE__HeaterZone6;i++) + { + heater_state__init(&HeaterInfo[i]); + heatersstates[i] = &HeaterInfo[i]; + } return; } @@ -520,6 +530,14 @@ void SendDiagnostics(void) } } */ + for (i=HEATER_TYPE__HeaterZone1;i<=HEATER_TYPE__HeaterZone6;i++) + { + LoadHeaterState((HeaterType)i,&HeaterInfo[i]); + //heatersstates[i] = &HeaterInfo[i]; + } + response.n_heatersstates = HEATER_TYPE__HeaterZone6+1; + response.heatersstates = heatersstates; + diagnosticsresponseContainer = createContainer(MESSAGE_TYPE__StartDiagnosticsResponse, DiagnosticsToken, false, &response, &start_diagnostics_response__pack, &start_diagnostics_response__get_packed_size); diagnosticsresponseContainer.continuous = true; diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c index fda955b98..ec2d9a9fe 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.c +++ b/Software/Embedded_SW/Embedded/Modules/General/process.c @@ -26,6 +26,8 @@ double headairflow = 0; double dryerairflow = 0; int32_t tableindex = 0; +#define MAX_ALLOWED_TEMPERATURE 280 + ProcessParameters* ProcessParametersKeep; uint32_t HandleProcessParameters(ProcessParameters* ProcessParams) @@ -144,8 +146,21 @@ void ProcessRequestFunc(MessageContainer* requestContainer) container_buffer = malloc(message_container__get_packed_size(&responseContainer)); + REPORT_MSG (ProcessParams->dryerzone1temp,"Process Params Dryer"); + + if (ProcessParams->dryerzone1temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__GENERAL_ERROR; + if (ProcessParams->dryerzone2temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__GENERAL_ERROR; + if (ProcessParams->dryerzone3temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__GENERAL_ERROR; + if (ProcessParams->mixertemp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__GENERAL_ERROR; + if (ProcessParams->headzone1temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__GENERAL_ERROR; + if (ProcessParams->headzone2temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__GENERAL_ERROR; + if (ProcessParams->headzone3temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__GENERAL_ERROR; + if (ProcessParams->headzone4temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__GENERAL_ERROR; + if (ProcessParams->headzone5temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__GENERAL_ERROR; + if (ProcessParams->headzone6temp > MAX_ALLOWED_TEMPERATURE) status = ERROR_CODE__GENERAL_ERROR; - status = HandleProcessParameters(ProcessParams); + if (status == 0) + status = HandleProcessParameters(ProcessParams); if (status) { responseContainer.has_error = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h index 74a8efeb3..1c1f45434 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h @@ -1,5 +1,7 @@ #include "PMR/common/MessageContainer.pb-c.h" #include "PMR/Hardware/HardwarePidControl.pb-c.h" +#include "PMR/Diagnostics/HeaterType.pb-c.h" +#include "PMR/Diagnostics/HeaterState.pb-c.h" #define MAX_HEATERS_NUM HARDWARE_PID_CONTROL_TYPE__MixerHeater+1 @@ -18,5 +20,7 @@ void HeatingStopReporting(void); bool HeaterGetOverTemperatureState(uint8_t HeaterId); +void LoadHeaterState(HeaterType HeaterType,HeaterState *HeaterState); + uint32_t HeatersEnd(void); uint32_t Heaters_Init(void); diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index ace2bf683..61bc04ba4 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -10,6 +10,8 @@ #include "PMR/Hardware/HardwarePidControlType.pb-c.h" #include "PMR/Hardware/HardwarePidControl.pb-c.h" +#include "PMR/Diagnostics/HeaterType.pb-c.h" +#include "PMR/Diagnostics/HeaterState.pb-c.h" #include "PMR/common/MessageContainer.pb-c.h" #include "../control/control.h" @@ -120,6 +122,26 @@ void HeatersControlStart(void) HeatersStartControlTimer(); } } +void LoadHeaterState(HeaterType HeaterType,HeaterState *HeaterState) +{ + HardwarePidControlType HeaterTypeToControlId[HEATER_TYPE__HeaterZone6] = {HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ1,HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ2,HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ3,HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ4,HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ5,HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ6}; + int HeaterId = HeaterTypeToControlId[HeaterType]; + + HeaterState->has_heatertype = true; + HeaterState->heatertype = HeaterType; + HeaterState->has_setpoint = true; + HeaterState->setpoint = HeaterCmd[HeaterId].targettemperatue/100; + HeaterState->has_currentvalue = true; + HeaterState->currentvalue = TemperatureSensorRead(HeaterId2PT100Id[HeaterId])/100; + HeaterState->has_isactive = true; + HeaterState->isactive = GetHeaterState(HeaterId); + HeaterState->has_isrampingup = true; + HeaterState->isrampingup = DCInitialHeating[HeaterId]; + HeaterState->has_isinsetpoint = true; + HeaterState->isinsetpoint = HeaterReady[HeaterId]; + + return; +} uint32_t HeatersSingleHeaterEnd(HardwarePidControlType HeaterId) { int status = OK; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index c7d5998c6..77e1939f9 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -401,7 +401,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) usnprintf(Message, 60, "Dancer %d limit %d value %d Zero %d",DancerId,DancerStopActivityLimit[index],avreageSampleValue,DancersCfg[DancerId].zeropoint); //JobAbortedByUser = true; ThreadControlActive = false; - JobEndReason = JOB_DANCER_FAIL; + JobEndReason = JOB_WINDER_DANCER_FAIL+index; SendJobProgress(0.0,0,false, Message); //EndState(CurrentJob,Message ); SegmentReady(Module_Thread,ModuleFail); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 6415c9025..0b85fbd87 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -56,6 +56,8 @@ Mailbox_Handle JobmsgQ = NULL; //static Clock_Params jobclkParams; JobEndReasonEnum JobEndReason = JOB_OK; +ErrorCode JobError_to_ErrorCode[JOB_OTHER_ALARM+1] = {ERROR_CODE__NONE,ERROR_CODE__JOB_UNSPECIFIED_ERROR,ERROR_CODE__JOB_THREAD_BREAK,ERROR_CODE__JOB_WINDER_DANCER_FAIL, + ERROR_CODE__JOB_POOLER_DANCER_FAIL,ERROR_CODE__JOB_FEEDER_DANCER_FAIL,ERROR_CODE__JOB_OUT_OF_DYE,ERROR_CODE__JOB_OTHER_ALARM}; #define MAX_TICKET_SIZE 10000 @@ -449,7 +451,7 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes if (JobEndReason != JOB_OK) { responseContainer.has_error = true; - responseContainer.error = ERROR_CODE__GENERAL_ERROR; + responseContainer.error = JobError_to_ErrorCode[JobEndReason]; } } else diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h index e0caaefae..a1e9e83e8 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h @@ -81,8 +81,11 @@ typedef enum typedef enum { JOB_OK, + JOB_UNSPECIFIED_ERROR, JOB_THREAD_BREAK, - JOB_DANCER_FAIL, + JOB_WINDER_DANCER_FAIL, + JOB_POOLER_DANCER_FAIL, + JOB_FEEDER_DANCER_FAIL, JOB_OUT_OF_DYE, JOB_OTHER_ALARM }JobEndReasonEnum; -- cgit v1.3.1