Bosch DCN Next Generation Uživatelský manuál Strana 199

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 296
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 198
DCN Next Generation Open Interface Release 2.4 Voting
en | 199
Bosch Communications Systems | 2007 February | SRS_VTINF | Du040905
break;
case VT_E_INCONTROL_OTHER_CHANNEL:
/* Another remote controller has control over the voting application */
/* report error and terminate */
.........
break;
case VT_E_NOERROR:
/* function ended succesful, continue */
break;
default:
/* some unexpected error occurred. */
/* report the error */
.........
break;
}
We have now established communication with the voting application on the CCU and can start
with the preparation of the voting session.
Preparing the voting
For the preparation of the voting we must set the global settings, the voting parameters and the
subject of the first voting round to be started.
The setting of the global parameters is done in the code below:
VT_T_GLOBAL_SETTINGS tGlobalSettings;
tGlobalSettings.wVotingLedMode = VT_C_LED_SECRET_FLASH_ON;
tGlobalSettings.wPresentVotes = VT_C_100_AUTHORISED_VOTES; /* AT decides
who */
tGlobalSettings.bShowVoteTimer = FALSE; /* we do not use the vote timer */
tGlobalSettings.wVoteTimerLimit = 0;
tGlobalSettings.bReserved1 = FALSE; /* Must be FALSE */
tGlobalSettings.bAutoAbstain = FALSE; /* We are using firstVoteCounts, so
false */
tGlobalSettings.bReserved2 = TRUE; /* Must be TRUE */
tGlobalSettings.bVoteWeightingOn = FALSE; /* Everyone has the weight 1 */
tGlobalSettings.bReserved3 = FALSE; /* Must be FALSE */
tGlobalSettings.bFirstVoteCount = TRUE; /* the first cast of a delegate
counts */
wError = VT_SetGlobalSettings (&tGlobalSettings);
if (wError != VT_E_NOERROR)
{
/* do error handling */
}
The second part of the preparation is setting the voting kind as used during all the vote rounds.
VT_T_VOTINGPARAMS tVotingControl;
WORD wIndex;
tVotingControl.wVotingMenu = VT_C_MENU_YES_NO_ABSTAIN;
tVotingControl.wNrOfAnswerOptions = 3; /* Yes, No and Abstain */
tVotingControl.bOpenVoting = TRUE; /* Individual results */
/* Only send the results to the remote controller */
tVotingControl.wInterimResultType = VT_C_INT_RES_INDIV_PC_ONLY;
tVotingControl.bCompressedResults = TRUE; /* results must be compressed */
wError = VT_SetVotingParams (&tVotingParams);
if (wError != VT_E_NOERROR)
{
/* do error handling */
}
These two calls finish the preparation for the voting session. We can now start each vote round
till the session is completed.
Running each vote round
For running the vote round we expect an external function present which collects the subject text
for the next voting. This external function returns TRUE if a new subject has been found and
returns FALSE when no more subjects are present. As subject legend we will use the fixed text
“Voting”.
Zobrazit stránku 198
1 2 ... 194 195 196 197 198 199 200 201 202 203 204 ... 295 296

Komentáře k této Příručce

Žádné komentáře