aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-12-24 16:20:59 +0200
committerAvi Levkovich <avi@twine-s.com>2020-12-24 16:20:59 +0200
commit71f7f59a5345c2df5d2fa8c641a88bf1d12bf063 (patch)
treebea86c782bb1a56cef3c824468680e8f0b9df476 /Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
parent49251db3f95a2c3146fc94ef2d487042891a6220 (diff)
parenta7d02907a37ba35da13b03264ba5110bd08f83c1 (diff)
downloadTango-71f7f59a5345c2df5d2fa8c641a88bf1d12bf063.tar.gz
Tango-71f7f59a5345c2df5d2fa8c641a88bf1d12bf063.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c')
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c63
1 files changed, 53 insertions, 10 deletions
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
index dedf8ba98..aef2af830 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
@@ -212,6 +214,8 @@ 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;
@@ -305,6 +309,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 +461,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 +658,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;
@@ -1136,6 +1172,12 @@ 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)
+ {
+ double prepare_progress = 0.9*HeatersPrepareProgress()+0.1*IdsPrepareProgress();
+ Report("prepare_progress" ,__FILE__,__LINE__,(int)(prepare_progress*100),RpWarning,0,0);
+ }
double totlength = 0;
if (JobToken[0] != 0)
@@ -1247,6 +1289,7 @@ void SendJobProgress(double ProcessedLength, int SegmentId, bool done, char *Mes
CurrentRequest = NULL;
}
JobStopReporting();
+ prepare_state = false;
HandleJobEnd(JobEndReason);
}
// if (responseContainer.data.data)