main.c 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #include "asj_pe_pullup_warpper.h"
  2. int main()
  3. {
  4. PullUp_ST pullup_t;
  5. pullup_t.asjPullUpLine[0].x = 0.0;
  6. pullup_t.asjPullUpLine[0].y = 0.0;
  7. pullup_t.asjPullUpLine[1].x = 0.0;
  8. pullup_t.asjPullUpLine[1].y = 0.0;
  9. pullup_t.arm_bend_flag = 1;
  10. pullup_t.hand_back_flag = 1;
  11. pullup_t.body_straight_flag = 1;
  12. pullup_t.hand_off_bar_flag = 1;
  13. pullup_t.exam_interval_sencond = 1;
  14. void* pullup = pullup_create();
  15. int init_ret = pullup_examInit(pullup, pullup_t);
  16. printf("[%s Line:%d] ------init_ret:%d\n", __FUNCTION__, __LINE__, init_ret);
  17. {
  18. int prepareStatus = 0;
  19. sampleRunJoint_RESULT_S *mResult;
  20. mResult = (sampleRunJoint_RESULT_S*)malloc(sizeof(sampleRunJoint_RESULT_S));
  21. mResult->nObjectSize = 0;
  22. for(int i = 0;i < 12;i++)
  23. {
  24. int processPrepare_ret = pullup_processPrepare(pullup, mResult, &prepareStatus);
  25. printf("[%s Line:%d] ------processPrepare_ret:%d\n", __FUNCTION__, __LINE__, processPrepare_ret);
  26. printf("[%s Line:%d] ------prepareStatus:%d\n", __FUNCTION__, __LINE__, prepareStatus);
  27. }
  28. }
  29. {
  30. PullUpResult_ST *result;
  31. result = (PullUpResult_ST*)malloc(sizeof(PullUpResult_ST));
  32. sampleRunJoint_RESULT_S *mResult;
  33. mResult = (sampleRunJoint_RESULT_S*)malloc(sizeof(sampleRunJoint_RESULT_S));
  34. mResult->nObjectSize = 0;
  35. for(int i = 0;i < 12;i++)
  36. {
  37. int processExam_ret = pullup_processExam(pullup, mResult, result);
  38. printf("[%s Line:%d] ------processExam_ret:%d\n", __FUNCTION__, __LINE__, processExam_ret);
  39. printf("[%s Line:%d] ------score:%d illegal_flag:%d\n", __FUNCTION__, __LINE__, result->pullUpCount, result->pullup_illegal_flag);
  40. }
  41. }
  42. printf("[%s Line:%d] ------------Prepare------------\n", __FUNCTION__, __LINE__);
  43. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpPrepareCode2String(PULLUP_PREPARE_BACKHAND));
  44. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpPrepareCode2String(PULLUP_PREPARE_HANDSNOTONBAR));
  45. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpPrepareCode2String(PULLUP_PREPARE_HANDSNOTSTRAIGHTEN));
  46. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpPrepareCode2String(PULLUP_PREPARE_HANDSWIDERTHANSHOULDERS));
  47. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpPrepareCode2String(PULLUP_PREPARE_NOHUMAN));
  48. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpPrepareCode2String(PULLUP_PREPARE_SUCCESS));
  49. printf("[%s Line:%d] ------------Exam------------\n", __FUNCTION__, __LINE__);
  50. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpExamCode2String(PULLUP_EXAM_NOTOVERBAR));
  51. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpExamCode2String(PULLUP_EXAM_BODYOVERSWING));
  52. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpExamCode2String(PULLUP_EXAM_BACKHAND));
  53. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpExamCode2String(PULLUP_EXAM_DROPBAR));
  54. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpExamCode2String(PULLUP_EXAM_HANDNOTSTRAIGHTEN));
  55. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpExamCode2String(PULLUP_EXAM_KNEEBEND));
  56. printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, PullUpExamCode2String(PULLUP_EXAM_OVERTIME));
  57. return 0;
  58. }