aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
committerMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
commit00a491d93733d4625ad329b2ba8237f445364b3f (patch)
tree4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
parent124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff)
downloadTango-00a491d9.tar.gz
Tango-00a491d9.zip
merge
Diffstat (limited to 'Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c')
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c77
1 files changed, 66 insertions, 11 deletions
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
index dedf8ba98..bbb75328b 100644
--- a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
+++ b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
@@ -115,6 +115,8 @@ ModuleStateEnum PrepareWaiting[MAX_SYSTEM_MODULES] = {ModuleIdle,ModuleIdle,Modu
double job_length = 0.0;
char infomsg[190];
+bool prepare_state = false;
+
/********************************************************************************************
* functions describes motor operation flow and movement state during profile execution
* used to operate in runtime correct profileflow execution
@@ -259,6 +261,7 @@ static ReturnCode PrepareState(void *JobDetails)
}
if (Configured[Module_Waste])
Waste_Prepare();
+ prepare_state = true;
return retcode;
}
@@ -305,6 +308,7 @@ uint32_t PrepareReady(int ModuleId, ModuleStateEnum result)
Report(infomsg, __FILE__, __LINE__, ready, RpError, status, 0);
SendJobProgress(0.0,0,false, infomsg);
+ prepare_state = false;
SendJobProgress(0.0, 0, false, "Prepare Ready");
if (status == OK) Message.messageId = PreparationResultsOk;
else Message.messageId = PreparationResultsFail;
@@ -456,11 +460,26 @@ uint32_t ThreadJoggingFunc(int speed)
TSegment->length = 200.0;
TSegment->n_brushstops = 0;
Ticket.segments[0] = TSegment;
- Tspool->backingrate = 32;
- Tspool->bottombackingrate = 32;
- Tspool->segmentoffsetpulses = 1000;
- Tspool->startoffsetpulses = 220;
- Tspool->rotationsperpassage = 3.1415926*2;
+ if (InternalWinderCfg.spoolbackingrate)
+ Tspool->backingrate = InternalWinderCfg.spoolbackingrate;
+ else
+ Tspool->backingrate = 32;
+ if (InternalWinderCfg.SpoolBottomBackingRate)
+ Tspool->bottombackingrate = InternalWinderCfg.SpoolBottomBackingRate;
+ else
+ Tspool->bottombackingrate = 32;
+ if (InternalWinderCfg.segmentoffsetpulses)
+ Tspool->segmentoffsetpulses = InternalWinderCfg.segmentoffsetpulses;
+ else
+ Tspool->segmentoffsetpulses = 1000;
+ if (InternalWinderCfg.startoffsetpulses)
+ Tspool->startoffsetpulses = InternalWinderCfg.startoffsetpulses;
+ else
+ Tspool->startoffsetpulses = 220;
+ if (InternalWinderCfg.NumberOfRotationPerPassage)
+ Tspool->rotationsperpassage = InternalWinderCfg.NumberOfRotationPerPassage;
+ else
+ Tspool->rotationsperpassage = 3.1415926*3;
Tspool->has_limitswitchstartpointoffset = false;
Ticket.spool = Tspool;
Ticket.threadparameters = &SavedThreadParameters;
@@ -638,11 +657,27 @@ uint32_t ThreadCleaningJob(int speed)
Tdispenser->index = 4; //TI dispenser
Ticket.segments[0] = TSegment;
Ticket.segments[1] = TSegment;
- Tspool->backingrate = 32;
- Tspool->bottombackingrate = 32;
- Tspool->segmentoffsetpulses = 1000;
- Tspool->startoffsetpulses = 220;
- Tspool->rotationsperpassage = 3.1415926*2;
+ if (InternalWinderCfg.spoolbackingrate)
+ Tspool->backingrate = InternalWinderCfg.spoolbackingrate;
+ else
+ Tspool->backingrate = 32;
+ if (InternalWinderCfg.SpoolBottomBackingRate)
+ Tspool->bottombackingrate = InternalWinderCfg.SpoolBottomBackingRate;
+ else
+ Tspool->bottombackingrate = 32;
+ if (InternalWinderCfg.segmentoffsetpulses)
+ Tspool->segmentoffsetpulses = InternalWinderCfg.segmentoffsetpulses;
+ else
+ Tspool->segmentoffsetpulses = 1000;
+ if (InternalWinderCfg.startoffsetpulses)
+ Tspool->startoffsetpulses = InternalWinderCfg.startoffsetpulses;
+ else
+ Tspool->startoffsetpulses = 220;
+ if (InternalWinderCfg.NumberOfRotationPerPassage)
+ Tspool->rotationsperpassage = InternalWinderCfg.NumberOfRotationPerPassage;
+ else
+ Tspool->rotationsperpassage = 3.1415926*3;
+ Tspool->has_limitswitchstartpointoffset = false;
Tspool->has_limitswitchstartpointoffset = false;
Ticket.spool = Tspool;
Ticket.threadparameters = &SavedThreadParameters;
@@ -1118,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);
@@ -1136,6 +1174,22 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes
Report(infomsg,__FILE__,__LINE__,55,RpWarning,33, 44);
}*/
//UInt Key = Task_disable();
+
+ if (prepare_state == true)
+ {
+ 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)
@@ -1247,6 +1301,7 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes
CurrentRequest = NULL;
}
JobStopReporting();
+ prepare_state = false;
HandleJobEnd(JobEndReason);
}
// if (responseContainer.data.data)