// simpleFIC.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "FIC.hpp" #include int main(int argc, char* argv[]) { printf("Hello World!\n"); printf("Please enter the crate number.\n"); unsigned int crate; scanf("%d",&crate); unsigned int slot=5; printf("Initializing FIC in slot %d of crate %d.\n",slot,crate); FIC myfic(crate,slot); int i,ichoice,keeplooping=1, emchoice=1; int ichoice1,iloop1=1, nerror=0; int clear=0, protocolErrs=0, evttot=0, evti=1; int foreva=1,data_nevts=0, emptyfifo=1;; unsigned short datach0[160],datach1[160],datach2[160],datach3[160]; unsigned int data1[160]; unsigned short data2[160]; int nevts=0; while(keeplooping) { printf("Please enter a number:\n"); printf(" 0: Quit.\n"); printf(" 1: set up the FIC initially.\n"); printf(" 2: turn emission off.\n"); printf(" 3: Turn emission on.\n"); printf(" 4: enable channels 0 and 1.\n"); printf(" 5: Enable channels 2 and 3.\n"); printf(" 6: disable all chanels.\n"); printf(" 7: send events\n"); printf(" 8: test submenu.\n"); printf(" 9: Diagnostic submenu.\n"); printf("10: Send and Receive events over VME.\n"); printf("11: Receive events over VME.\n"); // // get the user choice. // scanf("%d",&ichoice); // switch(ichoice) { case 0: keeplooping=0; break; case 1: myfic.setup(); break; case 2: myfic.emissionOff(); emchoice=0; break; case 3: myfic.emissionOn(); emchoice=1; break; case 4: for(i=0;i<2;i++) myfic.enableChannel(i); break; case 5: for(i=2;i<4;i++) myfic.enableChannel(i); break; case 6: for(i=0;i<4;i++) myfic.disableChannel(i); break; case 7: myfic.emissionOn(); int i,nevents; printf("How many events?\n"); scanf("%d",&nevents); for (i=0;i