Subversion Repositories HomeAutomation

Rev

Rev 1292 | Rev 1295 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1292 Rev 1293
Line 198... Line 198...
198
    }
198
    }
199
       
199
       
200
    /* Function 9 represents the sign value of the multiplication of x coordinates of the first point and the last point
200
    /* Function 9 represents the sign value of the multiplication of x coordinates of the first point and the last point
201
    minus the mediate value of x coordinates of all the points */
201
    minus the mediate value of x coordinates of all the points */
202
    //f9_tmp = ((buffer[startIndex].x - (xMax+xMin)/2)*(buffer[endIndex].x - (xMax+xMin)/2));
202
    //f9_tmp = ((buffer[startIndex].x - (xMax+xMin)/2)*(buffer[endIndex].x - (xMax+xMin)/2));
203
   
-
 
204
    f9_tmp = ((buffer[startIndex].x - (xMax+xMin)/2 > 0) ^ (buffer[endIndex].x - (xMax+xMin)/2 > 0));
203
    f9_tmp = ((buffer[startIndex].x - (xMax+xMin)/2 > 0) ^ (buffer[endIndex].x - (xMax+xMin)/2 > 0));
205
   
-
 
206
    functionData.f9 = CAN_MODULE_ENUM_TOUCH_GESTURE_F9_M;
204
    functionData.f9 = CAN_MODULE_ENUM_TOUCH_GESTURE_F9_M;
207
    if (!f9_tmp)
205
    if (!f9_tmp)
208
    {
206
    {
209
        functionData.f9 = CAN_MODULE_ENUM_TOUCH_GESTURE_F9_P;
207
        functionData.f9 = CAN_MODULE_ENUM_TOUCH_GESTURE_F9_P;
210
    }
208
    }
211
   
209
   
212
    /* Function 5 checks the sign value of the sum of the x coordinates of all the points that constitute strokes
210
    /* Function 5 checks the sign value of the sum of the x coordinates of all the points that constitute strokes
213
    minus x coordinates of the first point */
211
    minus x coordinates of the first point */
214
    functionData.f5 = CAN_MODULE_ENUM_TOUCH_GESTURE_F5_M;
212
    functionData.f5 = CAN_MODULE_ENUM_TOUCH_GESTURE_F5_M;
215
    if (f5_tmp > 0)
213
    if (f5_tmp > 0)
216
    {
214
    {
217
        functionData.f5 = CAN_MODULE_ENUM_TOUCH_GESTURE_F5_P;
215
        functionData.f5 = CAN_MODULE_ENUM_TOUCH_GESTURE_F5_P;
218
    }
216
    }
219
   
217
   
220
    /* Function 4 represents the sign value of the sum of the x coordinates of all the points that constitute strokes
218
    /* Function 4 represents the sign value of the sum of the x coordinates of all the points that constitute strokes
221
    minus the x coordinates of the last point */
219
    minus the x coordinates of the last point */
222
    functionData.f4 = CAN_MODULE_ENUM_TOUCH_GESTURE_F4_M;
220
    functionData.f4 = CAN_MODULE_ENUM_TOUCH_GESTURE_F4_M;
223
    if (f4_tmp > 0)
221
    if (f4_tmp > 0)
224
    {
222
    {
225
        functionData.f4 = CAN_MODULE_ENUM_TOUCH_GESTURE_F4_P;
223
        functionData.f4 = CAN_MODULE_ENUM_TOUCH_GESTURE_F4_P;
226
    }
224
    }
227
   
225
   
228
    /* Function 8 checks whether or not x coordinates of all the points except for the first point and the last point is between x0 and xn */
226
    /* Function 8 checks whether or not x coordinates of all the points except for the first point and the last point is between x0 and xn */
229
    functionData.f8 = CAN_MODULE_ENUM_TOUCH_GESTURE_F8_M;
227
    functionData.f8 = CAN_MODULE_ENUM_TOUCH_GESTURE_F8_P;
230
    if (xMin < min(buffer[startIndex].x,buffer[endIndex].x) || xMax > max(buffer[startIndex].x,buffer[endIndex].x))
228
    if (xMin < min(buffer[startIndex].x,buffer[endIndex].x) || xMax > max(buffer[startIndex].x,buffer[endIndex].x))
231
    {
229
    {
232
        functionData.f8 = CAN_MODULE_ENUM_TOUCH_GESTURE_F8_P;
230
        functionData.f8 = CAN_MODULE_ENUM_TOUCH_GESTURE_F8_M;
233
    }
231
    }
234
       
232
       
235
    //printf("1%u2%c3%c4%c5%c6%c7%u8%c9%c\n", f1, f2, f3, f4, f5, f6, f7, f8, f9);
233
    //printf("1%u2%c3%c4%c5%c6%c7%u8%c9%c\n", f1, f2, f3, f4, f5, f6, f7, f8, f9);
236
 
234
 
237
    return functionData;
235
    return functionData;