diff options
Diffstat (limited to 'Software/Embedded_SW/Embedded/StateMachines/Printing')
| -rw-r--r-- | Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c index aef2af830..bbb75328b 100644 --- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c +++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c @@ -214,8 +214,6 @@ static ReturnCode PrepareState(void *JobDetails) usnprintf(ErrorMsg, 80,"Configured Thrd %d Wind %d IDS %d Heat %d WHS %d",Configured[Module_Thread],Configured[Module_Winder],Configured[Module_IDS],Configured[Module_Heaters],Configured[Module_Waste]); Report(ErrorMsg, __FILE__, __LINE__, 0, RpWarning, 0, 0); - prepare_state = true; - if (Configured[Module_IDS]) { PrepareWaiting[Module_IDS] = ModuleWaiting; @@ -263,6 +261,7 @@ static ReturnCode PrepareState(void *JobDetails) } if (Configured[Module_Waste]) Waste_Prepare(); + prepare_state = true; return retcode; } @@ -1154,11 +1153,14 @@ void SendCleaningJobProgress(double ProcessedLength, int SegmentId, bool done, c } } +double heaterRatio = 1.00; +double dispenserRatio = 1.00 ; +float wfcf_count = 0; +double prepare_progress = 0.0; void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Message) { MessageContainer responseContainer; uint8_t* container_buffer; - //int len; //static msdid = 0; //int length = (int)(ProcessedLength*100); @@ -1175,9 +1177,19 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes if (prepare_state == true) { - double prepare_progress = 0.9*HeatersPrepareProgress()+0.1*IdsPrepareProgress(); - Report("prepare_progress" ,__FILE__,__LINE__,(int)(prepare_progress*100),RpWarning,0,0); - } + heaterRatio = HeatersPrepareProgress(); + dispenserRatio = IdsPrepareProgress(); + if ((heaterRatio>0.99)&&(dispenserRatio>0.99)) + { + wfcf_count+=1.00; + Report("prepare_progress wfcf" ,__FILE__,(int)(wfcf_count),(int)(heaterRatio*100),RpWarning,(int)(dispenserRatio*100),0); + } + prepare_progress = (0.9*heaterRatio)+(0.08*dispenserRatio) + (0.02*wfcf_count/25.0); + Report("prepare_progress" ,__FILE__,(int)(prepare_progress*1000),(int)(heaterRatio*1000),RpWarning,(int)(dispenserRatio*1000),0); + } + else + wfcf_count = 0; + double totlength = 0; if (JobToken[0] != 0) |
