aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Thread
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-06-22 12:02:18 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-06-22 12:02:18 +0300
commit7d2119987aade33c587dac1cd476326f977922c5 (patch)
tree03dab3b4dd76277248064c5abeb9df906b1126ab /Software/Embedded_SW/Embedded/Modules/Thread
parent99c3ca5c084ebee576dea0adc64b498133ff6939 (diff)
downloadTango-7d2119987aade33c587dac1cd476326f977922c5.tar.gz
Tango-7d2119987aade33c587dac1cd476326f977922c5.zip
Job process info and job end info, some alarm handling
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Thread')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
index f5462e398..5c581c7e6 100644
--- a/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
+++ b/Software/Embedded_SW/Embedded/Modules/Thread/Thread_print.c
@@ -15,6 +15,8 @@
#include "PMR/Printing/JobSegment.pb-c.h"
#include "PMR/Printing/JobTicket.pb-c.h"
+#include <utils/ustdlib.h>
+
#include "StateMachines/Printing/PrintingSTM.h"
#include "drivers/Motors/Motor.h"
@@ -178,7 +180,7 @@ uint32_t ThreadLengthCBFunction(uint32_t IfIndex, uint32_t ReadValue)
pooler_counter++;
if (pooler_counter%10 == 0)
{
- SendJobProgress(CurrentProcessedLength/CurrentRequestedLength,CurrentSegmentId,false);
+ SendJobProgress(CurrentProcessedLength/CurrentRequestedLength,CurrentSegmentId,false, "Progress");
//SendJobProgress(/*KeepNormalizedError*/MotorControlConfig[index].m_calculatedError,CurrentSegmentId,false);
}
@@ -259,6 +261,8 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
int32_t TranslatedReadValue, avreageSampleValue = 0;
uint32_t calculated_speed;
double NormalizedError;
+ char Message[60];
+
if (IfIndex>>8 != IfTypeThread)
{
LOG_ERROR (IfIndex, "Wrong Interface type");
@@ -293,7 +297,8 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
//TranslatedReadValue = 0;//test
MotorSamples[index][MotorSamplePointer[index]] = TranslatedReadValue;//(-1 * TranslatedReadValue);
MotorSamplePointer[index]++;
- if (MotorSamplePointer[index] >= MotorsControl[index].pvinputfilterfactormode) MotorSamplePointer[index] = 0;
+ if (MotorSamplePointer[index] >= MotorsControl[index].pvinputfilterfactormode)
+ MotorSamplePointer[index] = 0;
for (i=0;i<MotorsControl[index].pvinputfilterfactormode;i++)
avreageSampleValue += MotorSamples[index][i];
avreageSampleValue = avreageSampleValue / MotorsControl[index].pvinputfilterfactormode;
@@ -301,7 +306,9 @@ uint32_t ThreadControlCBFunction(uint32_t IfIndex, uint32_t ReadValue)
if ((abs(avreageSampleValue)> DancerStopActivityLimit[index])&&(JobCounter > eOneSecond))
{
- EndState(CurrentJob);
+ usnprintf(Message, 60, "Dancer % limit%d value %d Zero %d",DancerId,DancerStopActivityLimit[index],avreageSampleValue,DancersCfg[DancerId].zeropoint);
+
+ EndState(CurrentJob,Message );
}
NormalizedError = avreageSampleValue*NormalizedErrorCoEfficient[index];
MotorControlConfig[index].m_mesuredParam = NormalizedError;