From 09acf407dc5f432a2c293bde6ebf103b28af2549 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 3 Nov 2020 12:08:14 +0200 Subject: bugs, mostly in arc head init --- Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c | 4 ++-- Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c | 1 + Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c | 7 ++++--- Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 6 +++--- Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c | 2 ++ 5 files changed, 12 insertions(+), 8 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index eb855fd4a..b159897aa 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -923,8 +923,8 @@ void DiagnosticOneSecCollection(void) tempFlow = HeadFlowMeter; }*/ WasteLevel = GetWHSWasteTankLevelMiliLiter()/1000;//change from ml to litter - static double InitCounter = 60.0; - if ((GetMachineState()=MACHINE_STATE_WAIT_FOR_COOLER)) + static double InitCounter = 85.0; + if (GetMachineState()<=MACHINE_STATE_WAIT_FOR_COOLER) { InitCounter-=1.0; if(InitCounter<0)InitCounter = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c index a0b1b30c2..5c41d03f3 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c +++ b/Software/Embedded_SW/Embedded/Modules/General/MachineStatus.c @@ -157,6 +157,7 @@ int MachineUpdateResponseFunc(void) else return ERROR; + // Report("Sending machine state",__FILE__,__LINE__,(int)MachineStatus.state,RpWarning,(int)MachineStatus.overalltemperature,0); responseContainer = /*MachineUpdate*/createContainer(MESSAGE_TYPE__StartMachineStatusUpdateResponse, MachineUpdateToken, false, &response, &start_machine_status_update_response__pack, &start_machine_status_update_response__get_packed_size); responseContainer.has_continuous = true; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c index 4a43485cd..af82cdd9f 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c @@ -345,9 +345,10 @@ void HeadBlowersCfg() double PressureSensorInit(int blowerId) { - PressureSensorV0[blowerId] = MillisecGetTemperatures(BlowerIdToSensorId[blowerId]); - PressureSensorV0[blowerId] /= 10; - return PressureSensorV0[blowerId]; + double V0; + V0 = MillisecGetTemperatures(BlowerIdToSensorId[blowerId]); + V0 /= 10; + return V0; } int HeadBlowersGetRPM(uint8_t blowerId) diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index d2fd74256..c8cab116f 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -1608,9 +1608,9 @@ void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers) } } //for } - usnprintf(IdMessage, 80,"IDS_StartBrushStop %d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",WFCF,CurrentDispenserSpeed[0], + usnprintf(IdMessage, 80,"IDS_StartBrushStop %d/%d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",FileBrushStop->index,SegmentNumOfBrushStops,CurrentDispenserSpeed[0], CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]); - ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, FileBrushStop->index, RpWarning,n_dispensers, 0); + ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, SegmentNumOfBrushStops, FileBrushStop->index, RpWarning,(int)FileBrushStop->offsetmeters, 0); } uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) @@ -1676,7 +1676,7 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) IDS_StartBrushStop(n_dispensers, Dispensers); } JobBrushStopId++; - ReportWithPackageFilter(IDSFilter,"brushstop",__FILE__,__LINE__,(int)JobBrushStopId,RpMessage,(int)SegmentNumOfBrushStops,0); + //ReportWithPackageFilter(IDSFilter,"brushstop",__FILE__,__LINE__,(int)JobBrushStopId,RpMessage,(int)SegmentNumOfBrushStops,0); if (JobBrushStopId >= SegmentNumOfBrushStops) { ReportWithPackageFilter(IDSFilter,"last brushstop",__FILE__,__LINE__,(int)JobBrushStopId,RpWarning,(int)SegmentNumOfBrushStops,0); diff --git a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c index 5471397aa..25fb8e962 100644 --- a/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c +++ b/Software/Embedded_SW/Embedded/Modules/Waste/Waste_maint.c @@ -608,6 +608,8 @@ uint32_t Waste_PrepareCallbak(uint32_t IfIndex, uint32_t ReadValue) { SafeRemoveControlCallback(WasteReadyControlId,Waste_PrepareCallbak); WasteReadyControlId = 0xFF; + JobEndReason = JOB_PRESSURE_ALARM; + usnprintf(AlarmReasonStr, 100, "Module waste prepare - air flow not stabilized"); Report("Module waste prepare failed!", __FILE__, __LINE__, headready, RpMessage, headready, 0); PrepareReady(Module_Waste,ModuleFail); } -- cgit v1.3.1 From 7c5013e09cafac9a7f027b5b9b8d1352cb794d24 Mon Sep 17 00:00:00 2001 From: Ronen Sberlo Date: Tue, 3 Nov 2020 13:29:53 +0200 Subject: fix read from eeprom --- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c | 6 +++--- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h | 2 +- .../Embedded/StateMachines/Initialization/InitSequence.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c index af82cdd9f..3c626ac22 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c @@ -54,7 +54,7 @@ extern uint16_t Head_Fan_Tach[2]; extern uint8_t Head_Fan_PWM_Command[2]; -double PressureSensorV0[2] = {0.0, 0.0}; +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 @@ -343,9 +343,9 @@ void HeadBlowersCfg() } } -double PressureSensorInit(int blowerId) +uint32_t PressureSensorInit(int blowerId) { - double V0; + uint32_t V0; V0 = MillisecGetTemperatures(BlowerIdToSensorId[blowerId]); V0 /= 10; return V0; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h index 2c675606b..a23abf559 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_ex.h @@ -46,7 +46,7 @@ void HeatersControlStop(void); uint32_t Heaters_Init(void); double PressureSensorGetPressure(uint8_t SensorId); int HeadBlowersGetRPM(uint8_t fanId); -double PressureSensorInit(); +uint32_t PressureSensorInit(); void HeadBlowersInit(); uint32_t HeadBlowerPidRequestMessage(void* request, int BlowerId); void HeadBlowersCfg(); diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index c1362e220..5d2bf2922 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -83,7 +83,7 @@ uint32_t InitSequenceMachineReadyToDye(void); uint32_t InitSequenceStateMachine( INIT_SEQUENCE_STAGES_ENUM ReadValue); uint32_t PowerUpUpdate(MACHINE_STATE_STAGES_ENUM stage); int InitFailures = 0; -extern double PressureSensorV0[2]; +extern uint32_t PressureSensorV0[2]; MACHINE_STATE_STAGES_ENUM GetMachineState(void) { @@ -464,7 +464,7 @@ uint32_t InitSequenceWHSAirFlowCalibration(void) } uint32_t InitSequenceArcAirflowCalibration(void) { - double V0[2] = {0.0, 0.0}; + uint32_t V0[2] = {0, 0}; if (ResetReason & SYSCTL_CAUSE_POR) { V0[0] = PressureSensorInit(0); V0[1] = PressureSensorInit(1); -- cgit v1.3.1 From 824a4dba856dd575ed076d8e707ef59b39940932 Mon Sep 17 00:00:00 2001 From: Ronen Sberlo Date: Tue, 3 Nov 2020 15:35:21 +0200 Subject: change in Q calculation --- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c index 3c626ac22..69ac7fbb3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c @@ -51,6 +51,7 @@ #define ARC_ALARM_LIMIT 3 #define PRESSURE_SENSOR_CP 0.269 +#define PRESSURE_SENSOR_B 1.6668 extern uint16_t Head_Fan_Tach[2]; extern uint8_t Head_Fan_PWM_Command[2]; @@ -369,15 +370,14 @@ int HeadBlowersGetPWM(uint8_t blowerId) double PressureSensorGetPressure(uint8_t SensorId) { - double V0, Vm, Q, Cp; + double V0, Vm, Q; int FanId; - Cp = PRESSURE_SENSOR_CP; FanId = HeadBlowerSensorIdToFanId(SensorId); V0 = PressureSensorV0[FanId]; Vm = (double)(MillisecGetTemperatures(SensorId)); Vm /= 10.0; - Q = sqrt(Vm - V0 + 22) * Cp; + Q = (sqrt(Vm - V0 + 22) - PRESSURE_SENSOR_B) * PRESSURE_SENSOR_CP; return Q; } -- cgit v1.3.1 From 975f7174c6cd52882239ff2420300f151f3603e7 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 3 Nov 2020 21:34:47 +0200 Subject: ArcCleaningMotorSpeed change --- .../PMR/Printing/HeadCleaningParameters.pb-c.c | 19 ++++++++++++++++--- .../PMR/Printing/HeadCleaningParameters.pb-c.h | 4 +++- .../PMR/Printing/ProcessParameters.pb-c.c | 19 +++---------------- .../PMR/Printing/ProcessParameters.pb-c.h | 4 +--- .../Embedded_SW/Embedded/Modules/General/process.c | 2 -- .../Embedded_SW/Embedded/Modules/General/process.h | 1 - Software/Embedded_SW/Embedded/Modules/IDS/IDS.h | 1 + .../Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c | 2 +- Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 2 ++ 9 files changed, 27 insertions(+), 27 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Printing/HeadCleaningParameters.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Printing/HeadCleaningParameters.pb-c.c index 699470ded..a5fba86d3 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Printing/HeadCleaningParameters.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Printing/HeadCleaningParameters.pb-c.c @@ -52,7 +52,7 @@ void head_cleaning_parameters__free_unpacked assert(message->base.descriptor == &head_cleaning_parameters__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor head_cleaning_parameters__field_descriptors[1] = +static const ProtobufCFieldDescriptor head_cleaning_parameters__field_descriptors[2] = { { "", @@ -66,14 +66,27 @@ static const ProtobufCFieldDescriptor head_cleaning_parameters__field_descriptor 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HeadCleaningParameters, has_archeadcleaningmotorspeed), + offsetof(HeadCleaningParameters, archeadcleaningmotorspeed), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned head_cleaning_parameters__field_indices_by_name[] = { + 1, /* field[1] = ArcHeadCleaningMotorSpeed */ 0, /* field[0] = CleanerFlow */ }; static const ProtobufCIntRange head_cleaning_parameters__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 1 } + { 0, 2 } }; const ProtobufCMessageDescriptor head_cleaning_parameters__descriptor = { @@ -83,7 +96,7 @@ const ProtobufCMessageDescriptor head_cleaning_parameters__descriptor = "", "", sizeof(HeadCleaningParameters), - 1, + 2, head_cleaning_parameters__field_descriptors, head_cleaning_parameters__field_indices_by_name, 1, head_cleaning_parameters__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Printing/HeadCleaningParameters.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Printing/HeadCleaningParameters.pb-c.h index 9213143bb..08c7b7248 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Printing/HeadCleaningParameters.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Printing/HeadCleaningParameters.pb-c.h @@ -28,10 +28,12 @@ struct _HeadCleaningParameters ProtobufCMessage base; protobuf_c_boolean has_cleanerflow; double cleanerflow; + protobuf_c_boolean has_archeadcleaningmotorspeed; + double archeadcleaningmotorspeed; }; #define HEAD_CLEANING_PARAMETERS__INIT \ { PROTOBUF_C_MESSAGE_INIT (&head_cleaning_parameters__descriptor) \ - , 0, 0 } + , 0, 0, 0, 0 } /* HeadCleaningParameters methods */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Printing/ProcessParameters.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/Printing/ProcessParameters.pb-c.c index 44acaa3ad..a27a2202e 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Printing/ProcessParameters.pb-c.c +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Printing/ProcessParameters.pb-c.c @@ -52,7 +52,7 @@ void process_parameters__free_unpacked assert(message->base.descriptor == &process_parameters__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor process_parameters__field_descriptors[32] = +static const ProtobufCFieldDescriptor process_parameters__field_descriptors[31] = { { "", @@ -426,21 +426,8 @@ static const ProtobufCFieldDescriptor process_parameters__field_descriptors[32] 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, - { - "", - 32, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_archeadcleaningmotorspeed), - offsetof(ProcessParameters, archeadcleaningmotorspeed), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, }; static const unsigned process_parameters__field_indices_by_name[] = { - 31, /* field[31] = ArcHeadCleaningMotorSpeed */ 13, /* field[13] = DryerAirFlow */ 17, /* field[17] = DryerBufferLength */ 14, /* field[14] = DryerZone1Temp */ @@ -476,7 +463,7 @@ static const unsigned process_parameters__field_indices_by_name[] = { static const ProtobufCIntRange process_parameters__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 32 } + { 0, 31 } }; const ProtobufCMessageDescriptor process_parameters__descriptor = { @@ -486,7 +473,7 @@ const ProtobufCMessageDescriptor process_parameters__descriptor = "", "", sizeof(ProcessParameters), - 32, + 31, process_parameters__field_descriptors, process_parameters__field_indices_by_name, 1, process_parameters__number_ranges, diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/Printing/ProcessParameters.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/Printing/ProcessParameters.pb-c.h index aa762a3d6..9a6453221 100644 --- a/Software/Embedded_SW/Embedded/Communication/PMR/Printing/ProcessParameters.pb-c.h +++ b/Software/Embedded_SW/Embedded/Communication/PMR/Printing/ProcessParameters.pb-c.h @@ -88,12 +88,10 @@ struct _ProcessParameters double lblowertemp; protobuf_c_boolean has_pressurebuildup; double pressurebuildup; - protobuf_c_boolean has_archeadcleaningmotorspeed; - double archeadcleaningmotorspeed; }; #define PROCESS_PARAMETERS__INIT \ { PROTOBUF_C_MESSAGE_INIT (&process_parameters__descriptor) \ - , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } /* ProcessParameters methods */ diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c index 4538d0336..eef1d6985 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.c +++ b/Software/Embedded_SW/Embedded/Modules/General/process.c @@ -42,7 +42,6 @@ double pressurebuildup = 0; double dryerzone1temp = 0; int32_t tableindex = 0; double headBlowersFlow[2] = {1.0,1.0}; -double ArcCleaningMotorSpeed = 0.0; double dryerbufferMeters = 0; double dryerbufferCentimeters = 0; @@ -159,7 +158,6 @@ uint32_t HandleProcessParameters(ProcessParameters* ProcessParams,bool saveData) dryerairflow = ProcessParams->dryerairflow; pressurebuildup = ProcessParams->pressurebuildup; dryerzone1temp = ProcessParams->dryerzone1temp; - ArcCleaningMotorSpeed = ProcessParams->archeadcleaningmotorspeed; if (MachineReadyForHeating == false) { diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.h b/Software/Embedded_SW/Embedded/Modules/General/process.h index 4a1583aa8..f7f16d11e 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.h +++ b/Software/Embedded_SW/Embedded/Modules/General/process.h @@ -20,7 +20,6 @@ extern double dryerairflow; extern double pressurebuildup; extern double dryerzone1temp; extern double headBlowersFlow[2]; -extern double ArcCleaningMotorSpeed; extern int32_t tableindex; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS.h b/Software/Embedded_SW/Embedded/Modules/IDS/IDS.h index 1c17c4f6b..d86d7ab2d 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS.h +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS.h @@ -16,6 +16,7 @@ extern uint32_t InitialDispenserSpeed; extern double InitialDispenserPressure; extern uint32_t InitialDispenserTimeout; +extern double ArcCleaningMotorSpeed; extern uint32_t DispenserIdToMotorId[MAX_SYSTEM_DISPENSERS]; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c index 0e28134c4..0ae017c13 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_Cleaning.c @@ -19,7 +19,7 @@ #include "drivers/motors/motor.h" #include "drivers/valves/valve.h" #include "Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.h" - +double ArcCleaningMotorSpeed = 750; int SaveLeftRockerSpeed = 50, SaveRightRockerSpeed = 50; typedef enum { diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index c8cab116f..5b6ad643d 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -795,6 +795,8 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl { if (JobTicket->headcleaningparameters->has_cleanerflow) cleanerFlow = JobTicket->headcleaningparameters->cleanerflow; + if (JobTicket->headcleaningparameters->has_archeadcleaningmotorspeed) + ArcCleaningMotorSpeed = JobTicket->headcleaningparameters->archeadcleaningmotorspeed; } if ((cleanerFlow>200)&&(cleanerFlow<1150)) { -- cgit v1.3.1 From dcdef4f8f4041a22dbfa9a09075a8ba51bb019ac Mon Sep 17 00:00:00 2001 From: Ronen Sberlo Date: Wed, 4 Nov 2020 12:20:59 +0200 Subject: change fan too low alarm level --- Software/Embedded_SW/Embedded/Modules/General/process.c | 2 +- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c index eef1d6985..aa9419491 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.c +++ b/Software/Embedded_SW/Embedded/Modules/General/process.c @@ -41,7 +41,7 @@ double dryerairflow = 5.0; double pressurebuildup = 0; double dryerzone1temp = 0; int32_t tableindex = 0; -double headBlowersFlow[2] = {1.0,1.0}; +double headBlowersFlow[2] = {0.0,0.0}; double dryerbufferMeters = 0; double dryerbufferCentimeters = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c index 69ac7fbb3..9c8ab1e12 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c @@ -280,7 +280,7 @@ void ArcHeadAlarms(void) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_HIGH, false); count5 = (count5 < 0)?(0):(count5); } - if (currentFlow < 1.0) { + if (currentFlow < 0.1) { if (++count6 == ARC_ALARM_LIMIT) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_LOW, true); count6 = (count6 > ARC_ALARM_LIMIT)?(ARC_ALARM_LIMIT):(count6); @@ -300,7 +300,7 @@ void ArcHeadAlarms(void) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_HIGH, false); count7 = (count7 < 0)?(0):(count7); } - if (currentFlow < 1.0) { + if (currentFlow < 0.1) { if (++count8 == ARC_ALARM_LIMIT) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_LOW, true); count8 = (count8 > ARC_ALARM_LIMIT)?(ARC_ALARM_LIMIT):(count8); -- cgit v1.3.1 From a567f6686212a66cbe9f825f8f72e218c7362bcf Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Wed, 4 Nov 2020 13:07:16 +0200 Subject: some small fixes (tunnel air flow, power up messages, persistent OFF alarms) --- .../Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c | 2 -- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 2 +- .../Embedded_SW/Embedded/Modules/General/process.c | 6 +++- .../Embedded/Modules/Heaters/Heaters_print.c | 8 ++--- .../Embedded/Software Release Notes.txt | 3 ++ .../StateMachines/Initialization/InitSequence.c | 38 ++++++++++++++++++---- 6 files changed, 44 insertions(+), 15 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c index 495f27652..00502d3ba 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c @@ -905,8 +905,6 @@ void Pumps_Control(PUMPS_ENUM Pump_Id, bool Direction) //1 - OPEN, 0 - CLOSE ?? //F1_GPO_Reg.bits.F1_GPO_WASTECH_PUMP2 = Direction; SecondaryPumpActive = Direction; } - else - LOG_ERROR(WHS_Type,"Pump activated on new whs"); break; case WHS_WTANKPUMP2: #ifndef EVALUATION_BOARD diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 127ccbabf..4a93c6aab 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -1080,7 +1080,7 @@ void AlarmHandlingInternalSetAlarm(uint32_t AlarmId, bool value) if (AlarmItem[Alarm_i].EventType == AlarmId) { //if (0) // PERSISTENT ALARM - if ((AlarmItem[Alarm_i].isPersistent == true)) // PERSISTENT ALARM simulate + if ((AlarmItem[Alarm_i].isPersistent == true)&&(value == true)) // PERSISTENT ALARM simulate Currently looking for "true" value, otherwise the currently existing OFF event appears { if (PersistentEventsResponse.events == NULL) PersistentEventsResponse.events = (Event **)my_malloc(sizeof(Event*)*(PersistentEventsResponse.n_events+1)); diff --git a/Software/Embedded_SW/Embedded/Modules/General/process.c b/Software/Embedded_SW/Embedded/Modules/General/process.c index eef1d6985..872f772e2 100644 --- a/Software/Embedded_SW/Embedded/Modules/General/process.c +++ b/Software/Embedded_SW/Embedded/Modules/General/process.c @@ -41,7 +41,7 @@ double dryerairflow = 5.0; double pressurebuildup = 0; double dryerzone1temp = 0; int32_t tableindex = 0; -double headBlowersFlow[2] = {1.0,1.0}; +double headBlowersFlow[2] = {1.5,1.5}; double dryerbufferMeters = 0; double dryerbufferCentimeters = 0; @@ -133,6 +133,10 @@ uint32_t HandleProcessParameters(ProcessParameters* ProcessParams,bool saveData) { if (ProcessParams->has_headairflow == false) ProcessParams->headairflow = headairflow; + if (ProcessParams->has_lblowerflow == false) + ProcessParams->lblowerflow = headBlowersFlow[HEAD_FAN_LEFT]; + if (ProcessParams->has_rblowerflow == false) + ProcessParams->rblowerflow = headBlowersFlow[HEAD_FAN_RIGHT]; if (ProcessParams->has_feedertension == false) ProcessParams->feedertension = feedertension; if (ProcessParams->has_windertension == false) diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c index e702d7072..84013add6 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_print.c @@ -560,8 +560,8 @@ uint32_t HeatersSingleHeaterEnd(int HeaterId) } DeActivateHeater(HEATER_TYPE__DryerMainHeater); DeActivateHeater(HEATER_TYPE__DryerSecondaryHeater); - //Disable_Reading_Heaters_Current(HeaterId2CurrentId[HEATER_TYPE__DryerMainHeater]); - //Disable_Reading_Heaters_Current(HeaterId2CurrentId[HEATER_TYPE__DryerSecondaryHeater]); + Disable_Reading_Heaters_Current(HeaterId2CurrentId[HEATER_TYPE__DryerMainHeater]); + Disable_Reading_Heaters_Current(HeaterId2CurrentId[HEATER_TYPE__DryerSecondaryHeater]); HeaterPIDConfig[HeaterId].m_SetParam = 0; HeaterCmd[HeaterId].targettemperatue = 0; HeaterReady[HeaterId] = true; @@ -1449,8 +1449,8 @@ uint32_t HeaterControlCBFunction(uint32_t IfIndex, uint32_t readValue) } }*/ HeaterReady[index] = true; - //Disable_Reading_Heaters_Current(HeaterId2CurrentId[HEATER_TYPE__DryerMainHeater]); - //Disable_Reading_Heaters_Current(HeaterId2CurrentId[HEATER_TYPE__DryerSecondaryHeater]); + Disable_Reading_Heaters_Current(HeaterId2CurrentId[HEATER_TYPE__DryerMainHeater]); + Disable_Reading_Heaters_Current(HeaterId2CurrentId[HEATER_TYPE__DryerSecondaryHeater]); } return OK; diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt index 341cf3a48..2a692d068 100644 --- a/Software/Embedded_SW/Embedded/Software Release Notes.txt +++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt @@ -3,6 +3,9 @@ Embedded SW Release note - Version 1.5.1(3) - Pack 3 preparations for persistent alarms support configurable voltage hysteresis improve spike temperature handling (discard readvalue 0) +fix tunnel pressure calculation +support standby request +waste prepare failure - fix report Embedded SW Release note - Version 1.5.1(2) - Pack 3 ============================================================= diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 5d2bf2922..40315e623 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -91,8 +91,11 @@ MACHINE_STATE_STAGES_ENUM GetMachineState(void) } void SetMachineState(MACHINE_STATE_STAGES_ENUM NewState) { - MachineStateDetail = NewState; - PowerUpUpdate(NewState); + if (MachineStateDetail != NewState) + { + MachineStateDetail = NewState; + PowerUpUpdate(NewState); + } } void StopInitSequence(void) { @@ -146,7 +149,7 @@ uint32_t InitScheduler(uint32_t IfIndex, uint32_t BusyFlag) StoredInitStages = InitStages; InitSequenceStateMachine(InitStages); } - PowerUpUpdate(MachineStateDetail); + //PowerUpUpdate(MachineStateDetail); return OK; } /*******************************************************************************************************/ @@ -748,6 +751,14 @@ uint32_t InitSequenceStateMachine( INIT_SEQUENCE_STAGES_ENUM ReadValue) return OK; } char PowerUpToken[36+1] = {0}; +//char init_string[100]; +uint32_t PowerUpLoadControlId = 0xFF; +uint32_t PowerUpUpdateCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) +{ + + PowerUpUpdate(MachineStateDetail); + return OK; +} uint32_t PowerUpUpdate(MACHINE_STATE_STAGES_ENUM stage) { uint32_t status = NOT_SUPPORTED; @@ -762,7 +773,7 @@ uint32_t PowerUpUpdate(MACHINE_STATE_STAGES_ENUM stage) if (PowerUpToken[0] == 0) return OK; - Report("PowerUpUpdate",__FILE__,last,InitStages,RpWarning,(int)stage,0); + //Report("PowerUpUpdate",__FILE__,last,InitStages,RpWarning,(int)stage,0); response.has_state = true; response.has_progresspercentage = true; @@ -874,7 +885,8 @@ uint32_t PowerUpUpdate(MACHINE_STATE_STAGES_ENUM stage) Error = ERROR_CODE__POWER_UP_NO_CFG_FILE; break; } - //Report("PowerUpUpdate",__FILE__,last,(int)response.progresspercentage,RpWarning,(int)stage,0); + //usnprintf(init_string, 80, "PowerUpUpdate token %s",PowerUpToken); + Report("PowerUpUpdate",__FILE__,InitStages,(int)response.progresspercentage,RpWarning,(int)stage,0); responseContainer = createContainer(MESSAGE_TYPE__StartPowerUpResponse, PowerUpToken, last, &response, &start_power_up_response__pack, &start_power_up_response__get_packed_size); responseContainer.has_continuous = true; responseContainer.continuous = true; @@ -891,8 +903,18 @@ uint32_t PowerUpUpdate(MACHINE_STATE_STAGES_ENUM stage) SendChars((char*)container_buffer, container_size); //MessageContainer responseContainer; + if (last == true) + { + if (PowerUpLoadControlId!= 0xFF) + { + RemoveControlCallback(PowerUpLoadControlId, PowerUpUpdateCallBackFunction); + PowerUpLoadControlId = 0xFF; + } + } return status; } + + uint32_t PowerUpUpdateFunc(MessageContainer* requestContainer) { uint32_t status = NOT_SUPPORTED; @@ -900,11 +922,13 @@ uint32_t PowerUpUpdateFunc(MessageContainer* requestContainer) // MachineUpdateInitParams InitParams; - Report("PowerUpUpdateFunc",__FILE__,__LINE__,(int)0,RpWarning,(int)0,0); StartPowerUpRequest* request = start_power_up_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data); ustrncpy (PowerUpToken, requestContainer->token,36); + //usnprintf(init_string, 80, "PowerUpUpdateFunc token %s",PowerUpToken); + Report("PowerUpUpdateFunc",__FILE__,__LINE__,(int)0,RpWarning,(int)0,0); + PowerUpLoadControlId = AddControlCallback("PowerUpLoad", PowerUpUpdateCallBackFunction, 2* eOneSecond, TemplateDataReadCBFunction,0,0, 0 ); - PowerUpUpdate(MachineStateDetail); + //PowerUpUpdate(MachineStateDetail); start_power_up_request__free_unpacked(request,NULL); return status; } -- cgit v1.3.1 From f2698a355c2d63916e80d9dc3df0344c3f7635ae Mon Sep 17 00:00:00 2001 From: Ronen Sberlo Date: Wed, 4 Nov 2020 17:09:28 +0200 Subject: flow equation --- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c index 9c8ab1e12..f61639edb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c @@ -51,7 +51,7 @@ #define ARC_ALARM_LIMIT 3 #define PRESSURE_SENSOR_CP 0.269 -#define PRESSURE_SENSOR_B 1.6668 +#define PRESSURE_SENSOR_B 0.45 extern uint16_t Head_Fan_Tach[2]; extern uint8_t Head_Fan_PWM_Command[2]; @@ -377,7 +377,7 @@ double PressureSensorGetPressure(uint8_t SensorId) V0 = PressureSensorV0[FanId]; Vm = (double)(MillisecGetTemperatures(SensorId)); Vm /= 10.0; - Q = (sqrt(Vm - V0 + 22) - PRESSURE_SENSOR_B) * PRESSURE_SENSOR_CP; + Q = sqrt(Vm - V0 + 22) * PRESSURE_SENSOR_CP - PRESSURE_SENSOR_B; return Q; } -- cgit v1.3.1 From 59eae61ea085fce516b4985b79fb4361af80b50f Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 5 Nov 2020 08:38:35 +0200 Subject: blowers --- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c index 9c8ab1e12..69ac7fbb3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c @@ -280,7 +280,7 @@ void ArcHeadAlarms(void) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_HIGH, false); count5 = (count5 < 0)?(0):(count5); } - if (currentFlow < 0.1) { + if (currentFlow < 1.0) { if (++count6 == ARC_ALARM_LIMIT) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_LOW, true); count6 = (count6 > ARC_ALARM_LIMIT)?(ARC_ALARM_LIMIT):(count6); @@ -300,7 +300,7 @@ void ArcHeadAlarms(void) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_HIGH, false); count7 = (count7 < 0)?(0):(count7); } - if (currentFlow < 0.1) { + if (currentFlow < 1.0) { if (++count8 == ARC_ALARM_LIMIT) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_LOW, true); count8 = (count8 > ARC_ALARM_LIMIT)?(ARC_ALARM_LIMIT):(count8); -- cgit v1.3.1 From 2f01062dca5a8e1bb9388cd4420d39125ebd3561 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 5 Nov 2020 17:15:49 +0200 Subject: alarm handling improved, including fan alarms --- Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c | 10 +- Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h | 1 + .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 181 ++++++++------------- .../Embedded/Modules/Control/MillisecTask.c | 25 +-- .../Embedded/Modules/Heaters/Heaters_Blowers.c | 7 +- .../Embedded/Modules/Stubs_Handler/Progress.c | 13 ++ .../StateMachines/Initialization/InitSequence.c | 2 +- 7 files changed, 110 insertions(+), 129 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c index 95651eba2..0b308408c 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.c @@ -350,15 +350,15 @@ uint32_t Dryer_Read_Blower_Tach() return RPM; } */ +uint32_t Drayer_Fan_Speed_RPM = 0; +uint32_t Get_Dryer_Fan_Tacho() +{ + return Drayer_Fan_Speed_RPM; +} uint32_t Read_Dryer_Fan_Tacho() { - - uint32_t Drayer_Fan_Speed_RPM = 0; - Drayer_Fan_Speed_RPM = Calculate_Tacho_Fan_Speed(FPGA_Freq, 12, F1_Prescaler1_reg5, F1_Tacho_reg8); - - return Drayer_Fan_Speed_RPM; } diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h index e660b450a..121211c69 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA.h @@ -15,6 +15,7 @@ void Control_Dryer_Fan_PWM(uint8_t PWM_Command_Precent); void Machine_Idle_Breathing_Led(); uint32_t Read_Dryer_Fan_Tacho(); +uint32_t Get_Dryer_Fan_Tacho(); void Set_Speed_Sensor_TypeII_Registers(uint32_t Counter, uint32_t Prescaler); uint32_t Read_Speed_Sensor_TypeII(); diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index 4a93c6aab..e736d45ea 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -1,3 +1,4 @@ + /* * AlarmHandling.c @@ -491,14 +492,14 @@ uint32_t AlarmHandlingLoadFile(void) { FileAlarmItem[F_count].AlarmDirection = AlarmParametersTable->alarmitem[i]->alarmdirection; FileAlarmItem[F_count].AlarmDirection = AlarmParametersTable->alarmitem[i]->alarmdirection; - FileAlarmItem[F_count].Frequency = AlarmParametersTable->alarmitem[i]->frequency; //1/10/100/1000 + //FileAlarmItem[F_count].Frequency = AlarmParametersTable->alarmitem[i]->frequency; //1/10/100/1000 FileAlarmItem[F_count].AlarmSource = AlarmParametersTable->alarmitem[i]->alarmsource; FileAlarmItem[F_count].DeviceId = AlarmParametersTable->alarmitem[i]->deviceid; FileAlarmItem[F_count].ModuleDeviceId = AlarmParametersTable->alarmitem[i]->moduledeviceid; FileAlarmItem[F_count].AlarmValue = AlarmParametersTable->alarmitem[i]->alarmvalue; FileAlarmItem[F_count].AlarmDirection = AlarmParametersTable->alarmitem[i]->alarmdirection; FileAlarmItem[F_count].Severity = AlarmParametersTable->alarmitem[i]->severity; - FileAlarmItem[F_count].Predecessor = AlarmParametersTable->alarmitem[i]->predecessor; + //FileAlarmItem[F_count].Predecessor = AlarmParametersTable->alarmitem[i]->predecessor; FileAlarmItem[F_count].DebounceValue = AlarmParametersTable->alarmitem[i]->debouncevalue; FileAlarmItem[F_count].EventType = AlarmParametersTable->alarmitem[i]->eventtype; FileAlarmItem[F_count].isPersistent = AlarmParametersTable->alarmitem[i]->ispersistent; @@ -1213,29 +1214,8 @@ uint32_t AlarmHandlingLoop(uint32_t tick) if (AlarmItem[Alarm_i].AlarmSource > ALARM_SOURCE_TYPE__FluidLevelAlarm) continue; AlarmCounter++; - if (tick%AlarmItem[Alarm_i].Frequency == 0) + switch (AlarmItem[Alarm_i].AlarmSource) { - switch (AlarmItem[Alarm_i].AlarmSource) - { - /*case ALARM_SOURCE_TYPE__TemperatureAlarm: - ivalue = MillisecGetTemperatures((TEMPERATURE_SENSOR_ID_ENUM)AlarmItem[Alarm_i].DeviceId); - if (AlarmItem[Alarm_i].AlarmDirection == true) - { - if (ivalue/100 >= AlarmItem[Alarm_i].AlarmValue) - { - //LOG_ERROR (ivalue/100,"Temperature spike"); - Status = true; - } - } - else - { - if (ivalue/100 <= AlarmItem[Alarm_i].AlarmValue) - { - //LOG_ERROR (ivalue/100,"iTemperature spike"); - Status = true; - } - } - break;*/ case ALARM_SOURCE_TYPE__CoversAlarm: if (CheckTamperAlarms) { @@ -1261,14 +1241,6 @@ uint32_t AlarmHandlingLoop(uint32_t tick) if (CheckHardLimitAlarms) { Status = AlarmState[Alarm_i].Status; - /*if (AlarmItem[Alarm_i].AlarmDirection == true) - { - value = Get_Notification_Disp_UP(AlarmItem[Alarm_i].DeviceId); - } - else - { - value = Get_Notification_Disp_Down(AlarmItem[Alarm_i].DeviceId); - } polling in the safety */ } else { @@ -1422,21 +1394,6 @@ uint32_t AlarmHandlingLoop(uint32_t tick) default: Status = false; } - /*value = MotorGetStatus((TimerMotors_t)AlarmItem[Alarm_i].DeviceId); - if (AlarmItem[Alarm_i].AlarmDirection == true) - { - if (value && AlarmItem[Alarm_i].AlarmValue) - { - Status = true; - } - } - else - { - if ((value && AlarmItem[Alarm_i].AlarmValue)==false) - { - Status = true; - } - }*/ } } else @@ -1473,7 +1430,7 @@ uint32_t AlarmHandlingLoop(uint32_t tick) case ALARM_SOURCE_TYPE__TachoAlarm: // add by shai Status = false; - if (CheckTamperAlarms) + if (CheckMotorAlarms) { // ReportWithPackageFilter(AlarmFilter,"------------FANS_RPM[Alarm_i]----------------", __FILE__,__LINE__,Alarm_i, RpMessage, value, 0); @@ -1560,16 +1517,19 @@ uint32_t AlarmHandlingLoop(uint32_t tick) } else { - value = Read_Dryer_Fan_Tacho(); + + value = Get_Dryer_Fan_Tacho(); if (AlarmItem[Alarm_i].Severity == DEBUG_LOG_CATEGORY__Critical ) - if ((AlarmItem[Alarm_i].AlarmDirection == UNDER_VALUE) && (value == DRYER_FAN_STOP)) + { + if (value == DRYER_FAN_STOP) { Status = true; - //ReportWithPackageFilter(AlarmFilter,"----------- DRYER FAN RPM Error----------------", __FILE__,__LINE__,0, RpMessage, value, 0); } + //ReportWithPackageFilter(AlarmFilter,"----------- DRYER FAN RPM ----------------", __FILE__,__LINE__,msec_millisecondCounter, RpMessage, value, 0); + } else if (AlarmItem[Alarm_i].Severity == DEBUG_LOG_CATEGORY__Warning) { - if ((AlarmItem[Alarm_i].AlarmDirection == UNDER_VALUE) && (value < DRYER_FAN_MIN_RPM)) + if ((value>0)&&(value < DRYER_FAN_MIN_RPM)) { Status = true; //ReportWithPackageFilter(AlarmFilter,"----------- DRYER FAN RPM Error----------------", __FILE__,__LINE__,0, RpMessage, value, 0); @@ -1621,78 +1581,77 @@ uint32_t AlarmHandlingLoop(uint32_t tick) break; default: break; - } //switch - if (AlarmItem[Alarm_i].DebounceValue > 0) //handle debouncing + } //switch + if (AlarmItem[Alarm_i].DebounceValue > 0) //handle debouncing + { + if (Status == true) //increase counter { - if (Status == true) //increase counter + AlarmState[Alarm_i].DebounceCounter++; + if (AlarmState[Alarm_i].Status == false) // alarm is not set yet { - AlarmState[Alarm_i].DebounceCounter++; - if (AlarmState[Alarm_i].Status == false) // alarm is not set yet + if (AlarmState[Alarm_i].DebounceCounter < AlarmItem[Alarm_i].DebounceValue) //had not reached the debounce value { - if (AlarmState[Alarm_i].DebounceCounter < AlarmItem[Alarm_i].DebounceValue) //had not reached the debounce value - { - Status = false; //do not set the alarm - } //else alarm will be set - } - else // alarm is already set - { - AlarmState[Alarm_i].DebounceCounter = AlarmItem[Alarm_i].DebounceValue; // do not go over the debounce value - } + Status = false; //do not set the alarm + } //else alarm will be set } - else //status == false - decrease counter + else // alarm is already set { - AlarmState[Alarm_i].DebounceCounter--; - if (AlarmState[Alarm_i].Status == true) // alarm is set - { - if (AlarmState[Alarm_i].DebounceCounter > 0) // had not reached zero yet - { - Status = true; // do not reset the alarm yet - } // else reset the alarm - } - else // if the alarm is off - { - AlarmState[Alarm_i].DebounceCounter = 0; //do not go below 0 - } + AlarmState[Alarm_i].DebounceCounter = AlarmItem[Alarm_i].DebounceValue; // do not go over the debounce value } } - /*if (AlarmItem[Alarm_i].Predecessor!=0xFF) - { - if (AlarmState[AlarmItem[Alarm_i].Predecessor].Status == true) //higher hierarchy alarm is on - Status = false; - }*/ - if (Status != AlarmState[Alarm_i].Status) //change in alarm Status + else //status == false - decrease counter { - if (Status == true) // alarm on + AlarmState[Alarm_i].DebounceCounter--; + if (AlarmState[Alarm_i].Status == true) // alarm is set { - // report the alarm! - AlarmState[Alarm_i].EventPtr = my_malloc (sizeof(Event)); - if (AlarmState[Alarm_i].EventPtr) + if (AlarmState[Alarm_i].DebounceCounter > 0) // had not reached zero yet { - event__init(AlarmState[Alarm_i].EventPtr); - AlarmState[Alarm_i].EventPtr->has_type = true; - AlarmState[Alarm_i].EventPtr->type = AlarmItem[Alarm_i].EventType; - AlarmState[Alarm_i].EventPtr->message = NULL;//AlarmItem[Alarm_i].EventName; - } - AlarmState[Alarm_i].Status = true; - AlarmHandlingConsequentActions(Alarm_i, AlarmItem[Alarm_i].Severity); - ReportWithPackageFilter(AlarmFilter,"Alarm ON ", __FILE__,__LINE__,AlarmItem[Alarm_i].EventType, RpMessage, value, Alarm_i); + Status = true; // do not reset the alarm yet + } // else reset the alarm } - else // alarm off + else // if the alarm is off { - ReportWithPackageFilter(AlarmFilter,"Alarm OFF ", __FILE__,__LINE__,AlarmItem[Alarm_i].EventType, RpMessage, 0, Alarm_i); - if (AlarmState[Alarm_i].EventPtr) - { - //ROM_IntMasterDisable(); - Save_Alarm_i = Alarm_i; - Save_Alarm_ptr = AlarmState[Alarm_i].EventPtr; - Save_Alarm_Type = AlarmItem[Alarm_i].EventType; - my_free(AlarmState[Alarm_i].EventPtr); - AlarmState[Alarm_i].EventPtr = NULL; - //ROM_IntMasterEnable(); - } - AlarmState[Alarm_i].Status = false; - AlarmHandlingConsequentActions(Alarm_i, DEBUG_LOG_CATEGORY__Info); + AlarmState[Alarm_i].DebounceCounter = 0; //do not go below 0 + } + } + } + /*if (AlarmItem[Alarm_i].Predecessor!=0xFF) + { + if (AlarmState[AlarmItem[Alarm_i].Predecessor].Status == true) //higher hierarchy alarm is on + Status = false; + }*/ + if (Status != AlarmState[Alarm_i].Status) //change in alarm Status + { + if (Status == true) // alarm on + { + // report the alarm! + AlarmState[Alarm_i].EventPtr = my_malloc (sizeof(Event)); + if (AlarmState[Alarm_i].EventPtr) + { + event__init(AlarmState[Alarm_i].EventPtr); + AlarmState[Alarm_i].EventPtr->has_type = true; + AlarmState[Alarm_i].EventPtr->type = AlarmItem[Alarm_i].EventType; + AlarmState[Alarm_i].EventPtr->message = NULL;//AlarmItem[Alarm_i].EventName; + } + AlarmState[Alarm_i].Status = true; + AlarmHandlingConsequentActions(Alarm_i, AlarmItem[Alarm_i].Severity); + ReportWithPackageFilter(AlarmFilter,"Alarm ON ", __FILE__,__LINE__,AlarmItem[Alarm_i].EventType, RpMessage, value, Alarm_i); + } + else // alarm off + { + ReportWithPackageFilter(AlarmFilter,"Alarm OFF ", __FILE__,__LINE__,AlarmItem[Alarm_i].EventType, RpMessage, 0, Alarm_i); + if (AlarmState[Alarm_i].EventPtr) + { + //ROM_IntMasterDisable(); + Save_Alarm_i = Alarm_i; + Save_Alarm_ptr = AlarmState[Alarm_i].EventPtr; + Save_Alarm_Type = AlarmItem[Alarm_i].EventType; + my_free(AlarmState[Alarm_i].EventPtr); + AlarmState[Alarm_i].EventPtr = NULL; + //ROM_IntMasterEnable(); } + AlarmState[Alarm_i].Status = false; + AlarmHandlingConsequentActions(Alarm_i, DEBUG_LOG_CATEGORY__Info); } } } diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 689219583..1057ddbc3 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -610,21 +610,21 @@ uint32_t MillisecLowLoop(uint32_t tick) //call all modules Millisec functions //test dancers and speed encoders //check all callback units (state machine waiting for completion of a change) - bool Ten_msTick, Fifty_msTick, Hundred_msTick , m20msecTick,m70msecTick,m90msecTick, Onesecond_Tick,Tensecond_Tick,OneMinute_Tick,TenMinutes_Tick,OneHourTick,Gradient_Tick; - bool O700Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick; + bool Ten_msTick, Fifty_msTick, Hundred_msTick , m20msecTick,m90msecTick, Onesecond_Tick,Tensecond_Tick,OneMinute_Tick,TenMinutes_Tick,OneHourTick,Gradient_Tick; + bool O700Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick,O800Millisecond_Tick; //bool O100Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick,O800Millisecond_Tick,O900Millisecond_Tick; Ten_msTick = (tick%eTenMillisecond == 0) ?true:false; Fifty_msTick = (tick%eHundredMillisecond == 40) ?true:false; //eFiftyMillisecond Hundred_msTick = (tick%eHundredMillisecond == 0) ?true:false; m20msecTick = (tick%eHundredMillisecond == 20) ?true:false; - m70msecTick = (tick%eHundredMillisecond == 70) ?true:false; + //m70msecTick = (tick%eHundredMillisecond == 70) ?true:false; m90msecTick = (tick%eHundredMillisecond == 90) ?true:false; O700Millisecond_Tick = (tick%eOneSecond == 700) ?true:false; O200Millisecond_Tick = (tick%eOneSecond == 200) ?true:false; O400Millisecond_Tick = (tick%eOneSecond == 400) ?true:false; O500Millisecond_Tick = (tick%eOneSecond == 500) ?true:false; O600Millisecond_Tick = (tick%eOneSecond == 600) ?true:false; - //O800Millisecond_Tick = (tick%eOneSecond == 800) ?true:false; + O800Millisecond_Tick = (tick%eOneSecond == 800) ?true:false; //O900Millisecond_Tick = (tick%eOneSecond == 900) ?true:false; Gradient_Tick = (tick%400 == 0) ?true:false; Onesecond_Tick = (tick%eOneSecond == 0) ?true:false; @@ -660,10 +660,10 @@ uint32_t MillisecLowLoop(uint32_t tick) Trigger_PT100_Read();//call every 50mSec (minimum delay 30mSec) //Set_HeadCard_PT100();//call every 50mSec (minimum delay 30mSec) } - if(m70msecTick) + /*if(m70msecTick) { AlarmHandling_ControlTrigger(0,0); - } + }*/ if (m90msecTick) { for (Sensor_i = StartPT100;Sensor_i < MAX_HEAD_CARD_TEMP_SENS_ID;Sensor_i++) @@ -717,14 +717,11 @@ uint32_t MillisecLowLoop(uint32_t tick) } if (Gradient_Tick) DispensersCollectionCall(); - if (O700Millisecond_Tick) - { - Trigger_Heater_Current_Read(); - } if (O200Millisecond_Tick) { Trigger_WHS_MAX11614_Read_allADC(); FPGA_GetAllDispensersValveBusyOCD(); + Read_Dryer_Fan_Tacho(); temp = Read_Fans_Tacho(); DrawerFansStatus = temp & 0x1F; SystemFansStatus = temp & 0xE0; @@ -755,6 +752,14 @@ uint32_t MillisecLowLoop(uint32_t tick) } } } + if (O700Millisecond_Tick) + { + Trigger_Heater_Current_Read(); + } + if (O800Millisecond_Tick) + { + AlarmHandling_ControlTrigger(0,0); + } if (Onesecond_Tick) { //char Lenstr[160]; diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c index ba4749f13..59a0aee51 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c @@ -316,14 +316,15 @@ void HeadBlowersControlLoop () int blowerId; static int count[2] = {0, 0}; - ArcHeadAlarms(); - if (GetMachineState() < MACHINE_STATE_WAIT_FOR_COOLER) return; //do not start before controller is initialized and running if (!HeadBlowersEnable) { return; } + + ArcHeadAlarms(); + for (blowerId = 0; blowerId <= 1; blowerId++) { if (count[blowerId] == HeadBlowersCloseLoopTime[blowerId]) { count[blowerId] = 0; @@ -377,6 +378,8 @@ double PressureSensorGetPressure(uint8_t SensorId) V0 = PressureSensorV0[FanId]; Vm = (double)(MillisecGetTemperatures(SensorId)); Vm /= 10.0; + if ((Vm - V0 + 22)<0) + return 0.0; Q = sqrt(Vm - V0 + 22) * PRESSURE_SENSOR_CP - PRESSURE_SENSOR_B; return Q; } diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index b9b916eb6..5b216d25c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -1233,6 +1233,19 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.has_progress = true; } else + if(request->amount == 0xB23) //Set loading arm cycles + { + REPORT_MSG(request->delay,"Control dryer fan tacho"); + if (request->delay>0) + Control_Dryer_Fan(START,request->delay);//use START or STOP, 0 - 100%(); + else + Control_Dryer_Fan(STOP,0);//use START or STOP, 0 - 100%(); + Task_sleep(1000); + + response.progress = (double)Get_Dryer_Fan_Tacho(); + response.has_progress = true; + } + else if(request->amount == 0xC3) //suspend I2C task { if (request->delay == 0) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c index 40315e623..d5e125337 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/InitSequence.c @@ -249,7 +249,7 @@ uint32_t InitSequenceBlowerCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag) WHS_enable_control_loop(true); WHS_Set_SetPoint_Q_value(headairflow); - AlarmHandlingSetAlarm (EVENT_TYPE__MACHINE_STATE_INITIAL_BLOWER_FAILED,OFF); //handle alarm detection and operation + //AlarmHandlingSetAlarm (EVENT_TYPE__MACHINE_STATE_INITIAL_BLOWER_FAILED,OFF); //handle alarm detection and operation waste_seq_step1();// include 1Sec delay <- to open !!!! -- cgit v1.3.1 From 494359dd2d405c8c7d7ffbecb2dbde69134f30dd Mon Sep 17 00:00:00 2001 From: Ronen Sberlo Date: Thu, 5 Nov 2020 17:42:12 +0200 Subject: lost in merge --- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c index 59a0aee51..c9565cf13 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c @@ -280,7 +280,7 @@ void ArcHeadAlarms(void) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_HIGH, false); count5 = (count5 < 0)?(0):(count5); } - if (currentFlow < 1.0) { + if (currentFlow < 0.1) { if (++count6 == ARC_ALARM_LIMIT) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_LOW, true); count6 = (count6 > ARC_ALARM_LIMIT)?(ARC_ALARM_LIMIT):(count6); @@ -300,7 +300,7 @@ void ArcHeadAlarms(void) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_HIGH, false); count7 = (count7 < 0)?(0):(count7); } - if (currentFlow < 1.0) { + if (currentFlow < 0.1) { if (++count8 == ARC_ALARM_LIMIT) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_LOW, true); count8 = (count8 > ARC_ALARM_LIMIT)?(ARC_ALARM_LIMIT):(count8); -- cgit v1.3.1 From b41e559ca8801bbf6c71f14aadb00215c80686d5 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 5 Nov 2020 18:14:33 +0200 Subject: cancel last change --- Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c | 4 ++-- .../Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c index c9565cf13..59a0aee51 100644 --- a/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c +++ b/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters_Blowers.c @@ -280,7 +280,7 @@ void ArcHeadAlarms(void) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_HIGH, false); count5 = (count5 < 0)?(0):(count5); } - if (currentFlow < 0.1) { + if (currentFlow < 1.0) { if (++count6 == ARC_ALARM_LIMIT) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_1_FLOW_TOO_LOW, true); count6 = (count6 > ARC_ALARM_LIMIT)?(ARC_ALARM_LIMIT):(count6); @@ -300,7 +300,7 @@ void ArcHeadAlarms(void) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_HIGH, false); count7 = (count7 < 0)?(0):(count7); } - if (currentFlow < 0.1) { + if (currentFlow < 1.0) { if (++count8 == ARC_ALARM_LIMIT) AlarmHandlingSetAlarm(EVENT_TYPE__DYEING_HEAD_BLOWER_2_FLOW_TOO_LOW, true); count8 = (count8 > ARC_ALARM_LIMIT)?(ARC_ALARM_LIMIT):(count8); diff --git a/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs b/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs index 7319b8f41..f7533ea7e 100644 --- a/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs +++ b/Software/Stubs Collection/stubs/embeddedparametersbuild_w_cleaning.cs @@ -149,10 +149,12 @@ AllowedRangeForHeadBlowerDeviation = 7; configurationParameters.GeneralParameters.Add(AllowedRangeForHeadBlowerDeviation); double AllowedRangeForWasteBlowerDeviation = new Double(); -AllowedRangeForWasteBlowerDeviation = 10; +AllowedRangeForWasteBlowerDeviation = 20; configurationParameters.GeneralParameters.Add(AllowedRangeForWasteBlowerDeviation); - +double Voltage_Hysteresis = new Double(); +Voltage_Hysteresis = 4; +configurationParameters.GeneralParameters.Add(Voltage_Hysteresis); File.WriteAllBytes("C:/temp/EmbParam.cfg",configurationParameters.ToBytes()); -- cgit v1.3.1 From 55dffe48de95cb51b3a1a30e2ffc4336ec3bb2b2 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 8 Nov 2020 10:27:23 +0200 Subject: attempt thread logging support, some logs in IDS. --- .../Embedded_SW/Embedded/Communication/Container.c | 3 + .../Communication/PMR/Common/MessageType.pb-c.c | 26 ++++---- .../Communication/PMR/Common/MessageType.pb-c.h | 2 + .../EmbeddedParameters/AlarmHandlingItem.pb-c.c | 66 ++++++-------------- .../EmbeddedParameters/AlarmHandlingItem.pb-c.h | 6 +- .../AttemptThreadJoggingRequest.pb-c.c | 72 ++++++++++++++++++++++ .../AttemptThreadJoggingRequest.pb-c.h | 70 +++++++++++++++++++++ .../AttemptThreadJoggingResponse.pb-c.c | 72 ++++++++++++++++++++++ .../AttemptThreadJoggingResponse.pb-c.h | 70 +++++++++++++++++++++ Software/Embedded_SW/Embedded/DataDef.h | 6 +- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 20 +++--- Software/Embedded_SW/Embedded/Modules/IFS/ifs.c | 2 +- .../Embedded/Modules/Stubs_Handler/Progress.c | 8 +++ .../Embedded/Modules/Thread/ThreadLoad.c | 46 ++++++++++++++ .../Embedded/Modules/Thread/Thread_ex.h | 2 + .../Embedded/Modules/Thread/Thread_print.c | 22 ++++--- .../Embedded/StateMachines/Printing/JobSTM.c | 9 ++- .../Embedded/StateMachines/Printing/PrintingSTM.h | 1 + 18 files changed, 422 insertions(+), 81 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.h (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Communication/Container.c b/Software/Embedded_SW/Embedded/Communication/Container.c index 5bed0bcdc..b386ae20f 100644 --- a/Software/Embedded_SW/Embedded/Communication/Container.c +++ b/Software/Embedded_SW/Embedded/Communication/Container.c @@ -491,6 +491,9 @@ void receive_callback(char* buffer, size_t length) case MESSAGE_TYPE__StopThreadLoadingRequest: StopThreadLoadingFunc(requestContainer); break; + case MESSAGE_TYPE__AttemptThreadJoggingRequest: + AttemptThreadJoggingFunc(requestContainer); + break; case MESSAGE_TYPE__StubDispenserEEpromRequest: StubDispenserEEpromRequestFunc(requestContainer); break; 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 d7fe911c1..4b8277d75 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[269] = +static const ProtobufCEnumValue message_type__enum_values_by_number[271] = { { "", "", 0 }, { "", "", 1 }, @@ -272,6 +272,8 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[269] = { "", "", 11005 }, { "", "", 11006 }, { "", "", 11007 }, + { "", "", 11008 }, + { "", "", 11009 }, { "", "", 12000 }, { "", "", 12001 }, { "", "", 13000 }, @@ -280,9 +282,9 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[269] = { "", "", 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, 263},{13000, 265},{0, 269} +{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} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[271] = { { "", 189 }, { "", 190 }, @@ -294,6 +296,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = { "", 252 }, { "", 231 }, { "", 232 }, + { "", 263 }, + { "", 264 }, { "", 2 }, { "", 3 }, { "", 175 }, @@ -344,8 +348,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = { "", 210 }, { "", 131 }, { "", 132 }, - { "", 267 }, - { "", 268 }, + { "", 269 }, + { "", 270 }, { "", 223 }, { "", 224 }, { "", 221 }, @@ -375,8 +379,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = { "", 122 }, { "", 4 }, { "", 5 }, - { "", 265 }, - { "", 266 }, + { "", 267 }, + { "", 268 }, { "", 161 }, { "", 162 }, { "", 185 }, @@ -407,8 +411,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = { "", 166 }, { "", 187 }, { "", 188 }, - { "", 263 }, - { "", 264 }, + { "", 265 }, + { "", 266 }, { "", 241 }, { "", 242 }, { "", 245 }, @@ -561,9 +565,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "", "", "", - 269, + 271, message_type__enum_values_by_number, - 269, + 271, 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 cacc241b3..133d64f2d 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 @@ -283,6 +283,8 @@ typedef enum _MessageType { MESSAGE_TYPE__StopThreadLoadingResponse = 11005, MESSAGE_TYPE__TryThreadLoadingRequest = 11006, MESSAGE_TYPE__TryThreadLoadingResponse = 11007, + MESSAGE_TYPE__AttemptThreadJoggingRequest = 11008, + MESSAGE_TYPE__AttemptThreadJoggingResponse = 11009, MESSAGE_TYPE__StartInkFillingStatusRequest = 12000, MESSAGE_TYPE__StartInkFillingStatusResponse = 12001, MESSAGE_TYPE__PutDataStoreItemRequest = 13000, 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/ThreadLoading/AttemptThreadJoggingRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.c new file mode 100644 index 000000000..78659ae90 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AttemptThreadJoggingRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "AttemptThreadJoggingRequest.pb-c.h" +void attempt_thread_jogging_request__init + (AttemptThreadJoggingRequest *message) +{ + static const AttemptThreadJoggingRequest init_value = ATTEMPT_THREAD_JOGGING_REQUEST__INIT; + *message = init_value; +} +size_t attempt_thread_jogging_request__get_packed_size + (const AttemptThreadJoggingRequest *message) +{ + assert(message->base.descriptor == &attempt_thread_jogging_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t attempt_thread_jogging_request__pack + (const AttemptThreadJoggingRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &attempt_thread_jogging_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t attempt_thread_jogging_request__pack_to_buffer + (const AttemptThreadJoggingRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &attempt_thread_jogging_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +AttemptThreadJoggingRequest * + attempt_thread_jogging_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (AttemptThreadJoggingRequest *) + protobuf_c_message_unpack (&attempt_thread_jogging_request__descriptor, + allocator, len, data); +} +void attempt_thread_jogging_request__free_unpacked + (AttemptThreadJoggingRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &attempt_thread_jogging_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define attempt_thread_jogging_request__field_descriptors NULL +#define attempt_thread_jogging_request__field_indices_by_name NULL +#define attempt_thread_jogging_request__number_ranges NULL +const ProtobufCMessageDescriptor attempt_thread_jogging_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(AttemptThreadJoggingRequest), + 0, + attempt_thread_jogging_request__field_descriptors, + attempt_thread_jogging_request__field_indices_by_name, + 0, attempt_thread_jogging_request__number_ranges, + (ProtobufCMessageInit) attempt_thread_jogging_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.h new file mode 100644 index 000000000..366498be8 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AttemptThreadJoggingRequest.proto */ + +#ifndef PROTOBUF_C_AttemptThreadJoggingRequest_2eproto__INCLUDED +#define PROTOBUF_C_AttemptThreadJoggingRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _AttemptThreadJoggingRequest AttemptThreadJoggingRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _AttemptThreadJoggingRequest +{ + ProtobufCMessage base; +}; +#define ATTEMPT_THREAD_JOGGING_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&attempt_thread_jogging_request__descriptor) \ + } + + +/* AttemptThreadJoggingRequest methods */ +void attempt_thread_jogging_request__init + (AttemptThreadJoggingRequest *message); +size_t attempt_thread_jogging_request__get_packed_size + (const AttemptThreadJoggingRequest *message); +size_t attempt_thread_jogging_request__pack + (const AttemptThreadJoggingRequest *message, + uint8_t *out); +size_t attempt_thread_jogging_request__pack_to_buffer + (const AttemptThreadJoggingRequest *message, + ProtobufCBuffer *buffer); +AttemptThreadJoggingRequest * + attempt_thread_jogging_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void attempt_thread_jogging_request__free_unpacked + (AttemptThreadJoggingRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*AttemptThreadJoggingRequest_Closure) + (const AttemptThreadJoggingRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor attempt_thread_jogging_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_AttemptThreadJoggingRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.c new file mode 100644 index 000000000..d75845c99 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AttemptThreadJoggingResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "AttemptThreadJoggingResponse.pb-c.h" +void attempt_thread_jogging_response__init + (AttemptThreadJoggingResponse *message) +{ + static const AttemptThreadJoggingResponse init_value = ATTEMPT_THREAD_JOGGING_RESPONSE__INIT; + *message = init_value; +} +size_t attempt_thread_jogging_response__get_packed_size + (const AttemptThreadJoggingResponse *message) +{ + assert(message->base.descriptor == &attempt_thread_jogging_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t attempt_thread_jogging_response__pack + (const AttemptThreadJoggingResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &attempt_thread_jogging_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t attempt_thread_jogging_response__pack_to_buffer + (const AttemptThreadJoggingResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &attempt_thread_jogging_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +AttemptThreadJoggingResponse * + attempt_thread_jogging_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (AttemptThreadJoggingResponse *) + protobuf_c_message_unpack (&attempt_thread_jogging_response__descriptor, + allocator, len, data); +} +void attempt_thread_jogging_response__free_unpacked + (AttemptThreadJoggingResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &attempt_thread_jogging_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define attempt_thread_jogging_response__field_descriptors NULL +#define attempt_thread_jogging_response__field_indices_by_name NULL +#define attempt_thread_jogging_response__number_ranges NULL +const ProtobufCMessageDescriptor attempt_thread_jogging_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(AttemptThreadJoggingResponse), + 0, + attempt_thread_jogging_response__field_descriptors, + attempt_thread_jogging_response__field_indices_by_name, + 0, attempt_thread_jogging_response__number_ranges, + (ProtobufCMessageInit) attempt_thread_jogging_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.h new file mode 100644 index 000000000..e7324b29b --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AttemptThreadJoggingResponse.proto */ + +#ifndef PROTOBUF_C_AttemptThreadJoggingResponse_2eproto__INCLUDED +#define PROTOBUF_C_AttemptThreadJoggingResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _AttemptThreadJoggingResponse AttemptThreadJoggingResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _AttemptThreadJoggingResponse +{ + ProtobufCMessage base; +}; +#define ATTEMPT_THREAD_JOGGING_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&attempt_thread_jogging_response__descriptor) \ + } + + +/* AttemptThreadJoggingResponse methods */ +void attempt_thread_jogging_response__init + (AttemptThreadJoggingResponse *message); +size_t attempt_thread_jogging_response__get_packed_size + (const AttemptThreadJoggingResponse *message); +size_t attempt_thread_jogging_response__pack + (const AttemptThreadJoggingResponse *message, + uint8_t *out); +size_t attempt_thread_jogging_response__pack_to_buffer + (const AttemptThreadJoggingResponse *message, + ProtobufCBuffer *buffer); +AttemptThreadJoggingResponse * + attempt_thread_jogging_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void attempt_thread_jogging_response__free_unpacked + (AttemptThreadJoggingResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*AttemptThreadJoggingResponse_Closure) + (const AttemptThreadJoggingResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor attempt_thread_jogging_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_AttemptThreadJoggingResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index e128094a5..755e5a962 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -26,7 +26,8 @@ //#define FOUR_WINDERS #ifdef FOUR_WINDERS -#define BTSR_NO_TFU +#define BTSR_NO_FEEDER_TFU +#define BTSR_NO_PULLER_TFU #endif //#define USE_POWERSTEP01 -NA @@ -35,7 +36,8 @@ //#define VAC_TEST #define DISPENSER_VALVES_OPEN //#define USE_TUNNEL_PT100 -//#define BTSR_NO_TFU +//#define BTSR_NO_FEEDER_TFU +//#define BTSR_NO_PULLER_TFU //#define IGNORE_SPIKE //#define SPECIAL_DISPENSERS extern bool Special_Dispensers; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 5b6ad643d..fcd1c05a2 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -591,7 +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))) + { + ReportWithPackageFilter(IDSFilter,"IDS dispenser pre-run ended",__FILE__,i,(int)DispenserTotalPrepareSteps[i],RpWarning,(int)(pressure*100),0); + } if (DispenserTotalPrepareSteps[i]= DispenserPrepareTimeout) { @@ -730,7 +736,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl } } }//for - usnprintf(IdMessage, 80,"WFCF %d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",WFCF,CurrentDispenserSpeed[0], + usnprintf(IdMessage, 80,"WFCF %d K %d,C %d,M %d,Y %d,TI %d",WFCF,CurrentDispenserSpeed[0], CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]); ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, DispenserBuildTimeCounter, RpWarning, WFCF, 0); @@ -788,7 +794,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl JobEndSequence = false; if ((pressurebuildup>0.1)&&(pressurebuildup<4.5)) { - ReportWithPackageFilter(IDSFilter,"Setting pressure from RML feeder tension",__FILE__,__LINE__,(int)(pressurebuildup*100),RpWarning,(int)(DispenserPreparePressure*100),0); + ReportWithPackageFilter(IDSFilter,"Setting pressure from RML pressure buildup",__FILE__,__LINE__,(int)(pressurebuildup*100),RpWarning,(int)(DispenserPreparePressure*100),0); DispenserPreparePressure = pressurebuildup; } if (JobTicket->headcleaningparameters) @@ -1081,7 +1087,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl } } }//for - usnprintf(IdMessage, 80,"Presegment Prepare D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",CurrentDispenserSpeed[0], + usnprintf(IdMessage, 80,"Presegment Prepare K %d,C %d,M %d,Y %d,TI %d",CurrentDispenserSpeed[0], CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]); ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, Dispenser_i, RpWarning, segmentfirst_speed, 0); @@ -1283,7 +1289,7 @@ uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback); //SendJobProgress(0.0, 0, false, IdsMessage);*/ } }//for - usnprintf(IdMessage, 80,"Presegment WFCF %d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",WFCF,CurrentDispenserSpeed[0], + usnprintf(IdMessage, 80,"Presegment WFCF %d K %d,C %d,M %d,Y %d,TI %d",WFCF,CurrentDispenserSpeed[0], CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]); ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, FileBrushStop->index, RpWarning, lInterSegmentLength, 0); } @@ -1610,7 +1616,7 @@ void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers) } } //for } - usnprintf(IdMessage, 80,"IDS_StartBrushStop %d/%d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",FileBrushStop->index,SegmentNumOfBrushStops,CurrentDispenserSpeed[0], + usnprintf(IdMessage, 80,"IDS_StartBrushStop %d/%d K %d,C %d,M %d,Y %d,TI %d",FileBrushStop->index,SegmentNumOfBrushStops,CurrentDispenserSpeed[0], CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]); ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, SegmentNumOfBrushStops, FileBrushStop->index, RpWarning,(int)FileBrushStop->offsetmeters, 0); diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c index b2498ee7f..329357ed4 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c @@ -335,7 +335,7 @@ void midTankStateMachine(void) if (midTankCartColor == MIDTANK_8) { - CartridgeInkTimeout = CARTRIDGE_INK_TIMEOUT*4; + CartridgeInkTimeout = CARTRIDGE_INK_TIMEOUT*10; CartridgeCheckTime = FIVE_SECONDS*3; } // set valve selection diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index 5b216d25c..e694810d7 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -1246,6 +1246,14 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) response.has_progress = true; } else + if(request->amount == 0xB24) //Set loading arm cycles + { + REPORT_MSG(request->delay,"AttemptThreadJoggingFunc"); + AttemptThreadJoggingFunc(1); + response.progress = 0xb24; + response.has_progress = true; + } + else if(request->amount == 0xC3) //suspend I2C task { if (request->delay == 0) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 63072e4d8..1d310cf01 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -49,6 +49,7 @@ #include "PMR/ThreadLoading/TryThreadLoadingResponse.pb-c.h" #include "PMR/ThreadLoading/StopThreadLoadingRequest.pb-c.h" #include "PMR/ThreadLoading/StopThreadLoadingResponse.pb-c.h" +#include "PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.h" //#include //#include @@ -1597,3 +1598,48 @@ uint32_t StopThreadLoadingFunc(MessageContainer* requestContainer) return OK; } +uint8_t attemptJogCounter = 0; +#define ATTEMPT_JOG_TIMEOUT 18 +char AttemptJoggingToken[36+1] = {0}; + +uint32_t AttemptThreadJoggingCallback(uint32_t index, uint32_t ReadValue) +{ + AttemptThreadJoggingResponse response = ATTEMPT_THREAD_JOGGING_RESPONSE__INIT; + MessageContainer responseContainer; + + attemptJogCounter++; + Report("AttemptThreadJoggingCallback",__FILE__,attemptJogCounter,JobEndReason,RpWarning,(int)JobIsActive(),0); + if (attemptJogCountertoken,36); + Report("AttemptThreadJoggingFunc",__FILE__,__LINE__,0xFF,RpWarning,(int)ATTEMPT_JOG_TIMEOUT,0); + LoadingControlId = AddControlCallback("Load jog",AttemptThreadJoggingCallback, eOneSecond,TemplateDataReadCBFunction,0,0,0); + ThreadJoggingFunc(30); + return OK; +} + diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h index 0861b677b..43938c871 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h @@ -88,6 +88,8 @@ uint32_t StartThreadLoadingFunc(MessageContainer* requestContainer); uint32_t ContinueThreadLoadingFunc(MessageContainer* requestContainer); uint32_t StopThreadLoadingFunc(MessageContainer* requestContainer); uint32_t TryThreadLoadingFunc(MessageContainer* requestContainer); +uint32_t AttemptThreadJoggingFunc(MessageContainer* requestContainer); + void ThreadCheckArcHeadCovers(void); uint32_t Thread_Load_End(void); uint32_t ThreadLoadingRestartReport(void); //sending after a failure in the finalizing stage diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index bc4e6cb8f..8d41f3b9a 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -337,7 +337,7 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) }**/ //} -#ifdef BTSR_NO_TFU +#ifdef BTSR_NO_PULLER_TFU if (CurrentControlledSpeed[WINDER_MOTOR]>100) length = dyeingspeed/10; #endif @@ -917,7 +917,7 @@ uint32_t Release_Right_TFU_TensionCallback(uint32_t deviceID, uint32_t BusyFlag) uint32_t Release_Right_TFU_Tension() { uint32_t status = OK; -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_FEEDER_TFU if (RTFU_Up == true) { Report("Release_Right_TFU_Tension",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4,0); @@ -931,7 +931,7 @@ int SecondFeederCorrection = 4; int PrepareWaitCount = 0; uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadValue) { -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_FEEDER_TFU MotorStop (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,Soft_Stop); //per L6470 errata between mov and run commands Report("Adjust_Right_TFU_Tension_2ndCallback x more steps",__FILE__,__LINE__,MotorId,RpMessage,SecondFeederCorrection,0); if (JobIsActive()==false) @@ -955,7 +955,7 @@ uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadVa } uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue) { -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_FEEDER_TFU Report("Adjust_Right_TFU_Tension_Callback",__FILE__,__LINE__,MotorId,RpMessage,0,0); MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,SecondFeederCorrection* MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].microstep, Adjust_Right_TFU_Tension_2nd_Callback,1000); RTFU_Up = true; @@ -966,7 +966,7 @@ uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue) uint32_t Adjust_Right_TFU_Tension(double tension) { uint32_t status = OK; -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_FEEDER_TFU if (tension > 0.5) //0 = lower position, 1 = high position { if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP) == NO_LIMIT) @@ -1093,11 +1093,13 @@ uint32_t ThreadPrepareState(void *JobDetails) IntersegmentLength = JobTicket->intersegmentlength; PrepareWaitCount = 0; -#ifndef BTSR_NO_TFU status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__LeftDancer, windertension); ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Winder",__FILE__,HARDWARE_DANCER_TYPE__LeftDancer,PrepareWaitCount,RpWarning,(int)windertension,0); +#ifndef BTSR_NO_PULLER_TFU status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__MiddleDancer, pullertension); ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Puller",__FILE__,HARDWARE_DANCER_TYPE__MiddleDancer,PrepareWaitCount,RpWarning,(int)pullertension,0); +#endif +#ifndef BTSR_NO_FEEDER_TFU status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__RightDancer, feedertension); ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Feeder",__FILE__,HARDWARE_DANCER_TYPE__RightDancer,PrepareWaitCount,RpWarning,(int)feedertension,0); #endif @@ -1219,7 +1221,7 @@ uint32_t ThreadPrepareState(void *JobDetails) ///////////////////////////////////////////////////// MotorSetDirection((TimerMotors_t)HW_Motor_Id,MotorsCfg[HW_Motor_Id].directionthreadwize); -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_FEEDER_TFU if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { ReportWithPackageFilter(ThreadFilter,"Feeder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); @@ -1233,6 +1235,7 @@ uint32_t ThreadPrepareState(void *JobDetails) SpeedControlId = AddControlCallback(NULL,ThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); } #endif +#ifndef BTSR_NO_PULLER_TFU if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { ReportWithPackageFilter(ThreadFilter,"Puller Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); @@ -1246,7 +1249,8 @@ uint32_t ThreadPrepareState(void *JobDetails) PoolerLengthCalculationMultiplier = (MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulleyradius*2*PI)/(MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulseperround*MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].microstep); PoolerSpeedControlId = AddControlCallback(NULL,PoolerThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); } -#ifndef BTSR_NO_TFU +#endif +#ifndef BTSR_NO_FEEDER_TFU if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { if (ControlIdtoMotorId[Motor_i] != 0xFF) @@ -1261,6 +1265,8 @@ uint32_t ThreadPrepareState(void *JobDetails) //AddControlCallback(NULL,ThreadControlSpeedReadFunction, eHundredMillisecond,MotorGetSpeedFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); #endif } +#endif +#ifndef BTSR_NO_PULLER_TFU if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will n//ot be controlled { if (ControlIdtoMotorId[Motor_i] != 0xFF) diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 155d84fdb..82601a162 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -184,6 +184,13 @@ bool JobIsActive(void) return retcode; }*/ +ErrorCode getJobError_to_ErrorCode(JobEndReasonEnum JobError) +{ + if (JobError Date: Sun, 8 Nov 2020 14:35:29 +0200 Subject: check and fix attmptthreadjogging handling --- .../Embedded/Modules/Stubs_Handler/Progress.c | 2 +- .../Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c index e694810d7..c6cfbb1d1 100644 --- a/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c +++ b/Software/Embedded_SW/Embedded/Modules/Stubs_Handler/Progress.c @@ -1249,7 +1249,7 @@ void Stub_ProgressRequest(MessageContainer* requestContainer) if(request->amount == 0xB24) //Set loading arm cycles { REPORT_MSG(request->delay,"AttemptThreadJoggingFunc"); - AttemptThreadJoggingFunc(1); + AttemptThreadJoggingFunc(NULL); response.progress = 0xb24; response.has_progress = true; } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 1d310cf01..cdb726b5e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -1621,22 +1621,26 @@ uint32_t AttemptThreadJoggingCallback(uint32_t index, uint32_t ReadValue) responseContainer.has_error = true; responseContainer.error = getJobError_to_ErrorCode(JobEndReason); } - SafeRemoveControlCallback(LoadingControlId, Thread_Load_Jog_ThreadStop ); + SafeRemoveControlCallback(LoadingControlId, AttemptThreadJoggingCallback ); LoadingControlId = 0xFF; - responseContainer = createContainer(MESSAGE_TYPE__AttemptThreadJoggingResponse, AttemptJoggingToken, true, &response, &attempt_thread_jogging_response__pack, &attempt_thread_jogging_response__get_packed_size); - responseContainer.continuous = false; - uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); - size_t container_size = message_container__pack(&responseContainer, container_buffer); - my_free(responseContainer.data.data); - SendChars((char*)container_buffer, container_size); + if (AttemptJoggingToken[0]) + { + responseContainer = createContainer(MESSAGE_TYPE__AttemptThreadJoggingResponse, AttemptJoggingToken, true, &response, &attempt_thread_jogging_response__pack, &attempt_thread_jogging_response__get_packed_size); + responseContainer.continuous = false; + uint8_t* container_buffer = my_malloc(message_container__get_packed_size(&responseContainer)); + size_t container_size = message_container__pack(&responseContainer, container_buffer); + my_free(responseContainer.data.data); + SendChars((char*)container_buffer, container_size); + } return OK; } uint32_t AttemptThreadJoggingFunc(MessageContainer* requestContainer) { attemptJogCounter = 0; - ustrncpy (AttemptJoggingToken, requestContainer->token,36); + if(requestContainer) + ustrncpy (AttemptJoggingToken, requestContainer->token,36); Report("AttemptThreadJoggingFunc",__FILE__,__LINE__,0xFF,RpWarning,(int)ATTEMPT_JOG_TIMEOUT,0); LoadingControlId = AddControlCallback("Load jog",AttemptThreadJoggingCallback, eOneSecond,TemplateDataReadCBFunction,0,0,0); ThreadJoggingFunc(30); -- cgit v1.3.1 From eb160d2692e12bd5402c9686eb2850695fb999cc Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 8 Nov 2020 21:55:25 +0200 Subject: alarm handling --- .../Communication/PMR/Common/MessageType.pb-c.c | 26 ++++---- .../Communication/PMR/Common/MessageType.pb-c.h | 2 + .../EmbeddedParameters/AlarmHandlingItem.pb-c.c | 66 ++++++-------------- .../EmbeddedParameters/AlarmHandlingItem.pb-c.h | 6 +- .../AttemptThreadJoggingRequest.pb-c.c | 72 ++++++++++++++++++++++ .../AttemptThreadJoggingRequest.pb-c.h | 70 +++++++++++++++++++++ .../AttemptThreadJoggingResponse.pb-c.c | 72 ++++++++++++++++++++++ .../AttemptThreadJoggingResponse.pb-c.h | 70 +++++++++++++++++++++ Software/Embedded_SW/Embedded/DataDef.h | 6 +- .../Embedded/Modules/AlarmHandling/AlarmHandling.c | 4 ++ .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 20 +++--- Software/Embedded_SW/Embedded/Modules/IFS/ifs.c | 2 +- .../Embedded/Modules/Thread/Thread_Winder.c | 23 ++++++- .../Embedded/Modules/Thread/Thread_ex.h | 1 + .../Embedded/Modules/Thread/Thread_print.c | 22 ++++--- 15 files changed, 380 insertions(+), 82 deletions(-) create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.h create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.c create mode 100644 Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.h (limited to 'Software/Embedded_SW/Embedded/Modules') 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 d7fe911c1..4b8277d75 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[269] = +static const ProtobufCEnumValue message_type__enum_values_by_number[271] = { { "", "", 0 }, { "", "", 1 }, @@ -272,6 +272,8 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[269] = { "", "", 11005 }, { "", "", 11006 }, { "", "", 11007 }, + { "", "", 11008 }, + { "", "", 11009 }, { "", "", 12000 }, { "", "", 12001 }, { "", "", 13000 }, @@ -280,9 +282,9 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[269] = { "", "", 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, 263},{13000, 265},{0, 269} +{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} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[271] = { { "", 189 }, { "", 190 }, @@ -294,6 +296,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = { "", 252 }, { "", 231 }, { "", 232 }, + { "", 263 }, + { "", 264 }, { "", 2 }, { "", 3 }, { "", 175 }, @@ -344,8 +348,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = { "", 210 }, { "", 131 }, { "", 132 }, - { "", 267 }, - { "", 268 }, + { "", 269 }, + { "", 270 }, { "", 223 }, { "", 224 }, { "", 221 }, @@ -375,8 +379,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = { "", 122 }, { "", 4 }, { "", 5 }, - { "", 265 }, - { "", 266 }, + { "", 267 }, + { "", 268 }, { "", 161 }, { "", 162 }, { "", 185 }, @@ -407,8 +411,8 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[269] = { "", 166 }, { "", 187 }, { "", 188 }, - { "", 263 }, - { "", 264 }, + { "", 265 }, + { "", 266 }, { "", 241 }, { "", 242 }, { "", 245 }, @@ -561,9 +565,9 @@ const ProtobufCEnumDescriptor message_type__descriptor = "", "", "", - 269, + 271, message_type__enum_values_by_number, - 269, + 271, 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 cacc241b3..133d64f2d 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 @@ -283,6 +283,8 @@ typedef enum _MessageType { MESSAGE_TYPE__StopThreadLoadingResponse = 11005, MESSAGE_TYPE__TryThreadLoadingRequest = 11006, MESSAGE_TYPE__TryThreadLoadingResponse = 11007, + MESSAGE_TYPE__AttemptThreadJoggingRequest = 11008, + MESSAGE_TYPE__AttemptThreadJoggingResponse = 11009, MESSAGE_TYPE__StartInkFillingStatusRequest = 12000, MESSAGE_TYPE__StartInkFillingStatusResponse = 12001, MESSAGE_TYPE__PutDataStoreItemRequest = 13000, 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/ThreadLoading/AttemptThreadJoggingRequest.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.c new file mode 100644 index 000000000..78659ae90 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AttemptThreadJoggingRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "AttemptThreadJoggingRequest.pb-c.h" +void attempt_thread_jogging_request__init + (AttemptThreadJoggingRequest *message) +{ + static const AttemptThreadJoggingRequest init_value = ATTEMPT_THREAD_JOGGING_REQUEST__INIT; + *message = init_value; +} +size_t attempt_thread_jogging_request__get_packed_size + (const AttemptThreadJoggingRequest *message) +{ + assert(message->base.descriptor == &attempt_thread_jogging_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t attempt_thread_jogging_request__pack + (const AttemptThreadJoggingRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &attempt_thread_jogging_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t attempt_thread_jogging_request__pack_to_buffer + (const AttemptThreadJoggingRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &attempt_thread_jogging_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +AttemptThreadJoggingRequest * + attempt_thread_jogging_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (AttemptThreadJoggingRequest *) + protobuf_c_message_unpack (&attempt_thread_jogging_request__descriptor, + allocator, len, data); +} +void attempt_thread_jogging_request__free_unpacked + (AttemptThreadJoggingRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &attempt_thread_jogging_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define attempt_thread_jogging_request__field_descriptors NULL +#define attempt_thread_jogging_request__field_indices_by_name NULL +#define attempt_thread_jogging_request__number_ranges NULL +const ProtobufCMessageDescriptor attempt_thread_jogging_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(AttemptThreadJoggingRequest), + 0, + attempt_thread_jogging_request__field_descriptors, + attempt_thread_jogging_request__field_indices_by_name, + 0, attempt_thread_jogging_request__number_ranges, + (ProtobufCMessageInit) attempt_thread_jogging_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.h new file mode 100644 index 000000000..366498be8 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AttemptThreadJoggingRequest.proto */ + +#ifndef PROTOBUF_C_AttemptThreadJoggingRequest_2eproto__INCLUDED +#define PROTOBUF_C_AttemptThreadJoggingRequest_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _AttemptThreadJoggingRequest AttemptThreadJoggingRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _AttemptThreadJoggingRequest +{ + ProtobufCMessage base; +}; +#define ATTEMPT_THREAD_JOGGING_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&attempt_thread_jogging_request__descriptor) \ + } + + +/* AttemptThreadJoggingRequest methods */ +void attempt_thread_jogging_request__init + (AttemptThreadJoggingRequest *message); +size_t attempt_thread_jogging_request__get_packed_size + (const AttemptThreadJoggingRequest *message); +size_t attempt_thread_jogging_request__pack + (const AttemptThreadJoggingRequest *message, + uint8_t *out); +size_t attempt_thread_jogging_request__pack_to_buffer + (const AttemptThreadJoggingRequest *message, + ProtobufCBuffer *buffer); +AttemptThreadJoggingRequest * + attempt_thread_jogging_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void attempt_thread_jogging_request__free_unpacked + (AttemptThreadJoggingRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*AttemptThreadJoggingRequest_Closure) + (const AttemptThreadJoggingRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor attempt_thread_jogging_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_AttemptThreadJoggingRequest_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.c b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.c new file mode 100644 index 000000000..d75845c99 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AttemptThreadJoggingResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "AttemptThreadJoggingResponse.pb-c.h" +void attempt_thread_jogging_response__init + (AttemptThreadJoggingResponse *message) +{ + static const AttemptThreadJoggingResponse init_value = ATTEMPT_THREAD_JOGGING_RESPONSE__INIT; + *message = init_value; +} +size_t attempt_thread_jogging_response__get_packed_size + (const AttemptThreadJoggingResponse *message) +{ + assert(message->base.descriptor == &attempt_thread_jogging_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t attempt_thread_jogging_response__pack + (const AttemptThreadJoggingResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &attempt_thread_jogging_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t attempt_thread_jogging_response__pack_to_buffer + (const AttemptThreadJoggingResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &attempt_thread_jogging_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +AttemptThreadJoggingResponse * + attempt_thread_jogging_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (AttemptThreadJoggingResponse *) + protobuf_c_message_unpack (&attempt_thread_jogging_response__descriptor, + allocator, len, data); +} +void attempt_thread_jogging_response__free_unpacked + (AttemptThreadJoggingResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &attempt_thread_jogging_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define attempt_thread_jogging_response__field_descriptors NULL +#define attempt_thread_jogging_response__field_indices_by_name NULL +#define attempt_thread_jogging_response__number_ranges NULL +const ProtobufCMessageDescriptor attempt_thread_jogging_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "", + "", + "", + "", + sizeof(AttemptThreadJoggingResponse), + 0, + attempt_thread_jogging_response__field_descriptors, + attempt_thread_jogging_response__field_indices_by_name, + 0, attempt_thread_jogging_response__number_ranges, + (ProtobufCMessageInit) attempt_thread_jogging_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.h b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.h new file mode 100644 index 000000000..e7324b29b --- /dev/null +++ b/Software/Embedded_SW/Embedded/Communication/PMR/ThreadLoading/AttemptThreadJoggingResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AttemptThreadJoggingResponse.proto */ + +#ifndef PROTOBUF_C_AttemptThreadJoggingResponse_2eproto__INCLUDED +#define PROTOBUF_C_AttemptThreadJoggingResponse_2eproto__INCLUDED + +#include + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _AttemptThreadJoggingResponse AttemptThreadJoggingResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _AttemptThreadJoggingResponse +{ + ProtobufCMessage base; +}; +#define ATTEMPT_THREAD_JOGGING_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&attempt_thread_jogging_response__descriptor) \ + } + + +/* AttemptThreadJoggingResponse methods */ +void attempt_thread_jogging_response__init + (AttemptThreadJoggingResponse *message); +size_t attempt_thread_jogging_response__get_packed_size + (const AttemptThreadJoggingResponse *message); +size_t attempt_thread_jogging_response__pack + (const AttemptThreadJoggingResponse *message, + uint8_t *out); +size_t attempt_thread_jogging_response__pack_to_buffer + (const AttemptThreadJoggingResponse *message, + ProtobufCBuffer *buffer); +AttemptThreadJoggingResponse * + attempt_thread_jogging_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void attempt_thread_jogging_response__free_unpacked + (AttemptThreadJoggingResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*AttemptThreadJoggingResponse_Closure) + (const AttemptThreadJoggingResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor attempt_thread_jogging_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_AttemptThreadJoggingResponse_2eproto__INCLUDED */ diff --git a/Software/Embedded_SW/Embedded/DataDef.h b/Software/Embedded_SW/Embedded/DataDef.h index e128094a5..755e5a962 100644 --- a/Software/Embedded_SW/Embedded/DataDef.h +++ b/Software/Embedded_SW/Embedded/DataDef.h @@ -26,7 +26,8 @@ //#define FOUR_WINDERS #ifdef FOUR_WINDERS -#define BTSR_NO_TFU +#define BTSR_NO_FEEDER_TFU +#define BTSR_NO_PULLER_TFU #endif //#define USE_POWERSTEP01 -NA @@ -35,7 +36,8 @@ //#define VAC_TEST #define DISPENSER_VALVES_OPEN //#define USE_TUNNEL_PT100 -//#define BTSR_NO_TFU +//#define BTSR_NO_FEEDER_TFU +//#define BTSR_NO_PULLER_TFU //#define IGNORE_SPIKE //#define SPECIAL_DISPENSERS extern bool Special_Dispensers; diff --git a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c index e736d45ea..e754b0df2 100644 --- a/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c +++ b/Software/Embedded_SW/Embedded/Modules/AlarmHandling/AlarmHandling.c @@ -1022,6 +1022,10 @@ JobEndReasonEnum AlarmHandlingPrepareJob(void *CurrentJob) } } } + if (FoundReason == JOB_OK) + { + FoundReason = Winder_Check_Cone(); + } if (FoundReason != JOB_OK) { JobEndReason = getEndReason(AlarmId); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 5b6ad643d..fcd1c05a2 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -591,7 +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))) + { + ReportWithPackageFilter(IDSFilter,"IDS dispenser pre-run ended",__FILE__,i,(int)DispenserTotalPrepareSteps[i],RpWarning,(int)(pressure*100),0); + } if (DispenserTotalPrepareSteps[i]= DispenserPrepareTimeout) { @@ -730,7 +736,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl } } }//for - usnprintf(IdMessage, 80,"WFCF %d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",WFCF,CurrentDispenserSpeed[0], + usnprintf(IdMessage, 80,"WFCF %d K %d,C %d,M %d,Y %d,TI %d",WFCF,CurrentDispenserSpeed[0], CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]); ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, DispenserBuildTimeCounter, RpWarning, WFCF, 0); @@ -788,7 +794,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl JobEndSequence = false; if ((pressurebuildup>0.1)&&(pressurebuildup<4.5)) { - ReportWithPackageFilter(IDSFilter,"Setting pressure from RML feeder tension",__FILE__,__LINE__,(int)(pressurebuildup*100),RpWarning,(int)(DispenserPreparePressure*100),0); + ReportWithPackageFilter(IDSFilter,"Setting pressure from RML pressure buildup",__FILE__,__LINE__,(int)(pressurebuildup*100),RpWarning,(int)(DispenserPreparePressure*100),0); DispenserPreparePressure = pressurebuildup; } if (JobTicket->headcleaningparameters) @@ -1081,7 +1087,7 @@ bool AdjustDispenserSpeedToPressure(int DispenserId, double RefMaxPressure,doubl } } }//for - usnprintf(IdMessage, 80,"Presegment Prepare D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",CurrentDispenserSpeed[0], + usnprintf(IdMessage, 80,"Presegment Prepare K %d,C %d,M %d,Y %d,TI %d",CurrentDispenserSpeed[0], CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]); ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, Dispenser_i, RpWarning, segmentfirst_speed, 0); @@ -1283,7 +1289,7 @@ uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback); //SendJobProgress(0.0, 0, false, IdsMessage);*/ } }//for - usnprintf(IdMessage, 80,"Presegment WFCF %d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",WFCF,CurrentDispenserSpeed[0], + usnprintf(IdMessage, 80,"Presegment WFCF %d K %d,C %d,M %d,Y %d,TI %d",WFCF,CurrentDispenserSpeed[0], CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]); ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, __LINE__, FileBrushStop->index, RpWarning, lInterSegmentLength, 0); } @@ -1610,7 +1616,7 @@ void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers) } } //for } - usnprintf(IdMessage, 80,"IDS_StartBrushStop %d/%d D1 %d,D2 %d,D3 %d,D4 %d,D5 %d",FileBrushStop->index,SegmentNumOfBrushStops,CurrentDispenserSpeed[0], + usnprintf(IdMessage, 80,"IDS_StartBrushStop %d/%d K %d,C %d,M %d,Y %d,TI %d",FileBrushStop->index,SegmentNumOfBrushStops,CurrentDispenserSpeed[0], CurrentDispenserSpeed[1],CurrentDispenserSpeed[2],CurrentDispenserSpeed[3],CurrentDispenserSpeed[4]); ReportWithPackageFilter(IDSFilter,IdMessage, __FILE__, SegmentNumOfBrushStops, FileBrushStop->index, RpWarning,(int)FileBrushStop->offsetmeters, 0); diff --git a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c index b2498ee7f..329357ed4 100644 --- a/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c +++ b/Software/Embedded_SW/Embedded/Modules/IFS/ifs.c @@ -335,7 +335,7 @@ void midTankStateMachine(void) if (midTankCartColor == MIDTANK_8) { - CartridgeInkTimeout = CARTRIDGE_INK_TIMEOUT*4; + CartridgeInkTimeout = CARTRIDGE_INK_TIMEOUT*10; CartridgeCheckTime = FIVE_SECONDS*3; } // set valve selection diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index a6cb25c45..8ecb3f404 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -141,6 +141,25 @@ uint32_t InternalWindingConfigMessage(JobSpool* request) * report ready to the job STM */ int Screw_wait_counter; +uint32_t Winder_Check_Cone(void) +{ + if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT) + { + REPORT_MSG(LIMIT, "No cone in winder"); + if (Is_PP_Machine()) + { + if (IgnoreConeMissing == false) + { + //JobEndReason = JOB_THREAD_BREAK; + usnprintf(AlarmReasonStr, 100, "No cone in winder"); + //PrepareReady(Module_Winder,ModuleFail); + AlarmHandlingSetAlarm(EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST,true); + return JOB_THREAD_BREAK; + } + } + } + return JOB_OK; +} uint32_t Winder_Prepare(void *JobDetails) { JobTicket* JobTicket = JobDetails; @@ -159,7 +178,7 @@ uint32_t Winder_Prepare(void *JobDetails) * report ready to the job STM */ - if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT) + /*if (FPGA_Read_limit_Switches(GPI_SW_SPOOL_EXISTS)==LIMIT) { REPORT_MSG(LIMIT, "No cone in winder"); if (Is_PP_Machine()) @@ -173,7 +192,7 @@ uint32_t Winder_Prepare(void *JobDetails) return ERROR; } } - } + }*/ #ifdef READ_SCREW_ENCODER ScrewLocationRun[0] = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h index 0861b677b..a87406454 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_ex.h @@ -53,6 +53,7 @@ uint32_t LoadDancerConfigMessage(void); extern float NumberOfRotationPerPassage; //debug for rotation per passage trials uint32_t Winder_Init(void); +uint32_t Winder_Check_Cone(void); uint32_t Winder_Prepare(void *JobDetails); uint32_t Winder_Presegment(void *JobDetails, uint32_t SegmentId); uint32_t WinderDistanceToSpoolState(void ); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index bc4e6cb8f..0dca3537e 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -337,7 +337,7 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) }**/ //} -#ifdef BTSR_NO_TFU +#ifdef BTSR_NO_PULLER_TFU if (CurrentControlledSpeed[WINDER_MOTOR]>100) length = dyeingspeed/10; #endif @@ -917,7 +917,7 @@ uint32_t Release_Right_TFU_TensionCallback(uint32_t deviceID, uint32_t BusyFlag) uint32_t Release_Right_TFU_Tension() { uint32_t status = OK; -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_FEEDER_TFU if (RTFU_Up == true) { Report("Release_Right_TFU_Tension",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_RDANCER,RpMessage,MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].pulseperround/4,0); @@ -931,7 +931,7 @@ int SecondFeederCorrection = 4; int PrepareWaitCount = 0; uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadValue) { -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_FEEDER_TFU MotorStop (HARDWARE_MOTOR_TYPE__MOTO_RDANCER,Soft_Stop); //per L6470 errata between mov and run commands Report("Adjust_Right_TFU_Tension_2ndCallback x more steps",__FILE__,__LINE__,MotorId,RpMessage,SecondFeederCorrection,0); if (JobIsActive()==false) @@ -955,7 +955,7 @@ uint32_t Adjust_Right_TFU_Tension_2nd_Callback(uint32_t MotorId, uint32_t ReadVa } uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue) { -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_FEEDER_TFU Report("Adjust_Right_TFU_Tension_Callback",__FILE__,__LINE__,MotorId,RpMessage,0,0); MotorMoveWithCallback(HARDWARE_MOTOR_TYPE__MOTO_RDANCER, 1-MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].directionthreadwize,SecondFeederCorrection* MotorsCfg[HARDWARE_MOTOR_TYPE__MOTO_RDANCER].microstep, Adjust_Right_TFU_Tension_2nd_Callback,1000); RTFU_Up = true; @@ -966,7 +966,7 @@ uint32_t Adjust_Right_TFU_Tension_Callback(uint32_t MotorId, uint32_t ReadValue) uint32_t Adjust_Right_TFU_Tension(double tension) { uint32_t status = OK; -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_FEEDER_TFU if (tension > 0.5) //0 = lower position, 1 = high position { if (FPGA_Read_limit_Switches(GPI_LS_RDANCER_UP) == NO_LIMIT) @@ -1093,11 +1093,13 @@ uint32_t ThreadPrepareState(void *JobDetails) IntersegmentLength = JobTicket->intersegmentlength; PrepareWaitCount = 0; -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_PULLER_TFU status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__LeftDancer, windertension); ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Winder",__FILE__,HARDWARE_DANCER_TYPE__LeftDancer,PrepareWaitCount,RpWarning,(int)windertension,0); status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__MiddleDancer, pullertension); ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Puller",__FILE__,HARDWARE_DANCER_TYPE__MiddleDancer,PrepareWaitCount,RpWarning,(int)pullertension,0); +#endif +#ifndef BTSR_NO_FEEDER_TFU status = ThreadPrepare_Tension (HARDWARE_DANCER_TYPE__RightDancer, feedertension); ReportWithPackageFilter(ThreadFilter,"ThreadPrepare_Tension Feeder",__FILE__,HARDWARE_DANCER_TYPE__RightDancer,PrepareWaitCount,RpWarning,(int)feedertension,0); #endif @@ -1219,7 +1221,7 @@ uint32_t ThreadPrepareState(void *JobDetails) ///////////////////////////////////////////////////// MotorSetDirection((TimerMotors_t)HW_Motor_Id,MotorsCfg[HW_Motor_Id].directionthreadwize); -#ifndef BTSR_NO_TFU +#ifndef BTSR_NO_FEEDER_TFU if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { ReportWithPackageFilter(ThreadFilter,"Feeder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); @@ -1233,6 +1235,7 @@ uint32_t ThreadPrepareState(void *JobDetails) SpeedControlId = AddControlCallback(NULL,ThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); } #endif +#ifndef BTSR_NO_PULLER_TFU if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { ReportWithPackageFilter(ThreadFilter,"Puller Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); @@ -1246,7 +1249,8 @@ uint32_t ThreadPrepareState(void *JobDetails) PoolerLengthCalculationMultiplier = (MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulleyradius*2*PI)/(MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].pulseperround*MotorsCfg[ThreadMotorIdToMotorId[Motor_i]].microstep); PoolerSpeedControlId = AddControlCallback(NULL,PoolerThreadLengthCBFunction, eHundredMillisecond,MotorGetPositionFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); } -#ifndef BTSR_NO_TFU +#endif +#ifndef BTSR_NO_FEEDER_TFU if (Motor_i == FEEDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will not be controlled { if (ControlIdtoMotorId[Motor_i] != 0xFF) @@ -1261,6 +1265,8 @@ uint32_t ThreadPrepareState(void *JobDetails) //AddControlCallback(NULL,ThreadControlSpeedReadFunction, eHundredMillisecond,MotorGetSpeedFromFPGA,(IfTypeThread*0x100+Motor_i),ThreadMotorIdToMotorId[Motor_i],Motor_i); #endif } +#endif +#ifndef BTSR_NO_PULLER_TFU if (Motor_i == POOLER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will n//ot be controlled { if (ControlIdtoMotorId[Motor_i] != 0xFF) -- cgit v1.3.1