diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-05-26 18:13:17 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-05-26 18:13:17 +0300 |
| commit | d7d99dc7d1fa11845c5d4df3bbff16fec33b406c (patch) | |
| tree | 9cae8240e225014d35f661880aec17cca8c69486 /Software/Embedded_SW/Embedded/Modules/IDS | |
| parent | 77e72b9d16522648a350a95382309e9692434011 (diff) | |
| download | Tango-d7d99dc7d1fa11845c5d4df3bbff16fec33b406c.tar.gz Tango-d7d99dc7d1fa11845c5d4df3bbff16fec33b406c.zip | |
Version 1.4.0.2 improve winding (simplify). incorporate screw encoder reading. fix length/time problem between IDS and Thread.
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/IDS')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h | 1 | ||||
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c | 41 |
2 files changed, 38 insertions, 4 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h index a5165e7f2..4dbd2e89e 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_ex.h @@ -44,6 +44,7 @@ uint32_t IDSPrepareState(void *JobDetails); void IDSPrepareStart(void); uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId); +uint32_t IDSCheckSegmentData(void *SegmentDetails, int SegmentId); uint32_t IDSSegmentState(void *SegmentDetails, int SegmentId); uint32_t IDSDistanceToSpoolState(void); uint32_t IDSEndState(void); diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c index efedfe545..1d395ec8c 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_print.c @@ -850,6 +850,40 @@ uint32_t IDS_Cleaning_Stop_Cleaning_Solution (callback_fptr callback); } return OK; } +uint32_t IDSCheckSegmentData(void *SegmentDetails, int SegmentId) +{ + JobDescriptionFileSegment* PrevSegment = SegmentDetails; + uint32_t status = OK; + JobDescriptionFileBrushStop * tFileBrushStop; + int Brush_i; + +//check and close previous segment + if (PrevSegment) + { + if (JobBrushStopId<PrevSegment->brushstopscount) //we did not finish reading the brushstops of the previous segment + { + 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++) + { + if (status == ERROR) + break; + tFileBrushStop = GetNextBrushStopFromJobFile(); + if (tFileBrushStop) + { + FreeBrushStopFileData(tFileBrushStop); + Report("Unhandled brushstops handled",__FILE__,__LINE__,(int)Brush_i,RpWarning,(int)PrevSegment->brushstopscount,0); + } + else + { + status = ERROR; + break; + } + }//for brushstops + } + } + return status; +} uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) { JobSegment* Segment = SegmentDetails; @@ -864,7 +898,7 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) /* wait for all dispensers to get to the required pressure * move the presegment ready when all dispensers are ready. */ - REPORT_MSG(SegmentId,"IDSPreSegmentState"); + REPORT_MSG(Segment->n_brushstops,"IDSPreSegmentState"); if (JobBrushStopId>=Segment->n_brushstops) { LOG_ERROR(Segment->n_brushstops,"Error JobBrushStopId"); @@ -873,7 +907,6 @@ uint32_t IDSPreSegmentState(void *SegmentDetails, int SegmentId) return ERROR; } - if ((EnableIntersegment == true)&&(IntersegmentLength>0)) { Valve_Set(VALVE_MIXCHIP_WASTECH, Mixer_Waste); //if intersegment is defined throw the ink away @@ -1026,7 +1059,7 @@ void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers) /*IDS_Dispenser_Start_Motor_and_Open_Valve(DispenserId, segmentfirst_speed, NULL);*/ - Control3WayValvesWithCallback (DispenserId, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer + //Control3WayValvesWithCallback (DispenserId, Dispenser_Mixer, NULL); //direction: MidTank_Dispenser or Dispenser_Mixer MotorSetSpeed(HW_Motor_Id, segmentfirst_speed); CurrentDispenserSpeed[DispenserId] = segmentfirst_speed; usnprintf(IdsMessage, 80, @@ -1034,7 +1067,7 @@ void IDS_StartBrushStop(int n_dispensers, JobDispenser** Dispensers) DispenserId, (int) Dispensers[Dispenser_i]->nanolitterpersecond, (int) Dispensers[Dispenser_i]->nanoliterperpulse, - (int) segmentfirst_speed,Dispensers[Dispenser_i]->dispenserstepdivision,MotorsCfg[HW_Motor_Id].microstep); + (int) (segmentfirst_speed*1000),Dispensers[Dispenser_i]->dispenserstepdivision,MotorsCfg[HW_Motor_Id].microstep); //REPORT_MSG(segmentfirst_speed,IdsMessage); Report(IdsMessage, __FILE__, __LINE__, Dispenser_i, RpWarning, segmentfirst_speed, 0); //SendJobProgress(0.0, 0, false, IdsMessage); |
