private void processAnswersBlackCircleSelected(List<List<CircleF>> lsAnswersComplete, LineSegment2D[] pAnswerReferenceLines, Image<Bgr, byte> pImg) { Question question; for (int i = 0; i < lsAnswersComplete.Count; i++) { int maxLengthList = lsAnswersComplete[i].Count; for (int j = 0; j < maxLengthList; j++) { // for Answers // note that the last list of list is for CodeNumbers, so "-1" leave the last for letter...(else) #region process answers question = new Question(); if (lsAnswersComplete[i][j].Center.X == pAnswerReferenceLines[i].P1.X) { question.fillQuestion(ID_SEQUENCE + 1, "*************"); scalar = new MCvScalar(0, 255, 0); color = new Bgr(Color.Green); } else { if (lsAnswersComplete[i][j].Center.X < pAnswerReferenceLines[i].P1.X) {// Yes Answer question.fillQuestion(ID_SEQUENCE + 1, "False"); scalar = new MCvScalar(0, 0, 255); color = new Bgr(Color.Green); } else {// No answer question.fillQuestion(ID_SEQUENCE + 1, "Verdadero"); scalar = new MCvScalar(255, 0, 0); color = new Bgr(Color.Green); } } questions.Add(question); ID_SEQUENCE++; CvInvoke.cvCircle(pImg, new Point((int)lsAnswersComplete[i][j].Center.X, (int)lsAnswersComplete[i][j].Center.Y), 6, scalar, -1, LINE_TYPE.CV_AA, 0); #endregion } } }
public void FillingAnswerstToFinalQuestionsList() { //Questions Question question = new Question(); string result =""; for (int i = 0; i < lstAbsQuestions.Count(); i++) { if (lstAbsQuestions[i].get_respuesta() == 0) { result = empty; } if (lstAbsQuestions[i].get_respuesta() == 1) { result = "V"; } if (lstAbsQuestions[i].get_respuesta() == 2) { result = "F";} question.fillQuestion(lstAbsQuestions[i].get_idQuestion(), result); questions.Add(question); } //DNI txtCode.Text = getDNI(); //Opcion //opcion_01; //opcion_02; bool opcione_01 = true; for (int j = 0; j < 2; j++) { for (int i = 0; i < 5; i++) { int pos = (i * 2) + (j * 1); if (lstAbsOptions[pos].get_respuesta() == 1) { if (opcione_01) { opcion_01 = lstAbsOptions[pos].get_idQuestion(); opcione_01 = false; } else { opcion_02 = lstAbsOptions[pos].get_idQuestion(); } } } } //Sede for (int i = 0; i < lstAbsSede.Count(); i++) { if (lstAbsSede[i].get_respuesta() == 1) codigo_sede = lstAbsSede[i].get_idQuestion(); } //Ciclo for (int j = 0; j < 2; j++) { int aux_count = 0; for (int i = 0; i < 10; i++) { int pos = j + (i * 2); if (lstAbsCiclo[pos].get_respuesta() == 1) { if (j == 0) { num_01 = lstAbsCiclo[pos].get_idQuestion(); } if (j == 1 ) { num_02 = lstAbsCiclo[pos].get_idQuestion(); } } else aux_count++; } } //semestre for (int i = 0; i < lstAbsSemestre.Count(); i++) { if (lstAbsSemestre[i].get_respuesta() == 1) codigo_semestre = lstAbsSemestre[i].get_idQuestion(); } //turno for (int i = 0; i < lstAbsTurno.Count(); i++) { if (lstAbsTurno[i].get_respuesta() == 1) codigo_turno = lstAbsTurno[i].get_idQuestion(); } }
private void processAnswers(List<List<CircleF>> pLsOrdered, LineSegment2D[] pAnswerReferenceLines, LineSegment2D[] pCodeNumberRefenceLines, Image<Bgr, Byte> pImg) { Question question; for (int i = 0; i < pLsOrdered.Count; i++) { int maxLengthList = pLsOrdered[i].Count; for (int j = 0; j < maxLengthList; j++) { // for Answers // note that the last list of list is for CodeNumbers, so "-1" leave the last for letter...(else) #region process answers if (i < maxLengthList - 1) { question = new Question(); if (pLsOrdered[i][j].Center.X == pAnswerReferenceLines[i].P1.X) { question.fillQuestion(ID_SEQUENCE + 1, "*************"); scalar = new MCvScalar(0, 255, 0); color = new Bgr(Color.Green); } else { if (pLsOrdered[i][j].Center.X < pAnswerReferenceLines[i].P1.X) {// Yes Answer question.fillQuestion(ID_SEQUENCE + 1, "True"); scalar = new MCvScalar(0, 0, 255); color = new Bgr(Color.Green); } else {// No answer question.fillQuestion(ID_SEQUENCE + 1, "False"); scalar = new MCvScalar(255, 0, 0); color = new Bgr(Color.Green); } } questions.Add(question); ID_SEQUENCE++; } #endregion // for CodeNumbers #region process codes number else //this is the last list of circles { codeNumber = 0; int ii = pLsOrdered[i].Count - 1; //for (int k = - 1; 0 <= k; k--) for (int k = 0; k < pLsOrdered[i].Count; k++) { codeNumber += (int)(getDigitFromCode(pLsOrdered[i][k], pCodeNumberRefenceLines) * Math.Pow(10, ii)); ii--; } txtCode.Text = codeNumber.ToString(); scalar = new MCvScalar(0, 0, 0); color = new Bgr(Color.Green); } if (pLsOrdered[i][j].Radius == 20) { scalar = new MCvScalar(255, 255, 0); } CvInvoke.cvCircle(pImg, new Point((int)pLsOrdered[i][j].Center.X, (int)pLsOrdered[i][j].Center.Y), 15, scalar, -1, LINE_TYPE.CV_AA, 0); #endregion } } }