diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-06-10 17:09:07 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-06-10 17:09:07 +0300 |
| commit | d28f4ab232aaec838d80335b98f906fbddc21dca (patch) | |
| tree | 2678fa30592d011bfb51235f476f8abf7d8985d8 /Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | |
| parent | a622ca09b672048511cc65fd97c3847de7425bc5 (diff) | |
| parent | 3b13593f574debc58892a4d61a344624cc8e2b4a (diff) | |
| download | Tango-d28f4ab232aaec838d80335b98f906fbddc21dca.tar.gz Tango-d28f4ab232aaec838d80335b98f906fbddc21dca.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c index 349215d7d..c1d547f59 100644 --- a/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c +++ b/Software/Embedded_SW/Embedded/Modules/Thread/ThreadLoad.c @@ -190,6 +190,9 @@ ProcessParametersClear.lblowerflow = 0; ProcessParametersClear.dyeingspeed = 40; ProcessParametersClear.dryerbufferlength = ProcessParametersKeep.dryerbufferlength; + ProcessParametersClear.pullertension = ProcessParametersKeep.pullertension; + ProcessParametersClear.windertension = ProcessParametersKeep.windertension; + if (HandleProcessParameters(&ProcessParametersClear,false)!= OK) { LOG_ERROR (LoadStages, "Thread_Load_Reduce_Heat failed"); @@ -286,7 +289,7 @@ { TimeoutsCounter = 0; load.color = fastBILNK; - usnprintf(LoadErrorMsg, 100, "Stage %s - motor %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]); + usnprintf(LoadErrorMsg, 100, "Stage %s - %s timeout",LoadStagesStr[LoadStages], MotorStr[MotorId]); Report(LoadErrorMsg,__FILE__,__LINE__,LoadStages,RpWarning,TimeoutsCounter,0); LoadStatus = ERROR; @@ -647,6 +650,7 @@ { REPORT_MSG(LoadStages, "Thread Load State Machine step Thread_Load_Dryer_Loading"); + int CurrentlyLoaded = 0; if (dryerbufferlength) LoadArmRounds = (int)dryerbufferlength; if (LoadArmRounds <= 2) @@ -656,7 +660,12 @@ // OriginalMotorSpd_2PPS[FEEDER_MOTOR] = 1000; // CurrentControlledSpeed[FEEDER_MOTOR] = 1000; - //MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds); + MCU_E2PromRead(EEPROM_STORAGE_DRYER_CYCLES,&CurrentlyLoaded); + Report("Thread_Load_Dryer_Loading cycles",__FILE__,LoadArmRounds,CurrentlyLoaded,RpMessage,LoadArmRounds-CurrentlyLoaded,0); + if (CurrentlyLoaded) + { + LoadArmRounds -= CurrentlyLoaded; + } ThreadMotorIdToMotorId[FEEDER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_RDRIVING ; ThreadMotorIdToMotorId[DRYER_MOTOR] = HARDWARE_MOTOR_TYPE__MOTO_DRYER_DRIVING; @@ -806,14 +815,14 @@ else //done enough cycles, go to the center point { MotorMovetoEncoderPosition(HARDWARE_MOTOR_TYPE__MOTO_DRYER_LOADARM,Thread_Load_Set_Load_Arm_To_Stopper_Callback,30000); - MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-numberOfCycles); + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,0); Report("Store Number of cycles in drier",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0); } } else //timeout or no movement { Report("Store Number of cycles in drier - halted",__FILE__,__LINE__,numberOfCycles,RpMessage,LoadArmRounds,0); - MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-(numberOfCycles-1)); + MCU_E2PromProgram(EEPROM_STORAGE_DRYER_CYCLES,LoadArmRounds-numberOfCycles); TimeoutsCounter = 0; CallbackCounter = 0; /*if(PullerControlId != 0xFF) @@ -919,7 +928,12 @@ if (SecondTry == true) { - LoadArmRounds = 30; + MCU_E2PromRead(EEPROM_STORAGE_DRYER_CYCLES,&LoadArmRounds); + if (LoadArmRounds == 0) //prev trial stopped + { + LoadArmRounds = (int)dryerbufferlength; + } + //LoadArmRounds = 30; } else { @@ -1048,7 +1062,7 @@ } uint32_t ThreadLoadButton(THREAD_LOAD_STAGES_ENUM ReadValue) { - if (JobIsActive()) + if (JobIsActive()||(MachineReadyForHeating == false)) { Report("ThreadLoadButton called on job",__FILE__,__LINE__,LoadStages,RpMessage,ReadValue,0); return ERROR; |
