From aeabb681d16451e191a1620d4eebf40549771491 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Sun, 8 Dec 2019 14:51:46 +0200 Subject: Support for new head in ProtoBif and embedded (initial) --- .../Embedded/Modules/Thread/Thread_Winder.c | 6 +-- .../Embedded/Modules/Thread/Thread_print.c | 53 ++++++++++------------ 2 files changed, 26 insertions(+), 33 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 4de702e14..4c4ab2bcc 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -62,7 +62,7 @@ static uint32_t WindingConeLocation; static uint32_t WinderBackToBaseTime = 800; InternalWinderConfigStruc InternalWinderCfg = {0}; -#define READ_SCREW_ENCODER +//#define READ_SCREW_ENCODER #ifdef READ_SCREW_ENCODER uint32_t ScrewLocationLimitSwitch = 0,ScrewLocationStart = 0; uint32_t ScrewLocationRun[3]; @@ -289,8 +289,8 @@ uint32_t Screw100msecDirectionChange(uint32_t deviceID, uint32_t BusyFlag) { //uint32_t Steps; double temp,tempScrewSpeed; - double screw_horizontal_speed = 0; - double RotationsPerSecond; + //double screw_horizontal_speed = 0; + //double RotationsPerSecond; if (WinderMotorSpeedCounter++>=MAX_WINDER_SPEED_CALCULATION) { if (WinderMotorSpeedRollOver == false) diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 9d408a4a6..c0d571fab 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -118,7 +118,7 @@ uint32_t Control_Delta_Position_Pass(uint32_t Current_Read,uint32_t Previous_Rea if (Current_Read < Previous_Read) { Time_Pass = (MAX_COUNTER - Previous_Read) + Current_Read + 1; - Report("Length rollover",__FILE__,__LINE__,(int)Current_Read,RpWarning,(int)Previous_Read,0); + ReportWithPackageFilter(ThreadFilter,"Length rollover",__FILE__,__LINE__,(int)Current_Read,RpWarning,(int)Previous_Read,0); } else Time_Pass = Current_Read - Previous_Read; @@ -192,7 +192,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) { usnprintf(Lenstr, 100, "length huge: length %d, diff 0x%x, pos 0x%x prev 0x%x",(int)length*100,(int)positionDiff,PreviousPosition,prevprev); SendJobProgress(0.0,0,false, Lenstr); - Report(Lenstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); + ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); length = 0; } @@ -224,7 +224,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) { usnprintf(Lenstr, 100, "Total processed length: Feeder: %d Pooler %d",(int)TotalProcessedLength,(int)PoolerTotalProcessedLength); SendJobProgress(0.0,0,false, Lenstr); - Report(Lenstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); + ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); // segment/intersegment/distance to spool finished if (ProcessedLengthFuncPtr) ProcessedLengthFuncPtr(); @@ -282,7 +282,7 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) { usnprintf(Lenstr, 100, "length huge: length %d, diff 0x%x, pos 0x%x prev 0x%x",(int)length*100,(int)positionDiff,PreviousPosition,prevprev); SendJobProgress(0.0,0,false, Lenstr); - Report(Lenstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); + ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); length = 0; } @@ -315,7 +315,7 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) { usnprintf(Lenstr, 100, "Total processed length: Feeder: %d Pooler %d",(int)TotalProcessedLength,(int)PoolerTotalProcessedLength); SendJobProgress(0.0,0,false, Lenstr); - Report(Lenstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); + ReportWithPackageFilter(ThreadFilter,Lenstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); // segment/intersegment/distance to spool finished if (ProcessedLengthFuncPtr) ProcessedLengthFuncPtr(); @@ -421,7 +421,7 @@ void testDancersControl() len = usnprintf(time, 150, "params: speed 50, divider %d p %d * %d i %d * %d Dt*1000 %d Norm Coef %d initial speed %d",NORMAL_COEF_DIVIDER,(int)MotorsControl[FEEDER_MOTOR].proportionalgain,(int)MotorsControl[FEEDER_MOTOR].outputonoffhysteresisvalue, (int)MotorsControl[FEEDER_MOTOR].integraltime,(int)MotorsControl[FEEDER_MOTOR].setpointramprateorsoftstartramp,(int)(MotorsControl[FEEDER_MOTOR].controloutputtype*1000), (int)(NormalizedErrorCoEfficient[FEEDER_MOTOR]*1000000000),OriginalMotorSpd_2PPS[FEEDER_MOTOR]); - Report(time,__FILE__,__LINE__,111,RpError,111,0); + ReportWithPackageFilter(ThreadFilter,time,__FILE__,__LINE__,111,RpError,111,0); Task_sleep(100); ThreadControlCBFunction(IfTypeThread*0x100+FEEDER_MOTOR, DancersCfg[HARDWARE_DANCER_TYPE__RightDancer].zeropoint - mm20); ThreadControlCBFunction(IfTypeThread*0x100+FEEDER_MOTOR, DancersCfg[HARDWARE_DANCER_TYPE__RightDancer].zeropoint - mm10); @@ -478,7 +478,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) if (ReadValue < 10) { MotorFailedSample[index]++; - Report("Dancer value read too small.",__FILE__,__LINE__,DancerId,RpError,ReadValue,0); + ReportWithPackageFilter(ThreadFilter,"Dancer value read too small.",__FILE__,__LINE__,DancerId,RpError,ReadValue,0); return OK; } if (ReadValue == 0x3FFF) @@ -533,7 +533,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) SendSegmentFail(); //AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_BREAK,true); //EndState(CurrentJob,"ReadBreakSensor Error" ); - LOG_ERROR(index, "ReadBreakSensor Error"); + ReportWithPackageFilter(ThreadFilter,"ReadBreakSensor Error",__FILE__,BreakSensorCounter,(int)index,RpError,(int)JobCounter,0); return OK; } //passed limit }//ReadBreakSensor()==ERROR @@ -541,7 +541,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) { if (BreakSensorCounter) { - LOG_ERROR(BreakSensorCounter, "ReadBreakSensor Spike"); + ReportWithPackageFilter(ThreadFilter,"ReadBreakSensor Spike",__FILE__,BreakSensorCounter,(int)index,RpError,(int)JobCounter,0); } BreakSensorCounter = 0; } @@ -559,7 +559,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) SendSegmentFail(); //AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_BREAK,true); //EndState(CurrentJob,"ReadBreakSensor Error" ); - LOG_ERROR(index, "thread speed too low Error"); + ReportWithPackageFilter(ThreadFilter,"thread speed too low Error",__FILE__,BreakSensorCounter,(int)index,RpError,(int)JobCounter,0); return OK; } } @@ -573,7 +573,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) { keepdata = false; usnprintf(TMessage, 60, "Dancer %d limit %d value %d Zero %d",DancerId,DancerStopActivityLimit[index],avreageSampleValue,DancersCfg[DancerId].zeropoint); - Report(TMessage,__FILE__,__LINE__,avreageSampleValue,RpWarning,DancerStopActivityLimit[index],0); + ReportWithPackageFilter(ThreadFilter,TMessage,__FILE__,__LINE__,avreageSampleValue,RpWarning,DancerStopActivityLimit[index],0); //JobAbortedByUser = true; ThreadControlActive = false; //MotorGetStatusFromFPGA(ThreadMotorIdToMotorId[index]); @@ -593,7 +593,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_TENSION_CONTROL_FAILURE_WINDER_DANCER,true); break; }*/ - LOG_ERROR (DancerId, "Dancer Failure"); + ReportWithPackageFilter(ThreadFilter,"Dancer Failure",__FILE__,DancerId,(int)avreageSampleValue,RpError,(int)JobCounter,0); return OK; } NormalizedError = avreageSampleValue*NormalizedErrorCoEfficient[index]; @@ -613,7 +613,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) { //if (index == WINDER_MOTOR) //feeder unit handles errors opposite to left unit //{ - // Report("MotorSpeedUpdated",__FILE__,index,OriginalMotorSpd_2PPS[index],RpWarning,CurrentControlledSpeed[index],0); + // ReportWithPackageFilter(ThreadFilter,"MotorSpeedUpdated",__FILE__,index,OriginalMotorSpd_2PPS[index],RpWarning,CurrentControlledSpeed[index],0); //} /`*if (JobCounter >= 3000) { @@ -624,7 +624,7 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue) for (i=0;i=MAX_THREAD_CONTROL_LOG) // controlIndex = 0; @@ -774,7 +774,7 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) 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 { - Report("Feeder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); + ReportWithPackageFilter(ThreadFilter,"Feeder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); if (SpeedControlId != 0xFF) { RemoveControlCallback(SpeedControlId,ThreadLengthCBFunction); @@ -786,7 +786,7 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) } 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 { - Report("Puller Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); + ReportWithPackageFilter(ThreadFilter,"Puller Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); if (PoolerSpeedControlId != 0xFF) { if (RemoveControlCallback(PoolerSpeedControlId,PoolerThreadLengthCBFunction)!=OK) @@ -826,7 +826,7 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) } if (Motor_i == WINDER_MOTOR) // dryer motor is speed controlled. later a speed sensor will be utilized, but for now it will n//ot be controlled { - Report("Winder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); + ReportWithPackageFilter(ThreadFilter,"Winder Control",__FILE__,Motor_i,MotorControlConfig[Motor_i].m_params.Kp,RpWarning,MotorControlConfig[Motor_i].m_params.Ki,0); if (ControlIdtoMotorId[Motor_i] != 0xFF) { if(RemoveControlCallback(ControlIdtoMotorId[Motor_i],ThreadControlCBFunction)!=OK) @@ -869,7 +869,7 @@ void SetOriginMotorSpeed(float process_speed) OriginalMotorSpd_2PPS[Motor_i] = (int) motor_speed; InitialDryerSpeed = 0.0; CurrentControlledSpeed[Motor_i] = (int) motor_speed; - //Report("Original Speed",__FILE__,Motor_i,motor_speed,RpWarning,process_speed,0); + //ReportWithPackageFilter(ThreadFilter,"Original Speed",__FILE__,Motor_i,motor_speed,RpWarning,process_speed,0); for (i = 0; i <= MAX_CONTROL_SAMPLES; i++) MotorSpeedSamples[Motor_i][i] = motor_speed; @@ -881,8 +881,6 @@ void ThreadPreSegmentEnded(void) REPORT_MSG (0,"First ThreadPreSegmentEnded"); PreSegmentReady(Module_Thread,ModuleDone); } -#define DRYER_RAMPUP 1 -#ifdef DRYER_RAMPUP int DrierDivider = 10; uint32_t ThreadDryerRampUp(uint32_t IfIndex, uint32_t BusyFlag) { @@ -895,12 +893,11 @@ uint32_t ThreadDryerRampUp(uint32_t IfIndex, uint32_t BusyFlag) } MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,InitialDryerSpeed ); - Report("ThreadDryerRampUp",__FILE__,ControlIdtoMotorId[DRYER_MOTOR],(int)InitialDryerSpeed,RpWarning,(int)OriginalMotorSpd_2PPS[DRYER_MOTOR],0); + //ReportWithPackageFilter(ThreadFilter,"ThreadDryerRampUp",__FILE__,ControlIdtoMotorId[DRYER_MOTOR],(int)InitialDryerSpeed,RpWarning,(int)OriginalMotorSpd_2PPS[DRYER_MOTOR],0); return OK; } -#endif //******************************************************************************************************************** uint32_t ThreadPreSegmentState(void *SegmentDetails, uint32_t SegmentId) @@ -922,16 +919,12 @@ uint32_t ThreadPreSegmentState(void *SegmentDetails, uint32_t SegmentId) PrepareState = false; #ifndef TEST_PID_THREAD // set the new speed in the dryer motor to the speed of the new segment -#ifndef DRYER_RAMPUP - MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING, OriginalMotorSpd_2PPS[DRYER_MOTOR]); -#else DrierDivider = dyeingspeed/5; //ramp up drier in 5 cm/sec steps - Report("Drier ramp up",__FILE__,__LINE__,(int)dyeingspeed,RpWarning,(int)DrierDivider,0); + ReportWithPackageFilter(ThreadFilter,"Drier ramp up",__FILE__,__LINE__,(int)dyeingspeed,RpWarning,(int)DrierDivider,0); InitialDryerSpeed = OriginalMotorSpd_2PPS[DRYER_MOTOR]/DrierDivider; MotorSetSpeed(HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING,InitialDryerSpeed ); ControlIdtoMotorId[DRYER_MOTOR] = AddControlCallback("DryerRampUp",ThreadDryerRampUp, 200,TemplateDataReadCBFunction,0,0,0); #endif -#endif #ifdef HUNDRED_MICROSECONDS_DANCER_READ MillisecLogInit(); #endif @@ -1051,7 +1044,7 @@ char Endstr[150]; usnprintf(Endstr, 100, "Total _processed length: Feeder: %d Pooler %d",(int)TotalProcessedLength,(int)PoolerTotalProcessedLength); SendJobProgress(0.0,0,false, Endstr); - Report(Endstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); + ReportWithPackageFilter(ThreadFilter,Endstr,__FILE__,__LINE__,(int)TotalProcessedLength,RpWarning,(int)PoolerTotalProcessedLength,0); ThreadUpdateProcessLength (0.0,(void *)NULL); //TotalProcessedLength = 0.0; -- cgit v1.3.1 From 20be2491f5f8c6a01848a591fa48e966b0749663 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Mon, 9 Dec 2019 08:31:02 +0200 Subject: Restart motors after FPGA failure. cone exist and lid open - report only --- Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c | 1 + Software/Embedded_SW/Embedded/Modules/Control/control.c | 10 +++++++++- .../Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c | 10 +++++----- .../Embedded_SW/Embedded/Modules/Thread/Thread_print.c | 14 ++++++++------ 4 files changed, 23 insertions(+), 12 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c index 259fc65f0..03ee0a3ce 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_SPI_Comm.c @@ -438,6 +438,7 @@ void FPGA_SetMotorsInit() MotorDriverRequest[i].Stop = Hard_Hiz; FPGA_SetMotStop((HardwareMotorType)i); } + FPGA_WD_Occurred = false; //LOW logic level resets the logic and puts the device into Standby mode. F1_Moto_Driver_NSTBYRST1 = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index d59aae8f4..f9e6e7009 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -169,8 +169,16 @@ uint32_t ControlActivityLed( uint32_t Parameter1) ACTIVITY_RED_LED_OFF; // Heaters indication - all the Heaters OFF if(FPGA_WD_Occurred == true) { + FPGA_WD_Occurred = false; + AlarmHandlingSetAlarm(EVENT_TYPE__FPGA_WATCHDOG_ACTIVATED,true); + JobEndReason = JOB_MOTOR_ALARM; + SendJobProgress(0.0,0,false, "Hardware Failure Error"); + AbortJob("FPGA Watchdog Error"); + ReportWithPackageFilter(FPGAFilter, "FPGA Watchdog Error",__FILE__,__LINE__,0,RpError, 0,0); + ACTIVITY_GREEN_LED_ON; - //Motor_ReconfigAllMotors(); + FPGA_SetMotorsInit(); + Motor_ReconfigAllMotors(); } else ACTIVITY_GREEN_LED_OFF; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c index 4c4ab2bcc..4db985954 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_Winder.c @@ -140,13 +140,13 @@ 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"); - PrepareReady(Module_Winder,ModuleFail); - AlarmHandlingSetAlarm(EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST,true); - return ERROR; - }*/ + // PrepareReady(Module_Winder,ModuleFail); + // AlarmHandlingSetAlarm(EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST,true); + // return ERROR; + } #ifdef READ_SCREW_ENCODER ScrewLocationRun[0] = 0; diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index c0d571fab..8ccde6feb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -725,6 +725,8 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_TENSION_CONTROL_FAILURE_FEEDER_DANCER,false); AlarmHandlingSetAlarm(EVENT_TYPE__THREAD_TENSION_CONTROL_FAILURE_WINDER_DANCER,false); AlarmHandlingSetAlarm(EVENT_TYPE__WINDER_CONE_DOES_NOT_EXIST,false); + AlarmHandlingSetAlarm(EVENT_TYPE__FPGA_WATCHDOG_ACTIVATED,false); + EnableLubrication = JobTicket->enablelubrication; EnableIntersegment = JobTicket->enableintersegment; @@ -735,16 +737,16 @@ uint32_t ThreadInitialTestStub(HardwareMotor * request) if (FPGA_Read_limit_Switches(Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DH_LID]) != LIMIT) { ReportWithPackageFilter(ThreadFilter,"Dyeing head is open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DH_LID,RpFatalError,LIMIT,0); - JobEndReason = JOB_LIDS_OPEN; - PrepareReady(Module_Thread,ModuleFail); - return ERROR; + //JobEndReason = JOB_LIDS_OPEN; + //PrepareReady(Module_Thread,ModuleFail); + //return ERROR; } if (FPGA_Read_limit_Switches(Motor_Id_to_LS_IdDown[HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID]) != LIMIT) { ReportWithPackageFilter(ThreadFilter,"Dryer lid is open!!!",__FILE__,__LINE__,HARDWARE_MOTOR_TYPE__MOTO_DRYER_LID,RpFatalError,LIMIT,0); - JobEndReason = JOB_LIDS_OPEN; - PrepareReady(Module_Thread,ModuleFail); - return ERROR; + //JobEndReason = JOB_LIDS_OPEN; + //PrepareReady(Module_Thread,ModuleFail); + //return ERROR; } //start thread control for all motors -- cgit v1.3.1 From 9b712a41f08f8a0c13366db730fba6ec927a97d3 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 10 Dec 2019 18:13:09 +0200 Subject: improved vesrion after initial testing without head card --- .../Embedded/Drivers/Heater/TemperatureSensor.c | 3 ++- .../Embedded/Drivers/Heater/TemperatureSensor.h | 3 ++- .../Embedded/Modules/Control/MillisecTask.c | 28 +++++++++++++++++++-- .../Embedded_SW/Embedded/Modules/Control/control.c | 12 +++++++-- .../Embedded/Modules/Diagnostics/Diagnostics.c | 8 ++++-- .../Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 29 +++++++++++++++++----- .../Embedded/Modules/Thread/Thread_init.c | 10 ++++---- .../Embedded/Modules/Thread/Thread_print.c | 5 +++- .../Embedded/Software Release Notes.txt | 9 +++++++ .../Initialization/PowerOffSequence.c | 2 ++ .../Embedded/StateMachines/Printing/JobSTM.c | 4 --- .../Embedded/StateMachines/Printing/PrintingSTM.c | 7 +++++- 12 files changed, 95 insertions(+), 25 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Thread') diff --git a/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c b/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c index 201df8ec8..1fab20d7e 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c +++ b/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.c @@ -177,6 +177,7 @@ int TemperatureSensorRead(TEMPERATURE_SENSOR_ID_ENUM SensorId) return TempSensorResponse[SensorId].Temperature_C_mult_by_100; } +#ifndef Use_Head_Card int TemperatureListString(char* str) { int len; @@ -188,7 +189,7 @@ int TemperatureListString(char* str) ,TempSensorResponse[TEMP_SENSE_AN_ENCLOSURETEMP3].Temperature_C_mult_by_100/100); return len; } - +#endif uint32_t Filter_Temparature_Measurement(TEMPERATURE_SENSOR_ID_ENUM SensorId, int32_t Current_Measurement_C, uint32_t NoOfAvrSamples) diff --git a/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.h b/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.h index 88fe8f50a..4f9cb6c79 100644 --- a/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.h +++ b/Software/Embedded_SW/Embedded/Drivers/Heater/TemperatureSensor.h @@ -164,8 +164,9 @@ uint32_t CalculateTemperatures(TEMPERATURE_SENSOR_ID_ENUM SensorId, uint32_t Dat int TemperatureSensorRead(TEMPERATURE_SENSOR_ID_ENUM SensorId); // read from buffer +#ifndef Use_Head_Card int TemperatureListString(char* str); - +#endif //The temparature will be at: //TempSensorResponse[TEMP_SENSE_ANALOG_DYEINGH_TEMP1].Temperature_C_mult_by_100 diff --git a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c index 48a28ffe4..8897dfdbb 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/MillisecTask.c @@ -226,13 +226,18 @@ void OneMilliSecondMillisecInterrupt(UArg arg0) return ; } uint32_t PT100Activity = 0; +int32_t MillisecReadFromI2CTempSensor(uint32_t TempSensorId, MSecFptr Callback) +{ +#warning call I2C temeratures + return OK; +} + int32_t MillisecReadFromTempSensor(uint32_t TempSensorId, MSecFptr Callback) { if (TempSensorId >= MAX_MAIN_CARD_TEMP_SENS_ID) return -1; PT100Activity++; //read request PT100Data[TempSensorId].Callback = Callback; PT100Data[TempSensorId].Active = true; - return OK; } //typedef uint32_t (* MSecFptr)(uint32_t deviceID, uint32_t ReadValue); @@ -574,11 +579,13 @@ 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, Hundred_msTick , m90msecTick, Onesecond_Tick,OneMinute_Tick,OneHourTick; + bool Ten_msTick, Hundred_msTick , m20msecTick,m70msecTick,m90msecTick, Onesecond_Tick,OneMinute_Tick,OneHourTick; bool O100Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick; //bool O100Millisecond_Tick,O200Millisecond_Tick,O400Millisecond_Tick,O500Millisecond_Tick,O600Millisecond_Tick,O800Millisecond_Tick,O900Millisecond_Tick; Ten_msTick = (tick%eTenMillisecond == 0) ?true:false; Hundred_msTick = (tick%eHundredMillisecond == 0) ?true:false; + m20msecTick = (tick%eHundredMillisecond == 20) ?true:false; + m70msecTick = (tick%eHundredMillisecond == 70) ?true:false; m90msecTick = (tick%eHundredMillisecond == 90) ?true:false; O100Millisecond_Tick = (tick%eOneSecond == 100) ?true:false; O200Millisecond_Tick = (tick%eOneSecond == 200) ?true:false; @@ -603,6 +610,23 @@ uint32_t MillisecLowLoop(uint32_t tick) if(Machine_Idle_Mode == true) Machine_Idle_Breathing_Led(); } +#ifdef Use_Head_Card + if (m20msecTick) //read odd PT1000 + { + for (Sensor_i = HEAD_PT100_ZONE_1_0X80_0;Sensor_i < HEAD_PT100_ZONE_2_0X80_1;Sensor_i++) + { + MillisecReadFromI2CTempSensor(Sensor_i, NULL); + } +#warning call chip select replace in I2C + } + if (m70msecTick) //read odd PT1000 + { + for (Sensor_i = HEAD_PT100_ZONE_2_0X80_1;Sensor_i < HEAD_PT100_RESERVE_0X8E_1;Sensor_i++) + { + MillisecReadFromI2CTempSensor(Sensor_i, NULL); + } + } +#endif if (m90msecTick) { #ifdef Use_Head_Card diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index f9e6e7009..b60fb3aa4 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -45,17 +45,25 @@ //by recieved esign flow of the user from the UI /////////////////////////////////////////////////////////////////////////////////////////// #include "include.h" -#include "Modules/General/GeneralHardware.h" #include #include +#include + #include "drivers/adc_sampling/adc.h" +#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" + #include "Modules/General/buttons.h" +#include "Modules/General/GeneralHardware.h" + +#include "StateMachines/Printing/PrintingSTM.h" #include "control.h" #include "MillisecTask.h" -#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h" + + + /******************** Definitions ********************************************/ #define MAX_TANGO_CONTROL_DEVICES 120 /******************** STRUCTURES AND ENUMs ********************************************/ diff --git a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c index fff75fd54..6e8b50c02 100644 --- a/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c +++ b/Software/Embedded_SW/Embedded/Modules/Diagnostics/Diagnostics.c @@ -514,6 +514,7 @@ void DiagnosticOneSecCollection(void) dispenserspressure[i][DiagnosticsIndex] = GetDispenserPressure(i); //Read_MidTank_Pressure_Sensor + MidTankpressure[i][0] = Get_MidTank_Pressure_Sensor(i); } } void Diagnostic100msecCollection(void) @@ -523,7 +524,7 @@ void Diagnostic100msecCollection(void) return; //DiagnosticLoadSpeedSensor(getSensorSpeedData()); - if (DiagnosticMode == Diagnostic_Extreme_Mode) + if (DiagnosticMode != Diagnostic_Extreme_Mode) DiagnosticTenMsecCollection(); //call the 10msec function every 100 msec to reduce transport if (DiagnosticMode >= Diagnostic_Extended_Mode) @@ -681,13 +682,14 @@ void SendDiagnostics(void) DiagnosticsMonitor.headzone4temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ4]; DiagnosticsMonitor.headzone5temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ5]; DiagnosticsMonitor.headzone6temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ6]; +#ifdef Use_Head_Card DiagnosticsMonitor.headzone7temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ7]; DiagnosticsMonitor.headzone8temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ8]; DiagnosticsMonitor.headzone9temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ9]; DiagnosticsMonitor.headzone10temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ10]; DiagnosticsMonitor.headzone11temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ11]; DiagnosticsMonitor.headzone12temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ12]; - +#endif DiagnosticsMonitor.dryerzone1temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature]; DiagnosticsMonitor.dryerzone2temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain]; DiagnosticsMonitor.dryerzone3temperature = HeaterTemperature[HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary]; @@ -699,12 +701,14 @@ void SendDiagnostics(void) DiagnosticsMonitor.n_headzone4temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ4]; DiagnosticsMonitor.n_headzone5temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ5]; DiagnosticsMonitor.n_headzone6temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ6]; +#ifdef Use_Head_Card DiagnosticsMonitor.n_headzone7temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ7]; DiagnosticsMonitor.n_headzone8temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ8]; DiagnosticsMonitor.n_headzone9temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ9]; DiagnosticsMonitor.n_headzone10temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ10]; DiagnosticsMonitor.n_headzone11temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ11]; DiagnosticsMonitor.n_headzone12temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ12]; +#endif DiagnosticsMonitor.n_dryerzone1temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__DryerAirTemperature]; DiagnosticsMonitor.n_dryerzone2temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__DryerHeaterMain]; DiagnosticsMonitor.n_dryerzone3temperature = HeaterCounterIndex[HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary]; diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 3b55758e4..3af6416cb 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -48,7 +48,7 @@ int DispenserSamplePointer[MAX_SYSTEM_DISPENSERS] = {0}; double DispenserNormalizedErrorCoEfficient[MAX_SYSTEM_DISPENSERS] = {0}; double lubricant_speed = 0.0; HardwarePidControlType ThreadDispenserIdToControlId[MAX_SYSTEM_DISPENSERS] = { HARDWARE_PID_CONTROL_TYPE__Dispenser1,HARDWARE_PID_CONTROL_TYPE__Dispenser2,HARDWARE_PID_CONTROL_TYPE__Dispenser3,HARDWARE_PID_CONTROL_TYPE__Dispenser4,HARDWARE_PID_CONTROL_TYPE__Dispenser5,HARDWARE_PID_CONTROL_TYPE__Dispenser6,HARDWARE_PID_CONTROL_TYPE__Dispenser7,HARDWARE_PID_CONTROL_TYPE__Dispenser8}; - +JobUploadStrategy uploadstrategy = JOB_UPLOAD_STRATEGY__Default; bool DispenserReady[MAX_SYSTEM_DISPENSERS] = {true}; bool IDS_Active = false; /******************** STRUCTURES AND ENUMs ********************************************/ @@ -300,7 +300,8 @@ JobDescriptionFileBrushStop *FirstBrushStop = NULL; { LOG_ERROR (BrushStop->index, "no dispensers in brushstop"); } - FreeBrushStopFileData(BrushStop); + if (FirstBrushStop!= BrushStop) + FreeBrushStopFileData(BrushStop); BrushStop = NULL; } else @@ -356,6 +357,7 @@ c. Go to step 2.a x Segment.BrushStopsCount. JobTicket* JobTicket = JobDetails; int Dispenser_i, Segment_i,Brush_i,DispenserId; + uploadstrategy = JobTicket->uploadstrategy; if (JobTicket->uploadstrategy == JOB_UPLOAD_STRATEGY__JobDescriptionFile) { return (IDS_MapDispenserUsedinFileJob(JobDetails)); @@ -480,7 +482,6 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) //******************************************************************************************************************** uint32_t IDS_Prepare_Callback(uint32_t DispenserId, uint32_t ReadValue) { - bool pressureReady = false; int i; int NumofReadyDispensers = 0; TimerMotors_t HW_Motor_Id; @@ -534,16 +535,18 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) if (NumofReadyDispensers>=NumOfActiveDispensers) { pressureReady = true; + Report("pressureReady = true;",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)NumOfActiveDispensers,0); } if ((DispenserBuildTimeCounter >= DispenserPrepareTimeout)||(pressureReady == true)) { DispenserBuildTimeCounter = 0; pressureReady = true; + Report("pressureReady = true or timeout;",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)NumOfActiveDispensers,0); } } else if (endOfPrepareWCF == false) { - if ((0 == DispenserBuildTimeCounter)&&(FirstBrushStop)) + if ((DispenserBuildTimeCounter == PRESSURE_READ_TIME_GAP)&&(FirstBrushStop)) { Report("start prepare dispensers at rate * WFCF",__FILE__,__LINE__,InterSegmentStepsCount,RpWarning,(int)lInterSegmentLength,0); if (FirstBrushStop) @@ -600,6 +603,16 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) Report(IdsMessage, __FILE__, __LINE__, Dispenser_i, RpWarning, segmentfirst_speed, 0); //SendJobProgress(0.0, 0, false, IdsMessage); } + else + { + if (DispenserUsedInJob[DispenserId] == true) + { + MotorStop(HW_Motor_Id, Hard_Hiz); + CurrentDispenserSpeed[Dispenser_i] = 0; + usnprintf(IdsMessage, 80,"Presegment Prepare Dispenser %d stopped",DispenserId,(int) segmentfirst_speed); + Report(IdsMessage, __FILE__, __LINE__, Dispenser_i, RpWarning, segmentfirst_speed, 0); + } + } }//for }//if n_dis } @@ -609,9 +622,13 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) //close waste valve one second before segment - trial Valve_Set(VALVE_MIXCHIP_WASTECH, Mixer_Head); } - if (InterSegmentStartWFCFDispensers >= DispenserBuildTimeCounter) + if (DispenserBuildTimeCounter >= InterSegmentStartWFCFDispensers) { endOfPrepareWCF = true; + FreeBrushStopFileData(FirstBrushStop); + FirstBrushStop =NULL; + Report("endOfPrepareWCF = true;",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)NumOfActiveDispensers,0); + } } //start new stage @@ -1242,7 +1259,7 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) } else { - LOG_ERROR(FileBrushStop,"BrushStopReadError"); + LOG_ERROR(FileBrushStop,"End run - BrushStopReadError"); JobEndReason = JOB_OUT_OF_DYE; PreSegmentReady(Module_IDS,ModuleFail); } diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c index 226bb2559..0df950f34 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_init.c @@ -154,12 +154,12 @@ char DancerConfigPath[50] = "0://SysInfo//DancCfg.cfg"; uint32_t StoreDancerConfigMessage() { uint32_t status = OK; - /* FRESULT Fresult = FR_OK; - // HardwareConfiguration DancerConfig; - // HardwareDancer Dancers[MAX_SYSTEM_DANCERS]; + // FRESULT Fresult = FR_OK; + HardwareConfiguration DancerConfig; + HardwareDancer Dancers[MAX_SYSTEM_DANCERS]; // uint8_t* response_buffer; // size_t response_size = 0; - // int Dancer_i; + int Dancer_i; hardware_configuration__init(&DancerConfig); DancerConfig.dancers = (HardwareDancer**)my_malloc(sizeof(HardwareDancer*)*MAX_SYSTEM_DANCERS); @@ -174,7 +174,7 @@ uint32_t StoreDancerConfigMessage() DancerConfig.n_dancers++; DancersCfg[Dancer_i].zeropoint = DancerConfig.dancers[Dancer_i]->zeropoint; } - */ + status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_0,DancersCfg[0].zeropoint); status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_1,DancersCfg[1].zeropoint); status |= MCU_E2PromProgram(EEPROM_STORAGE_DANCER_2,DancersCfg[2].zeropoint); diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c index 8ccde6feb..34934af0c 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c @@ -300,9 +300,12 @@ uint32_t PoolerThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue) { if (PrepareState == true) { +#ifdef Use_Head_Card + strcpy(Lenstr,"Heating up"); +#else //later - add temperatures TemperatureListString(Lenstr); - +#endif SendJobProgress(0.0,0,false, Lenstr); } else diff --git a/Software/Embedded_SW/Embedded/Software Release Notes.txt b/Software/Embedded_SW/Embedded/Software Release Notes.txt index 63b06e673..8e4424747 100644 --- a/Software/Embedded_SW/Embedded/Software Release Notes.txt +++ b/Software/Embedded_SW/Embedded/Software Release Notes.txt @@ -12,6 +12,15 @@ IDS: *dispenser data, *improve autofill on job start, *puller_tension from RML a Thread: *real dryer rampup. dancers from EEPROM only. *insure rockers motors voltage value; print: *prevent job on open covers (dryer, head) + +Embedded SW Release note - Version 1.4.5.104 (alpha 1 ++) +============================================================= +restart HW and report if FPGA fails +stop led blinking when jogging job fails +fix IDS bug that prevented cleaning job at power off +log power off temperature. fix bug that causes premature shutoff (PT100 spike) + + Embedded SW Release note - Version 1.4.5.100 (alpha 1 +) ============================================================= magnet handling improved diff --git a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c index 79191072a..e4efad2a0 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Initialization/PowerOffSequence.c @@ -70,6 +70,7 @@ void PowerOffSetTemperatureThreshold (int32_t temperature) if (temperature) { PowerOffTemperatureThreshold = temperature*100; + Report("PowerOff Set Temperature",__FILE__,__LINE__,(int)PowerOffTemperatureThreshold,RpWarning,(int)3600,0); } } /*******************************************************************************************************/ @@ -373,6 +374,7 @@ uint32_t PowerOffWaitForTemperatureCallback(uint32_t IfIndex, uint32_t BusyFlag) /*******************************************************************************************************/ uint32_t PowerOffWaitForTemperature(void) { + Report("PowerOff Wait For Temperature",__FILE__,__LINE__,(int)PowerOffTemperatureThreshold,RpWarning,(int)3600,0); if (WaitForProcessControlId == 0xFF) { WaitForProcessCounter = 0; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index 651cc636e..83f4f032e 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -98,8 +98,6 @@ JobSpool *Tspool; bool CopyConfigured[MAX_SYSTEM_MODULES]; bool CleaningJobActive = false, JoggingJobActive = false; char ErrorMsg[100]; -JobUploadStrategy uploadstrategy = JOB_UPLOAD_STRATEGY__Default; - ModuleStateEnum PrepareWaiting[MAX_SYSTEM_MODULES] = {ModuleIdle,ModuleIdle,ModuleIdle,ModuleIdle,ModuleIdle}; double job_length = 0.0; @@ -747,11 +745,9 @@ void JobRequestFunc(MessageContainer* requestContainer) if (CurrentJob->uploadstrategy == JOB_UPLOAD_STRATEGY__JobDescriptionFile) { LOG_ERROR(JobActive, "Job upload strategy file"); - uploadstrategy = JOB_UPLOAD_STRATEGY__JobDescriptionFile; } else { - uploadstrategy = JOB_UPLOAD_STRATEGY__Default; n_segments = CurrentJob->n_segments; } status = PASSED; diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c index 671ab1dd8..587b1d2e8 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/PrintingSTM.c @@ -384,7 +384,11 @@ uint32_t PreSegmentReady(int ModuleId, ModuleStateEnum result) } PreSegmentWaiting[ModuleId] = result; - if (result == ModuleFail) status = ERROR; + if (result == ModuleFail) + { + status = ERROR; + Report("PreSegmentReady Fail!",__FILE__,__LINE__,(int)ModuleId,RpWarning,(int)result,0); + } for (i=0;imessageId = PreSegmentResultsFail; SendJobProgress(0.0, 0, false, "PreSegment Failed"); + Report("PreSegment Fail!",__FILE__,__LINE__,(int)ModuleId,RpWarning,(int)result,0); } //memcpy(Message.messageData,JobDetails,MAX_MSG_LEN); Message.msglen = 10; -- cgit v1.3.1