Exemplo n.º 1
0
        public void CommitSettings()
        {
            if (hardwareInterface.Destroyed)
            {
                throw new ScopeIOException("Cannot commit settings, hardware interface gone");
            }
            try
            {
                bool acquisitionUpdateRequired = false;
                bool viewUpdateRequired        = false;

                PicMemory.Commit();
                AdcMemory.Commit();
                List <MemoryRegister> FpgaRegisters = FpgaSettingsMemory.Commit();
                List <MemoryRegister> FpgaStrobes   = StrobeMemory.Commit();

                var FpgaRegistersAddresses = FpgaRegisters.Select(x => (REG)x.Address);
                if (FpgaRegistersAddresses.Where(x => Constants.AcquisitionRegisters.Contains(x)).Count() > 0)
                {
                    acquisitionUpdateRequired = true;
                }
                if (FpgaRegistersAddresses.Where(x => Constants.ViewRegisters.Contains(x)).Count() > 0)
                {
                    viewUpdateRequired = true;
                }
                if (!acquisitionUpdateRequired && FpgaStrobes.Select(x => (STR)x.Address).Where(x => Constants.AcquisitionStrobes.Contains(x)).Count() > 0)
                {
                    acquisitionUpdateRequired = true;
                }

                if (acquisitionUpdateRequired)
                {
                    toggleAcquisitionUpdateStrobe();
                    DiscardPreviousAcquisition = true;
                }
                if (viewUpdateRequired && !SuspendViewportUpdates)
                {
                    toggleViewUpdateStrobe();
                }
            }
            catch (ScopeIOException e)
            {
                Logger.Error("I/O failure while committing scope settings (" + e.Message + ")");
            }
        }
Exemplo n.º 2
0
        public void CommitSettings()
        {
            try
            {
                bool acquisitionUpdateRequired = false;
                bool viewUpdateRequired        = false;

                PicMemory.Commit();
                AdcMemory.Commit();
                List <MemoryRegister> FpgaRegisters = FpgaSettingsMemory.Commit();
                List <MemoryRegister> FpgaStrobes   = StrobeMemory.Commit();

                var FpgaRegistersAddresses = FpgaRegisters.Select(x => (REG)x.Address);
                if (FpgaRegistersAddresses.Where(x => AcquisitionRegisters.Contains(x)).Count() > 0)
                {
                    acquisitionUpdateRequired = true;
                }
                if (FpgaRegistersAddresses.Where(x => DumpRegisters.Contains(x)).Count() > 0)
                {
                    viewUpdateRequired = true;
                }
                if (!acquisitionUpdateRequired && FpgaStrobes.Select(x => (STR)x.Address).Where(x => AcquisitionStrobes.Contains(x)).Count() > 0)
                {
                    acquisitionUpdateRequired = true;
                }

                if (acquisitionUpdateRequired)
                {
                    toggleAcquisitionUpdateStrobe();
                    DiscardPreviousAcquisition = true;
                }
                if (viewUpdateRequired)
                {
                    toggleViewUpdateStrobe();
                }
            }
            catch (ScopeIOException e)
            {
                Logger.Error("I/O failure while committing scope settings (" + e.Message + ")");
            }
        }