aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/StateMachines
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-12-23 22:45:37 +0200
committerShlomo Hecht <shlomo@twine-s.com>2020-12-23 22:45:37 +0200
commita7d02907a37ba35da13b03264ba5110bd08f83c1 (patch)
treeca2bb997a06e16e34eb64a3c7ccea258cdfa925e /Software/Embedded_SW/Embedded/StateMachines
parentbd9bea9c2555a86fe092d5edb725867aadc64671 (diff)
downloadTango-a7d02907a37ba35da13b03264ba5110bd08f83c1.tar.gz
Tango-a7d02907a37ba35da13b03264ba5110bd08f83c1.zip
prepare progress
Diffstat (limited to 'Software/Embedded_SW/Embedded/StateMachines')
-rw-r--r--Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c b/Software/Embedded_SW/Embedded/StateMachines/Printing/JobSTM.c
index c5ac305e2..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;
@@ -1167,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)
@@ -1278,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)