diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-18 16:53:27 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-18 16:53:27 +0200 |
| commit | d490924ad53668da9cfac498a925def0ff616b6d (patch) | |
| tree | 4211d0c2379b08b0afb1c862530f40e2d17f0cc8 /Software | |
| parent | e766a7f3799444e93a5dc9547c4121c4aa3b14fb (diff) | |
| parent | a9d18c495bfb4232b61bf4b45f1ba3c626cdb61b (diff) | |
| download | Tango-d490924ad53668da9cfac498a925def0ff616b6d.tar.gz Tango-d490924ad53668da9cfac498a925def0ff616b6d.zip | |
MERGED.
Diffstat (limited to 'Software')
57 files changed, 1191 insertions, 369 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index 76c2fe9f2..77efa1cfd 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -653,7 +653,7 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) GetFilesRequest* request = get_files_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); GetFilesResponse response = GET_FILES_RESPONSE__INIT; - + //struct tm RTC_time; #define MAX_NUM_OF_FILES 20 DIR dir; FILINFO* fno[MAX_NUM_OF_FILES]; @@ -727,6 +727,13 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) else usnprintf(&FullPath[i], 50, "%s%s%s", request->path,"/", fno[i]->fname); Data[i].fullpath = &FullPath[i][0]; + /*RTC_time.tm_year=(fno[i]->fdate>>9)+1980;//populate the time struct (FAT start==1980, RTC.year==0) + RTC_time.tm_mon=(fno[i]->fdate>>5)&0x000F; + RTC_time.tm_mday=fno[i]->fdate&0x001F; + RTC_time.tm_hour=(fno[i]->ftime>>11)&0x001F; + RTC_time.tm_min=(fno[i]->ftime>>5)&0x003F; + RTC_time.tm_sec=(fno[i]->ftime<<1)&0x003E;*/ + } response.n_items = NumOfFiles; diff --git a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c index fd6889185..d0193f970 100644 --- a/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c +++ b/Software/Embedded_SW/Embedded/Common/SW_Info/SW_Info.c @@ -20,7 +20,7 @@ typedef struct } TangoVersion_t; -TangoVersion_t _gTangoVersion = {1,5,2,0}; +TangoVersion_t _gTangoVersion = {1,5,2,1}; #define BUILD_DATE __DATE__ char Dat[50] = BUILD_DATE; 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 4b8277d75..8a0e37288 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[271] = +static const ProtobufCEnumValue message_type__enum_values_by_number[275] = { { "", "", 0 }, { "", "", 1 }, @@ -123,6 +123,10 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[271] = { "", "", 112 }, { "", "", 113 }, { "", "", 114 }, + { "", "", 115 }, + { "", "", 116 }, + { "", "", 117 }, + { "", "", 118 }, { "", "", 1000 }, { "", "", 1001 }, { "", "", 1002 }, @@ -282,159 +286,163 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[271] = { "", "", 13003 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 2},{1000, 114},{2000, 135},{2044, 175},{3000, 177},{4000, 191},{5000, 199},{6000, 203},{7000, 209},{8000, 233},{9000, 241},{10000, 245},{11000, 255},{12000, 265},{13000, 267},{0, 271} +{0, 0},{3, 2},{1000, 118},{2000, 139},{2044, 179},{3000, 181},{4000, 195},{5000, 203},{6000, 207},{7000, 213},{8000, 237},{9000, 245},{10000, 249},{11000, 259},{12000, 269},{13000, 271},{0, 275} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[271] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[275] = { - { "", 189 }, - { "", 190 }, - { "", 179 }, - { "", 180 }, - { "", 247 }, - { "", 248 }, + { "", 193 }, + { "", 194 }, + { "", 183 }, + { "", 184 }, { "", 251 }, { "", 252 }, - { "", 231 }, - { "", 232 }, - { "", 263 }, - { "", 264 }, + { "", 255 }, + { "", 256 }, + { "", 235 }, + { "", 236 }, + { "", 267 }, + { "", 268 }, { "", 2 }, { "", 3 }, - { "", 175 }, - { "", 176 }, - { "", 127 }, - { "", 128 }, - { "", 133 }, - { "", 134 }, - { "", 205 }, - { "", 206 }, - { "", 257 }, - { "", 258 }, + { "", 179 }, + { "", 180 }, + { "", 131 }, + { "", 132 }, + { "", 137 }, + { "", 138 }, + { "", 209 }, + { "", 210 }, + { "", 261 }, + { "", 262 }, + { "", 221 }, + { "", 222 }, + { "", 187 }, + { "", 188 }, + { "", 223 }, + { "", 224 }, + { "", 123 }, + { "", 124 }, + { "", 211 }, + { "", 212 }, + { "", 149 }, + { "", 150 }, + { "", 155 }, + { "", 156 }, + { "", 237 }, + { "", 238 }, + { "", 151 }, + { "", 152 }, + { "", 153 }, + { "", 154 }, + { "", 1 }, { "", 217 }, { "", 218 }, - { "", 183 }, - { "", 184 }, - { "", 219 }, - { "", 220 }, { "", 119 }, { "", 120 }, - { "", 207 }, - { "", 208 }, - { "", 145 }, - { "", 146 }, - { "", 151 }, - { "", 152 }, - { "", 233 }, - { "", 234 }, - { "", 147 }, - { "", 148 }, - { "", 149 }, - { "", 150 }, - { "", 1 }, + { "", 121 }, + { "", 122 }, + { "", 118 }, + { "", 231 }, + { "", 232 }, + { "", 215 }, + { "", 216 }, + { "", 229 }, + { "", 230 }, { "", 213 }, { "", 214 }, - { "", 115 }, - { "", 116 }, - { "", 117 }, - { "", 118 }, - { "", 114 }, + { "", 135 }, + { "", 136 }, + { "", 273 }, + { "", 274 }, { "", 227 }, { "", 228 }, - { "", 211 }, - { "", 212 }, { "", 225 }, { "", 226 }, - { "", 209 }, - { "", 210 }, - { "", 131 }, - { "", 132 }, - { "", 269 }, - { "", 270 }, - { "", 223 }, - { "", 224 }, - { "", 221 }, - { "", 222 }, - { "", 177 }, - { "", 178 }, - { "", 203 }, - { "", 204 }, - { "", 215 }, - { "", 216 }, - { "", 237 }, - { "", 238 }, + { "", 181 }, + { "", 182 }, + { "", 207 }, + { "", 208 }, + { "", 219 }, + { "", 220 }, + { "", 241 }, + { "", 242 }, + { "", 243 }, + { "", 244 }, { "", 239 }, { "", 240 }, - { "", 235 }, - { "", 236 }, - { "", 137 }, - { "", 138 }, - { "", 143 }, - { "", 144 }, - { "", 139 }, - { "", 140 }, { "", 141 }, { "", 142 }, + { "", 147 }, + { "", 148 }, + { "", 143 }, + { "", 144 }, + { "", 145 }, + { "", 146 }, { "", 0 }, - { "", 121 }, - { "", 122 }, + { "", 125 }, + { "", 126 }, + { "", 114 }, + { "", 115 }, { "", 4 }, { "", 5 }, - { "", 267 }, - { "", 268 }, - { "", 161 }, - { "", 162 }, - { "", 185 }, - { "", 186 }, - { "", 171 }, - { "", 172 }, - { "", 159 }, - { "", 160 }, + { "", 271 }, + { "", 272 }, + { "", 165 }, + { "", 166 }, + { "", 189 }, + { "", 190 }, + { "", 175 }, + { "", 176 }, + { "", 163 }, + { "", 164 }, + { "", 199 }, + { "", 200 }, + { "", 157 }, + { "", 158 }, + { "", 173 }, + { "", 174 }, + { "", 177 }, + { "", 178 }, + { "", 201 }, + { "", 202 }, + { "", 257 }, + { "", 258 }, + { "", 127 }, + { "", 128 }, { "", 195 }, { "", 196 }, - { "", 153 }, - { "", 154 }, + { "", 139 }, + { "", 140 }, { "", 169 }, { "", 170 }, - { "", 173 }, - { "", 174 }, - { "", 197 }, - { "", 198 }, - { "", 253 }, - { "", 254 }, - { "", 123 }, - { "", 124 }, { "", 191 }, { "", 192 }, - { "", 135 }, - { "", 136 }, - { "", 165 }, - { "", 166 }, - { "", 187 }, - { "", 188 }, - { "", 265 }, - { "", 266 }, - { "", 241 }, - { "", 242 }, + { "", 269 }, + { "", 270 }, { "", 245 }, { "", 246 }, { "", 249 }, { "", 250 }, - { "", 255 }, - { "", 256 }, - { "", 125 }, - { "", 126 }, - { "", 193 }, - { "", 194 }, - { "", 163 }, - { "", 164 }, - { "", 167 }, - { "", 168 }, - { "", 243 }, - { "", 244 }, + { "", 253 }, + { "", 254 }, { "", 259 }, { "", 260 }, + { "", 129 }, + { "", 130 }, + { "", 197 }, + { "", 198 }, + { "", 167 }, + { "", 168 }, + { "", 171 }, + { "", 172 }, + { "", 247 }, + { "", 248 }, + { "", 263 }, + { "", 264 }, { "", 100 }, { "", 101 }, + { "", 116 }, + { "", 117 }, { "", 6 }, { "", 7 }, { "", 8 }, @@ -541,22 +549,22 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[271] = { "", 31 }, { "", 106 }, { "", 107 }, - { "", 201 }, - { "", 202 }, - { "", 157 }, - { "", 158 }, - { "", 155 }, - { "", 156 }, - { "", 261 }, - { "", 262 }, - { "", 129 }, - { "", 130 }, - { "", 199 }, - { "", 200 }, - { "", 181 }, - { "", 182 }, - { "", 229 }, - { "", 230 }, + { "", 205 }, + { "", 206 }, + { "", 161 }, + { "", 162 }, + { "", 159 }, + { "", 160 }, + { "", 265 }, + { "", 266 }, + { "", 133 }, + { "", 134 }, + { "", 203 }, + { "", 204 }, + { "", 185 }, + { "", 186 }, + { "", 233 }, + { "", 234 }, }; const ProtobufCEnumDescriptor message_type__descriptor = { @@ -565,9 +573,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "", "", "", - 271, + 275, message_type__enum_values_by_number, - 271, + 275, message_type__enum_values_by_name, 16, 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 133d64f2d..ec3c02f49 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 @@ -134,6 +134,10 @@ typedef enum _MessageType { MESSAGE_TYPE__StubMainCardEEpromWriteResponse = 112, MESSAGE_TYPE__StubHeadEEpromRequest = 113, MESSAGE_TYPE__StubHeadEEpromResponse = 114, + MESSAGE_TYPE__ProcedureRequest = 115, + MESSAGE_TYPE__ProcedureResponse = 116, + MESSAGE_TYPE__StubAllHardwareRequest = 117, + MESSAGE_TYPE__StubAllHardwareResponse = 118, MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket = 1000, MESSAGE_TYPE__ExternalBridgeLoginRequest = 1001, MESSAGE_TYPE__ExternalBridgeLoginResponse = 1002, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.c index 2ed0ef818..7f25525ff 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.c @@ -52,7 +52,7 @@ void alarm_handling_item__free_unpacked assert(message->base.descriptor == &alarm_handling_item__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] = +static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[10] = { { "", @@ -71,18 +71,6 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] 2, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, - offsetof(AlarmHandlingItem, has_frequency), - offsetof(AlarmHandlingItem, frequency), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "", - 3, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, offsetof(AlarmHandlingItem, has_deviceid), offsetof(AlarmHandlingItem, deviceid), NULL, @@ -92,7 +80,7 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] }, { "", - 4, + 3, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, offsetof(AlarmHandlingItem, has_moduledeviceid), @@ -104,7 +92,7 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] }, { "", - 5, + 4, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, offsetof(AlarmHandlingItem, has_alarmvalue), @@ -116,7 +104,7 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] }, { "", - 6, + 5, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_BOOL, offsetof(AlarmHandlingItem, has_alarmdirection), @@ -128,7 +116,7 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] }, { "", - 7, + 6, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_ENUM, offsetof(AlarmHandlingItem, has_severity), @@ -140,19 +128,7 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] }, { "", - 8, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_UINT32, - offsetof(AlarmHandlingItem, has_predecessor), - offsetof(AlarmHandlingItem, predecessor), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { - "", - 9, + 7, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_UINT32, offsetof(AlarmHandlingItem, has_debouncevalue), @@ -164,7 +140,7 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] }, { "", - 10, + 8, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_ENUM, offsetof(AlarmHandlingItem, has_eventtype), @@ -176,7 +152,7 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] }, { "", - 11, + 9, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_STRING, 0, /* quantifier_offset */ @@ -188,7 +164,7 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] }, { "", - 12, + 10, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_BOOL, offsetof(AlarmHandlingItem, has_ispersistent), @@ -200,23 +176,21 @@ static const ProtobufCFieldDescriptor alarm_handling_item__field_descriptors[12] }, }; static const unsigned alarm_handling_item__field_indices_by_name[] = { - 5, /* field[5] = AlarmDirection */ + 4, /* field[4] = AlarmDirection */ 0, /* field[0] = AlarmSource */ - 4, /* field[4] = AlarmValue */ - 8, /* field[8] = DebounceValue */ - 2, /* field[2] = DeviceId */ - 10, /* field[10] = EventName */ - 9, /* field[9] = EventType */ - 1, /* field[1] = Frequency */ - 11, /* field[11] = IsPersistent */ - 3, /* field[3] = ModuleDeviceId */ - 7, /* field[7] = Predecessor */ - 6, /* field[6] = Severity */ + 3, /* field[3] = AlarmValue */ + 6, /* field[6] = DebounceValue */ + 1, /* field[1] = DeviceId */ + 8, /* field[8] = EventName */ + 7, /* field[7] = EventType */ + 9, /* field[9] = IsPersistent */ + 2, /* field[2] = ModuleDeviceId */ + 5, /* field[5] = Severity */ }; static const ProtobufCIntRange alarm_handling_item__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 12 } + { 0, 10 } }; const ProtobufCMessageDescriptor alarm_handling_item__descriptor = { @@ -226,7 +200,7 @@ const ProtobufCMessageDescriptor alarm_handling_item__descriptor = "", "", sizeof(AlarmHandlingItem), - 12, + 10, alarm_handling_item__field_descriptors, alarm_handling_item__field_indices_by_name, 1, alarm_handling_item__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.h index f69c7b96d..635c38544 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/EmbeddedParameters/AlarmHandlingItem.pb-c.h @@ -31,8 +31,6 @@ struct _AlarmHandlingItem ProtobufCMessage base; protobuf_c_boolean has_alarmsource; AlarmSourceType alarmsource; - protobuf_c_boolean has_frequency; - uint32_t frequency; protobuf_c_boolean has_deviceid; uint32_t deviceid; protobuf_c_boolean has_moduledeviceid; @@ -43,8 +41,6 @@ struct _AlarmHandlingItem protobuf_c_boolean alarmdirection; protobuf_c_boolean has_severity; DebugLogCategory severity; - protobuf_c_boolean has_predecessor; - uint32_t predecessor; protobuf_c_boolean has_debouncevalue; uint32_t debouncevalue; protobuf_c_boolean has_eventtype; @@ -55,7 +51,7 @@ struct _AlarmHandlingItem }; #define ALARM_HANDLING_ITEM__INIT \ { PROTOBUF_C_MESSAGE_INIT (&alarm_handling_item__descriptor) \ - , 0, ALARM_SOURCE_TYPE__TemperatureAlarm, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, DEBUG_LOG_CATEGORY__Info, 0, 0, 0, 0, 0, EVENT_TYPE__None, NULL, 0, 0 } + , 0, ALARM_SOURCE_TYPE__TemperatureAlarm, 0, 0, 0, 0, 0, 0, 0, 0, 0, DEBUG_LOG_CATEGORY__Info, 0, 0, 0, EVENT_TYPE__None, NULL, 0, 0 } /* AlarmHandlingItem methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureRequest.pb-c.c new file mode 100644 index 000000000..4b5a8018e --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureRequest.pb-c.c @@ -0,0 +1,157 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ProcedureRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ProcedureRequest.pb-c.h" +void procedure_request__init + (ProcedureRequest *message) +{ + static const ProcedureRequest init_value = PROCEDURE_REQUEST__INIT; + *message = init_value; +} +size_t procedure_request__get_packed_size + (const ProcedureRequest *message) +{ + assert(message->base.descriptor == &procedure_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t procedure_request__pack + (const ProcedureRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &procedure_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t procedure_request__pack_to_buffer + (const ProcedureRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &procedure_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ProcedureRequest * + procedure_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ProcedureRequest *) + protobuf_c_message_unpack (&procedure_request__descriptor, + allocator, len, data); +} +void procedure_request__free_unpacked + (ProcedureRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &procedure_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor procedure_request__field_descriptors[6] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(ProcedureRequest, has_type), + offsetof(ProcedureRequest, type), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(ProcedureRequest, has_timeout), + offsetof(ProcedureRequest, timeout), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_FLOAT, + offsetof(ProcedureRequest, has_param1), + offsetof(ProcedureRequest, param1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_FLOAT, + offsetof(ProcedureRequest, has_param2), + offsetof(ProcedureRequest, param2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_FLOAT, + offsetof(ProcedureRequest, has_param3), + offsetof(ProcedureRequest, param3), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_FLOAT, + offsetof(ProcedureRequest, has_param4), + offsetof(ProcedureRequest, param4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned procedure_request__field_indices_by_name[] = { + 2, /* field[2] = Param1 */ + 3, /* field[3] = Param2 */ + 4, /* field[4] = Param3 */ + 5, /* field[5] = Param4 */ + 1, /* field[1] = Timeout */ + 0, /* field[0] = Type */ +}; +static const ProtobufCIntRange procedure_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 6 } +}; +const ProtobufCMessageDescriptor procedure_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(ProcedureRequest), + 6, + procedure_request__field_descriptors, + procedure_request__field_indices_by_name, + 1, procedure_request__number_ranges, + (ProtobufCMessageInit) procedure_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureRequest.pb-c.h new file mode 100644 index 000000000..26740256c --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureRequest.pb-c.h @@ -0,0 +1,82 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ProcedureRequest.proto */ + +#ifndef PROTOBUF_C_ProcedureRequest_2eproto__INCLUDED +#define PROTOBUF_C_ProcedureRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +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 _ProcedureRequest ProcedureRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ProcedureRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_type; + int32_t type; + protobuf_c_boolean has_timeout; + int32_t timeout; + protobuf_c_boolean has_param1; + float param1; + protobuf_c_boolean has_param2; + float param2; + protobuf_c_boolean has_param3; + float param3; + protobuf_c_boolean has_param4; + float param4; +}; +#define PROCEDURE_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&procedure_request__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* ProcedureRequest methods */ +void procedure_request__init + (ProcedureRequest *message); +size_t procedure_request__get_packed_size + (const ProcedureRequest *message); +size_t procedure_request__pack + (const ProcedureRequest *message, + uint8_t *out); +size_t procedure_request__pack_to_buffer + (const ProcedureRequest *message, + ProtobufCBuffer *buffer); +ProcedureRequest * + procedure_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void procedure_request__free_unpacked + (ProcedureRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ProcedureRequest_Closure) + (const ProcedureRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor procedure_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ProcedureRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureResponse.pb-c.c new file mode 100644 index 000000000..4de720698 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureResponse.pb-c.c @@ -0,0 +1,144 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ProcedureResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "ProcedureResponse.pb-c.h" +void procedure_response__init + (ProcedureResponse *message) +{ + static const ProcedureResponse init_value = PROCEDURE_RESPONSE__INIT; + *message = init_value; +} +size_t procedure_response__get_packed_size + (const ProcedureResponse *message) +{ + assert(message->base.descriptor == &procedure_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t procedure_response__pack + (const ProcedureResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &procedure_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t procedure_response__pack_to_buffer + (const ProcedureResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &procedure_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +ProcedureResponse * + procedure_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (ProcedureResponse *) + protobuf_c_message_unpack (&procedure_response__descriptor, + allocator, len, data); +} +void procedure_response__free_unpacked + (ProcedureResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &procedure_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor procedure_response__field_descriptors[5] = +{ + { + "", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(ProcedureResponse, has_type), + offsetof(ProcedureResponse, type), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(ProcedureResponse, has_time), + offsetof(ProcedureResponse, time), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_FLOAT, + offsetof(ProcedureResponse, has_replyvalue1), + offsetof(ProcedureResponse, replyvalue1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_FLOAT, + offsetof(ProcedureResponse, has_replyvalue2), + offsetof(ProcedureResponse, replyvalue2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_FLOAT, + offsetof(ProcedureResponse, has_replyvalue3), + offsetof(ProcedureResponse, replyvalue3), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned procedure_response__field_indices_by_name[] = { + 2, /* field[2] = ReplyValue1 */ + 3, /* field[3] = ReplyValue2 */ + 4, /* field[4] = ReplyValue3 */ + 1, /* field[1] = Time */ + 0, /* field[0] = Type */ +}; +static const ProtobufCIntRange procedure_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor procedure_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(ProcedureResponse), + 5, + procedure_response__field_descriptors, + procedure_response__field_indices_by_name, + 1, procedure_response__number_ranges, + (ProtobufCMessageInit) procedure_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureResponse.pb-c.h new file mode 100644 index 000000000..e06fda627 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Stubs/ProcedureResponse.pb-c.h @@ -0,0 +1,80 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: ProcedureResponse.proto */ + +#ifndef PROTOBUF_C_ProcedureResponse_2eproto__INCLUDED +#define PROTOBUF_C_ProcedureResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +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 _ProcedureResponse ProcedureResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _ProcedureResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_type; + int32_t type; + protobuf_c_boolean has_time; + int32_t time; + protobuf_c_boolean has_replyvalue1; + float replyvalue1; + protobuf_c_boolean has_replyvalue2; + float replyvalue2; + protobuf_c_boolean has_replyvalue3; + float replyvalue3; +}; +#define PROCEDURE_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&procedure_response__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* ProcedureResponse methods */ +void procedure_response__init + (ProcedureResponse *message); +size_t procedure_response__get_packed_size + (const ProcedureResponse *message); +size_t procedure_response__pack + (const ProcedureResponse *message, + uint8_t *out); +size_t procedure_response__pack_to_buffer + (const ProcedureResponse *message, + ProtobufCBuffer *buffer); +ProcedureResponse * + procedure_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void procedure_response__free_unpacked + (ProcedureResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*ProcedureResponse_Closure) + (const ProcedureResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor procedure_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_ProcedureResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c b/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c index b44af40fa..c130b0275 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c +++ b/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c @@ -213,7 +213,7 @@ int TemperatureListString(char* str) TempSensorResponse[HEAD_PT100_ZONE_3_0X82_0].Temperature_C_mult_by_100/100, TempSensorResponse[HEAD_PT100_AIR_HEATER_1_0X8C_0].Temperature_C_mult_by_100/100, TempSensorResponse[HEAD_PT100_AIR_HEATER_2_0X8C_1].Temperature_C_mult_by_100/100, TempSensorResponse[HEAD_PT100_MIXER_0X8E_0].Temperature_C_mult_by_100/100, TempSensorResponse[TEMP_SENSE_ANALOG_DRYER_TEMP1].Temperature_C_mult_by_100/100, - (int)(GetWHSAirFlow(HEAD_FLOW_METER)*100),(int)(PressureSensorGetPressure(HEAD_PT100_ZONE_5_0X84_0)*100),(int)(PressureSensorGetPressure(HEAD_PT100_ZONE_7_0X86_0)*100)); + (int)(GetWHSAirFlow(HEAD_FLOW_METER)*100),(int)(PressureSensorGetPressure(HEAD_FAN_RIGHT)*100),(int)(PressureSensorGetPressure(HEAD_FAN_LEFT)*100)); } else { diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/Fan/Head_Fan.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/Fan/Head_Fan.h index 394a69e1d..438d552ff 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/Fan/Head_Fan.h +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/Fan/Head_Fan.h @@ -75,5 +75,6 @@ uint8_t Head_Fan_Read_Tacho(bool Fan); uint8_t Head_Read_Config_Reg(); uint8_t Head_Fan_config(); uint8_t Head_Fans_Init(); +uint8_t Head_Check_Fan_Controller_Type(); #endif /* DRIVERS_I2C_COMMUNICATION_HEAD_CARD_FAN_HEAD_FAN_H_ */ diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/Fan/fan_click.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/Fan/fan_click.c index 728531488..ab68d6539 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/Fan/fan_click.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/Head_Card/Fan/fan_click.c @@ -26,7 +26,7 @@ uint8_t readbuffer[2]; uint8_t writebuffer[2]; -uint32_t I2C_HEAD_FAN_SLAVE_ADD = 0x5C; +uint32_t I2C_HEAD_FAN_SLAVE_ADD = UNKNOWN; FAN_CLICK_INFO Fan_Click_Info; @@ -195,6 +195,34 @@ uint8_t Head_fan_click_revision() return status; } +uint8_t Head_Check_Fan_Controller_Type() +{ + uint8_t status = ERROR; + + Select_Main_Head_Mux_Channel(); + + if(I2C_HEAD_FAN_SLAVE_ADD == UNKNOWN) + { + I2C_HEAD_FAN_SLAVE_ADD = 0x5C; + status = Head_fan_click_productID(); + + if((Fan_Click_Info.Product_ID != 0x36) || (status != OK)) + { + I2C_HEAD_FAN_SLAVE_ADD = 0x5E; + status = Head_fan_click_productID(); + } + + if((Fan_Click_Info.Product_ID != 0x36) || (status != OK)) + { + I2C_HEAD_FAN_SLAVE_ADD = 0x00; + ReportWithPackageFilter(GeneralFilter,"unable to recognize the Head fan controller", __FILE__,__LINE__, status, RpMessage, 0, 0); + status = ERROR; + } + } + return status; +} + + uint8_t Head_Read_Config_Reg() { uint8_t status = OK; @@ -296,6 +324,7 @@ uint8_t Head_Fans_Init() { uint8_t status = OK; + Head_Check_Fan_Controller_Type(); Head_Read_Config_Reg(); //Output is configured as a push-pull output EMC2302_Write.Reg.PWM_Output_Config |= 0x3;//Bit0 Output PWM1, Bit2 Output PWM2, 0 open drain, 1 push-pull diff --git a/Software/Embedded_SW/Embedded/Drivers/RFID/RFID_Task.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.c index f5101d9e7..fc4bad71d 100644 --- a/Software/Embedded_SW/Embedded/Drivers/RFID/RFID_Task.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.c @@ -10,7 +10,7 @@ #include "include.h" #include "inc/hw_memmap.h" -#include <Drivers/RFID/RFID_Task.h> +#include <Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.h> Task_Handle RFID_Task_Handle; Mailbox_Handle RFID_ReadingMsgQ = NULL; typedef enum diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.h b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.h new file mode 100644 index 000000000..6d16701fc --- /dev/null +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/I2C_RFID_Dispenser_Task/I2C_RFID_Disp_Task.h @@ -0,0 +1,16 @@ +/* + * RFID_Task.h + * + * Created on: 2 Nov 2020 + * Author: avi + */ + +#ifndef DRIVERS_RFID_TASK_RFID_TASK_H_ +#define DRIVERS_RFID_TASK_RFID_TASK_H_ + +void Trigger_RFID_Init(); +void Trigger_Dispenser_ReadData(int dispenserId);; + + + +#endif /* DRIVERS_RFID_TASK_RFID_TASK_H_ */ diff --git a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.c b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.c index f22d53a77..73bc2f9af 100644 --- a/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.c +++ b/Software/Embedded_SW/Embedded/Drivers/I2C_Communication/WHS_Card/D_EMC2302_Fan/WHS_Fan.c @@ -233,7 +233,7 @@ uint8_t WHS_Check_Fan_Controller_Type(WHS_fan_num fan_number) if((Fan_Driver_Info[fan_number].Product_ID != 0x36) || (status != OK)) { I2CFanViaSwitch_ADD_Buf[fan_number] = 0x00; - ReportWithPackageFilter(WasteFilter,"unable to recognize the an controller", __FILE__,__LINE__, status, RpMessage, fan_number, 0); + ReportWithPackageFilter(WasteFilter,"unable to recognize the WHS fan controller", __FILE__,__LINE__, status, RpMessage, fan_number, 0); status = ERROR; } diff --git a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c index 779d7e82f..ae862505a 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c +++ b/Software/Embedded_SW/Embedded/Drivers/Motors/MotorActions.c @@ -354,7 +354,7 @@ uint32_t MotorRunCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO { angle = Calculate_Arm_Distance(Arm_Drier_Center,temp); - if ((angle<400)||(angle>16000)) + if (abs(angle)<400) { BusyFlag = NOTBUSY; } @@ -376,7 +376,7 @@ uint32_t MotorRunCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) //TODO Report("motor timeout",__FILE__,__LINE__,MotorId,RpMessage,MotorTimeout[MotorId],0); Busy = BUSY; } - Report("MotorRunCallBackFunctionMotorRunCallBackFunction curr prev return",__FILE__,encoder,temp,RpWarning,AccumulatedArmMovement,0); + Report("MotorRunCallBackFunction curr prev return",__FILE__,encoder,temp,RpWarning,AccumulatedArmMovement,0); //call the module callback if (MotorCallback[MotorId]) { @@ -1128,10 +1128,10 @@ float Calculate_Arm_Angle(uint32_t Drier_Center,uint32_t Current_Angle) int Calculate_Arm_Distance(uint32_t Drier_Center,uint32_t Current_Angle) { int angle; - if (Current_Angle >= Drier_Center) + //if (Current_Angle >= Drier_Center) angle = Current_Angle - Drier_Center; - else - angle = Current_Angle + 0x3FFF - Drier_Center; + //else + // angle = Current_Angle + 0x3FFF - Drier_Center; ReportWithPackageFilter(DiagnosticsFilter,"Calculate_Arm_Distance",__FILE__,angle,Current_Angle,RpMessage,Drier_Center,0); return angle; } @@ -1163,7 +1163,7 @@ uint32_t LoadingArmReset_Callback(uint32_t MotorId, uint32_t ReadValue) { ReportWithPackageFilter(DiagnosticsFilter,"LoadingArmReset_Callback OK",__FILE__,__LINE__,Arm_Drier_Center,RpMessage,ReadValue,0); MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,0); - if ((angle<400)||(angle>16000)) + if (abs(angle)<400) //if (fabs(angle)<0.2) { ReportWithPackageFilter(DiagnosticsFilter,"drier center proximity",__FILE__,temp,Arm_Drier_Center,RpMessage,angle,0); diff --git a/Software/Embedded_SW/Embedded/Drivers/RFID/RFID_Task.h b/Software/Embedded_SW/Embedded/Drivers/RFID/RFID_Task.h deleted file mode 100644 index e69de29bb..000000000 --- a/Software/Embedded_SW/Embedded/Drivers/RFID/RFID_Task.h +++ /dev/null diff --git a/Software/Embedded_SW/Embedded/Main.c b/Software/Embedded_SW/Embedded/Main.c index c1d83abb3..36883df23 100644 --- a/Software/Embedded_SW/Embedded/Main.c +++ b/Software/Embedded_SW/Embedded/Main.c @@ -182,8 +182,8 @@ Void errHook(Error_Block *eb) System_printf("assertion violation: "); f_write(LogFileHandle,"\r\nassertion violation: ",22,&Bytes ); } + CloseLogFile(); } - CloseLogFile(); #ifdef WATCHDOG @@ -222,6 +222,7 @@ void Init_EVB() int main(void) { + FRESULT Fresult = FR_OK; // Enable interrupts to the processor. // ROM_IntMasterDisable(); @@ -255,6 +256,39 @@ int main(void) LOG_ERROR (iFResult, "Error during init Flash File System"); assert(iFResult); } + Fresult = f_mkdir("0://SysInfo"); + if ((Fresult != FR_OK)&&(Fresult != FR_EXIST)) + { +#ifdef WATCHDOG + ROM_WatchdogResetDisable(WATCHDOG0_BASE); + uint32_t timeout = 0xFFFFFFFFU; + ROM_WatchdogReloadSet(WATCHDOG0_BASE, timeout); +#endif + STATUS_GREEN_LED_ON; + ACTIVITY_GREEN_LED_ON; + COMM_GREEN_LED_ON; + + STATUS_RED_LED_ON; + ACTIVITY_RED_LED_ON; + COMM_RED_LED_ON; + //FFS error + Report("FFS error - rebuilding", __FILE__,__LINE__,Fresult, RpMessage,0, 0); + FRESULT iFResult = Init_Flash_File_System(true);// true + Fresult = f_mkdir("0://SysInfo"); + + ACTIVITY_GREEN_LED_OFF; + COMM_GREEN_LED_OFF; + + STATUS_RED_LED_OFF; + ACTIVITY_RED_LED_OFF; + COMM_RED_LED_OFF; +#ifdef WATCHDOG + ROM_WatchdogResetEnable(WATCHDOG0_BASE); + timeout = 120000000*3; + ROM_WatchdogReloadSet(WATCHDOG0_BASE, timeout); +#endif + } + OpenLogFile(); Data = MCU_E2PromEmbeddedVersionRead(); memcpy (&Version,&Data,4); @@ -277,6 +311,7 @@ int main(void) I2C_BUSY_DELAY = 100; //temporary workaround!!! //WHS_Type = WHS_TYPE_NEW; //for testing + //Head_Type = HEAD_TYPE_ARC; //for testing if ((Head_Type >= HEAD_TYPE_UNKNOWN_WITH_CARD)&&(WHS_Type == WHS_TYPE_NEW)) { diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index e754b0df2..eceb92d63 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -631,8 +631,16 @@ JobEndReasonEnum getEndReason(uint32_t AlarmId) switch (AlarmItem[AlarmId].AlarmSource) { case ALARM_SOURCE_TYPE__TemperatureAlarm: - usnprintf(AlarmReasonStr, 100, "Temperature problem in heater %d",AlarmItem[AlarmId].DeviceId); - return JOB_TEMPERATURE_ALARM; + if (AlarmItem[AlarmId].Severity == DEBUG_LOG_CATEGORY__Critical) + { + usnprintf(AlarmReasonStr, 100, "Safety Critical Alarm %d",AlarmItem[AlarmId].EventType); + return JOB_SAFETY_CRITICAL_ALARM; + } + else + { + usnprintf(AlarmReasonStr, 100, "Temperature problem in heater %d",AlarmItem[AlarmId].DeviceId); + return JOB_TEMPERATURE_ALARM; + } case ALARM_SOURCE_TYPE__LimitSwitchAlarm: usnprintf(AlarmReasonStr, 100, "Dispenser %d empty",AlarmItem[AlarmId].DeviceId); return JOB_OUT_OF_DYE; @@ -987,13 +995,20 @@ JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) } if ((IFS_Availability[1] == IFS_RECOGNIZED_INIT_PASSED)&&(IFS_Availability[2] == IFS_RECOGNIZED_INIT_PASSED)) //ifs installed -check cartridges { - - tempFoundReason = Waste_CheckState(&AlarmId); - if (tempFoundReason!=JOB_OK) - { - FoundReason = tempFoundReason; - ReportWithPackageFilter(AlarmFilter,"waste handling alarm preventing job", __FILE__,__LINE__,AlarmItem[Alarm_i].EventType, AlarmItem[Alarm_i].Severity, AlarmItem[Alarm_i].DeviceId, 0); - } + tempFoundReason = Waste_CheckState(&AlarmId); + if (tempFoundReason!=JOB_OK) + { + for (Alarm_i = 0;Alarm_i<NumOfSystemAlarms;Alarm_i++) + { + if (AlarmId == (AlarmItem[Alarm_i].EventType)) + { + FoundReason = tempFoundReason; + AlarmId = Alarm_i; + ReportWithPackageFilter(AlarmFilter,"waste handling alarm preventing job", __FILE__,AlarmId,AlarmItem[Alarm_i].EventType, AlarmItem[Alarm_i].Severity, AlarmItem[Alarm_i].DeviceId, 0); + break; + } + } + } } if ((AlarmState[Alarm_i].Status == true)&&(FoundReason == JOB_OK)) { @@ -1025,6 +1040,18 @@ JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) if (FoundReason == JOB_OK) { FoundReason = Winder_Check_Cone(); + if (FoundReason!=JOB_OK) + { + for (Alarm_i = 0;Alarm_i<NumOfSystemAlarms;Alarm_i++) + { + if (AlarmItem[Alarm_i].EventType == EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST) + { + AlarmId = Alarm_i; + ReportWithPackageFilter(AlarmFilter,"cone not in place - preventing job", __FILE__,AlarmId,AlarmItem[Alarm_i].EventType, AlarmItem[Alarm_i].Severity, AlarmItem[Alarm_i].DeviceId, 0); + break; + } + } + } } if (FoundReason != JOB_OK) { diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index b159897aa..4122955b3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -532,10 +532,10 @@ void CopyTemperaturesToMonitor(void) DiagnosticsMonitor.n_headzone12temperature = HeaterCounterIndex[HEATER_TYPE__HeaterZone12]; - DiagnosticsMonitor.n_headblower1airflow = HeaterCounterIndex[HEATER_TYPE__HeaterZone5]; - DiagnosticsMonitor.n_headblower2airflow = HeaterCounterIndex[HEATER_TYPE__HeaterZone7]; - headblower1airflow = PressureSensorGetPressure(HEAD_PT100_ZONE_5_0X84_0); - headblower2airflow = PressureSensorGetPressure(HEAD_PT100_ZONE_7_0X86_0); + DiagnosticsMonitor.n_headblower1airflow = HeaterCounterIndex[HEATER_TYPE__HeaterZone7]; + DiagnosticsMonitor.n_headblower2airflow = HeaterCounterIndex[HEATER_TYPE__HeaterZone5]; + headblower1airflow = PressureSensorGetPressure(HEAD_FAN_RIGHT); + headblower2airflow = PressureSensorGetPressure(HEAD_FAN_LEFT); DiagnosticsMonitor.headblower1airflow = &headblower1airflow; DiagnosticsMonitor.headblower2airflow = &headblower2airflow; @@ -545,6 +545,20 @@ void CopyTemperaturesToMonitor(void) headblowervoltage2 = HeadBlowersGetRPM(HEAD_FAN_LEFT); DiagnosticsMonitor.headblowervoltage1 = &headblowervoltage1; DiagnosticsMonitor.headblowervoltage2 = &headblowervoltage2; +#warning machine to machine test + DiagnosticsMonitor.headzone4temperature = + HeaterTemperature[HEATER_TYPE__HeaterZone4]; + DiagnosticsMonitor.headzone9temperature = + HeaterTemperature[HEATER_TYPE__HeaterZone9]; + DiagnosticsMonitor.headzone10temperature = + HeaterTemperature[HEATER_TYPE__HeaterZone10]; + DiagnosticsMonitor.n_headzone4temperature = + HeaterCounterIndex[HEATER_TYPE__HeaterZone4]; + DiagnosticsMonitor.n_headzone9temperature = + HeaterCounterIndex[HEATER_TYPE__HeaterZone9]; + DiagnosticsMonitor.n_headzone10temperature = + HeaterCounterIndex[HEATER_TYPE__HeaterZone10]; + } #ifdef FOUR_WINDERS // double dancer2,dancer3,dancer4; @@ -989,6 +1003,11 @@ void DiagnosticOneSecCollection(void) //DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone8, MillisecGetTemperatures(HEAD_PT100_ZONE_8_0X86_1)); DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone11, MillisecGetTemperatures(HEAD_PT100_ZONE_11_0X8A_0)); DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone12, MillisecGetTemperatures(HEAD_PT100_ZONE_12_0X8A_1)); +#warning MACHINE TO MACHINE TEST + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone4, MillisecGetTemperatures(HEAD_PT100_ZONE_4_0X82_1)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone9, MillisecGetTemperatures(HEAD_PT100_ZONE_9_0X88_0)); + DiagnosticLoadTemperature(HEATER_TYPE__HeaterZone10, MillisecGetTemperatures(HEAD_PT100_ZONE_10_0X88_1)); + } DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature, MillisecGetTemperatures(TEMP_SENSE_ANALOG_DRYER_TEMP1)); DiagnosticLoadTemperature(HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain, MillisecGetTemperatures(TEMP_SENSE_ANALOG_DRYER_TEMP2)); diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c index c7f8740d1..9a14cd1b8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/DiagnosticsHoming.c @@ -475,7 +475,7 @@ uint32_t Diagnostics_Set_Load_Arm_To_Stopper_Callback(uint32_t deviceID, uint32_ angle = Calculate_Arm_Distance(D_DrierPrevLocation,temp); - if ((angle<14000 )||(BusyFlag == BUSY)) // OK - take another round + if ((abs (angle)<14000 )||(BusyFlag == BUSY)) // OK - take another round { responseContainer.has_error = true; responseContainer.error = ERROR_CODE__GENERAL_ERROR; @@ -611,7 +611,7 @@ uint32_t Diagnostics_Dryer_Loading_Callback(uint32_t MotorId, uint32_t ReadValue ReportWithPackageFilter(DiagnosticsFilter,"Diagnostics_Dryer_Loading_Callback",__FILE__,(int)angle,(int)ReadValue,RpMessage,temp,0); MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,D_numberOfCycles); - if ((angle>14000 )&&(ReadValue == NOTBUSY)) // OK - take another round + if ((abs(angle)>14000 )&&(ReadValue == NOTBUSY)) // OK - take another round { D_DrierPrevLocation = temp; //ReportWithPackageFilter(DiagnosticsFilter,"Diagnostics_Dryer_Loading_Callback",__FILE__,__LINE__,LoadStages,RpMessage,NumberOfDrierLoaderCycles,0); diff --git a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c index 193a35e12..cc2c508c0 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c +++ b/Software/Embedded_SW/Embedded/Modules/General/GeneralHardware.c @@ -885,7 +885,9 @@ void FlashInitAndLoad(void) } Report("Hardware Initialized", __FILE__,__LINE__,Bytes, RpMessage, GENHWCFG_MAP_IN_FLASH, 0); - StoreDancerConfigMessage(); + StoreDancerConfigMessage(0); + StoreDancerConfigMessage(1); + StoreDancerConfigMessage(2); Report("Dancer Initialized", __FILE__,DancersCfg[0].zeropoint,DancersCfg[1].zeropoint, RpMessage, DancersCfg[2].zeropoint, 0); /*Bytes = AlarmHandlingLoadFile(); if (Bytes>0) diff --git a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c index 4c248e94b..bf68b64f0 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c +++ b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c @@ -245,7 +245,7 @@ return OK; * */ char WasteEmptyingToken[36+1] = {0}; -uint32_t CartridgeStateUpdate(CartridgeSlot Slot,CartridgeState State, double percentage) +uint32_t CartridgeStateUpdate(CartridgeSlot Slot, int32_t index, CartridgeState State, double percentage) { if (WasteEmptyingToken[0] == 0) return ERROR; @@ -271,6 +271,9 @@ uint32_t CartridgeStateUpdate(CartridgeSlot Slot,CartridgeState State, double pe CartData.has_slot = true; CartData.slot = Slot; + CartData.has_index = true; + CartData.index = index; + /* struct _CartridgeStatus { @@ -327,9 +330,9 @@ uint32_t StartInkFillingStatusRequestFunc(MessageContainer* requestContainer) StartInkFillingStatusRequest* request = start_ink_filling_status_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); ustrncpy (WasteEmptyingToken, requestContainer->token,36); - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink,CARTRIDGE_STATE__None,0); - CartridgeStateUpdate(CARTRIDGE_SLOT__WasteMiddle,CARTRIDGE_STATE__None,0); - CartridgeStateUpdate(CARTRIDGE_SLOT__WasteLower,CARTRIDGE_STATE__None,0); + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink,0, CARTRIDGE_STATE__None,0); + CartridgeStateUpdate(CARTRIDGE_SLOT__WasteMiddle, 0, CARTRIDGE_STATE__None,0); + CartridgeStateUpdate(CARTRIDGE_SLOT__WasteLower, 1, CARTRIDGE_STATE__None,0); start_ink_filling_status_request__free_unpacked(request,NULL); return status; // case MESSAGE_TYPE__StartWasteEmptyingRequest: diff --git a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h index ed3ec205d..a9539e0fa 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h +++ b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.h @@ -19,7 +19,7 @@ void SetMachineStatus (MachineState State); int MachineUpdateResponseFunc(void); uint32_t StartInkFillingStatusRequestFunc(MessageContainer* requestContainer); -uint32_t CartridgeStateUpdate(CartridgeSlot Slot,CartridgeState State, double percentage); +uint32_t CartridgeStateUpdate(CartridgeSlot Slot, int32_t index, CartridgeState State, double percentage); diff --git a/Software/Embedded_SW/Embedded/Modules/General/buttons.c b/Software/Embedded_SW/Embedded/Modules/General/buttons.c index 0dda71d16..833530536 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/buttons.c +++ b/Software/Embedded_SW/Embedded/Modules/General/buttons.c @@ -62,6 +62,7 @@ uint32_t ButtonLoadCBFunction(uint32_t IfIndex, uint32_t ReadValue); //uint32_t LoadLongPress( button *pBtn); bool get_pbAction ( button *pBtn, PB_Status ReadValue); +int JogSpeed = 40; #define LOADLONGPRESS 3 int PowerDown() @@ -325,7 +326,7 @@ uint32_t ButtonJogCBFunction(uint32_t IfIndex, uint32_t ReadValue) ReportWithPackageFilter(GeneralFilter,"------------ joggingMachine: Jogging is sttENABLE and PRESS-----------------", __FILE__,__LINE__,jog.state, RpMessage, jog.Action, 0); jog.color = colorON; jog.color = BLINK; - ThreadJoggingFunc(40); + ThreadJoggingFunc(JogSpeed); jog.state = sttJOGGING; } } diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c index 59a0aee51..5134e97aa 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c @@ -50,15 +50,17 @@ #define MAX_ALLOWED_PWM 255 #define ARC_ALARM_LIMIT 3 -#define PRESSURE_SENSOR_CP 0.269 -#define PRESSURE_SENSOR_B 0.45 +#define PRESSURE_SENSOR_CP 0.269 +#define PRESSURE_SENSOR_B 0.45 +#define V0_DEFAULT_VALUE 1050 +#define FAN_MIN_RPM_THRESHOLD 4000 extern uint16_t Head_Fan_Tach[2]; extern uint8_t Head_Fan_PWM_Command[2]; uint32_t PressureSensorV0[2] = {0, 0}; uint8_t HeadBlowersCloseLoopTime[2] = {2, 2}; uint8_t HeadBlowersEnable = 1; -uint8_t BlowerIdToSensorId[2] = {HEAD_PT100_ZONE_5_0X84_0, HEAD_PT100_ZONE_7_0X86_0}; //HEAD_FAN_RIGHT, HEAD_FAN_LEFT +uint8_t BlowerIdToSensorId[2] = {HEAD_PT100_ZONE_7_0X86_0, HEAD_PT100_ZONE_5_0X84_0}; //HEAD_FAN_RIGHT, HEAD_FAN_LEFT typedef struct { @@ -90,8 +92,8 @@ void HeadBlowersInit() HeadBlowerControl[0].m_params.MAX = 200; HeadBlowerControl[0].m_params.MIN = -200; HeadBlowerControl[0].m_params.Kd = 0; - HeadBlowerControl[0].m_params.Kp = 350; - HeadBlowerControl[0].m_params.Ki = 25; + HeadBlowerControl[0].m_params.Kp = 800; + HeadBlowerControl[0].m_params.Ki = 80; HeadBlowerControl[0].m_params.IntegralErrorMultiplier = 10; HeadBlowerControl[0].m_params.ProportionalErrorMultiplier = 10; HeadBlowerControl[0].m_params.epsilon = 0; @@ -108,8 +110,8 @@ void HeadBlowersInit() HeadBlowerControl[1].m_params.MAX = 200; HeadBlowerControl[1].m_params.MIN = -200; HeadBlowerControl[1].m_params.Kd = 0; - HeadBlowerControl[1].m_params.Kp = 350; - HeadBlowerControl[1].m_params.Ki = 25; + HeadBlowerControl[1].m_params.Kp = 800; + HeadBlowerControl[1].m_params.Ki = 80; HeadBlowerControl[1].m_params.IntegralErrorMultiplier = 10; HeadBlowerControl[1].m_params.ProportionalErrorMultiplier = 10; HeadBlowerControl[1].m_params.epsilon = 0; @@ -181,11 +183,16 @@ int HeadBlowerSensorIdToFanId(uint8_t sensorId) return HEAD_FAN_LEFT; } +int HeadBlowerFanIdToBlowerId(uint8_t FanId) +{ + return BlowerIdToSensorId[FanId]; +} + bool HeadBlowerFlowControl(double Q_value, uint8_t blowerId) { double currentFlow = 0.0; - currentFlow = PressureSensorGetPressure(BlowerIdToSensorId[blowerId]); + currentFlow = PressureSensorGetPressure(blowerId); HeadBlowerPidFunc(Q_value,currentFlow, blowerId); return OK; } @@ -270,7 +277,7 @@ void ArcHeadAlarms(void) count4 = (count4 < 0)?(0):(count4); } - currentFlow = PressureSensorGetPressure(HEAD_PT100_ZONE_5_0X84_0); + currentFlow = PressureSensorGetPressure(HEAD_FAN_RIGHT); if (currentFlow > 5.0) { if (++count5 == ARC_ALARM_LIMIT) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_HIGH, true); @@ -290,7 +297,7 @@ void ArcHeadAlarms(void) count6 = (count6 < 0)?(0):(count6); } - currentFlow = PressureSensorGetPressure(HEAD_PT100_ZONE_7_0X86_0); + currentFlow = PressureSensorGetPressure(HEAD_FAN_LEFT); if (currentFlow > 5.0) { if (++count7 == ARC_ALARM_LIMIT) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_HIGH, true); @@ -347,9 +354,13 @@ void HeadBlowersCfg() uint32_t PressureSensorInit(int blowerId) { - uint32_t V0; - V0 = MillisecGetTemperatures(BlowerIdToSensorId[blowerId]); - V0 /= 10; + uint32_t rpm, V0 = 0; + + rpm = HeadBlowersGetRPM(blowerId); + if (rpm < FAN_MIN_RPM_THRESHOLD) { + V0 = MillisecGetTemperatures(BlowerIdToSensorId[blowerId]); + V0 /= 10; + } return V0; } @@ -369,12 +380,12 @@ int HeadBlowersGetPWM(uint8_t blowerId) return Head_Fan_PWM_Command[blowerId]; } -double PressureSensorGetPressure(uint8_t SensorId) +double PressureSensorGetPressure(uint8_t FanId) { double V0, Vm, Q; - int FanId; + int SensorId; - FanId = HeadBlowerSensorIdToFanId(SensorId); + SensorId = BlowerIdToSensorId[FanId]; V0 = PressureSensorV0[FanId]; Vm = (double)(MillisecGetTemperatures(SensorId)); Vm /= 10.0; @@ -400,6 +411,7 @@ uint32_t HeadBlowerCommandRequestMessage(int blowerId, float flow) ReportWithPackageFilter(HeatersFilter,"flow not in range",__FILE__, flow, blowerId,RpError, 0,0); return ERROR; } + ReportWithPackageFilter(HeatersFilter,"HeadBlower configured",__FILE__,blowerId,(int)(flow*100),RpError, PressureSensorV0[blowerId],0); headBlowersFlow[blowerId] = flow; return OK; } diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h index a23abf559..ee60a75cc 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h @@ -44,7 +44,7 @@ uint32_t HeatersEnd(void); void HeatersControlStart(void); void HeatersControlStop(void); uint32_t Heaters_Init(void); -double PressureSensorGetPressure(uint8_t SensorId); +double PressureSensorGetPressure(uint8_t FanId); int HeadBlowersGetRPM(uint8_t fanId); uint32_t PressureSensorInit(); void HeadBlowersInit(); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index fcd1c05a2..b1b81b3f1 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -591,10 +591,10 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl { DispenserTotalPrepareSteps[i]+=(CurrentDispenserSpeed[i]*PRESSURE_READ_TIME_GAP/eOneSecond); HW_Motor_Id = DispenserIdToMotorId[i]; - if ((DispenserTotalPrepareSteps[i]>TargetNumberOfStepsPreRun)&&(DispenserTotalPrepareSteps[i]<(TargetNumberOfStepsPreRun+InitialDispenserSpeed))) + /*if ((DispenserTotalPrepareSteps[i]>TargetNumberOfStepsPreRun)&&(DispenserTotalPrepareSteps[i]<(TargetNumberOfStepsPreRun+InitialDispenserSpeed))) { ReportWithPackageFilter(IDSFilter,"IDS dispenser pre-run ended",__FILE__,i,(int)DispenserTotalPrepareSteps[i],RpWarning,(int)(pressure*100),0); - } + }*/ if (DispenserTotalPrepareSteps[i]<TargetNumberOfStepsPreRun) { AdjustDispenserSpeedToPressure(i,MaximalPressurePreRun,pressure); @@ -634,7 +634,9 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl if (NumofReadyDispensers>=NumOfActiveDispensers) { pressureReady = true; - ReportWithPackageFilter(IDSFilter,"pressureReady = true;",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)NumOfActiveDispensers,0); + usnprintf(IdMessage, 80,"setting pressureReady = true %d K %d,C %d,M %d,Y %d,TI %d",(int)TargetNumberOfStepsPreRun,DispenserTotalPrepareSteps[0],DispenserTotalPrepareSteps[1], + DispenserTotalPrepareSteps[2],DispenserTotalPrepareSteps[3],DispenserTotalPrepareSteps[4]); + ReportWithPackageFilter(IDSFilter,IdMessage,__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)NumOfActiveDispensers,0); } if (pressureReady == true) { @@ -1935,6 +1937,8 @@ uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId) } } + if (CurrentDispenserSpeed[CLEANER_DISPENSER]>0) + IDS_Cleaning_Stop_Cleaning_Solution(NULL); IDS_StopLubrication(); Init_CleaningStageCounter();//set the counter before relocating HeadCard_Actuators_Relocate(); diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c index 329357ed4..469e82aa8 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c @@ -157,9 +157,20 @@ bool CartridgeInkFull() int GetCartridgeFillPercent() { double MidTank_Pressure = 0; - +#ifdef IFS_DEBUG + static int percent = 0; + if (midTankState == MidTankStateFilling) { + if (percent < 100) { + percent += 1; + } + } else { + percent = 0; + } + return percent; +#else MidTank_Pressure = Read_MidTank_Pressure_Sensor(midTankCartColor); return (((MidTank_Pressure - midTankCapacity)* 100) / CARTRIDGE_CAPATICY); +#endif } bool midTankCart_door() @@ -284,7 +295,6 @@ void midTankStateMachine(void) break; } //check RFID - check cartridge OK - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Inserted, 0); // send request for validation to ppc inkAuthenticationPass = 2; //not defined @@ -306,17 +316,18 @@ void midTankStateMachine(void) Report("MidTank Cartridge authentication wait...", __FILE__, __LINE__, authenticationTimeOutCounter, RpMessage, 0, 0); if (authenticationTimeOutCounter > 60) { midTankState = MidTankStateIdle; - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Error, 0); + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__Error, 0); } break; } if (inkAuthenticationPass == false) { Report("MidTank Cartridge authentication fail", __FILE__, __LINE__, 0, RpMessage, 0, 0); - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Error, 0); + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__Error, 0); midTankState = MidTankStateIdle; break; } // Cartridge status received from user - assume cartridge is full + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__Inserted, 0); midTankCapacity = Get_MidTank_Pressure_Sensor(midTankCartColor); if ((midTankCapacity > MidTankEmptyLimit)&&(midTankCartColor!=MIDTANK_8))//enable lubricant filling in two stages @@ -325,13 +336,13 @@ void midTankStateMachine(void) cart1.color = fastBILNK; Report("Mid-tank not empty", __FILE__, __LINE__, midTankCapacity, RpMessage, MidTankEmptyLimit, 0); midTankState = MidTankStateIdle; - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Error, 0); + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__Error, 0); break; } Report("Mid-tank filling in process", __FILE__,__LINE__,(int)(MidTankEmptyLimit*1000), RpMessage, (int)(midTankCapacity*1000), 0); Pannel_Leds(CART_1, MODE_ON); cart1.color = BLINK; - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Filling, 0); + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__Filling, 0); if (midTankCartColor == MIDTANK_8) { @@ -356,7 +367,7 @@ void midTankStateMachine(void) Report("Cartridge extracted during filling!!!", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); Report("Mid-tank # filling fail", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); midTankState = MidTankStateIdle; - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Absent, GetCartridgeFillPercent()); + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__Absent, GetCartridgeFillPercent()); } // if time out or emptying done - idle if (midTankTimeoutCounter++ > CartridgeInkTimeout) { @@ -366,7 +377,7 @@ void midTankStateMachine(void) MidTankValvesAction(Cartridge_MidTank_OFF); Report("Mid-tank # filling fail", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); Report("Call customer support", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Error, GetCartridgeFillPercent()); + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__Error, GetCartridgeFillPercent()); midTankState = MidTankStateIdle; } else if (CartridgeInkFull()) { midTankTimeoutCounter = 0; @@ -376,9 +387,10 @@ void midTankStateMachine(void) Report("Mid-tank # filling done", __FILE__, __LINE__, midTankState, RpMessage, 0, 0); midTankState = MidTankStateIdle; // RFID change status - inkEmpty - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__FillingCompleted, 100.0); + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__FillingCompleted, 100.0); } - CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, CARTRIDGE_STATE__Filling, GetCartridgeFillPercent()); + if (midTankState == MidTankStateFilling) + CartridgeStateUpdate(CARTRIDGE_SLOT__Ink, midTankCartColor, CARTRIDGE_STATE__Filling, GetCartridgeFillPercent()); break; default: Report("wrong state", __FILE__, __LINE__, midTankState, RpMessage, 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 c6cfbb1d1..284a43e41 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -1246,7 +1246,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.has_progress = true; } else - if(request->amount == 0xB24) //Set loading arm cycles + if(request->amount == 0xB24) //AttemptThreadJoggingFunc { REPORT_MSG(request->delay,"AttemptThreadJoggingFunc"); AttemptThreadJoggingFunc(NULL); @@ -1254,6 +1254,23 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.has_progress = true; } else + if(request->amount == 0xB25) //Change jog speed + { + REPORT_MSG(request->delay,"Change jog speed"); + if (request->delay<100) + JogSpeed = request->delay; + response.progress = JogSpeed; + response.has_progress = true; + } + else + if(request->amount == 0xB26) //Change sublimation time + { + REPORT_MSG(request->delay,"Change sublimation time"); + setSublimationBlowTime(request->delay); + response.progress = JogSpeed; + response.has_progress = true; + } + else if(request->amount == 0xC3) //suspend I2C task { if (request->delay == 0) diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c index 3d2db071e..27a7dfb31 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Stub_Dancer.c @@ -70,6 +70,7 @@ void Stub_DancerPositionRequest(MessageContainer* requestContainer) response.has_general_status = true; response.detailed_status = DANCER_ENC[request->dancer_id].Det_status; response.has_general_status = true; + StoreDancerConfigMessage(Dancer_Id); } else if(Dancer_Id < NUM_OF_ROTENC*2) { @@ -86,8 +87,6 @@ void Stub_DancerPositionRequest(MessageContainer* requestContainer) response.detailed_status = ERROR; // use the Reserved bits to send our errors response.has_general_status = true; } - if (Dancer_Id == 2) - StoreDancerConfigMessage(); responseContainer = createContainer(MESSAGE_TYPE__StubDancerPositionResponse, requestContainer->token, true, &response, &stub_dancer_position_response__pack, &stub_dancer_position_response__get_packed_size); //free(request); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index cdb726b5e..c3f15aff8 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -258,7 +258,7 @@ { CallbackCounter--; } - if ((angle>14000 )&&(BusyFlag == NOTBUSY)) // OK - take another round + if ((abs(angle)>14000 )&&(BusyFlag == NOTBUSY)) // OK - take another round { Report("Thread_Load_Set_Load_Arm_To_Stopper time",__FILE__,msec_millisecondCounter - UnloadingStart,msec_millisecondCounter,RpMessage,UnloadingStart,0); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h index 07ecf5d0b..11a92ab63 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h @@ -46,7 +46,7 @@ uint32_t ThreadEndState(); bool Set_Thread_Rockers_Bypass (int value); -uint32_t StoreDancerConfigMessage(void); +uint32_t StoreDancerConfigMessage(int DancerId); uint32_t LoadDancerConfigMessage(void); //uint32_t MotorPidRequestMessage(HardwarePidControl* request); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index 1920db03a..869485b71 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -188,40 +188,36 @@ uint32_t MotorPidRequestMessage(HardwarePidControl* request) } char DancerConfigPath[50] = "0://SysInfo//DancCfg.cfg"; -uint32_t StoreDancerConfigMessage() +uint32_t StoreDancerConfigMessage(int DancerId) { uint32_t status = OK; // FRESULT Fresult = FR_OK; //HardwareConfiguration DancerConfig; HardwareDancer Dancers[MAX_SYSTEM_DANCERS]; - // uint8_t* response_buffer; +#ifdef FOUR_WINDERS + uint8_t DancerAddress[MAX_SYSTEM_DANCERS] = {EEPROM_STORAGE_DANCER_0,EEPROM_STORAGE_DANCER_1,EEPROM_STORAGE_DANCER_2,EEPROM_STORAGE_DANCER_3,EEPROM_STORAGE_DANCER_4}; +#else + uint8_t DancerAddress[MAX_SYSTEM_DANCERS] = {EEPROM_STORAGE_DANCER_0,EEPROM_STORAGE_DANCER_1,EEPROM_STORAGE_DANCER_2}; +#endif // size_t response_size = 0; - int Dancer_i; + int Dancer_i = DancerId; //hardware_configuration__init(&DancerConfig); //DancerConfig.dancers = (HardwareDancer**)my_malloc(sizeof(HardwareDancer*)*MAX_SYSTEM_DANCERS); - for (Dancer_i = 0; Dancer_i < MAX_SYSTEM_DANCERS; Dancer_i++) - { - hardware_dancer__init(&Dancers[Dancer_i]); - //DancerConfig.dancers[Dancer_i] = &Dancers[Dancer_i]; - Dancers[Dancer_i].has_zeropoint = true; - Dancers[Dancer_i].hardwaredancertype = Dancer_i; - Dancers[Dancer_i].has_hardwaredancertype = true; - Dancers[Dancer_i].zeropoint=Control_Read_Dancer_Position(Dancer_i,0); - //DancerConfig.n_dancers++; - DancersCfg[Dancer_i].zeropoint = Dancers[Dancer_i].zeropoint; - DancersCfg[Dancer_i].zeropoint = Control_Read_Dancer_Position(Dancer_i,0); - } + hardware_dancer__init(&Dancers[Dancer_i]); + //DancerConfig.dancers[Dancer_i] = &Dancers[Dancer_i]; + Dancers[Dancer_i].has_zeropoint = true; + Dancers[Dancer_i].hardwaredancertype = Dancer_i; + Dancers[Dancer_i].has_hardwaredancertype = true; + Dancers[Dancer_i].zeropoint=Control_Read_Dancer_Position(Dancer_i,0); + //DancerConfig.n_dancers++; + DancersCfg[Dancer_i].zeropoint = Dancers[Dancer_i].zeropoint; + DancersCfg[Dancer_i].zeropoint = Control_Read_Dancer_Position(Dancer_i,0); - status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_0,DancersCfg[0].zeropoint); - status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_1,DancersCfg[1].zeropoint); - status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_2,DancersCfg[2].zeropoint); - Report("~~~~~~Store eeprom 0",__FILE__,DancersCfg[0].zeropoint,(int)DancersCfg[1].zeropoint,RpWarning,(int)DancersCfg[2].zeropoint,0); -#ifdef FOUR_WINDERS - status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_3,DancersCfg[HARDWARE_DANCER_3].zeropoint); - status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_4,DancersCfg[HARDWARE_DANCER_4].zeropoint); - Report("~~~~~~Store eeprom 1",__FILE__,__LINE__,(int)DancersCfg[HARDWARE_DANCER_3].zeropoint,RpWarning,(int)DancersCfg[HARDWARE_DANCER_4].zeropoint,0); -#endif + + + status |= MCU_E2PromProgram(DancerAddress[Dancer_i],DancersCfg[Dancer_i].zeropoint); + Report("~~~~~~Store eeprom dancer",__FILE__,__LINE__,Dancer_i,RpWarning,(int)DancersCfg[Dancer_i].zeropoint,0); /* response_buffer = my_malloc(hardware_configuration__get_packed_size(&DancerConfig)); if (response_buffer) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 8d41f3b9a..5fee72dc7 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -1338,22 +1338,22 @@ uint32_t UpdatePidDuringRun(HardwarePidControl *request) return ERROR; - if (request->derivativetime == true) + if (request->has_derivativetime == true) { MotorControlConfig[Motor_i].m_params.Kd = request->derivativetime; ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun Kd",__FILE__,Motor_i,(int)(request->derivativetime),RpWarning,0,0); } - if (request->proportionalgain == true) + if (request->has_proportionalgain == true) { MotorControlConfig[Motor_i].m_params.Kp = request->proportionalgain; ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun Kp",__FILE__,Motor_i,(int)(request->proportionalgain),RpWarning,0,0); } - if (request->integraltime == true) + if (request->has_integraltime == true) { MotorControlConfig[Motor_i].m_params.Ki = request->integraltime; ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun Ki",__FILE__,Motor_i,(int)(request->integraltime),RpWarning,0,0); } - if (request->epsilon == true) + if (request->has_epsilon == true) { MotorControlConfig[Motor_i].m_params.epsilon = request->epsilon; ReportWithPackageFilter(ThreadFilter,"UpdatePidDuringRun epsilon",__FILE__,Motor_i,(int)(request->epsilon*10000),RpWarning,0,0); diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 25fb8e962..c1b54b4d6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -42,6 +42,7 @@ uint32_t Cartridge_Cover_Control; button *CartLed[MaxWasteCartridges] = {0, &cart2, &cart3}; WasteTankStateEnum WasteTankState = WasteTankStateIdle; +extern char WasteEmptyingToken[36+1]; int init = 1; bool setWasteValve (WasteCartridgeEnum WasteCartridge); @@ -165,7 +166,7 @@ WasteCartridgeEnum cartGetActiveCart() { uint32_t CartId; - for (CartId = 0; CartId < MaxWasteCartridges; CartId++) { + for (CartId = WasteCartridge_middle; CartId < MaxWasteCartridges; CartId++) { if (CartState[CartId] == CartridgeStateACTIVE) return CartId; } @@ -223,10 +224,13 @@ bool setWasteValve (WasteCartridgeEnum WasteCartridge) bool RdWasteTankEmptySensor() { //double WasteLevel = 0.0; - +#ifndef WHS_DEBUG if (WHS_Type == WHS_TYPE_UNKNOWN) { return WHS_GPI_WCONTAINER_WARN(); - } else { //new WHS + } + else +#endif + { //new WHS //WasteLevel = GetWHSWasteTankLevelMiliLiter(); if (wasteLevel < wasteLevelEmpty) return 1; //Empty @@ -237,10 +241,13 @@ bool RdWasteTankEmptySensor() bool RdWasteTankFullSensor() { //double WasteLevel = 0.0; - +#ifndef WHS_DEBUG if (WHS_Type == WHS_TYPE_UNKNOWN) { return WHS_GPI_WCONTAINER_FULL(); - } else { //new WHS + } + else +#endif + { //new WHS //WasteLevel = GetWHSWasteTankLevelMiliLiter(); if (wasteLevel >= wasteLevelFull) return 1; //full @@ -251,10 +258,13 @@ bool RdWasteTankFullSensor() bool RdWasteTankOverFlowSensor() { //double WasteLevel = 0.0; - +#ifndef WHS_DEBUG if (WHS_Type == WHS_TYPE_UNKNOWN) { return WHS_GPI_WASTE_OVERFULL(); - } else {//new WHS + } + else +#endif + {//new WHS //WasteLevel = GetWHSWasteTankLevelMiliLiter(); if (wasteLevel > wasteLevelOverflow) return 1; //overflow @@ -348,13 +358,14 @@ uint32_t Waste_DoorOpenDuringEmptying(uint32_t IfIndex, uint32_t ReadValue) void Waste_StateMachine_OneSecond_Call(void) { static WasteTankStateEnum prev_state = 0; - static int prev_wasteLevel = 0; + static int cart, prev_wasteLevel = 0; + static int insertUpdate[3] = {0, 0, 0}; //call cartridge state if ((Is_Cartridge_Present(CART_2) != cartGetPresence(WasteCartridge_middle)) || (init)) { if (Is_Cartridge_Present(CART_2)) { cartCART_INSERTED(WasteCartridge_middle); - CartridgeStateUpdate(CARTRIDGE_SLOT__WasteMiddle, CARTRIDGE_STATE__Inserted, 0); + insertUpdate[CARTRIDGE_SLOT__WasteMiddle-1] = 1; } else { cartCART_EXTRACTED(WasteCartridge_middle); } @@ -362,12 +373,20 @@ void Waste_StateMachine_OneSecond_Call(void) if ((Is_Cartridge_Present(CART_3) != cartGetPresence(WasteCartridge_lower)) || (init)) { if (Is_Cartridge_Present(CART_3)) { cartCART_INSERTED(WasteCartridge_lower); - CartridgeStateUpdate(CARTRIDGE_SLOT__WasteLower, CARTRIDGE_STATE__Inserted, 0); + insertUpdate[CARTRIDGE_SLOT__WasteLower-1] = 1; } else { cartCART_EXTRACTED(WasteCartridge_lower); } } + //update ppc + for (cart = WasteCartridge_middle; cart <= WasteCartridge_lower; cart++) { + if ((insertUpdate[cart]) && (WasteEmptyingToken[0])) { + CartridgeStateUpdate(cart, cart-1, CARTRIDGE_STATE__Inserted, 0); + insertUpdate[cart] = 0; + } + } + //call door state cartCart_door(); @@ -467,7 +486,7 @@ void Waste_StateMachine(void) //start emptying // RFID change status - set wasteFilling WasteTankState = WasteTankStateEmptying; - CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__Emptying, 0); + CartridgeStateUpdate(activeCart, activeCart-1, CARTRIDGE_STATE__Emptying, 0); break; case WasteTankStateEmptying: // if time out or emptying done - idle @@ -478,7 +497,7 @@ void Waste_StateMachine(void) WasteTankState = WasteTankStateIdle; usnprintf(str, 100, "WasteTankStateEmptying Timeout. time:%d:%d volume:%d", timeout_counter/60, timeout_counter%60, WHS_GetCartridgeFill()); Report(str, __FILE__, __LINE__, 0, RpMessage, 0, 0); - CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__Error, WHS_GetCartridgeFillPercent()); + CartridgeStateUpdate(activeCart, activeCart-1, CARTRIDGE_STATE__Error, WHS_GetCartridgeFillPercent()); AlarmHandlingSetAlarm( EVENT_TYPE__WASTE_CONTAINER_EMPTYING_TIMEOUT, true); RemoveControlCallback(Cartridge_Cover_Control, Waste_DoorOpenDuringEmptying); timeout_counter = 0; @@ -493,10 +512,11 @@ void Waste_StateMachine(void) AlarmHandlingSetAlarm( EVENT_TYPE__ALL_WASTE_CARTRIDGES_FULL, true); usnprintf(str, 100, "WasteTankStateEmptying done. time:%d:%d volume:%d", timeout_counter/60, timeout_counter%60, WHS_GetCartridgeFill()); Report(str, __FILE__, __LINE__, 0, RpMessage, 0, 0); - CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__EmptyingCompleted, WHS_GetCartridgeFillPercent()); + CartridgeStateUpdate(activeCart, activeCart-1, CARTRIDGE_STATE__EmptyingCompleted, WHS_GetCartridgeFillPercent()); timeout_counter = 0; } - CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__Emptying, WHS_GetCartridgeFillPercent()); + if (WasteTankState == WasteTankStateEmptying) + CartridgeStateUpdate(activeCart, activeCart-1, CARTRIDGE_STATE__Emptying, WHS_GetCartridgeFillPercent()); #ifdef WHS_DEBUG wasteLevel -= 100; timeout_counter += 10; @@ -517,7 +537,7 @@ void Waste_StateMachine(void) AlarmHandlingSetAlarm( EVENT_TYPE__ALL_WASTE_CARTRIDGES_FULL, true); Report("WasteTankStatePaused done", __FILE__, __LINE__, 0, RpMessage, 0, 0); timeout_counter = 0; - CartridgeStateUpdate(activeCart, CARTRIDGE_STATE__Error, WHS_GetCartridgeFillPercent()); + CartridgeStateUpdate(activeCart, activeCart-1, CARTRIDGE_STATE__Error, WHS_GetCartridgeFillPercent()); } break; default: @@ -567,8 +587,8 @@ uint32_t Waste_PrepareCallbak(uint32_t IfIndex, uint32_t ReadValue) { bool ready = false, headready = false,whsready = false; double HeadFlow = GetWHSAirFlow(HEAD_FLOW_METER); - double HeadIn_Flow = PressureSensorGetPressure(HEAD_PT100_ZONE_5_0X84_0); - double HeadOut_Flow = PressureSensorGetPressure(HEAD_PT100_ZONE_7_0X86_0); + double HeadIn_Flow = PressureSensorGetPressure(HEAD_FAN_RIGHT); + double HeadOut_Flow = PressureSensorGetPressure(HEAD_FAN_LEFT); if ((HeadFlow<(headairflow*(1+AllowedRangeForWasteBlowerDeviation))) &&(HeadFlow>(headairflow*(1-AllowedRangeForWasteBlowerDeviation)))) { diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt index 4e1f7104f..736f6e3be 100644 --- a/Software/Embedded_SW/Embedded/Software Release Notes.txt +++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt @@ -1,3 +1,18 @@ +Embedded SW Release note - Version 1.5.2(1) - Pack 3 +============================================================= +Rebuild Flash file system on Initialization failure. +Protobuf - Procedure request, Read all hardware request, AttemptThreadJoggingRequest. +Align pressure reading setup with electric scripts. +fix alarm handling bugs (#4085, #4097), fix job failures report. +add diagnostic temperature meters to diagnostic data (zone 4,9,10). +add stub to control jog speed. +fix Change Pid During Job stub handling. +IFS and waste cartridge requests. +Blowers V0 initialization and handling fixed and improved. +Dancer resetting - enable for single dancer +support initial BTSR tests +Store cleaning parameters from the last job for cleaning jobs (#4112) + Embedded SW Release note - Version 1.5.1(4) - Pack 3 ============================================================= fix tunnel pressure calculation diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index b50957089..5d97a0003 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -491,8 +491,16 @@ uint32_t InitSequenceArcAirflowCalibration(void) MCU_E2PromRead(EEPROM_PRESSURE_SENSOR_V0_1, &V0[1]); ReportWithPackageFilter(InitFilter,"load initial values from EEPROM", __FILE__,__LINE__, (int)V0[0], RpMessage, (int)V0[1], 0); } - PressureSensorV0[0] = V0[0]; - PressureSensorV0[1] = V0[1]; + if ((V0[0] > 1000) && (V0[0] < 1200)) { + PressureSensorV0[0] = V0[0]; + } else { + PressureSensorV0[0] = 1100; + } + if ((V0[1] > 1000) && (V0[1] < 1200)) { + PressureSensorV0[1] = V0[1]; + } else { + PressureSensorV0[1] = 1100; + } return OK; } uint32_t InitSequenceInitialBlowerActivation(void) @@ -500,10 +508,6 @@ uint32_t InitSequenceInitialBlowerActivation(void) WHS_enable_control_loop(false); Turn_the_Blower_On();//Turn on with the Default_Voltage Control_Voltage_To_Blower(1); //stop the blower - if (Head_Type == HEAD_TYPE_ARC) { - Trigger_Head_Fan_Control(0, 0); - Trigger_Head_Fan_Control(1, 0); - } HeadBlowersInit(); Task_sleep (1000); @@ -913,6 +917,7 @@ uint32_t PowerUpUpdate(MACHINE_STATE_STAGES_ENUM stage) { RemoveControlCallback(PowerUpLoadControlId, PowerUpUpdateCallBackFunction); PowerUpLoadControlId = 0xFF; + PowerUpStopReporting(); } } return status; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h index 10dd4c71e..d7352492a 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.h @@ -39,6 +39,7 @@ void setPowerOffDisableCleaning (bool value); uint32_t PowerDownUpdateFunc(MessageContainer* requestContainer); uint32_t AbortPowerDownFunc(MessageContainer* requestContainer); +void PowerDownStopReporting(void); #endif /* STATEMACHINES_INITIALIZATION_POWEROFFSEQUENCE_H_ */ diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 82601a162..a2a0d6f67 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -105,7 +105,7 @@ JobSegment *TSegment; JobBrushStop *TbrushStop; JobDispenser *Tdispenser; JobSpool *Tspool; -HeadCleaningParameters *CleaningParameters; +HeadCleaningParameters *CleaningParameters = NULL; bool CopyConfigured[MAX_SYSTEM_MODULES]; bool CleaningJobActive = false, JoggingJobActive = false; char ErrorMsg[100]; @@ -596,10 +596,9 @@ uint32_t ThreadCleaningJob(int speed) TSegment = my_malloc(sizeof(JobSegment)); Tspool = my_malloc(sizeof(JobSpool)); TbrushStop = my_malloc(sizeof(JobBrushStop)); - CleaningParameters = my_malloc(sizeof(CleaningParameters)); - CleaningParameters->has_cleanerflow = true; - CleaningParameters->cleanerflow = 800; Ticket.headcleaningparameters = CleaningParameters; + if (Ticket.headcleaningparameters) + Report("Clean job cleaning parameters", __FILE__, __LINE__, Ticket.headcleaningparameters->cleanerflow, RpWarning, Ticket.headcleaningparameters->archeadcleaningmotorspeed, 0); TSegment->length = 10.0; Ticket.length += (TSegment->length*n_segments); TSegment->n_brushstops = 1; @@ -649,8 +648,8 @@ void FreeCleaningJobData(void *JobDetails) { JobTicket* JobTicket = JobDetails; - if (JobTicket->headcleaningparameters) - free (JobTicket->headcleaningparameters); + //if (JobTicket->headcleaningparameters) + // free (JobTicket->headcleaningparameters); if (JobTicket->spool) { free (JobTicket->spool); @@ -962,6 +961,18 @@ void JobRequestFunc(MessageContainer* requestContainer) usnprintf(ErrorMsg, 100, "spool parameters error"); } } + if (Ticket->headcleaningparameters) + { + ///store last updated cleaning parameters + if (CleaningParameters == NULL) + CleaningParameters = my_malloc(sizeof(CleaningParameters)); + CleaningParameters->has_cleanerflow = Ticket->headcleaningparameters->has_cleanerflow; + CleaningParameters->cleanerflow = Ticket->headcleaningparameters->cleanerflow; + CleaningParameters->has_archeadcleaningmotorspeed = Ticket->headcleaningparameters->has_archeadcleaningmotorspeed; + CleaningParameters->archeadcleaningmotorspeed = Ticket->headcleaningparameters->archeadcleaningmotorspeed; + Report("Save job cleaning parameters", __FILE__, __LINE__, CleaningParameters->cleanerflow, RpWarning, CleaningParameters->archeadcleaningmotorspeed, 0); + + } } else diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h index dde582749..b27199aaf 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.h @@ -188,6 +188,8 @@ bool JobIsActive(void); extern bool SuspendLargeMessages; +extern int JogSpeed; + extern bool CopyConfigured[MAX_SYSTEM_MODULES]; extern bool CleaningJobActive; extern bool JoggingJobActive; diff --git a/Software/PMR/Messages/Common/MessageType.proto b/Software/PMR/Messages/Common/MessageType.proto index 2dca4ee09..152408996 100644 --- a/Software/PMR/Messages/Common/MessageType.proto +++ b/Software/PMR/Messages/Common/MessageType.proto @@ -125,6 +125,10 @@ enum MessageType StubMainCardEEpromWriteResponse = 112; StubHeadEEpromRequest = 113; StubHeadEEpromResponse = 114; + ProcedureRequest = 115; + ProcedureResponse = 116; + StubAllHardwareRequest = 117; + StubAllHardwareResponse = 118; //------------------------------------ diff --git a/Software/PMR/Messages/EmbeddedParameters/AlarmHandlingItem.proto b/Software/PMR/Messages/EmbeddedParameters/AlarmHandlingItem.proto index 0dbc0a114..51fd85311 100644 --- a/Software/PMR/Messages/EmbeddedParameters/AlarmHandlingItem.proto +++ b/Software/PMR/Messages/EmbeddedParameters/AlarmHandlingItem.proto @@ -9,16 +9,14 @@ import "EventType.proto"; message AlarmHandlingItem { - AlarmSourceType AlarmSource = 1; - uint32 Frequency = 2; //1/10/100/1000 - uint32 DeviceId = 3; - uint32 ModuleDeviceId = 4; - uint32 AlarmValue = 5; - bool AlarmDirection = 6; - Debugging.DebugLogCategory Severity = 7; - uint32 Predecessor = 8; - uint32 DebounceValue = 9; - Diagnostics.EventType EventType = 10; - string EventName = 11; - bool IsPersistent = 12; + AlarmSourceType AlarmSource = 1; + uint32 DeviceId = 2; + uint32 ModuleDeviceId = 3; + uint32 AlarmValue = 4; + bool AlarmDirection = 5; + Debugging.DebugLogCategory Severity = 6; + uint32 DebounceValue = 7; + Diagnostics.EventType EventType = 8; + string EventName = 9; + bool IsPersistent = 10; } diff --git a/Software/PMR/Messages/Stubs/ProcedureRequest.proto b/Software/PMR/Messages/Stubs/ProcedureRequest.proto new file mode 100644 index 000000000..2c65a2910 --- /dev/null +++ b/Software/PMR/Messages/Stubs/ProcedureRequest.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; + +message ProcedureRequest +{ + int32 Type = 1; + int32 Timeout = 2; + float Param1 = 3; + float Param2 = 4; + float Param3 = 5; + float Param4 = 6; +}
\ No newline at end of file diff --git a/Software/PMR/Messages/Stubs/ProcedureResponse.proto b/Software/PMR/Messages/Stubs/ProcedureResponse.proto new file mode 100644 index 000000000..840ba054b --- /dev/null +++ b/Software/PMR/Messages/Stubs/ProcedureResponse.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + +package Tango.PMR.Stubs; +option java_package = "com.twine.tango.pmr.stubs"; + +message ProcedureResponse +{ + int32 Type = 1; + int32 Time = 2; + float ReplyValue1 = 3; + float ReplyValue2 = 4; + float ReplyValue3 = 5; +}
\ No newline at end of file diff --git a/Software/Stubs Collection/alarm generator/alarm_gen.exe b/Software/Stubs Collection/alarm generator/alarm_gen.exe Binary files differindex 6044e0ef0..58979127c 100644 --- a/Software/Stubs Collection/alarm generator/alarm_gen.exe +++ b/Software/Stubs Collection/alarm generator/alarm_gen.exe diff --git a/Software/Stubs Collection/stubs/ChangePidDuringRun.cs b/Software/Stubs Collection/stubs/ChangePidDuringRun.cs index 4d07cac71..9422e2cdc 100644 --- a/Software/Stubs Collection/stubs/ChangePidDuringRun.cs +++ b/Software/Stubs Collection/stubs/ChangePidDuringRun.cs @@ -8,19 +8,19 @@ using System.Threading; using System.Threading.Tasks; using System.Collections.Generic; using Tango.PMR.Stubs; +using Tango.PMR.Hardware; using Tango.Stubs; public void OnExecute(StubManager stubManager) { +StubHeatingTestRequest stubHeatingTestRequest = new StubHeatingTestRequest(); stubHeatingTestRequest.DryerZone1Temp = 0; stubHeatingTestRequest.DryerZone2Temp = 0; HardwarePidControl hardwarePidControl = new HardwarePidControl(); -hardwarePidControl.HardwarePidControlType = Tango.PMR.Hardware.HardwarePidControlType.FeederMotor; hardwarePidControl.OutputProportionalPowerLimit = 0.5; //Maximal additional power hardwarePidControl.OutputProportionalBand = 5; -hardwarePidControl.IntegralTime = 7000; //Ki hardwarePidControl.DerivativeTime = 0; //Kd hardwarePidControl.SensorCorrectionAdjustment = 0; hardwarePidControl.SensorMinValue = 0; @@ -30,15 +30,19 @@ hardwarePidControl.SetPointControlOutputRate = 0; hardwarePidControl.ControlOutputType = 0.001; ////Dt hardwarePidControl.SsrControlOutputType = 0; hardwarePidControl.OutputOnOffHysteresisValue = 100; //Kp divider -hardwarePidControl.ProcessVariableSamplingRate = 0; -hardwarePidControl.PvInputFilterFactorMode = 6; //averaging the readouts / number of samples +hardwarePidControl.ProcessVariableSamplingRate = 10; +hardwarePidControl.PvInputFilterFactorMode = 4; //averaging the readouts / number of samples hardwarePidControl.OutputProportionalCycleTime = 0; hardwarePidControl.AcHeatersHalfCycleTime = 0; -hardwarePidControl.ProportionalGain = 5000; //Kp hardwarePidControl.PidActive = false; hardwarePidControl.Epsilon = 0; +hardwarePidControl.OutputOnOffHysteresisValue = 100; -stubHeatingTestRequest.HardwarePidControl1 = hardwarePidControl1; +hardwarePidControl.HardwarePidControlType = Tango.PMR.Hardware.HardwarePidControlType.MotorWinder; +hardwarePidControl.IntegralTime = 8000; //Ki +hardwarePidControl.ProportionalGain = 7000; //Kp + +stubHeatingTestRequest.HardwarePidControl1 = hardwarePidControl; StubHeatingTestPollRequest stubHeatingTestPollRequest = new StubHeatingTestPollRequest(); diff --git a/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip index 3b2172443..dc6557505 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip @@ -29,10 +29,10 @@ <ROW Property="ExtractFilesFirst" Value="1"/> <ROW Property="LogoIcon" Value="externalui.ico" MultiBuildValue="DefaultBuild:machine_full_0UZ_icon.ico_1" Type="1" MsiKey="LogoIcon"/> <ROW Property="Manufacturer" Value="Twine Solutions LTD"/> - <ROW Property="ProductCode" Value="1033:{60135750-CBB3-42F2-BCFC-9C43156DCA8A} " Type="16"/> + <ROW Property="ProductCode" Value="1033:{29B2755A-3E0C-4E63-8713-274456E8C843} " Type="16"/> <ROW Property="ProductLanguage" Value="1033"/> <ROW Property="ProductName" Value="Tango FSE"/> - <ROW Property="ProductVersion" Value="1.1.0.0" Type="32"/> + <ROW Property="ProductVersion" Value="1.1.1.0" Type="32"/> <ROW Property="RUNAPPLICATION" Value="1" Type="4"/> <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/> <ROW Property="UpgradeCode" Value="{0E13CB0D-89F7-465E-9F56-F1CBD6773E6E}"/> @@ -779,7 +779,7 @@ <ROW Action="AI_DetectSoftware" Sequence="101"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.BuildComponent"> - <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\FSE\Release" PackageFileName="Tango FSE v1.1.0" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="Tango FSE v1.1.0"/> + <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\FSE\Release" PackageFileName="Tango FSE v1.1.1" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="Tango FSE v1.1.1"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent"> <ROW Path="<AI_DICTS>ui.ail"/> diff --git a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip index 13f3dae11..a9fca2e1a 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/Machine Studio Installer.aip @@ -16,10 +16,10 @@ <ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]." ValueLocId="*"/> <ROW Property="ARPNOREPAIR" MultiBuildValue="DefaultBuild:1"/> <ROW Property="Manufacturer" Value="Twine"/> - <ROW Property="ProductCode" Value="1033:{730EA73A-6350-443D-9767-230B8178CB4E} " Type="16"/> + <ROW Property="ProductCode" Value="1033:{7577BEBE-247C-415C-BE01-3BA0BEF8CBBD} " Type="16"/> <ROW Property="ProductLanguage" Value="1033"/> <ROW Property="ProductName" Value="Machine Studio"/> - <ROW Property="ProductVersion" Value="4.2.0.0" Type="32"/> + <ROW Property="ProductVersion" Value="4.2.1.0" Type="32"/> <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/> <ROW Property="UpgradeCode" Value="{CBEE5CAE-7C5A-4280-98DE-AA98113764E4}"/> <ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/> @@ -873,7 +873,7 @@ <ROW Action="AI_DetectSoftware" Sequence="101"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.BuildComponent"> - <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\Machine Studio\Release" PackageFileName="Machine Studio Installer_v4.2.0" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="Machine Studio Installer_v4.2.0"/> + <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\Machine Studio\Release" PackageFileName="Machine Studio Installer_v4.2.1" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="Machine Studio Installer_v4.2.1"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent"> <ROW Path="<AI_DICTS>ui.ail"/> diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt Binary files differindex 5fe5afe5a..9453b5c13 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt +++ b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer-cache/cacheIndex.txt diff --git a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip index 872e4b938..76614c76c 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/PPC Installer.aip @@ -18,10 +18,10 @@ <ROW Property="ARPNOREPAIR" Value="1" MultiBuildValue="DefaultBuild:1"/> <ROW Property="ARPSYSTEMCOMPONENT" Value="1"/> <ROW Property="Manufacturer" Value="Twine"/> - <ROW Property="ProductCode" Value="1033:{89DF366A-2C79-4626-BA98-249E464D5997} " Type="16"/> + <ROW Property="ProductCode" Value="1033:{CE4F6CA8-3FB0-4C08-9948-21DC430EB452} " Type="16"/> <ROW Property="ProductLanguage" Value="1033"/> <ROW Property="ProductName" Value="Tango"/> - <ROW Property="ProductVersion" Value="1.2.0.0" Type="32"/> + <ROW Property="ProductVersion" Value="1.2.1.0" Type="32"/> <ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/> <ROW Property="UpgradeCode" Value="{F8EAB8B4-FD57-45B7-8307-D52DF760273D}"/> <ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/> @@ -529,7 +529,7 @@ <ROW Action="AI_DetectSoftware" Sequence="101"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.BuildComponent"> - <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\PPC" PackageFileName="PPC Installer_v1.2.0" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="PPC Installer_v1.2.0"/> + <ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFolder="..\Build\Installers\PPC" PackageFileName="PPC Installer_v1.2.1" Languages="en" InstallationType="4" CabsLocation="1" PackageType="1" FilesInsideExe="true" ExtractionFolder="[AppDataFolder][|Manufacturer]\[|ProductName] [|ProductVersion]\install" ExtUI="true" UseLargeSchema="true" ExeName="PPC Installer_v1.2.1"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent"> <ROW Path="<AI_DICTS>ui.ail"/> diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp index 39b093539..2d002fb1e 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.cpp @@ -501,6 +501,9 @@ void Tango::ColorLib::ColorConverter::readColorTransformations(ConversionInput* bool has_forwarddata = conversionInput->has_forwarddata; uint8_t *data = conversionInput->forwarddata.data; int nprocessranges = conversionInput->n_processranges; + if(nprocessranges <=0) + throw std::exception("number of process ranges is zero or less"); + m_colortable->InitColorTables(has_forwarddata, data, nprocessranges); SetNumberofInks(m_colortable->GetnA2BnSepOut()); } @@ -508,7 +511,10 @@ void Tango::ColorLib::ColorConverter::readColorTransformations(ConversionInput* void Tango::ColorLib::ColorConverter::SetStripWhitepoint(double threadl, double threada, double threadb) { //Read thread white. Thread White is given in CIELab Space - m_whitepointLab.Set(threadl, threada, threadb); + if((threadl<=0 || threadl>100) || (threada<-127 || threada>128) || (threadb < -127 || threadb>128)) + throw std::exception("White Point Lab exceeds limits"); + else + m_whitepointLab.Set(threadl, threada, threadb); //White point in XYZ Color Space ColorConvert CConvert(D65, D65); C_RGB_XYZ_Lab tmpW; @@ -522,6 +528,31 @@ void Tango::ColorLib::ColorConverter::readCalibrationTables(InputLiquid **inputl { SetNumberofInks((int)(n_inputliquid)); //CalibData *CalibCurves = new CalibData[m_nInks]; + + // Verify Data + for (int i = 0; i < m_nInks; ++i) + { + if (inputliquid[i]->maxnanoliterpercentimeter <= 0) + { + throw std::exception("Liquid Factor is zero or negative!"); + return; + } + + } + // Verify x and y are monotonic for each ink channel + bool IsValid = false; + CalibrationData *calibdata; + for (int i = 0; i < m_nInks; ++i) + { + calibdata = inputliquid[i]->calibrationdata; + IsValid = CheckMonotonicity(calibdata); + if (IsValid = false) + { + throw std::exception("Calibration Data is not monotonic"); + return; + } + } + if(m_CalibCurves == NULL) m_CalibCurves = new CalibData[m_nInks]; //m_CalibCurves = DBG_NEW CalibData[m_nInks]; @@ -530,26 +561,26 @@ void Tango::ColorLib::ColorConverter::readCalibrationTables(InputLiquid **inputl InputLiquid* InkType = inputliquid[i]; m_CalibCurves[i].SetCalibName((int)(InkType->calibrationdata->liquidtype)); - + m_CalibCurves[i].SetMaxNlPerCM(inputliquid[i]->maxnanoliterpercentimeter); switch (InkType->calibrationdata->liquidtype) { - case LIQUID_TYPE__Cyan: - case LIQUID_TYPE__Magenta: - case LIQUID_TYPE__Yellow: - case LIQUID_TYPE__Black: - { - // calibration data. - CalibrationData* calibrationData = InkType->calibrationdata; - SetCalibData(calibrationData, i, &m_CalibCurves[i]); - m_CalibCurves[i].InitInterpolations(); - break; - } - default: - { - throw std::exception("could not fill all calibration tables"); - return; - } + case LIQUID_TYPE__Cyan: + case LIQUID_TYPE__Magenta: + case LIQUID_TYPE__Yellow: + case LIQUID_TYPE__Black: + { + // calibration data. + CalibrationData* calibrationData = InkType->calibrationdata; + SetCalibData(calibrationData, i, &m_CalibCurves[i]); + m_CalibCurves[i].InitInterpolations(); + break; + } + default: + { + throw std::exception("could not fill all calibration tables"); + return; + } } } return; @@ -558,15 +589,14 @@ void Tango::ColorLib::ColorConverter::readCalibrationTables(InputLiquid **inputl void Tango::ColorLib::ColorConverter::SetCalibData(CalibrationData *calibrationData, int i, CalibData *tmpCurve) { - if (calibrationData->calibrationpoints <= 0) + if (calibrationData->n_calibrationpoints <2) { char msg[100]; - int n = - strcpy_s(msg, 100, "No Calibration points in table "); - + strcpy_s(msg, 100, "Not enough Calibration points in table "); throw std::exception(msg); return; } + //check data validity tmpCurve->SetCalibCurveSize((int)(calibrationData->n_calibrationpoints)); //Iterate over calibration points.. @@ -596,6 +626,54 @@ void Tango::ColorLib::ColorConverter::SetCalibData(CalibrationData *calibrationD return; } +bool Tango::ColorLib::ColorConverter::CheckMonotonicity(CalibrationData *calibdata) +{ + //Check Monotonicity of Smooth Lab Channel + bool retvalue = true; + if (calibdata->n_calibrationpoints < 2) + { + throw std::exception("Not enough Calibration points in table "); + retvalue = false; + return(retvalue); + } + double diffx, diffy; + double *xval = new double[calibdata->n_calibrationpoints]; + double *yval = new double[calibdata->n_calibrationpoints]; + for (int i = 0; i < (int)calibdata->n_calibrationpoints; ++i) + { + xval[i] = calibdata->calibrationpoints[i]->x; + yval[i] = calibdata->calibrationpoints[i]->y; + } + + diffy= yval[calibdata->n_calibrationpoints - 1] - yval[0]; + diffx = xval[calibdata->n_calibrationpoints - 1] - xval[0]; + int CFx = 1; + if (diffx < 0) + CFx = -1; + int CFy = 1; + if (diffy < 0) + CFy = -1; + + for (int i = 0; i < (int)calibdata->n_calibrationpoints - 1; ++i) + { + diffx = CFx * (xval[i + 1] - xval[i]); + if (diffx <= 0.0) + { + throw std::exception("non-monotonic x-axis "); + retvalue = false; + return(retvalue); + } + diffy = CFx * (yval[i + 1] - yval[i]); + if (diffy <= 0.0) + { + throw std::exception("non-monotonic y-axis "); + retvalue = false; + return(retvalue); + } + } + return retvalue; +} + void Tango::ColorLib::ColorConverter:: ConvertLabColorToLinearInks(InputCoordinates* inputcoordinates, VectorXd &InkOut, VectorXd &RGBOut, VectorXd &LabOut, int &GamutRegion, bool &InGamut, SURROUND sur, CAM02CS CS) @@ -1361,7 +1439,11 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i } conversionInput->inputcoordinates->inputliquids = filteredInputLiquids; - conversionInput->inputcoordinates->n_inputliquids = expected_liquids; + if(expected_liquids<=0) + throw std::exception("expected_liquids is zero"); + else + conversionInput->inputcoordinates->n_inputliquids = expected_liquids; + //Filter and arrange colors //Initialize Output... @@ -1378,7 +1460,10 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i if(m_colortable ==NULL) m_colortable = new ColorTable(); readColorTransformations(conversionInput); - m_nProcessRanges = conversionInput->n_processranges; + if(conversionInput->n_processranges<=0) + throw std::exception("number of process ranges is zero"); + else + m_nProcessRanges = conversionInput->n_processranges; if(m_NormGamutRegionMaxLim == NULL) m_NormGamutRegionMaxLim = new double[m_nProcessRanges]; double *tmpVal = m_colortable->GetNormGamutRegionMaxLim(); @@ -1405,6 +1490,18 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i //Tables have been filled //Set Process Ranges + for (int i = 0; i < m_nProcessRanges; ++i) + { + if(conversionInput->processranges[i]->maxinkuptake<=0) + throw std::exception("Process Range is zero\0"); + } + double diff = 0; + for (int i = 1; i < m_nProcessRanges; ++i) + { + diff = conversionInput->processranges[i]->maxinkuptake - conversionInput->processranges[i - 1]->maxinkuptake; + if(diff<=0) + throw std::exception("Process Rangesare not monotonic\0"); + } if(m_ProcessRangesMaxP == NULL) m_ProcessRangesMaxP = new double[m_nProcessRanges]; for (int i = 0; i < m_nProcessRanges; ++i) diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.h b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.h index e4190e75e..2aae30b64 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.h +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/ColorConverter.h @@ -165,6 +165,7 @@ namespace Tango void LimitNLInks2Volume(VectorXd NLInks, int &GamutRegion, VectorXd &OutVolume); void LimitNLInks2VolumeThr(VectorXd NLInks, int &GamutRegion, VectorXd &Volume); void GetClosestInk(VectorXd Volume, int &GamutRegion, VectorXd &BestVolume); + bool CheckMonotonicity(CalibrationData *calibdata); }; } } diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Utils/ColorTable.cpp b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Utils/ColorTable.cpp index ac2a65a54..85348970a 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Utils/ColorTable.cpp +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v4/Utils/ColorTable.cpp @@ -89,8 +89,15 @@ void ColorTable::readColorTables(bool has_data, uint8_t * data, int nprocessrang if(m_GamutRegionMaxLim == NULL) m_GamutRegionMaxLim = new double[m_nGamutRegions]; for (int i = 0; i < m_nGamutRegions; ++i) - m_GamutRegionMaxLim[i] = tmpGamutRegionsLim[i]; - + { + if(tmpGamutRegionsLim[i]<=0) + { + throw std::exception("Gamut region Limit is zero or negative\0"); + return; + } + else + m_GamutRegionMaxLim[i] = tmpGamutRegionsLim[i]; + } m_nProcessRanges = (int)(nprocessranges); uint32_t tmp; @@ -300,6 +307,8 @@ void ColorTable::readColorTables(bool has_data, uint8_t * data, int nprocessrang header = NULL; } } + else + throw std::exception("Color Table has no Data"); //Verify all relevant tags had been read @@ -570,7 +579,7 @@ void ColorTable::SetNormFactor() void ColorTable::SetInverseNormFactor() { if (m_NormFactor <= 0) - m_InvNormFactor = -1; + throw std::exception("NormFactor is zero or Negative"); else m_InvNormFactor = 1.0 / m_NormFactor; } @@ -578,8 +587,11 @@ void ColorTable::SetInverseNormFactor() void ColorTable::NormGamutRegionMaxLim() { double GamutRegionMaxLim0 = m_GamutRegionMaxLim[0]; + if(GamutRegionMaxLim0<=0) + throw std::exception("Gamut Region Max Limit is zero or Negative"); for (int i = 0; i < m_nProcessRanges; ++i) m_GamutRegionMaxLim[i] = 100 * m_GamutRegionMaxLim[i] / GamutRegionMaxLim0; } + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs index 03c55f1c8..a6b7f8ce9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ using System.Runtime.InteropServices; [assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)] [assembly: AssemblyTitle("Tango - Machine Studio")] -[assembly: AssemblyVersion("4.2.0.0")] +[assembly: AssemblyVersion("4.2.1.0")] [assembly: ComVisible(false)]
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs index 186cda159..aad563fc1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs @@ -8,4 +8,4 @@ using System.Windows; // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Tango PPC Application")] -[assembly: AssemblyVersion("1.2.0.0")] +[assembly: AssemblyVersion("1.2.1.0")] |
