예제 #1
0
 public static void initBiases()
 {
     if (init == false)
     {
         bias_bytes = new byte[114];
         populateLookupTables();
         programDACs();
         ATISinterface.setWire(ATISinterface.ControlSignals.BGenPower_Up);
         init = true;
     }
 }
 private void boxEnableTD_Checked(object sender, RoutedEventArgs e)
 {
     ATISinterface.setWire(ATISinterface.ControlSignals.Enable_AER_TD);
 }
 private void btnShutter_Click(object sender, RoutedEventArgs e)
 {
     ATISinterface.setWire(ATISinterface.ControlSignals.shutter);
     ATISinterface.clearWire(ATISinterface.ControlSignals.shutter);
 }
 private void boxAPSsequential_Checked(object sender, RoutedEventArgs e)
 {
     ATISinterface.setWire(ATISinterface.ControlSignals.sequential);
 }
 private void boxCouple_Checked(object sender, RoutedEventArgs e)
 {
     ATISinterface.setWire(ATISinterface.ControlSignals.couple);
 }
 private void boxTDROIinv_Checked(object sender, RoutedEventArgs e)
 {
     ATISinterface.setWire(ATISinterface.ControlSignals.ROI_TD_inv);
 }
 private void boxAPSROI_Checked(object sender, RoutedEventArgs e)
 {
     ATISinterface.setWire(ATISinterface.ControlSignals.APS_ROI_en);
 }
예제 #8
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            #region "color definitions"
            //The 12 S1 colours
            List <System.Windows.Media.Color> colors = new List <System.Windows.Media.Color>();
            colors.Add(Color.FromRgb(0, 0, 0));
            colors.Add(Color.FromRgb(255, 0, 0));
            colors.Add(Color.FromRgb(255, 128, 0));
            colors.Add(Color.FromRgb(255, 255, 0));
            colors.Add(Color.FromRgb(128, 255, 0));
            colors.Add(Color.FromRgb(0, 255, 0));
            colors.Add(Color.FromRgb(0, 255, 128));
            colors.Add(Color.FromRgb(0, 255, 255));
            colors.Add(Color.FromRgb(0, 128, 255));
            colors.Add(Color.FromRgb(0, 0, 255));
            colors.Add(Color.FromRgb(128, 0, 255));
            colors.Add(Color.FromRgb(255, 0, 255));
            colors.Add(Color.FromRgb(128, 0, 128));
            BitmapPalette myPalette = new BitmapPalette(colors);

            //The 36 S2 colours
            List <System.Windows.Media.Color> fullcolors = new List <System.Windows.Media.Color>();
            fullcolors.Add(Color.FromRgb(0, 0, 0));
            fullcolors.Add(Color.FromRgb(255, 42, 0));
            fullcolors.Add(Color.FromRgb(255, 85, 0));
            fullcolors.Add(Color.FromRgb(255, 128, 0));
            fullcolors.Add(Color.FromRgb(255, 170, 0));
            fullcolors.Add(Color.FromRgb(255, 213, 0));
            fullcolors.Add(Color.FromRgb(255, 255, 0));
            fullcolors.Add(Color.FromRgb(212, 255, 0));
            fullcolors.Add(Color.FromRgb(170, 255, 0));
            fullcolors.Add(Color.FromRgb(128, 255, 0));
            fullcolors.Add(Color.FromRgb(85, 255, 0));
            fullcolors.Add(Color.FromRgb(42, 255, 0));
            fullcolors.Add(Color.FromRgb(0, 255, 0));
            fullcolors.Add(Color.FromRgb(0, 255, 42));
            fullcolors.Add(Color.FromRgb(0, 255, 85));
            fullcolors.Add(Color.FromRgb(0, 255, 128));
            fullcolors.Add(Color.FromRgb(0, 255, 170));
            fullcolors.Add(Color.FromRgb(0, 255, 212));
            fullcolors.Add(Color.FromRgb(0, 255, 255));
            fullcolors.Add(Color.FromRgb(0, 212, 255));
            fullcolors.Add(Color.FromRgb(0, 170, 255));
            fullcolors.Add(Color.FromRgb(0, 128, 255));
            fullcolors.Add(Color.FromRgb(0, 85, 255));
            fullcolors.Add(Color.FromRgb(0, 43, 255));
            fullcolors.Add(Color.FromRgb(0, 0, 255));
            fullcolors.Add(Color.FromRgb(42, 0, 255));
            fullcolors.Add(Color.FromRgb(85, 0, 255));
            fullcolors.Add(Color.FromRgb(128, 0, 255));
            fullcolors.Add(Color.FromRgb(170, 0, 255));
            fullcolors.Add(Color.FromRgb(212, 0, 255));
            fullcolors.Add(Color.FromRgb(255, 0, 255));
            fullcolors.Add(Color.FromRgb(255, 0, 212));
            fullcolors.Add(Color.FromRgb(255, 0, 170));
            fullcolors.Add(Color.FromRgb(128, 0, 128));
            fullcolors.Add(Color.FromRgb(128, 0, 85));
            fullcolors.Add(Color.FromRgb(128, 0, 43));
            BitmapPalette myfullPalette = new BitmapPalette(fullcolors);

            //The 3 TD "colours"
            List <System.Windows.Media.Color> colorsBW = new List <System.Windows.Media.Color>();
            colorsBW.Add(Color.FromRgb(128, 128, 128));
            colorsBW.Add(Color.FromRgb(0, 0, 0));
            colorsBW.Add(Color.FromRgb(255, 255, 255));
            BitmapPalette myBWPalette = new BitmapPalette(colorsBW);
            #endregion

            _TDbackBuffer  = new WriteableBitmap(304, 240, 96, 96, PixelFormats.Indexed8, myBWPalette);
            _APSbackBuffer = new WriteableBitmap(304, 240, 96, 96, PixelFormats.Gray8, null);

            ATISinterface.initATIS("ramtest.bit");
            BiasesInterface.initBiases();

            ATISinterface.setWire(ATISinterface.ControlSignals.Enable_AER_TD);
            ATISinterface.setWire(ATISinterface.ControlSignals.Enable_AER_APS);
            ATISinterface.resetFifos();

            /*
             * //init HMAX
             * ATIS.setHMAXThreshold(ATISinterface.HMAXlayer.S1, 150);
             * ATIS.setHMAXDecay(ATISinterface.HMAXlayer.S1, 1);
             * ATIS.setHMAXThreshold(ATISinterface.HMAXlayer.C1, 5); //actually a refractory period...
             * ATIS.setHMAXThreshold(ATISinterface.HMAXlayer.S2, 150);
             * ATIS.setHMAXDecay(ATISinterface.HMAXlayer.S2, 1);
             *
             * ATIS.programHMAXkernels(ATISinterface.HMAXlayer.S2, "S2Kernels.val");
             * //ATIS.programHMAXkernels(ATISinterface.HMAXlayer.S1, "S1Kernels.val");
             */

            ATISinterface.setWire(ATISinterface.ControlSignals.couple);

            AcquisitionThread();
        }