/praktikum/petdaqfmf/libxxusb.cpp |
File deleted |
|
Property changes: |
Deleted: svn:executable |
Index: petdaqfmf/CAENV965.c |
=================================================================== |
--- petdaqfmf/CAENV965.c (revision 112) |
+++ petdaqfmf/CAENV965.c (nonexistent) |
@@ -1,107 +0,0 @@ |
-#include <stdlib.h> |
-#include <stdio.h> |
-#include "CAENV965.h" |
-#include "CAENV965_DEF.h" |
-#include "vme.h" |
- |
-static unsigned long ModuleAddress[10]; |
- |
-int _VI_FUNC V965_map (int ModuleNumber, unsigned long ModuleOffset, int print) |
-{ |
- int i; |
- unsigned short geo, fw, ah, al; |
- if (print) { |
- printf("CAEN V965_map \n"); |
- } |
- ModuleAddress[ModuleNumber] = ModuleOffset; |
- VME_A24D16_R(ModuleAddress[ModuleNumber] + CAENV965_FW, &fw); |
- geo = 0; |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_CRN, &geo); |
- for (i=0;i<32;i++) |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_THM + 2*i, &geo); |
- geo = ModuleNumber+1; |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_GEO, &geo); |
- geo = 0; |
- VME_A24D16_R(ModuleAddress[ModuleNumber] + CAENV965_GEO, &geo); |
- VME_A24D16_R(ModuleAddress[ModuleNumber] + CAENV965_ADH, &ah); |
- VME_A24D16_R(ModuleAddress[ModuleNumber] + CAENV965_ADL, &al); |
- if (print) { |
- printf("CAEN V965 offset = 0x%08x\n", ModuleOffset); |
- printf(" V965_map firmware = %d.%d\n", (fw>>8)&0xff, fw&0xff); |
- printf(" V965_map geo = %d\n", geo&0x1f ); |
- printf(" V965_map addr = 0x%04X0000\n", (ah<<8)|(al&0xff)); |
- } |
- |
- return 0; |
-} |
- |
- |
-int _VI_FUNC V965_init (int ModuleNumber, unsigned short ped) |
-{ |
- unsigned short dum16; |
- |
- dum16= 0x80; |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_BS1, &dum16); |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_BC1, &dum16); |
- dum16= ped; |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_PED, &dum16); |
- dum16= 0x5000; |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_BS2, &dum16); |
- dum16= 0x4; |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_BS2, &dum16); |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_BC2, &dum16); |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_ECR, &dum16); |
- |
- printf ( " V965_init Module %d initialized!\n", ModuleNumber ) ; |
- return 0; |
-} |
- |
-int _VI_FUNC V965_clear (int ModuleNumber) |
-{ |
- |
- unsigned short dum16; |
- |
- dum16= 0x4; |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_BS2, &dum16); |
- VME_A24D16_W(ModuleAddress[ModuleNumber] + CAENV965_BC2, &dum16); |
- printf("V965_clear\n"); |
- return 0; |
- |
-} |
- |
-int _VI_FUNC V965_status (int ModuleNumber) |
-{ |
- unsigned short dum16; |
- |
- VME_A24D16_R(ModuleAddress[ModuleNumber] + CAENV965_SR1, &dum16); |
- //printf("*%d\n",dum16); |
- return (int)dum16; |
-} |
- |
-int _VI_FUNC V965_status2 (int ModuleNumber) |
-{ |
- |
- unsigned short dum16; |
- |
- VME_A24D16_R(ModuleAddress[ModuleNumber] + CAENV965_SR2, &dum16); |
- |
- return (int)dum16; |
-} |
- |
-int _VI_FUNC V965_read (int ModuleNumber, unsigned long whereto[],int len) |
-{ |
- int status, ndata, i; |
- |
- ndata = 0; |
- |
- do { |
- if (ndata>=len) { |
- printf("ERROR V965_read: Increase storage size: ndata=%d\n",ndata); |
- break; |
- } |
- VME_A24D32_R(ModuleAddress[ModuleNumber] + CAENV965_OB, &whereto[ndata]); |
- i=(whereto[ndata]>>25)&0x3; |
- if (i<3) ndata++; |
- } while (i<2); |
- return ndata; |
-} |
Index: petdaqfmf/CAENV965.h |
=================================================================== |
--- petdaqfmf/CAENV965.h (revision 112) |
+++ petdaqfmf/CAENV965.h (nonexistent) |
@@ -1,13 +0,0 @@ |
-#ifndef _CAENV965_H |
-#define _CAENV965_H |
- |
-#define _VI_FUNC |
- |
-int _VI_FUNC V965_map (int ModuleNumber, unsigned long ModuleOffset, int print) ; |
-int _VI_FUNC V965_init (int ModuleNumber, unsigned short ped) ; |
-int _VI_FUNC V965_clear (int ModuleNumber) ; |
-int _VI_FUNC V965_status (int ModuleNumber) ; |
-int _VI_FUNC V965_status2 (int ModuleNumber) ; |
-int _VI_FUNC V965_read (int ModuleNumber, unsigned long whereto[],int len); |
- |
-#endif |
Index: petdaqfmf/libxxusb.h |
=================================================================== |
--- petdaqfmf/libxxusb.h (revision 112) |
+++ petdaqfmf/libxxusb.h (nonexistent) |
@@ -1,114 +0,0 @@ |
-#include <usb.h> |
- |
- |
-#define XXUSB_WIENER_VENDOR_ID 0x16DC /* Wiener, Plein & Baus */ |
-#define XXUSB_VMUSB_PRODUCT_ID 0x000B /* VM-USB */ |
-#define XXUSB_CCUSB_PRODUCT_ID 0x0001 /* CC-USB */ |
-#define XXUSB_ENDPOINT_OUT 2 /* Endpoint 2 Out*/ |
-#define XXUSB_ENDPOINT_IN 0x86 /* Endpoint 6 In */ |
-#define XXUSB_FIRMWARE_REGISTER 0 |
-#define XXUSB_GLOBAL_REGISTER 1 |
-#define XXUSB_ACTION_REGISTER 10 |
-#define XXUSB_DELAYS_REGISTER 2 |
-#define XXUSB_WATCHDOG_REGISTER 3 |
-#define XXUSB_SELLEDA_REGISTER 6 |
-#define XXUSB_SELNIM_REGISTER 7 |
-#define XXUSB_SELLEDB_REGISTER 4 |
-#define XXUSB_SERIAL_REGISTER 15 |
-#define XXUSB_LAMMASK_REGISTER 8 |
-#define XXUSB_LAM_REGISTER 12 |
-#define XXUSB_READOUT_STACK 2 |
-#define XXUSB_SCALER_STACK 3 |
-#define XXUSB_NAF_DIRECT 12 |
- |
-// dodal 19.4.2011 da dela na 64-bit masinah |
-typedef unsigned int Uint32_t; |
- |
-struct XXUSB_STACK |
-{ |
-Uint32_t Data; |
-short Hit; |
-short APatt; |
-short Num; |
-short HitMask; |
-}; |
- |
-struct XXUSB_CC_COMMAND_TYPE |
-{ |
-short Crate; |
-short F; |
-short A; |
-short N; |
-Uint32_t Data; |
-short NoS2; |
-short LongD; |
-short HitPatt; |
-short QStop; |
-short LAMMode; |
-short UseHit; |
-short Repeat; |
-short AddrScan; |
-short FastCam; |
-short NumMod; |
-short AddrPatt; |
-Uint32_t HitMask[4]; |
-Uint32_t Num; |
-}; |
- |
-struct xxusb_device_typ |
-{ |
- struct usb_device *usbdev; |
- char SerialString[7]; |
-}; |
- |
-typedef struct xxusb_device_typ xxusb_device_type; |
-typedef unsigned char UCHAR; |
-typedef struct usb_bus usb_busx; |
- |
- |
-int xxusb_longstack_execute(usb_dev_handle *hDev, void *DataBuffer, int lDataLen, int timeout); |
-int xxusb_bulk_read(usb_dev_handle *hDev, void *DataBuffer, int lDataLen, int timeout); |
-int xxusb_bulk_write(usb_dev_handle *hDev, void *DataBuffer, int lDataLen, int timeout); |
-int xxusb_usbfifo_read(usb_dev_handle *hDev, int *DataBuffer, int lDataLen, int timeout); |
- |
-short xxusb_register_read(usb_dev_handle *hDev, short RegAddr, Uint32_t *RegData); |
-short xxusb_stack_read(usb_dev_handle *hDev, short StackAddr, Uint32_t *StackData); |
-short xxusb_stack_write(usb_dev_handle *hDev, short StackAddr, Uint32_t *StackData); |
-short xxusb_stack_execute(usb_dev_handle *hDev, Uint32_t *StackData); |
-short xxusb_register_write(usb_dev_handle *hDev, short RegAddr, Uint32_t RegData); |
-short xxusb_reset_toggle(usb_dev_handle *hDev); |
- |
-short xxusb_devices_find(xxusb_device_type *xxusbDev); |
-short xxusb_device_close(usb_dev_handle *hDev); |
-usb_dev_handle* xxusb_device_open(struct usb_device *dev); |
-short xxusb_flash_program(usb_dev_handle *hDev, char *config, short nsect); |
-short xxusb_flashblock_program(usb_dev_handle *hDev, UCHAR *config); |
-usb_dev_handle* xxusb_serial_open(char *SerialString); |
- |
-short VME_register_write(usb_dev_handle *hdev, Uint32_t VME_Address, Uint32_t Data); |
-short VME_register_read(usb_dev_handle *hdev, Uint32_t VME_Address, Uint32_t *Data); |
-short VME_LED_settings(usb_dev_handle *hdev, int LED, int code, int invert, int latch); |
-short VME_DGG(usb_dev_handle *hdev, unsigned short channel, unsigned short trigger,unsigned short output, Uint32_t delay, unsigned short gate, unsigned short invert, unsigned short latch); |
- |
-short VME_Output_settings(usb_dev_handle *hdev, int Channel, int code, int invert, int latch); |
- |
-short VME_read_16(usb_dev_handle *hdev,short Address_Modifier, Uint32_t VME_Address, Uint32_t *Data); |
-short VME_read_32(usb_dev_handle *hdev, short Address_Modifier, Uint32_t VME_Address, Uint32_t *Data); |
-short VME_BLT_read_32(usb_dev_handle *hdev, short Address_Modifier, int count, Uint32_t VME_Address, Uint32_t Data[]); |
-short VME_write_16(usb_dev_handle *hdev, short Address_Modifier, Uint32_t VME_Address, Uint32_t Data); |
-short VME_write_32(usb_dev_handle *hdev, short Address_Modifier, Uint32_t VME_Address, Uint32_t Data); |
- |
-short CAMAC_DGG(usb_dev_handle *hdev, short channel, short trigger, short output, int delay, int gate, short invert, short latch); |
-short CAMAC_register_read(usb_dev_handle *hdev, int A, Uint32_t *Data); |
-short CAMAC_register_write(usb_dev_handle *hdev, int A, Uint32_t Data); |
-short CAMAC_LED_settings(usb_dev_handle *hdev, int LED, int code, int invert, int latch); |
-short CAMAC_Output_settings(usb_dev_handle *hdev, int Channel, int code, int invert, int latch); |
-short CAMAC_read_LAM_mask(usb_dev_handle *hdev, Uint32_t *Data); |
-short CAMAC_write_LAM_mask(usb_dev_handle *hdev, Uint32_t Data); |
- |
-short CAMAC_write(usb_dev_handle *hdev, int N, int A, int F, Uint32_t Data, int *Q, int *X); |
-short CAMAC_read(usb_dev_handle *hdev, int N, int A, int F, Uint32_t *Data, int *Q, int *X); |
-short CAMAC_Z(usb_dev_handle *hdev); |
-short CAMAC_C(usb_dev_handle *hdev); |
-short CAMAC_I(usb_dev_handle *hdev, int inhibit); |
- |
/petdaqfmf/libxxusb.h |
Property changes: |
Deleted: svn:executable |
Index: petdaqfmf/daq.C |
=================================================================== |
--- petdaqfmf/daq.C (revision 112) |
+++ petdaqfmf/daq.C (nonexistent) |
@@ -1,583 +0,0 @@ |
-#include <stdio.h> |
-#include <stdlib.h> |
-#include <string.h> |
-#include <unistd.h> |
-#include <sys/mman.h> |
-#include <errno.h> |
-#include <ctype.h> |
-#include <time.h> |
-#include <sys/time.h> |
-#include <sys/stat.h> |
-#include <signal.h> |
-#include <zlib.h> |
- |
-#include "CAENV965_DEF.h" |
-#include "VmUsbStack.h" |
- |
-#include "vme.h" |
- |
-#include "daq.h" |
- |
-#define VERSION 1.0 |
-#define TIMEOUT 3 |
- |
- |
-/* VME modules */ |
- |
-#define CAEN_V792 0x340000 // IJS V792 |
-#define CAEN_V792_1 0x530000 // FMF1 V792 |
-#define CAEN_V792_2 0x630000 // FMF2 V792 |
-#define CAEN_V965 0x350000 // IJS V965 |
-int addr[3]={CAEN_V792,CAEN_V792_1,CAEN_V965 }; |
-int nadc=3; |
- |
-int gPedestal = 255; |
- |
-#define BUFF_L 2048 |
-static int stackwrite[10000]; |
-static int stackdata[10000],stackdump[27000]; |
- |
- |
-/************************************************/ |
-int weight_while(int num) |
-{ |
- int i, tmp; |
- |
- for ( i =0; i <num; i++ ) tmp = 0; |
- return 0; |
-} |
-#define WWHILE weight_while(0) |
- |
-#define TRUE 1 |
-#define FALSE 0 |
- |
-int timer_out; |
-struct sigaction oact; |
-void timerast (int signumber) |
-{ |
- timer_out = TRUE; |
- fprintf(stderr,"TIMEOUT !!!\n"); |
-} |
- |
-void tmlnk (int tout) |
-{ |
- timer_out = FALSE; |
- struct sigaction act; |
- struct itimerval tdelay; |
- |
- act.sa_handler = timerast; |
- sigemptyset (&act.sa_mask); |
- act.sa_flags = 0; |
- |
- tdelay.it_value.tv_sec = tout / 100; |
- tdelay.it_value.tv_usec = 10000 * (tout % 100); |
- tdelay.it_interval.tv_sec = 0; |
- tdelay.it_interval.tv_usec = 0; |
- |
- if (sigaction (SIGALRM, &act, &oact) < 0) |
- { |
- perror ("sigaction(tmlnk)"); |
- exit (EXIT_FAILURE); |
- } |
- if (setitimer (ITIMER_REAL, &tdelay, NULL) < 0) |
- { |
- perror ("setitimer(tmlnk)"); |
- exit (EXIT_FAILURE); |
- } |
-} |
- |
-void tmulk () |
-{ |
- struct itimerval tdelay; |
- |
- tdelay.it_value.tv_sec = 0; |
- tdelay.it_value.tv_usec = 0; |
- tdelay.it_interval.tv_sec = 0; |
- tdelay.it_interval.tv_usec = 0; |
- |
- if (setitimer (ITIMER_REAL, &tdelay, NULL) < 0) |
- { |
- perror ("setitimer(tmulk)"); |
- exit (EXIT_FAILURE); |
- } |
- if (sigaction (SIGALRM, &oact, NULL) < 0) |
- { |
- perror ("sigaction(tmulk)"); |
- exit (EXIT_FAILURE); |
- } |
-} |
- |
-int fexist( char * path){ |
- struct stat sbuf; |
- int res; |
- if(!path || !*path) return 0; |
- res=stat(path,&sbuf); |
- if (res){ |
- if (errno==ENOENT) { |
- return 0; |
- } else { |
- return -1; |
- } |
- } |
- return 1; |
-} |
- |
- |
- |
- |
-int daq::init(){ |
- |
- xxusb_register_write(udev,1,0x0); // Stop DAQ mode |
- while (xxusb_usbfifo_read(udev,(int *) stackdump,BUFF_L,100)>0); |
- |
- |
- int rate=1000; |
- int i=80000000/rate-40; // 80 MHz |
- if (i<72) i=72; |
- // Set DGG channel A as a pulser, output on O1, |
- // with delay =500 x 12.5ns, |
- // and width = 500 x 12.5ns, |
- // not latching or inverting |
- // VME_DGG(udev,0,6,0,24000,6000,0,0); |
- VME_DGG(udev,0,6,0,i,40,0,0); |
- // Set DGG channel B to trigger on NIM1, output on O2, |
- // with delay =200 x 12.5ns, |
- // and width = 200 x 12.5ns, |
- // not latching or inverting |
- VME_DGG(udev,1,1,1,0,10,0,1); |
- |
- |
-// INIT stackdata |
- int fPedestal=gPedestal; |
- printf("CAEN V965 Pedestal set to %d\n", fPedestal); |
- if (fInit != NULL ) delete fInit; |
- fInit=new VmUsbStack(); |
- |
- for (int i=0;i<nadc;i++){ |
- fInit->WriteA24D16( addr[i] + CAENV965_CRN , 0x0); |
- fInit->WriteA24D16( addr[i] + CAENV965_GEO , i); |
- fInit->ReadA24D16(addr[i] + CAENV965_GEO); |
- for (int j=0;j<32;j++){ |
- fInit->WriteA24D16(addr[i] + CAENV965_THM + 0x02*j, fThreshold[j+i*32]); // threshold/kill for 32 channels |
- } |
- fInit->WriteA24D16( addr[i] + CAENV965_BS1, 0x80 ); // soft reset |
- fInit->WriteA24D16( addr[i] + CAENV965_BC1, 0x80 ); // soft reset |
- fInit->WriteA24D16( addr[i] + CAENV965_PED, fPedestal ); // pedestal |
- fInit->WriteA24D16( addr[i] + CAENV965_BS2,0x5000); |
- fInit->WriteA24D16( addr[i] + CAENV965_BS2,0x4); // clear module |
- fInit->WriteA24D16( addr[i] + CAENV965_BC2,0x4); |
- } |
- fInit->Marker(0xFAFC); |
- |
-// fInit->Print(); |
- |
- |
- // READOUT stackdata |
- if (fStack != NULL ) delete fStack; |
- fStack=new VmUsbStack(); |
- fStack->Marker(0xFFAB); |
- //fStack->ConditionalRead(addr[i] + CAENV965_SR1,0x1); // TRG wait : loop until bit 0 is on |
- // fStack->RepeatRead( CMD_A24, CMD_D32, addr[i] + CAENV965_OB,34,0); // repead read |
- //fStack->ConditionalRead(addr[i] + CAENV965_OB ,0x4000000) ; // loop until bit 26 is on, read data |
- for (int j=0;j<36;j++) fStack->ReadA24D32(addr[0] + CAENV965_OB); |
- for (int j=0;j<36;j++) fStack->ReadA24D32(addr[1] + CAENV965_OB); |
- for (int j=0;j<8;j++) fStack->ReadA24D32(addr[2] + CAENV965_OB);// 4 channels connected |
- fStack->Marker(0xFAFB); |
- |
- for (int i=0;i<nadc;i++){ |
- fStack->WriteA24D16(addr[i] + CAENV965_BS2,0x4); // clear module |
- fStack->WriteA24D16(addr[i] + CAENV965_BC2,0x4); |
- } |
- |
- //fStack->Print(); |
- |
- VME_LED_settings(udev, 0,0,0,0); // Set Yellow LED to light with with USB out buffer not empty |
- VME_LED_settings(udev, 1,1,0,0); // Set Red LED to light with NIM1 |
- VME_LED_settings(udev,2,0,0,0); // Set Green LED to light when stack is not empty |
- |
- Uint32_t vmereg; |
- VME_register_read(udev,0x00,&vmereg); |
- printf("VMUSB Firmware ID -> 0x%08X\n",vmereg); |
- |
- VME_register_read(udev,0x04,&vmereg); |
- printf("VMUSB Global Mode -> 0x%08X\n",vmereg); |
- |
- vmereg=(vmereg&0xF000)|0x0004; |
- VME_register_write(udev,0x04,vmereg); |
- VME_register_write(udev,0x08,0x00000080); |
- VME_register_write(udev,0x28,0x0); |
- VME_register_write(udev,0x2C,0x0); |
- VME_register_write(udev,0x30,0x0); |
- VME_register_write(udev,0x34,0x0); |
- VME_register_write(udev,0x3C,0x000); |
- |
- int nb = fInit->Get(10000,stackdata); |
- int ret= xxusb_stack_execute(udev,(Uint32_t *)stackdata); |
- printf("Init::%d ret=%d\n",nb,ret); |
- if (ret>0) for (int i=0;i<ret/2;i++) printf ("stackdata=0x%08X\n",stackdata[i]); |
- |
- int nb0= fStack->Get(10000,&stackwrite[0]); |
- if (nb0>768) { |
- fprintf(stderr,"nb0=%d > 768 error xxusb_stack_write\n", nb0); |
- exit(-1); |
- } |
- nb =xxusb_stack_write(udev,0x2,(Uint32_t *) stackwrite); |
- nb0=xxusb_stack_read(udev,0x2,(Uint32_t *) stackdata); |
- for (int i=0;i<stackwrite[0]+1;i++){ |
- if (stackdata[i]!=stackwrite[i]) printf("%d %d init err %x %x\n",nb,nb0,stackwrite[i], stackdata[i]); |
- } |
- |
- if (fMode==2) xxusb_register_write(udev,1,0x1); // Start DAQ mode |
- |
- printf("daq::init() \n"); |
- return 0; |
-} |
- |
-int daq::connect(){ |
- VME_START(NULL); |
- printf("daq::connect()\n"); |
- return 0; |
-} |
- |
-int daq::disconnect(){ |
- /* zakljuci */ |
- VME_STOP(); |
- printf("daq::disconnect()\n"); |
- return 0; |
-} |
- |
-int daq:: clear(){ |
- return 0; |
-} |
- |
-inline int module_header(int recid,Uint32_t *data,int len){ |
- data[0] = recid; |
- data[1] = (len >0)? len : 0 ; |
- return data[1]+2; |
-} |
- |
- |
-int daq::event(unsigned int *data, int maxn, int *ctr, int print){ |
- int tout=200; /* 1/100 of a second */ |
- const int lsize=sizeof(unsigned Uint32_t); |
- |
- |
- ctr[0]++; |
- ctr[1]++; |
- |
- int count=0; |
- |
- switch (fMode){ |
- case 0:// normal calls |
- { |
- unsigned short clr= 0x4; |
- unsigned int status=0; |
- Uint32_t mdata; |
- |
- for (int i=0;i<2;i++){ |
- // wait for trg |
- tmlnk (tout); |
- do VME_A24D16_R( addr[i] + CAENV965_SR1, &status); while ( (status&0x1)==0 && timer_out==0 ); |
- tmulk(); |
- // readout data |
- if (timer_out) return 0; |
- int len=0; |
- |
- do { |
- VME_A24D32_R(addr[i] + CAENV965_OB, &mdata); |
- mdata=data[count++]; |
- len++; |
- } while ( (mdata & 0x4000000)==0 && timer_out==0) ; // bit 26 EOB or not valid datum |
- // clear |
- VME_A24D16_W( addr[i] + CAENV965_BS2, &clr); |
- VME_A24D16_W( addr[i] + CAENV965_BC2, &clr); |
- |
- if (count+2<maxn) { |
- if (print) printf("V965 %3d\n",len); |
- count+=module_header(0x130+i,&data[count],len); |
- ctr[2]++; |
- ctr[3]+=len; |
- } |
- |
- timer_out=0; |
- } |
- } |
- break; |
- case 1:// stack execute |
- { |
- fStack->Get(10000,(int *)data); |
- int ret=xxusb_stack_execute(udev,(Uint32_t *) data); //The first element of the array is the number of bytes. |
- if (ret< 0 ) { |
- printf ("xxusb_stack_execute error err=%d\n",ret); \ |
- count = 0; |
- } else count= ret/lsize; |
- |
- } |
- break; |
- case 2:// stack load |
- { |
- int ret=xxusb_usbfifo_read(udev,(int *) data,BUFF_L,100); |
- if (ret< 0 ) { |
- if (ret!=-110) { |
- printf ("xxusb_usbfifo_read error err=%d\n",ret); |
- end(); |
- init(); |
- } |
- count = 0; |
- } else { |
- if (0 && print && ret>0) { |
- for (int i=0;i<100;i++) { |
- printf ("%4d fifodata=0x%08X\n",i, data[i]); |
- if (data[i]==0xFAFB) break; |
- } |
- /* |
- |
- 0 fifodata=0x0000000D |
- 1 fifodata=0x00000049 |
- 2 fifodata=0x0000FFAB |
- 3 fifodata=0x00002000 |
- 4 fifodata=0x00000200 |
- 5 fifodata=0x00004141 |
- 6 fifodata=0x00000000 |
- 7 fifodata=0x00004057 |
- 8 fifodata=0x00000010 |
- 9 fifodata=0x00004052 |
- 10 fifodata=0x00000001 |
- 11 fifodata=0x0000405C |
- 12 fifodata=0x00000011 |
- 13 fifodata=0x0000405D |
- 14 fifodata=0x00000002 |
- 15 fifodata=0x0000405E |
- 16 fifodata=0x00000012 |
- 17 fifodata=0x0000401C |
- 18 fifodata=0x00000003 |
- 19 fifodata=0x0000402F |
- 20 fifodata=0x00000013 |
- 21 fifodata=0x00004024 |
- 22 fifodata=0x00000004 |
- 23 fifodata=0x00004076 |
- 24 fifodata=0x00000014 |
- 25 fifodata=0x0000412F |
- 26 fifodata=0x00000005 |
- 27 fifodata=0x0000404C |
- 28 fifodata=0x00000015 |
- 29 fifodata=0x00004132 |
- 30 fifodata=0x00000006 |
- 31 fifodata=0x00004044 |
- 32 fifodata=0x00000016 |
- 33 fifodata=0x0000404A |
- 34 fifodata=0x00000007 |
- 35 fifodata=0x0000409B |
- 36 fifodata=0x00000017 |
- 37 fifodata=0x000040F1 |
- 38 fifodata=0x00000008 |
- 39 fifodata=0x00004087 |
- 40 fifodata=0x00000018 |
- 41 fifodata=0x00004173 |
- 42 fifodata=0x00000009 |
- 43 fifodata=0x0000404C |
- 44 fifodata=0x00000019 |
- 45 fifodata=0x0000406C |
- 46 fifodata=0x0000000A |
- 47 fifodata=0x00004070 |
- 48 fifodata=0x0000001A |
- 49 fifodata=0x0000406E |
- 50 fifodata=0x0000000B |
- 51 fifodata=0x00004014 |
- 52 fifodata=0x0000001B |
- 53 fifodata=0x000040B7 |
- 54 fifodata=0x0000000C |
- 55 fifodata=0x000040A9 |
- 56 fifodata=0x0000001C |
- 57 fifodata=0x00004048 |
- 58 fifodata=0x0000000D |
- 59 fifodata=0x00004118 |
- 60 fifodata=0x0000001D |
- 61 fifodata=0x0000409D |
- 62 fifodata=0x0000000E |
- 63 fifodata=0x0000405B |
- 64 fifodata=0x0000001E |
- 65 fifodata=0x00004285 |
- 66 fifodata=0x0000000F |
- 67 fifodata=0x00004159 |
- 68 fifodata=0x0000001F |
- 69 fifodata=0x00000035 |
- 70 fifodata=0x00000400 |
- 71 fifodata=0x00000035 |
- 72 fifodata=0x00000600 |
- 73 fifodata=0x00000035 |
- 74 fifodata=0x0000FAFB |
- |
- |
- */ |
- } |
- if (print) printf("------------------ret=%d data[0]=%d\n",ret,(int)data[0]); |
- count= ret/lsize; |
- ctr[2]+=data[0]; |
- ctr[3]+=count; |
- } |
- } |
- break; |
- } |
- return count*lsize; |
-} |
- |
-int daq::end(){ |
- |
- xxusb_register_write(udev,1,0x0); // Stop DAQ mode |
- while (xxusb_usbfifo_read(udev,(int *) stackdata,BUFF_L,30)>0); |
- printf("daq::end()\n"); |
- return 0; |
-} |
- |
-daq::daq(){ |
- fMode = 2; |
- fPedestal=255; |
- for (int i=0;i<128;i++){ |
- if (i<72) fThreshold.push_back(0); |
- else fThreshold.push_back(0x1<<8); // samo 4 kanali na zadnjem modulu so enablani |
- } |
- fThresholdEnable=0; |
- fStop=0; |
- fInit=NULL; |
- fStack=NULL; |
- connect(); |
-} |
- |
-daq::~daq(){ |
-disconnect(); |
-} |
- |
-#ifdef MAIN |
-/* ------------------- CatchSig ----------------- */ |
-int ctrlcflag=0; |
- |
-void SigInt (int sig) |
-{ |
- ctrlcflag = 1; |
- timer_out=1; |
-} |
- |
-int main (int argc, char **argv){ |
- // intercept routine |
- if (signal (SIGINT, SigInt) == SIG_ERR) { |
- perror ("sigignore"); |
- } |
- |
- // print welcome message |
- time_t t,told, tstart, tstop; |
- time(&t); |
- fprintf(stdout,"#############################################\n"); |
- fprintf(stdout,"Program %s version %2.1f\n",argv[0], VERSION); |
- fprintf(stdout,"Compiled on %s %s\n",__DATE__, __TIME__); |
- fprintf(stdout,"Runtime %s \n",ctime(&t)); |
- fprintf(stdout,"#############################################\n"); |
- |
- |
- int neve=-1; |
- char cfname[100]="test.dat"; |
- char *fname=cfname; |
- char *fpedname=NULL; |
- |
-#define BSIZE 10000 |
- Uint32_t data[10000]; |
- |
- |
- daq *d= new daq(); |
- int c; |
- |
- while ((c = getopt (argc, argv, "p:n:t:o:")) != -1) |
- switch (c) |
- { |
- case 'o': |
- sprintf(fname ,"%s", optarg); |
- if (fexist(fname)==1){ |
- fprintf(stdout,"Error !\n"); |
- fprintf(stdout,"File %s already exist. Appending ....\n",fname); |
- //fprintf(stdout,"Remove the file and restart !!!\n"); |
- //exit(0); |
- } |
- break; // input file |
- case 'n': |
- neve = atoi(optarg); // negative argument time ( in s )limited event loop |
- break; |
- case 't': |
- { |
- |
- sprintf(fpedname ,"%s", optarg); |
- FILE *fped=fopen(fpedname,"r"); |
- int j=0; |
- int ndim=400; |
- char line[ndim]; |
- int val=0; |
- while (fgets(line,ndim,fped)!=NULL){ |
- sscanf(line,"%d",&val); |
- d->fThreshold[j++]=val; |
- } |
- d->fThresholdEnable=1; |
- //fclose(fped); |
- fclose(fped); |
- break; |
- } |
- case 'p': |
- gPedestal = atoi(optarg); // injected charge to the qdc |
- break; |
- } |
- |
- if (argc==1) { |
- fprintf(stdout,"Usage: %s -o [filename] -n [number of events] -t [thresholdfile] -p <qdc inject charge>\n negative number of events = acq time in seconds\n",argv[0]); |
- exit(-1); |
- } |
- //FILE *fp=fopen(fname,"a"); |
- gzFile fp=gzopen(fname,"a"); |
- |
- d->init(); |
- d->clear(); |
- |
- int hdr[4]={2}; // recid od run 11 naprej |
- int i=0; |
- int ntotal=0; |
- int counters[30]={0,0,0,0,0, 0,0,0,0,0,0,0}; |
- char names[10][20]={"TRG","CAEN V965"}; |
- time(&t); |
- tstart=t; |
- tstop=tstart+360000; |
- if (neve<-1) { |
- tstop=tstart-neve; |
- neve=-1; |
- } |
- for (i=0;i!=neve && !ctrlcflag && t<tstop;i++){ |
- time(&t); |
- if (t!=told ) printf("%d in %2.2f min daq::event() %s\n",i, (double)(t-tstart)/60., ctime(&t)); |
- int nb=d->event(data,BSIZE, counters,t!=told); |
- if (nb>0){ |
- // zapis v datoteko |
- hdr[1]=nb+4*sizeof(int); |
- hdr[2]=time(NULL); |
- hdr[3]=i; |
- |
- //fwrite(hdr, sizeof(int),4 , fp); |
- gzwrite(fp, hdr, sizeof(int)*4); //gzip |
- // recid=1 do runa 10. ntotal += fwrite(data, sizeof(int),nb, fp); |
- //ntotal += fwrite(data, 1,nb, fp); |
- ntotal += gzwrite(fp, data, nb); |
- told=t; |
- } else i--; |
- } |
- |
- d->end(); |
- delete d; |
- printf("Number of Events: %d\n",i); |
- if (ctrlcflag) printf("User Program termination CTRL-C\n"); |
- if (t>tstop ) printf("Timeout termination tstart# t>tstop: %d# %d >%d\n",(int)t, (int)tstart, (int) tstop); |
- |
- |
- //fclose(fp); |
- gzclose(fp); |
- fprintf(stdout,"%d bytes written to %s\nCounts:\n", (int) (ntotal*sizeof(int)),fname); |
- for (i=0;i<2;i++) fprintf(stdout,"%s\t%d\t%d\n",names[i],counters[2*i],counters[2*i+1]) ; |
- |
- |
- return 0; |
-} |
-#endif |
Index: petdaqfmf/.root_hist |
=================================================================== |
--- petdaqfmf/.root_hist (revision 112) |
+++ petdaqfmf/.root_hist (nonexistent) |
@@ -1,99 +0,0 @@ |
-TBrowser tt |
-.q |
-TBrowser d |
-TFile *_file0 = TFile::Open("test100.root") |
-ach0->Draw() |
-.q |
-TFile *_file0 = TFile::Open("test50.root") |
-ach0->Draw() |
-.q |
-TFile *_file0 = TFile::Open("test150.root") |
-ach0->Draw() |
-TFile *_file0 = TFile::Open("test250.root") |
-ach0->Draw() |
-TFile *_file0 = TFile::Open("test200.root") |
-ach0->Draw() |
-TFile *_file0 = TFile::Open("test150.root") |
-ach0->Draw() |
-TFile *_file0 = TFile::Open("test100.root") |
-ach0->Draw() |
-TFile *_file0 = TFile::Open("test50.root") |
-ach0->Draw() |
-.q |
-TFile *_file0 = TFile::Open("test80.root") |
-ach0->Draw() |
-ach0->Draw() |
-ach1->Draw() |
-ach2->Draw() |
-ach3->Draw() |
-ach4->Draw() |
-ach5->Draw() |
-ach6->Draw() |
-ach7->Draw() |
-ach8->Draw() |
-ach9->Draw() |
-ach10->Draw() |
-ach11->Draw() |
-ach12->Draw() |
-ach13->Draw() |
-ach14->Draw() |
-ach15->Draw() |
-ach16->Draw() |
-ach15->Draw() |
-.q |
-TFile *_file0 = TFile::Open("test80_reversed.root") |
-ach15->Draw() |
-ach1->Draw() |
-ach2->Draw() |
-ach3->Draw() |
-ach4->Draw() |
-ach4->Draw() |
-.q |
-TFile *_file0 = TFile::Open("test.root") |
-ach4->Draw() |
-1->Draw() |
-a1->Draw() |
-ach5->Draw() |
-ach5->Draw() |
-ach7->Draw() |
-ach16->Draw() |
-ach18->Draw() |
-ach36->Draw() |
-.q |
-TFile *_file0 = TFile::Open("test1.root") |
-ach7->Draw() |
-ach17->Draw() |
-ach7->Draw() |
-.q |
-TFile *_file0 = TFile::Open("test.root") |
-ach7->Draw() |
-ach27->Draw() |
-ach17->Draw() |
-ach18->Draw() |
-ach16->Draw() |
-ach15->Draw() |
-ach14->Draw() |
-ach13->Draw() |
-.ls |
-sumadc1->Draw() |
-sumadc0->Draw() |
-cadc0->Draw() |
-pmt0->Draw() |
-pmt1->Draw() |
-pmt0->Draw() |
-sumadc0->Draw() |
-.q |
-TFile *_file0 = TFile::Open("test_reversed.root") |
-sumadc0->Draw() |
-tbrowser |
-TBrowser |
-TBrowser jj |
-.q |
-TFile *_file0 = TFile::Open("test850.root") |
-ach14->Draw() |
-ach11->Draw() |
-ach0->Draw() |
-ach15->Draw() |
-ach16->Draw() |
-ach15->Draw() |
-.q |
Index: petdaqfmf/wienvme_dll.h |
=================================================================== |
--- petdaqfmf/wienvme_dll.h (revision 112) |
+++ petdaqfmf/wienvme_dll.h (nonexistent) |
@@ -1,53 +0,0 @@ |
-#ifndef _WIENVME_DLL_H |
-#define _WIENVME_DLL_H |
- |
-#include "libxxusb.h" |
- |
-extern usb_dev_handle *udev; |
- |
- |
- |
-int VME_start (char*); |
-int VME_close (int); |
-int VME_stop (void); |
-int VME_reset (void); |
- |
- |
-int VME_read16 (Uint32_t, void*); |
-int VME_read32 (Uint32_t, void*); |
- |
-int VME_write16 ( Uint32_t, void*); |
-int VME_write32 ( Uint32_t, void*); |
- |
-#define VME_START(NODE) VME_start((NODE)) |
-#define VME_STOP() VME_stop() |
-#define VME_RESET() VME_reset() |
- |
-#define VME_A24D16_R(VME,DATA) VME_read16( (VME), (DATA)) |
-#define VME_A24D32_R(VME,DATA) VME_read32( (VME), (DATA)) |
- |
-#define VME_A24D16_W(VME,DATA) VME_write16( (VME), (DATA)) |
-#define VME_A24D32_W(VME,DATA) VME_write32( (VME), (DATA)) |
- |
-#define VME_A32D16_R(VME,DATA) VME_read16( (VME), (DATA)) |
-#define VME_A32D32_R(VME,DATA) VME_read32( (VME), (DATA)) |
- |
-#define VME_A32D16_W(VME,DATA) VME_write16( (VME), (DATA)) |
-#define VME_A32D32_W(VME,DATA) VME_write32( (VME), (DATA)) |
- |
-typedef unsigned short ADDRESS_MODIFIER; |
- |
-#define Std_Sup_Data (ADDRESS_MODIFIER)0x3d |
-#define Std_Sup_Prog (ADDRESS_MODIFIER)0x3e |
-#define Std_NoPriv_Data (ADDRESS_MODIFIER)0x39 |
-#define Std_NoPriv_Prog (ADDRESS_MODIFIER)0x3a |
- |
-#define Short_Sup (ADDRESS_MODIFIER)0x2d |
-#define Short_NoPriv (ADDRESS_MODIFIER)0x29 |
- |
-#define Ext_Sup_Data (ADDRESS_MODIFIER)0x0d |
-#define Ext_Sup_Prog (ADDRESS_MODIFIER)0x0e |
-#define Ext_NoPriv_Data (ADDRESS_MODIFIER)0x09 |
-#define Ext_NoPriv_Prog (ADDRESS_MODIFIER)0x0a |
- |
-#endif |
/petdaqfmf/wienvme_dll.h |
Property changes: |
Deleted: svn:executable |
Index: petdaqfmf/daq.h |
=================================================================== |
--- petdaqfmf/daq.h (revision 112) |
+++ petdaqfmf/daq.h (nonexistent) |
@@ -1,24 +0,0 @@ |
-#ifndef _daq_h_ |
-#define _daq_h_ |
-#include <vector> |
-class VmUsbStack; |
-class daq { |
-public: |
- VmUsbStack * fStack; |
- VmUsbStack * fInit; |
- int fPedestal; |
- int fThresholdEnable; |
- std::vector<int> fThreshold; |
- int fStop; |
- int fMode; |
- int clear(); |
- int end(); |
- int event(unsigned int *, int,int*, int ); |
- int init(); |
- int connect(); |
- int disconnect(); |
- daq(); |
- ~daq(); |
-}; |
- |
-#endif |
Index: petdaqfmf/VMEModule.hh |
=================================================================== |
--- petdaqfmf/VMEModule.hh (revision 112) |
+++ petdaqfmf/VMEModule.hh (nonexistent) |
@@ -1,39 +0,0 @@ |
-/********************\ |
- VMEModule.hh |
- |
- update: 04/01/28 |
- |
-\********************/ |
- |
-#ifndef VMEMODULE_HH |
-#define VMEMODULE_HH |
- |
- |
- |
-#include <stdio.h> |
-#include <sys/types.h> |
-#include "pcivme_ni.h" |
- |
-#define VMEA24 (unsigned short)0x39 |
-#define VMEA32 (unsigned short)0x09 |
-#define VMEA16 (unsigned short)0x29 |
-class VMEModule { |
-protected: |
- int m_fd; |
- int m_vmeptr; |
- caddr_t m_vmeaddr; |
- size_t m_size; |
- unsigned long m_baseaddress; |
-public: |
- VMEModule(int device, caddr_t vmeaddr, size_t size); |
- ~VMEModule(); |
- unsigned long getBaseAddress() { return (unsigned long) m_baseaddress; } |
- caddr_t getVmeAddress() { return m_vmeaddr; } |
- void write32(unsigned long address, unsigned long value); |
- unsigned long read32(unsigned long address); |
- |
- void write16(unsigned long address, unsigned short value); |
- unsigned short read16(unsigned long address); |
-}; |
- |
-#endif |
Index: petdaqfmf/README |
=================================================================== |
--- petdaqfmf/README (revision 112) |
+++ petdaqfmf/README (nonexistent) |
@@ -1,2 +0,0 @@ |
-./daq -o [filename] -n [number of events] -t [thresholdfile] -p <qdc inject charge> |
- negative number of events = acq time in seconds |
Index: petdaqfmf/pcivme_ni.h |
=================================================================== |
--- petdaqfmf/pcivme_ni.h (revision 112) |
+++ petdaqfmf/pcivme_ni.h (nonexistent) |
@@ -1,84 +0,0 @@ |
-#ifndef __PCIVME_NI_H__ |
-#define __PCIVME_NI_H__ |
- |
-//------------------------------------------------------------------------------------------- |
-// pcivme_ni.h - header for ni-labview shared library or dll for ARW pcivme interface |
-// this library can also be used for other purposes aside from labview |
-// |
-// Copyright (C) 2002-2004 ARW Elektronik Germany |
-// |
-// this source code is published under LGPL (Open Source). You can use, redistrubute and |
-// modify it unless this header is not modified or deleted. No warranty is given that |
-// this software will work like expected. |
-// This product is not authorized for use as critical component in life support systems |
-// wihout the express written approval of ARW Elektronik Germany. |
-// |
-// Please announce changes and hints to ARW Elektronik |
-// |
-// $Log: pcivme_ni.h,v $ |
-// Revision 1.8 2004/08/13 19:23:45 klaus |
-// conversion to kernel-version 2.6, released version 3.0 |
-// |
-// Revision 1.7 2002/10/20 18:07:18 klaus |
-// changed error handling |
-// |
-// Revision 1.6 2002/10/18 21:56:28 klaus |
-// completed functional features, untested |
-// |
-// Revision 1.5 2002/10/18 21:56:28 klaus |
-// completed functional features, untested |
-// |
-// Revision 1.4 2002/10/17 21:16:03 klaus |
-// filled function bodies |
-// |
-// Revision 1.3 2002/10/17 21:16:03 klaus |
-// filled function bodies |
-// |
-// Revision 1.2 2002/10/17 19:05:03 klaus |
-// VME access is working through test to lib to driver |
-// |
-// Revision 1.1 2002/10/12 22:04:44 klaus |
-// first work done |
-// |
-// what who when |
-// first steps AR 17.11.1999 |
-// VMEerror new AR 07.01.2000 |
-// made LINUX shared library from windows template AR 12.10.2002 |
-// |
- |
-//------------------------------------------------------------------------------------------- |
-// INCLUDES |
-// |
-#define BOOLEAN int |
-#if !defined(TRUE) && !defined(FALSE) |
- #define FALSE 0 |
- #define TRUE 1 |
-#endif |
- |
-//------------------------------------------------------------------------------------------- |
-// PROTOTYPES |
-// |
-#ifdef __cplusplus |
-extern "C" |
-{ |
-#endif |
-int VMEopen(const char *cszDeviceName, unsigned char ubAddressModifier, int *pnHandle); |
-int VMEinit(const char *cszDeviceName, unsigned short nVMEMM, unsigned char ubAddressModifier, int *pnHandle); |
-int setAccessProperties(int nHandle, unsigned char bModifier, unsigned char bAccessType); |
-int VMEread(int nHandle, unsigned long ulAddress, unsigned char ubAccessWidth, unsigned long ulElementCount, void *pvBuffer); |
-int VMEwrite(int nHandle, unsigned long ulAddress, unsigned char ubAccessWidth, unsigned long ulElementCount, void *pvBuffer); |
-int VMEaccessVIC(int nHandle, unsigned char ubAccessMode, unsigned short uwAddress, unsigned char *ubContent); |
-int VMEreset(int nHandle); |
-int VMETAS(int nHandle, unsigned long ulAddress, unsigned char *ubResult); |
-int VMEcontrolInterrupt(int nHandle, BOOLEAN *bEnable); |
-int VMEinterrupt(int nHandle, unsigned char *ubVector); |
-int VMEsysfailGet(int nHandle, BOOLEAN *bResult); |
-int VMEsysfailSet(int nHandle, BOOLEAN bForce); |
-int VMEerror(int nHandle); |
-int VMEclose(int nHandle); |
-int GetLastError(int nHandle); |
-#ifdef __cplusplus |
-} |
-#endif |
- |
-#endif /* __PCIVME_NI_H__ */ |
Index: petdaqfmf/wienvmeusb_dll.c |
=================================================================== |
--- petdaqfmf/wienvmeusb_dll.c (revision 112) |
+++ petdaqfmf/wienvmeusb_dll.c (nonexistent) |
@@ -1,98 +0,0 @@ |
-#include <stdlib.h> |
-#include <stdio.h> |
-#include "pcivme_ni.h" |
-#include "wienvme_dll.h" |
-//----------- DEFINES ----------------------------------------------------- |
-#define DEVICENAME_LINUX "/dev/vmemm_1" // a device name 'template' for WINNT |
- |
-usb_dev_handle *udev; |
- |
- |
- |
- |
-int VME_start (char* serial) |
-{ |
- |
- char serial_default[100]; |
- sprintf(serial_default, "VM0120"); |
- if (serial != NULL) |
- udev = xxusb_serial_open(serial); |
- else |
- udev = xxusb_serial_open(serial_default); |
- printf(" VME_start %s--->udev!=NULL ==>%d\n", serial, udev!=NULL); |
- if (!udev) { |
- printf(" Check usb udev permissions and restart! Exiting .....\n", serial, udev!=NULL); |
- exit(-1); |
- } |
- return 0; |
-} |
- |
- |
- |
-int VME_stop () |
-{ |
- if (udev) xxusb_device_close(udev); |
- |
- |
- return 0; |
-} |
- |
-short Address_Modifier= Std_NoPriv_Data; |
- |
-int VME_read16 (Uint32_t at, void* buff) |
-{ |
- int result; |
- |
-/* D16 read */ |
- |
- result = VME_read_16(udev, Address_Modifier, at , (Uint32_t *) buff); |
- if (result <0) { |
- printf("D16 read at 0x%X failed! err=%d\n", at,result); |
- } |
-// printf("0x%X, 0x%X, 0x%X, 0x%X\n", hHandle, at, n, * (unsigned short *) buff); |
- return (result); |
-} |
- |
-int VME_read32 (Uint32_t at, void* buff) |
-{ |
- int result; |
- |
-/* D32 read */ |
- |
- result = VME_read_32(udev, Address_Modifier, at , (Uint32_t *) buff); |
- if (result < 0) { |
- printf("D32 read at 0x%X failed err=%d!\n", at,result); |
- } |
- //printf("0x%X, 0x%X, 0x%X, 0x%X\n", hHandle, at, n, * (unsigned short *) buff); |
- return (result); |
-} |
- |
-int VME_write16 (Uint32_t at, void* buff) |
-{ |
- int result; |
- Uint32_t data= *((short *)buff); |
- |
-/* D16 write */ |
- |
- result = VME_write_16(udev, Address_Modifier, at, data ); |
- if (result<0) { |
- printf("D16 write at 0x%X failed! err=%d\n", at,result); |
- } |
- return (result); |
-} |
- |
-int VME_write32 ( Uint32_t at, void* buff) |
-{ |
- int result; |
- Uint32_t data= *((Uint32_t *)buff); |
- |
-/* D32 write */ |
- |
- result = VME_write_32(udev, Address_Modifier, at, data ); |
- |
- if (result<0) { |
- printf("D32 write at 0x%X failed! err=%d\n", at,result); |
- } |
- //printf("D32 write at 0x%lX buff=0x%X\n", at,((int*) buff)[0]); |
- return (result); |
-} |
/petdaqfmf/wienvmeusb_dll.c |
Property changes: |
Deleted: svn:executable |
Index: petdaqfmf/LinkDef.h |
=================================================================== |
--- petdaqfmf/LinkDef.h (revision 112) |
+++ petdaqfmf/LinkDef.h (nonexistent) |
@@ -1,10 +0,0 @@ |
-#ifdef __CINT__ |
- |
-#pragma link off all globals; |
-#pragma link off all classes; |
-#pragma link off all functions; |
- |
-#pragma link C++ class daq; |
- |
-#endif |
- |
Index: petdaqfmf/VmUsbStack.C |
=================================================================== |
--- petdaqfmf/VmUsbStack.C (revision 112) |
+++ petdaqfmf/VmUsbStack.C (nonexistent) |
@@ -1,124 +0,0 @@ |
-#include <stdio.h> |
-#include <vector> |
-#include "VmUsbStack.h" |
- |
-VmUsbStack::VmUsbStack(){ |
- fStack.push_back(0x1); |
- fStack.push_back(0x0); |
-} |
- |
-VmUsbStack::~VmUsbStack(){ |
- fStack.clear(); |
-} |
- |
-int VmUsbStack::Get(int maxn, int *stack){ |
- for (int i=0;i<fStack.size();i++){ |
- if (i<maxn) stack[i]=fStack[i]; else return -1; |
- } |
- return fStack[0]; |
-} |
- |
- |
-void VmUsbStack::Append(int cmd, int addr ){ |
- fStack.push_back(cmd & 0xFFFF); |
- fStack.push_back(cmd >> 16); |
- fStack.push_back(addr&0xFFFF); |
- fStack.push_back((addr >> 16)& 0xFFFF); |
- fStack[0]=fStack.size()-1; |
-} |
- |
-void VmUsbStack::Append(int cmd, int addr , int data){ |
- Append( cmd, addr ); |
- fStack.push_back(data&0xFFFF); |
- fStack.push_back((data >> 16)&0xFFFF); |
- fStack[0] = fStack.size()-1; |
-} |
- |
-void VmUsbStack::ReadA24D16(int addr ){ |
- Append(CMD_READ | CMD_A24 , CMD_D16 | addr); |
-} |
- |
-void VmUsbStack::WriteA24D16(int addr, int data){ |
- return Append(CMD_WRITE | CMD_A24,CMD_D16 | addr, data); |
-} |
- |
-void VmUsbStack::ReadA24D32(int addr ){ |
- Append(CMD_READ | CMD_A24 , CMD_D32 | addr); |
-} |
- |
-void VmUsbStack::WriteA24D32(int addr, int data){ |
- return Append(CMD_WRITE | CMD_A24 , CMD_D32 | addr, data); |
-} |
- |
-void VmUsbStack::ReadA32D16(int addr ){ |
- Append(CMD_READ | CMD_A32 , CMD_D16| addr); |
-} |
- |
-void VmUsbStack::WriteA32D16(int addr, int data){ |
- return Append(CMD_WRITE | CMD_A32 , CMD_D16 | addr, data); |
-} |
- |
-void VmUsbStack::ReadA32D32(int addr ){ |
- Append(CMD_READ | CMD_A32 , CMD_D32 | addr); |
-} |
- |
-void VmUsbStack::WriteA32D32(int addr, int data){ |
- return Append(CMD_WRITE | CMD_A32 , CMD_D32| addr, data); |
-} |
- |
- |
-void VmUsbStack::Marker(int marker){ |
- return Append(CMD_MRK, marker); |
-} |
- |
-void VmUsbStack::ConditionalRead(int adr_mod,int d16d32, int addr, int bmask){ |
- Append(CMD_READ| CMD_HD | adr_mod ,addr); |
- Append(CMD_READ| CMD_HD | CMD_HM |adr_mod, d16d32 |addr,bmask); |
-} |
- |
-void VmUsbStack::RepeatRead(int adr_mod,int d16d32, int baseaddr, int n, int increment){ |
- for (int i=0;i<n;i++) Append( adr_mod | CMD_READ, d16d32 +baseaddr + i*increment); |
-} |
-void VmUsbStack::RepeatWrite(int adr_mod,int d16d32,int baseaddr, int n, int increment, int data){ |
- for (int i=0;i<n;i++) Append( adr_mod | CMD_WRITE,d16d32 + baseaddr+i*increment, data); |
-} |
- |
-void VmUsbStack::Print(){ |
- for (int i=0; i < fStack.size();i++) printf("0x%04x\n",fStack[i]); |
- printf("%d %d __________________________________\n",fStack.size(),fStack[0]); |
-} |
- |
-#ifdef MAIN |
-#include "CAENV965_DEF.h" |
-#define CAEN_V965 0x340000 |
- |
-int main(){ |
-// INIT stackdata |
-int geo=1,fPedestal=255; |
-VmUsbStack *init=new VmUsbStack(); |
-init->Write(CAEN_V965 + CAENV965_CRN, 0x0); |
-init->Write(CAEN_V965 + CAENV965_GEO, geo); |
-init->RepeatWrite( CAEN_V965 + CAENV965_THM, 32, 0x02,0x0); // threshold/kill for 32 channels, 2*i addr increment |
-init->Write( CAEN_V965 + CAENV965_BS1, 0x80 ); // soft reset |
-init->Write( CAEN_V965 + CAENV965_BC1, 0x80 ); // soft reset |
-init->Write( CAEN_V965 + CAENV965_PED, fPedestal ); // pedestal |
-init->Write(CAEN_V965 + CAENV965_BS2,0x5000); |
-init->Write(CAEN_V965 + CAENV965_BS2,0x4); // clear module |
-init->Write(CAEN_V965 + CAENV965_BC2,0x4); |
-init->Print(); |
- |
-// READOUT stackdata |
-VmUsbStack *stack=new VmUsbStack(); |
-stack->Write(CAEN_V965 + CAENV965_BS2,0x4); // clear module |
-stack->Write(CAEN_V965 + CAENV965_BC2,0x4); |
-stack->ConditionalRead(CAEN_V965 + CAENV965_SR1,0x1); // TRG wait : loop until bit 0 is on |
-stack->ConditionalRead(CAEN_V965 + CAENV965_OB ,0x4000000) ; // loop until bit 26 is on, read data |
-stack->Marker(0xFAFB); |
-stack->Print(); |
- |
- int st[1000]; |
- int nb= stack->Get(1000,st); |
- for (int i=0;i<nb;i++) if (st[i]!=stack->fStack[i]) printf("error i=%d 0x%04x 0x%04x \n",i,st[i],stack->fStack[i] ); |
- return 0; |
-} |
-#endif |
Index: petdaqfmf/CAENV965_DEF.h |
=================================================================== |
--- petdaqfmf/CAENV965_DEF.h (revision 112) |
+++ petdaqfmf/CAENV965_DEF.h (nonexistent) |
@@ -1,22 +0,0 @@ |
-#ifndef _CAENV965_DEF_H |
-#define _CAENV965_DEF_H |
- |
-#define CAENV965_OB 0x0 |
-#define CAENV965_FW 0x1000 |
-#define CAENV965_GEO 0x1002 |
-#define CAENV965_MCA 0x1004 |
-#define CAENV965_BS1 0x1006 |
-#define CAENV965_BC1 0x1008 |
-#define CAENV965_SR1 0x100E |
-#define CAENV965_CR1 0x1010 |
-#define CAENV965_ADH 0x1012 |
-#define CAENV965_ADL 0x1014 |
-#define CAENV965_SR2 0x1022 |
-#define CAENV965_BS2 0x1032 |
-#define CAENV965_BC2 0x1034 |
-#define CAENV965_CRN 0x103C |
-#define CAENV965_ECR 0x1040 |
-#define CAENV965_PED 0x1060 |
-#define CAENV965_THM 0x1080 |
- |
-#endif |
Index: petdaqfmf/gui.C |
=================================================================== |
--- petdaqfmf/gui.C (revision 112) |
+++ petdaqfmf/gui.C (nonexistent) |
@@ -1,455 +0,0 @@ |
-// By ROOT version 5.17/02 on 2008-03-13 06:46:41 |
- |
-#ifndef ROOT_TGDockableFrame |
-#include "TGDockableFrame.h" |
-#endif |
-#ifndef ROOT_TGMenu |
-#include "TGMenu.h" |
-#endif |
-#ifndef ROOT_TGMdiDecorFrame |
-#include "TGMdiDecorFrame.h" |
-#endif |
-#ifndef ROOT_TG3DLine |
-#include "TG3DLine.h" |
-#endif |
-#ifndef ROOT_TGMdiFrame |
-#include "TGMdiFrame.h" |
-#endif |
-#ifndef ROOT_TGMdiMainFrame |
-#include "TGMdiMainFrame.h" |
-#endif |
-#ifndef ROOT_TGuiBldHintsButton |
-#include "TGuiBldHintsButton.h" |
-#endif |
-#ifndef ROOT_TGMdiMenu |
-#include "TGMdiMenu.h" |
-#endif |
-#ifndef ROOT_TGListBox |
-#include "TGListBox.h" |
-#endif |
-#ifndef ROOT_TGNumberEntry |
-#include "TGNumberEntry.h" |
-#endif |
-#ifndef ROOT_TGScrollBar |
-#include "TGScrollBar.h" |
-#endif |
-#ifndef ROOT_TGuiBldHintsEditor |
-#include "TGuiBldHintsEditor.h" |
-#endif |
-#ifndef ROOT_TRootBrowser |
-#include "TRootBrowser.h" |
-#endif |
-#ifndef ROOT_TGFrame |
-#include "TGFrame.h" |
-#endif |
-#ifndef ROOT_TGFileDialog |
-#include "TGFileDialog.h" |
-#endif |
-#ifndef ROOT_TGShutter |
-#include "TGShutter.h" |
-#endif |
-#ifndef ROOT_TGButtonGroup |
-#include "TGButtonGroup.h" |
-#endif |
-#ifndef ROOT_TGCanvas |
-#include "TGCanvas.h" |
-#endif |
-#ifndef ROOT_TGFSContainer |
-#include "TGFSContainer.h" |
-#endif |
-#ifndef ROOT_TGButton |
-#include "TGButton.h" |
-#endif |
-#ifndef ROOT_TGuiBldEditor |
-#include "TGuiBldEditor.h" |
-#endif |
-#ifndef ROOT_TGTextEdit |
-#include "TGTextEdit.h" |
-#endif |
-#ifndef ROOT_TGFSComboBox |
-#include "TGFSComboBox.h" |
-#endif |
-#ifndef ROOT_TGLabel |
-#include "TGLabel.h" |
-#endif |
-#ifndef ROOT_TGView |
-#include "TGView.h" |
-#endif |
-#ifndef ROOT_TRootGuiBuilder |
-#include "TRootGuiBuilder.h" |
-#endif |
-#ifndef ROOT_TGTab |
-#include "TGTab.h" |
-#endif |
-#ifndef ROOT_TGListView |
-#include "TGListView.h" |
-#endif |
-#ifndef ROOT_TGSplitter |
-#include "TGSplitter.h" |
-#endif |
-#ifndef ROOT_TGStatusBar |
-#include "TGStatusBar.h" |
-#endif |
-#ifndef ROOT_TGListTree |
-#include "TGListTree.h" |
-#endif |
-#ifndef ROOT_TGToolTip |
-#include "TGToolTip.h" |
-#endif |
-#ifndef ROOT_TGToolBar |
-#include "TGToolBar.h" |
-#endif |
-#ifndef ROOT_TRootEmbeddedCanvas |
-#include "TRootEmbeddedCanvas.h" |
-#endif |
-#ifndef ROOT_TCanvas |
-#include "TCanvas.h" |
-#endif |
-#ifndef ROOT_TGuiBldDragManager |
-#include "TGuiBldDragManager.h" |
-#endif |
- |
-#include "Riostream.h" |
-#include "TApplication.h" |
-#include "TROOT.h" |
-#include "TSystem.h" |
-#include "TGraph.h" |
-#include "TH1F.h" |
-#include "daq.h" |
- |
-TGTextButton *gTextButton[10]; |
-TCanvas *fCanvas; |
-TGMainFrame *fMain; |
-TGTextEntry *gFilename; |
-TGNumberEntry *gPedestal; |
-TGNumberEntry *gCh; |
-TGNumberEntry *gMaxEve; |
-TGNumberEntry *gNeve; |
-TGTextEntry *gTimeDisplay; |
-TGCheckButton *gCheckButton; |
- |
- |
-TRootEmbeddedCanvas *gCanvas; |
-#define MAXCH 32 |
-TH1F* gHisto[MAXCH]; |
-daq * gDaq; |
-#define WINDOW_NAME "ADC CAEN V965" |
-//---------------------------------------------------- |
-int UIRDimming(int state){ |
- switch (state) { |
- case 0: |
- gTextButton[0]->SetEnabled(0); |
- gTextButton[1]->SetEnabled(1); |
- gTextButton[2]->SetEnabled(0); |
- |
- break; |
- |
- case 1: |
- gTextButton[0]->SetEnabled(0); |
- gTextButton[1]->SetEnabled(0); |
- gTextButton[2]->SetEnabled(1); |
- |
- break; |
- |
- case 2: |
- gTextButton[0]->SetEnabled(1); |
- gTextButton[1]->SetEnabled(1); |
- gTextButton[2]->SetEnabled(0); |
- break; |
- |
- default: |
- break; |
- } |
- return 0; |
-} |
- |
-int fDebug; |
-void GetDebug(){ |
- if ( gCheckButton->IsOn() ) fDebug=1; |
- else fDebug=0; |
-} |
- |
-int GetTime(char *x){ |
- int ret; |
- time_t rawtime; |
- static time_t oldtime=-1; |
- struct tm * timeinfo; |
- time ( &rawtime ); |
- ret = (oldtime==rawtime); |
- timeinfo = localtime ( &rawtime ); |
- sprintf(x,"%s",asctime (timeinfo)); |
- int len=strlen(x); |
- if (len) x[len-1]=0; |
- return ret; |
-} |
-void MyTimer(){ |
- char cmd[100]; |
- if (!GetTime(cmd)){ |
- if (gTimeDisplay) gTimeDisplay->SetText(cmd); |
- if (gCanvas){ |
- gCanvas->GetCanvas()->Modified(); |
- gCanvas->GetCanvas()->Update(); |
- } |
- } |
-} |
- |
-//---------------------------------------------------- |
-// thread function |
-int gStop=0; |
-#define BSIZE 10000 |
-unsigned long gBuf[BSIZE]; |
-void Run(){ |
- printf("Start of Run\n" ); |
- |
- // odpremo datoteko za pisanje |
- int counters[10]={0,0,0,0,0, 0,0,0,0,0}; |
- char names[20][20]={"CAENV 1290","CAEN V965","LC2277","LC2277","LC2277"}; |
- |
- char fname[128]; |
- sprintf(fname,"%s.dat",gFilename->GetText()); |
- FILE *fp=fopen(fname,"w"); |
- int neve = (int) gMaxEve->GetNumber(); |
- int hdr[4]={1}; |
- |
- if (gDaq) gDaq->fStop=0; |
- // zajem zeljenega kolicine podatkov |
- for (int n=0;n<neve;n++){ |
- if (!gDaq) break; |
- int nb = gDaq->event(gBuf,BSIZE,counters,1); |
- if (gDaq->fStop) break; |
- // zapis v datoteko |
- hdr[1]=nb+4*sizeof(int); |
- hdr[2]=time(NULL); |
- hdr[3]=n; |
- |
- fwrite(hdr, sizeof(int),4 , fp); |
- if (nb) fwrite(gBuf, 1,nb, fp); |
- // napolni histograme |
- int nint= nb/4; |
- |
- int ii=0; |
- |
- while (ii<nint){ |
- |
- int recid=gBuf[ii++]; |
- int len =gBuf[ii++]; |
- unsigned int *dbuf= (unsigned int *)&gBuf[ii]; |
- if (n%1000==0) printf("%d 0x%03x Len=%d\n",n,recid,len); |
- unsigned short edge; |
- |
- if (recid==0x130){ |
- for (int i=0; i<len; i++) { |
- int dtype=(dbuf[i]>>25)&0x3; |
- if (dtype==0) { |
- int ch=(dbuf[i]>>17)&0xf; |
- if (2*ch<MAXCH) { |
- int rg=(dbuf[i]>>16)&0x1; |
- int adc=dbuf[i]&0xfff; |
- gHisto[2*ch+rg]->Fill(adc); |
- // printf("V965 0x%08x nev=%4d %d. [ch=%2d] range=%d data=%d \n",dbuf[i],n,i,ch,rg,adc); |
- } |
- } |
- } |
- } // if (recid==0x130) |
- ii+=len; |
- } |
- /* |
- // decode |
- |
- int nint=nb/sizeof(int); |
- |
- for (int i=0;i<nint;i++){ |
- unsigned short tdc = gBuf[i]&0xFFFF; |
- unsigned short ch = (gBuf[i] >> 17 ) &0x1F; |
- unsigned short edge = (gBuf[i] >> 16 ) &0x1; |
- if (edge && ch < MAXCH) gHisto[ch]->Fill(tdc); |
- if (fDebug) printf("nev=%4d %d. [ch=%2d] egde=%d data=%d",n,i,ch,edge,tdc); |
- } |
- */ |
- gSystem->ProcessEvents(); |
- MyTimer(); |
- gNeve->SetNumber(n); |
- } |
- fclose(fp); |
- UIRDimming(2); |
- printf("End of MyThread neve=%d\n",neve); |
- |
-} |
- |
- |
-int save2ascii(){ |
- if (!gHisto[0]) return 0; |
- char fname[128]; |
- sprintf(fname,"%s.txt",gFilename->GetText()); |
- FILE *fp= fopen(fname, "w"); |
- fprintf(fp, "%s\n",WINDOW_NAME); |
- char cmd[128]; |
- GetTime(cmd); |
- fprintf(fp, "Shranjeno: %s\n\n", cmd ); |
- fprintf(fp, "Kanal hid=") ; |
- for (int j=0;j<MAXCH;j++) fprintf(fp, "%d\t",j); |
- fprintf(fp, "\n-------------------------------------------------\n"); |
- for (int i=0;i<gHisto[0]->GetNbinsX();i++){ |
- fprintf(fp, "%d\t",i); |
- for (int j=0;j<MAXCH;j++) fprintf(fp, "%d\t",(int) gHisto[j]->GetBinContent(i+1)); |
- fprintf(fp, "\n"); |
- } |
- fclose(fp); |
- printf("Histogram content is dumped to the file %s\n",fname); |
- return 0; |
- } |
- |
-void MyEventHandler(int i){ |
- |
- UIRDimming(i); |
- |
- switch (i) { |
- case 0: // Init |
- gDaq->fPedestal = (int)(gPedestal->GetNumber()); |
- gDaq->init(); |
- break; |
- case 1: // Start |
- Run(); |
- case 2: // Stop |
- gDaq->fStop=1; |
- case 3: // ReDraw |
- gCanvas->GetCanvas()->Modified(); |
- gCanvas->GetCanvas()->Update(); |
- break; |
- case 4: // Clear |
- for (int j=0;j<MAXCH;j++) if (gHisto[j]) gHisto[j]->Reset(); |
- break; |
- case 5: // Save |
- save2ascii(); |
- break; |
- case 6: // Print |
- gCanvas->GetCanvas()->SaveAs("zivljenjski_cas_mionov.pdf"); |
- break; |
- case 7: // exit |
- gApplication->Terminate(0); |
- break; |
- } |
- |
-} |
- |
-int Redraw(long val=0){ |
- unsigned int ch= (unsigned int)(gCh->GetNumber()); |
- if (ch<MAXCH && gHisto[ch]) { |
- gCanvas->GetCanvas()->cd(); |
- gHisto[ch]->Draw(); |
- gCanvas->GetCanvas()->Modified(); |
- gCanvas->GetCanvas()->Update(); |
- } else { |
- if (gCh->GetNumber()>=MAXCH) gCh->SetNumber(MAXCH-1); |
- if (gCh->GetNumber()< 0) gCh->SetNumber(0); |
- } |
- return 0; |
-} |
-//---------------------------------------------------- |
- |
-int gui(){ |
- |
- for (int i=0;i<MAXCH;i++){ |
- char hname[50]; |
- sprintf(hname,"Ch. %d Rg.%d;ADC;N",i/2,i%2); |
- char hn[50]; |
- sprintf(hn,"ch%d",i); |
- gHisto[i] = new TH1F(hn,hname,4096,-0.5,4095.5); |
- } |
- gDaq= new daq(); |
- fMain = new TGMainFrame(0,800,800); |
- TGHorizontalFrame *fH=new TGHorizontalFrame(fMain,800,400); |
- //------------------------------------------------------------ |
- TGLayoutHints *f0= new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2); |
- TGLayoutHints *layout2= new TGLayoutHints(kLHintsLeft | kLHintsTop,20,20,20,20); |
- // gumbi |
- |
- int nbut=8; |
- const char *names[10]={"Init","Start","Stop","Refresh","Clear","Save", "Print" , "Exit"}; |
- for (int i=0;i<nbut;i++){ |
- |
- gTextButton[i]= new TGTextButton(fH, names[i]); |
- gTextButton[i]->SetTextJustify(36); |
- gTextButton[i]->SetMargins(0,0,0,0); |
- gTextButton[i]->SetWrapLength(-1); |
- gTextButton[i]->Resize(50,22); |
- fH->AddFrame(gTextButton[i], layout2); |
- char cmd[50]; |
- sprintf(cmd,"MyEventHandler(=%d)",i); |
- TQObject::Connect(gTextButton[i],"Clicked()",0,0,cmd); |
- } |
- |
- gCheckButton = new TGCheckButton( fH,"Debug"); |
- gCheckButton->Resize(50,22); |
- TQObject::Connect(gCheckButton,"Clicked()", 0, 0 , "GetDebug()"); |
- gCheckButton->SetState(kButtonDown); |
- fH->AddFrame(gCheckButton, f0); |
- |
- fMain->AddFrame(fH , f0); |
- //--------------------------------------------------------- |
- // ura |
- TGLabel *lab1; |
- fH=new TGHorizontalFrame(fMain,800,200); |
- lab1 = new TGLabel( fH ,"Time:"); |
- fH->AddFrame(lab1, f0); |
- gTimeDisplay = new TGTextEntry( fH,""); |
- gTimeDisplay->Resize(200,22); |
- fH->AddFrame(gTimeDisplay, f0); |
- fMain->AddFrame(fH , f0); |
- //--------------------------------------------------------- |
- // inputi |
- fH=new TGHorizontalFrame(fMain,800,200); |
- lab1 = new TGLabel( fH ,"Filename:"); |
- fH->AddFrame(lab1, f0); |
- gFilename = new TGTextEntry( fH,"filename"); |
- gFilename->Resize(200,22); |
- fH->AddFrame(gFilename, f0); |
- fMain->AddFrame(fH , f0); |
- //--------------------------------------------------------- |
- fH=new TGHorizontalFrame(fMain,800,200); |
- lab1 = new TGLabel( fH ,"ADC Pedestal:"); |
- fH->AddFrame(lab1, f0); |
- gPedestal = new TGNumberEntry( fH,100); |
- gPedestal->Resize(100,22); |
- fH->AddFrame(gPedestal, f0); |
- fMain->AddFrame(fH , f0); |
- //--------------------------------------------------------- |
- fH=new TGHorizontalFrame(fMain,800,200); |
- lab1 = new TGLabel( fH ,"N of events to acquire:"); |
- fH->AddFrame(lab1, f0); |
- gMaxEve = new TGNumberEntry( fH,10000); |
- gMaxEve->Resize(100,22); |
- fH->AddFrame(gMaxEve, f0); |
- fMain->AddFrame(fH , f0); |
- //--------------------------------------------------------- |
- fH=new TGHorizontalFrame(fMain,800,200); |
- lab1 = new TGLabel( fH ,"Number of events:"); |
- fH->AddFrame(lab1, f0); |
- gNeve = new TGNumberEntry( fH,0); |
- gNeve->Resize(100,22); |
- fH->AddFrame(gNeve, f0); |
- fMain->AddFrame(fH , f0); |
- //--------------------------------------------------------- |
- // canvas |
- fH=new TGHorizontalFrame(fMain,800,200); |
- gCanvas = new TRootEmbeddedCanvas ("gCanvas",fH,800,400); |
- fH->AddFrame(gCanvas, f0); |
- fMain->AddFrame(fH , f0); |
- //------------------------------------------------------------ |
- fH=new TGHorizontalFrame(fMain,800,200); |
- lab1 = new TGLabel( fH ,"Channel number (0..31):"); |
- fH->AddFrame(lab1, f0); |
- gCh = new TGNumberEntry( fH,0); |
- fH->AddFrame(gCh, f0); |
- TQObject::Connect(gCh,"ValueSet(Long_t)",0,0,"Redraw(Long_t )"); |
- |
- fMain->AddFrame(fH , f0); |
- //------------------------------------------------------------ |
- fMain->SetWindowName(WINDOW_NAME); |
- fMain->MapSubwindows(); |
- fMain->Resize(fMain->GetDefaultSize()); |
- fMain->MapWindow(); |
- Redraw(); |
- GetDebug(); |
- return 0; |
-} |
Index: petdaqfmf/VmUsbStack.h |
=================================================================== |
--- petdaqfmf/VmUsbStack.h (revision 112) |
+++ petdaqfmf/VmUsbStack.h (nonexistent) |
@@ -1,45 +0,0 @@ |
-#ifndef VMUSBSTACK_H |
-#define VMUSBSTACK_H |
-#define CMD_WRITE 0x000 |
-#define CMD_READ 0x100 |
-#define CMD_A24 0x039 |
-#define CMD_A32 0x009 |
-#define CMD_HM 0x80000 |
-#define CMD_HD 0x20000 |
-#define CMD_MRK 0x2000 |
-#define CMD_DLY 0x8000 |
-#define CMD_BLT 0xFF000000 |
- |
-#define CMD_D16 1 |
-#define CMD_D32 0 |
- |
-#include <vector> |
-class VmUsbStack { |
- public: |
- VmUsbStack(); |
- ~VmUsbStack(); |
- std::vector<int> fStack; |
- void Append(int cmd, int marker); |
- void Append(int cmd, int addr, int data); |
- |
- void Marker(int marker); |
- void WriteA32D16(int addr, int data); |
- void ReadA32D16(int addr ); |
- void WriteA32D32(int addr, int data); |
- void ReadA32D32(int addr ); |
- |
- void WriteA24D16(int addr, int data); |
- void ReadA24D16(int addr ); |
- void WriteA24D32(int addr, int data); |
- void ReadA24D32(int addr ); |
- |
- void ConditionalRead(int am ,int d16d32,int addr, int data); |
- void RepeatRead(int addr_modifier,int d16d32, int baseaddr, int n, int increment); |
- void RepeatWrite(int addr_modifier,int d16d32, int baseaddr, int n, int increment, int data); |
- |
- int Get(int maxn, int *stack); |
- void Print(); |
-}; |
- |
- |
-#endif |
Index: petdaqfmf/Dict.h |
=================================================================== |
--- petdaqfmf/Dict.h (revision 112) |
+++ petdaqfmf/Dict.h (nonexistent) |
@@ -1,44 +0,0 @@ |
-/******************************************************************** |
-* Dict.h |
-* CAUTION: DON'T CHANGE THIS FILE. THIS FILE IS AUTOMATICALLY GENERATED |
-* FROM HEADER FILES LISTED IN G__setup_cpp_environmentXXX(). |
-* CHANGE THOSE HEADER FILES AND REGENERATE THIS FILE. |
-********************************************************************/ |
-#ifdef __CINT__ |
-#error Dict.h/C is only for compilation. Abort cint. |
-#endif |
-#include <stddef.h> |
-#include <stdio.h> |
-#include <stdlib.h> |
-#include <math.h> |
-#include <string.h> |
-#define G__ANSIHEADER |
-#define G__DICTIONARY |
-#include "G__ci.h" |
-extern "C" { |
-extern void G__cpp_setup_tagtableDict(); |
-extern void G__cpp_setup_inheritanceDict(); |
-extern void G__cpp_setup_typetableDict(); |
-extern void G__cpp_setup_memvarDict(); |
-extern void G__cpp_setup_globalDict(); |
-extern void G__cpp_setup_memfuncDict(); |
-extern void G__cpp_setup_funcDict(); |
-extern void G__set_cpp_environmentDict(); |
-} |
- |
- |
-#include "TObject.h" |
-#include "TMemberInspector.h" |
-#include "daq.h" |
-#include <algorithm> |
-namespace std { } |
-using namespace std; |
- |
-#ifndef G__MEMFUNCBODY |
-#endif |
- |
-extern G__linked_taginfo G__DictLN_vectorlEintcOallocatorlEintgRsPgR; |
-extern G__linked_taginfo G__DictLN_VmUsbStack; |
-extern G__linked_taginfo G__DictLN_daq; |
- |
-/* STUB derived class for protected member access */ |