1 #include "ControllerF32.h"
2 #include "Error.h"
3 
4 
test_pid_f32()5     void ControllerF32::test_pid_f32()
6     {
7        for(int i=0; i < this->nbSamples; i++)
8        {
9           *this->pDst++ = arm_pid_f32(&instPid, *this->pSrc++);
10        }
11     }
12 
test_clarke_f32()13     void ControllerF32::test_clarke_f32()
14     {
15        float32_t Ialpha;
16        float32_t Ibeta;
17        for(int i=0; i < this->nbSamples; i++)
18        {
19          arm_clarke_f32(0.1,0.2,&Ialpha,&Ibeta);
20        }
21     }
22 
test_inv_clarke_f32()23     void ControllerF32::test_inv_clarke_f32()
24     {
25        float32_t Ia;
26        float32_t Ib;
27        for(int i=0; i < this->nbSamples; i++)
28        {
29          arm_clarke_f32(0.1,0.2,&Ia,&Ib);
30        }
31     }
32 
test_park_f32()33     void ControllerF32::test_park_f32()
34     {
35        float32_t Id,Iq;
36 
37        for(int i=0; i < this->nbSamples; i++)
38        {
39           arm_park_f32(0.1,0.2,&Id,&Iq,0.1,0.2);
40        }
41     }
42 
test_inv_park_f32()43     void ControllerF32::test_inv_park_f32()
44     {
45         float32_t Ialpha,Ibeta;
46 
47         for(int i=0; i < this->nbSamples; i++)
48         {
49            arm_inv_park_f32(0.1,0.2,&Ialpha,&Ibeta,0.1,0.2);
50         }
51     }
52 
test_sin_cos_f32()53     void ControllerF32::test_sin_cos_f32()
54     {
55         float32_t sinVal,cosVal;
56 
57         for(int i=0; i < this->nbSamples; i++)
58         {
59            arm_sin_cos_f32(0.1,&sinVal,&cosVal);
60         }
61     }
62 
setUp(Testing::testID_t id,std::vector<Testing::param_t> & params,Client::PatternMgr * mgr)63     void ControllerF32::setUp(Testing::testID_t id,std::vector<Testing::param_t>& params,Client::PatternMgr *mgr)
64     {
65 
66 
67        std::vector<Testing::param_t>::iterator it = params.begin();
68        this->nbSamples = *it;
69 
70        samples.reload(ControllerF32::SAMPLES_F32_ID,mgr,this->nbSamples);
71        output.create(this->nbSamples,ControllerF32::OUT_SAMPLES_F32_ID,mgr);
72 
73        switch(id)
74        {
75            case TEST_PID_F32_1:
76               arm_pid_init_f32(&instPid,1);
77            break;
78 
79        }
80 
81        this->pSrc=samples.ptr();
82       this->pDst=output.ptr();
83 
84     }
85 
tearDown(Testing::testID_t id,Client::PatternMgr * mgr)86     void ControllerF32::tearDown(Testing::testID_t id,Client::PatternMgr *mgr)
87     {
88     }
89