123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #include "asj_pe_situp_warpper.h"
- int main()
- {
- SitUp_ST situp_t;
- situp_t.knee_angle_min = 45.0;
- situp_t.knee_angle_max = 90.0;
- situp_t.knee_elbow_distance = 15.0;
- situp_t.knee_hip_shoulder_angle = 160.0;
- situp_t.hip_shoulder_angle = 15.0;
- situp_t.leg_bend_flag = 1;
- situp_t.hands_on_head_flag = 1;
- situp_t.hip_lift_flag = 1;
- situp_t.body_lying_flag = 1;
- situp_t.leave_pad_end_flag = 1;
- void* situp = situp_create();
- int init_ret = situp_examInit(situp, situp_t);
- printf("[%s Line:%d] ------init_ret:%d\n", __FUNCTION__, __LINE__, init_ret);
- {
- int prepareStatus = 0;
- sampleRunJoint_RESULT_S *mResult;
- mResult = (sampleRunJoint_RESULT_S*)malloc(sizeof(sampleRunJoint_RESULT_S));
- mResult->nObjectSize = 0;
- for(int i = 0;i < 12;i++)
- {
- int processPrepare_ret = situp_processPrepare(situp, mResult, &prepareStatus);
- printf("[%s Line:%d] ------processPrepare_ret:%d\n", __FUNCTION__, __LINE__, processPrepare_ret);
- printf("[%s Line:%d] ------prepareStatus:%d\n", __FUNCTION__, __LINE__, prepareStatus);
- }
- }
- {
- SitUpResult_ST *result;
- result = (SitUpResult_ST*)malloc(sizeof(SitUpResult_ST));
- sampleRunJoint_RESULT_S *mResult;
- mResult = (sampleRunJoint_RESULT_S*)malloc(sizeof(sampleRunJoint_RESULT_S));
- mResult->nObjectSize = 0;
- for(int i = 0;i < 12;i++)
- {
- int processExam_ret = situp_processExam(situp, mResult, result);
- printf("[%s Line:%d] ------processExam_ret:%d\n", __FUNCTION__, __LINE__, processExam_ret);
- printf("[%s Line:%d] ------score:%d illegal_flag:%d\n", __FUNCTION__, __LINE__, result->sitUpCount, result->situp_illegal_flag);
- }
- }
- printf("[%s Line:%d] ------------Prepare------------\n", __FUNCTION__, __LINE__);
- printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, SitUpPrepareCode2String(SITUP_PREPARE_NOHUMAN));
- printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, SitUpPrepareCode2String(SITUP_PREPARE_NOTLIEFALT));
- printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, SitUpPrepareCode2String(SITUP_PREPARE_KNEEANGLEILLEGAL));
- printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, SitUpPrepareCode2String(SITUP_PREPARE_HANDNOTCLOSEHEAD));
- printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, SitUpPrepareCode2String(SITUP_PREPARE_SUCCESS));
- printf("[%s Line:%d] ------------Exam------------\n", __FUNCTION__, __LINE__);
- printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, SitUpExamCode2String(SITUP_EXAM_KNEEANGLEILLEGAL));
- printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, SitUpExamCode2String(SITUP_EXAM_ELBOWNOTTOUCHKNEE));
- printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, SitUpExamCode2String(SITUP_EXAM_NOTLIEFALT));
- printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, SitUpExamCode2String(SITUP_EXAM_HIPLEAVEPAD));
- printf("[%s Line:%d] ------%s\n", __FUNCTION__, __LINE__, SitUpExamCode2String(SITUP_EXAM_HANDNOTCLOSEHEAD));
- return 0;
- }
|