diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-08-25 10:08:01 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-08-25 10:08:01 +0300 |
| commit | 338edba081dba2a2aefb634811be1cc84ec93d64 (patch) | |
| tree | 0021538796c254a8eab8527e8461a2e831e68c1c /Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | |
| parent | 49ddda1cc22d6cbb72f499b37e5db32c95252dfa (diff) | |
| download | Tango-338edba081dba2a2aefb634811be1cc84ec93d64.tar.gz Tango-338edba081dba2a2aefb634811be1cc84ec93d64.zip | |
merge
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 54 |
1 files changed, 44 insertions, 10 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index 3f30e755a..9c82cb1bf 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -452,6 +452,9 @@ c. Go to step 2.a x Segment.BrushStopsCount. uint32_t DispenserPrepareControlId = 0xFF; int NumOfActiveDispensers = 0; int DispenserBuildTimeCounter = 0; +#define DISPENSER_UP_MOVEMENT + int DispenserTotalPrepareSteps[MAX_SYSTEM_DISPENSERS]; + bool DispenserLastMovementDown[MAX_SYSTEM_DISPENSERS]; #define PRESSURE_READ_TIME_GAP 100 uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) { @@ -508,6 +511,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) return OK; // all configured heaters are ready } char IdsMessage[100]; + char IdMessage[100]; int SegmentPrepareWFCFCounter = 0; bool pressureReady = false,endOfPrepareWCF = false; //******************************************************************************************************************** @@ -532,6 +536,11 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) { if (DispenserBuildTimeCounter<(2*eOneSecond)) { + for (i = 0; i < MAX_DYE_DISPENSERS; i++) + { + DispenserTotalPrepareSteps[i]+=(CurrentDispenserSpeed[i]*PRESSURE_READ_TIME_GAP/eOneSecond); + DispenserLastMovementDown[i] = false; + } //REPORT_MSG(DispenserBuildTimeCounter,"waiting 2 seconds for pressure changes"); return OK; } @@ -541,10 +550,18 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) //IDS_StopHomeDispenser(i); if (DispenserUsedInJob[i] == true) //we actually should check for all dispensers { + DispenserTotalPrepareSteps[i]+=(CurrentDispenserSpeed[i]*PRESSURE_READ_TIME_GAP/eOneSecond); + HW_Motor_Id = DispenserIdToMotorId[i]; if (GetDispenserPressure(i) > DispenserPreparePressure*1.05) { - NumofReadyDispensers++; +#ifdef DISPENSER_UP_MOVEMENT + if (DispenserTotalPrepareSteps[i]>120000) +#endif + { + NumofReadyDispensers++; + Report("Dispenser total prepare steps ready",__FILE__,DispenserTotalPrepareSteps[i],(int)(DispenserPreparePressure*100),RpWarning,IDS_Dispenser_Data[i].consumedinnanolitter,0); + } if (Special_Dispensers == true) { MotorStop(HW_Motor_Id, Hard_Hiz); @@ -582,8 +599,9 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) { HW_Motor_Id = DispenserIdToMotorId[CLEANER_DISPENSER]; MotorStop(HW_Motor_Id, Hard_Hiz); + if (CurrentDispenserSpeed[CLEANER_DISPENSER]) + Report("IDS stop cleaner",__FILE__,CLEANER_DISPENSER,(int)(GetDispenserPressure(CLEANER_DISPENSER)*100),RpWarning,(int)CurrentDispenserSpeed[CLEANER_DISPENSER] ,0); CurrentDispenserSpeed[CLEANER_DISPENSER] = 0; - //Report("IDS stop cleaner",__FILE__,CLEANER_DISPENSER,(int)(GetDispenserPressure(CLEANER_DISPENSER)*100),RpWarning,(int)CurrentDispenserSpeed[CLEANER_DISPENSER] ,0); } if ((NumofReadyDispensers)&&(DispenserBuildTimeCounter%1000 == 0)) @@ -599,7 +617,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) { DispenserBuildTimeCounter = 0; pressureReady = true; - Report("pressureReady = true or timeout;",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)NumOfActiveDispensers,0); + Report("pressureReady = true or timeout;",__FILE__,DispenserBuildTimeCounter,NumofReadyDispensers,RpWarning,(int)(DispenserPreparePressure*100),0); } } else if (endOfPrepareWCF == false) @@ -641,7 +659,6 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) } if (segmentfirst_speed > MINIMAL_MOTOR_SPEED) { - char IdMessage[100]; segmentfirst_speed *= (100+WFCF); segmentfirst_speed /= 100; DispenserSegmentReady[DispenserId] = false; @@ -730,7 +747,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) JobTicket* JobTicket = JobDetails; JobEndSequence = false; - if ((pressurebuildup>0.1)&&(pressurebuildup<2.5)) + if ((pressurebuildup>0.1)&&(pressurebuildup<4.0)) { Report("Setting pressure from RML feeder tension",__FILE__,__LINE__,(int)(pressurebuildup*100),RpWarning,(int)(DispenserPreparePressure*100),0); DispenserPreparePressure = pressurebuildup; @@ -742,7 +759,7 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) } if ((cleanerFlow>200)&&(cleanerFlow<1150)) { - Report("Setting pressure from RML feeder tension",__FILE__,__LINE__,(int)(cleanerFlow),RpWarning,(int)CleaningDispenserSpeed,0); + Report("Setting cleanerFlow from RML cleanerFlow",__FILE__,__LINE__,(int)(cleanerFlow),RpWarning,(int)CleaningDispenserSpeed,0); CleaningDispenserSpeed = cleanerFlow; } else if (cleanerFlow <= 10) @@ -813,6 +830,8 @@ uint32_t InactiveDispenserHome(uint32_t DispenserId, uint32_t ReadValue) Report("Stop active dispenser homing ",__FILE__,i,HomingActive[i],RpWarning,CurrentDispenserSpeed[i],0); IDS_StopHomeDispenser(i); } + DispenserTotalPrepareSteps[i] = 0; + Report("Dispenser total prepare steps zero",__FILE__,i,DispenserTotalPrepareSteps[i],RpWarning,IDS_Dispenser_Data[i].consumedinnanolitter,0); } else { @@ -1220,8 +1239,11 @@ uint32_t IDSCheckSegmentData(void *SegmentDetails, int SegmentId) uint32_t status = OK; JobDescriptionFileBrushStop * tFileBrushStop; int Brush_i; + Task_Stat statbuf; //check and close previous segment + RemoveControlCallback(BrushStopControlId,IDSBrushStopRestartCallback); + BrushStopControlId = 0xFF; if (PrevSegment) { if (JobBrushStopId<PrevSegment->brushstopscount) //we did not finish reading the brushstops of the previous segment @@ -1229,7 +1251,7 @@ uint32_t IDSCheckSegmentData(void *SegmentDetails, int SegmentId) Report("Unhandled brushstops remained",__FILE__,__LINE__,(int)JobBrushStopId,RpWarning,(int)PrevSegment->brushstopscount,0); //REPORT_MSG (Segment->brushstopscount, "Segment->brushstopscount"); //for (Brush_i=JobBrushStopId;Brush_i<PrevSegment->brushstopscount;Brush_i++) #bug 3348 - unhandled jobstops stops too soon - for (Brush_i=JobBrushStopId;Brush_i<=PrevSegment->brushstopscount;Brush_i++) + for (Brush_i=JobBrushStopId;Brush_i<PrevSegment->brushstopscount;Brush_i++) { if (status == ERROR) break; @@ -1241,13 +1263,19 @@ uint32_t IDSCheckSegmentData(void *SegmentDetails, int SegmentId) } else { + Task_stat(Task_self(),&statbuf); + Report("Unhandled BrushStopRead Error",__FILE__,statbuf.used,(int)statbuf.stackSize,RpWarning,(int)statbuf.stackHeap,0); + //JobEndReason = JOB_OUT_OF_DYE; + //SegmentReady(Module_IDS,ModuleFail); + Report("Unhandled brushstops ERROR",__FILE__,__LINE__,(int)tFileBrushStop,RpWarning,(int)PrevSegment->brushstopscount,0); status = ERROR; break; } }//for brushstops } } - return status; + Report("Unhandled brushstops result",__FILE__,__LINE__,(int)Brush_i,RpWarning,(int)PrevSegment->brushstopscount,0); + return OK; } uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) { @@ -1525,7 +1553,7 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) Task_Stat statbuf; if(BrushStopStartTime+BrushStopLength+100 < msec_millisecondCounter ) { - Report("!!!!!!!!!!!!Overtime!",__FILE__,msec_millisecondCounter,(int)BrushStopStartTime,RpWarning,(int)BrushStopLength,0); + Report("!!!!!!!!!!!!Overtime!",__FILE__,msec_millisecondCounter,(int)BrushStopStartTime,RpWarning,(int)BrushStopLength,0); } if(++BrushStopCounter < BrushStopTime) @@ -1535,6 +1563,11 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) BrushStopCounter = 0; BrushStopStartTime = msec_millisecondCounter; + if (BrushStopControlId == 0xFF) + { + Report("!!!BrushStopControlId = 0xFF",__FILE__,msec_millisecondCounter,(int)BrushStopStartTime,RpWarning,(int)BrushStopLength,0); + return OK; + } if (JobEndSequence == true) { @@ -1563,7 +1596,8 @@ uint32_t IDSBrushStopRestartCallback(uint32_t IfIndex, uint32_t readValue) } else { - LOG_ERROR(FileBrushStop,"BrushStopReadError"); + Task_stat(Task_self(),&statbuf); + Report("BrushStopRead Error",__FILE__,statbuf.used,(int)statbuf.stackSize,RpWarning,(int)statbuf.stackHeap,0); JobEndReason = JOB_OUT_OF_DYE; SegmentReady(Module_IDS,ModuleFail); } |
