Ejemplo n.º 1
0
        /// <summary>
        /// The main function: instant Agilent, MPQ class, and textboxes.
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            agilentDevice = new Agilent();
            mpqDevice     = new MPQ();

            dutTextBoxWellA = new TextBox[] {
                this.textBoxDUT1,
                this.textBoxDUT2,
                this.textBoxDUT3,
                this.textBoxDUT4,
                this.textBoxDUT5,
                this.textBoxDUT6,
                this.textBoxDUT7,
                this.textBoxDUT8
            };

            dutTextBoxWellB = new TextBox[] {
                this.textBoxDUT9,
                this.textBoxDUT10,
                this.textBoxDUT11,
                this.textBoxDUT12,
                this.textBoxDUT13,
                this.textBoxDUT14,
                this.textBoxDUT15,
                this.textBoxDUT16
            };
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The main function: instant Agilent, MPQ class, and textboxes.
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            agilentDevice = new Agilent();
            mpqDevice = new MPQ();

            dutTextBoxWell = new TextBox[]{
                this.textBoxDUT1,
                this.textBoxDUT2,
                this.textBoxDUT3,
                this.textBoxDUT4,
                this.textBoxDUT5,
                this.textBoxDUT6,
                this.textBoxDUT7,
                this.textBoxDUT8,
                this.textBoxDUT9,
                this.textBoxDUT10,
                this.textBoxDUT11,
                this.textBoxDUT12,
                this.textBoxDUT13,
                this.textBoxDUT14,
                this.textBoxDUT15,
                this.textBoxDUT16};
        }
Ejemplo n.º 3
0
        //
        //----------------------------------------------------------------------------------------
        //
        /// <summary>
        /// Construction of TestWell Class
        /// </summary>
        /// <param name="Agilent"></param>Agilent Class, define the method of Agilent equipments.
        /// <param name="MPQ"></param>MPQ Class, define the method of MPQ programmer.
        /// <param name="wellNumber"></param>Well number, 1 for WellA, 2 for WellB
        /// <param name="serialNumber"></param>Serialnumber of 1 DUT on panel, 19 digits.
        public TestWell(Agilent Agilent, MPQ MPQ, string serialNumber, TrackpadConfig tpConfig)
        {
            m_Agilent = Agilent;
            m_MPQ = MPQ;
            m_DeviceConfig = tpConfig;

            serialNumber = serialNumber.Remove(18); //remove last digit
            m_DUTArray = new DUT[] { DUT1, DUT2, DUT3, DUT4, DUT5, DUT6, DUT7, DUT8 };

            int i = 1;
            foreach (DUT dut in m_DUTArray)
            {
                dut.SerailNumber = serialNumber + i.ToString();
                dut.RawCount = new List<int>();
                dut.Noise = new List<int>();
                dut.IDAC = new List<int>();
                dut.Global_IDAC = new List<int>();
                dut.IDACGain = new List<byte>();
                dut.Local_IDAC = new List<int>();
                dut.IDAC_Erased = new List<int>();
                i++;
            }

            DUT14_PortEnables = 0xF;    //Enable all DUTs
            DUT58_PortEnalbes = 0xF;
        }
Ejemplo n.º 4
0
        public Blp(string path)
        {
            var handle = MPQ.OpenFile(path);

            if (handle == IntPtr.Zero)
            {
                throw new FileNotFoundException();
            }
            Data   = new BlpData(new MPQStream(handle));
            _cache = new Image[Data.MipCount];
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Everlook.Package.PackageInteractionHandler"/> class.
        /// </summary>
        /// <param name="inPackagePath">In package path.</param>
        public PackageInteractionHandler(string inPackagePath)
        {
            if (File.Exists(inPackagePath))
            {
                this.Package = new MPQ(new FileStream(inPackagePath, FileMode.Open, FileAccess.Read, FileShare.Read));
            }
            else
            {
                throw new FileNotFoundException("No package could be found at the specified path.");
            }

            this.PackagePath = inPackagePath;
        }
Ejemplo n.º 6
0
        //
        //----------------------------------------------------------------------------------------
        //

        /// <summary>
        /// Construction of TestWell Class
        /// </summary>
        /// <param name="Agilent"></param>Agilent Class, define the method of Agilent equipments.
        /// <param name="MPQ"></param>MPQ Class, define the method of MPQ programmer.
        /// <param name="wellNumber"></param>Well number, 1 for WellA, 2 for WellB
        /// <param name="serialNumber"></param>Serialnumber of 1 DUT on panel, 19 digits.
        public TestWell(Agilent Agilent, MPQ MPQ, byte wellNumber, string serialNumber)
        {
            m_Agilent    = Agilent;
            m_MPQ        = MPQ;
            currWell     = wellNumber;
            serialNumber = serialNumber.Remove(18);
            m_DUTArray   = new DUT[] { DUT1, DUT2, DUT3, DUT4, DUT5, DUT6, DUT7, DUT8 };

            int i = 1;

            foreach (DUT dut in m_DUTArray)
            {
                dut.SerailNumber = serialNumber + i.ToString();
                dut.RawCountX    = new List <int>();
                dut.NoiseX       = new List <int>();
                dut.RawCountY    = new List <int>();
                dut.NoiseY       = new List <int>();
                dut.IDAC         = new List <int>();
                dut.Global_IDAC  = new List <int>();
                dut.IDACGain     = new List <byte>();
                dut.IDAC_Erased  = new List <int>();
                i++;
            }

            DUT14_PortEnables = 0xF;    //Enable all DUTs
            DUT58_PortEnalbes = 0xF;

            if (wellNumber == 1)        //WELLA
            {
                MPQ_ADDRESS1 = 1;
                MPQ_ADDRESS2 = 2;
            }
            else                        //WELLB
            {
                MPQ_ADDRESS1 = 3;
                MPQ_ADDRESS2 = 4;
            }
        }
Ejemplo n.º 7
0
        //
        //----------------------------------------------------------------------------------------
        //
        /// <summary>
        /// Construction of TestWell Class
        /// </summary>
        /// <param name="Agilent"></param>Agilent Class, define the method of Agilent equipments.
        /// <param name="MPQ"></param>MPQ Class, define the method of MPQ programmer.
        /// <param name="wellNumber"></param>Well number, 1 for WellA, 2 for WellB
        /// <param name="serialNumber"></param>Serialnumber of 1 DUT on panel, 19 digits.
        public TestWell(Agilent Agilent, MPQ MPQ, byte wellNumber, string serialNumber)
        {
            m_Agilent = Agilent;
            m_MPQ = MPQ;
            currWell = wellNumber;
            serialNumber = serialNumber.Remove(18);
            m_DUTArray = new DUT[] { DUT1, DUT2, DUT3, DUT4, DUT5, DUT6, DUT7, DUT8 };

            int i = 1;
            foreach (DUT dut in m_DUTArray)
            {
                dut.SerailNumber = serialNumber + i.ToString();
                dut.RawCountX = new List<int>();
                dut.NoiseX = new List<int>();
                dut.RawCountY = new List<int>();
                dut.NoiseY = new List<int>();
                dut.IDAC = new List<int>();
                dut.Global_IDAC = new List<int>();
                dut.IDACGain = new List<byte>();
                dut.IDAC_Erased = new List<int>();
                i++;
            }

            DUT14_PortEnables = 0xF;    //Enable all DUTs
            DUT58_PortEnalbes = 0xF;

            if (wellNumber == 1)        //WELLA
            {
                MPQ_ADDRESS1 = 1;
                MPQ_ADDRESS2 = 2;
            }
            else                        //WELLB
            {
                MPQ_ADDRESS1 = 3;
                MPQ_ADDRESS2 = 4;
            }
        }
Ejemplo n.º 8
0
        private void exitTPT()
        {
            try
            {
                RegistryKey saveKey = Registry.LocalMachine.CreateSubKey(@"software\Cypress\TrackpadTest");

                saveKey.SetValue("Total Tested", totalTestedNumber.ToString());
                saveKey.SetValue("Total Failed", totalFailedNumber.ToString());
                saveKey.SetValue("Yield Rate", yieldRate.ToString());

                saveKey.SetValue("Test ID", testID);
                saveKey.SetValue("Test Station", testStation);
                saveKey.SetValue("Test Site", testSite);
                agilentDevice = null;
                mpqDevice     = null;
                testWellA     = null;
                GC.Collect(0);
                System.Threading.Thread.Sleep(100);
            }
            catch (Exception ex)
            {
                Log.error(ex.Message);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Get the content-detectable protections associated with a single path
        /// </summary>
        /// <param name="file">Path to the file to scan</param>
        /// <returns>Dictionary of list of strings representing the found protections</returns>
        private Dictionary <string, List <string> > GetInternalProtections(string file)
        {
            // Quick sanity check before continuing
            if (!File.Exists(file))
            {
                return(null);
            }

            // Initialze the protections found
            var protections = new Dictionary <string, List <string> >();

            // Get the extension for certain checks
            string extension = Path.GetExtension(file).ToLower().TrimStart('.');

            // Open the file and begin scanning
            using (FileStream fs = File.OpenRead(file))
            {
                // Get the first 16 bytes for matching
                byte[] magic = new byte[16];
                try
                {
                    fs.Read(magic, 0, 16);
                    fs.Seek(-16, SeekOrigin.Current);
                }
                catch
                {
                    // We don't care what the issue was, we can't read or seek the file
                    return(null);
                }

                #region Non-Archive File Types

                // Executable
                if (ScanAllFiles || new Executable().ShouldScan(magic))
                {
                    var subProtections = new Executable().Scan(this, fs, file);
                    Utilities.AppendToDictionary(protections, subProtections);
                }

                // Text-based files
                if (ScanAllFiles || new Textfile().ShouldScan(magic, extension))
                {
                    var subProtections = new Textfile().Scan(this, fs, file);
                    Utilities.AppendToDictionary(protections, subProtections);
                }

                #endregion

                #region Archive File Types

                // If we're scanning archives, we have a few to try out
                if (ScanArchives)
                {
                    // 7-Zip archive
                    if (new SevenZip().ShouldScan(magic))
                    {
                        var subProtections = new SevenZip().Scan(this, fs, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // BFPK archive
                    if (new BFPK().ShouldScan(magic))
                    {
                        var subProtections = new BFPK().Scan(this, fs, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // BZip2
                    if (new BZip2().ShouldScan(magic))
                    {
                        var subProtections = new BZip2().Scan(this, fs, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // GZIP
                    if (new GZIP().ShouldScan(magic))
                    {
                        var subProtections = new GZIP().Scan(this, fs, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // InstallShield Cabinet
                    if (file != null && new InstallShieldCAB().ShouldScan(magic))
                    {
                        var subProtections = new InstallShieldCAB().Scan(this, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // Microsoft Cabinet
                    if (file != null && new MicrosoftCAB().ShouldScan(magic))
                    {
                        var subProtections = new MicrosoftCAB().Scan(this, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // MSI
                    if (file != null && new MSI().ShouldScan(magic))
                    {
                        var subProtections = new MSI().Scan(this, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // MPQ archive
                    if (file != null && new MPQ().ShouldScan(magic))
                    {
                        var subProtections = new MPQ().Scan(this, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // PKZIP archive (and derivatives)
                    if (new PKZIP().ShouldScan(magic))
                    {
                        var subProtections = new PKZIP().Scan(this, fs, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // RAR archive
                    if (new RAR().ShouldScan(magic))
                    {
                        var subProtections = new RAR().Scan(this, fs, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // Tape Archive
                    if (new TapeArchive().ShouldScan(magic))
                    {
                        var subProtections = new TapeArchive().Scan(this, fs, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // Valve archive formats
                    if (file != null && new Valve().ShouldScan(magic))
                    {
                        var subProtections = new Valve().Scan(this, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }

                    // XZ
                    if (new XZ().ShouldScan(magic))
                    {
                        var subProtections = new XZ().Scan(this, fs, file);
                        Utilities.PrependToKeys(subProtections, file);
                        Utilities.AppendToDictionary(protections, subProtections);
                    }
                }

                #endregion
            }

            // Clear out any empty keys
            Utilities.ClearEmptyKeys(protections);

            return(protections);
        }
Ejemplo n.º 10
0
 private static void InternalSignString(MPQ archive)
 {
 }
Ejemplo n.º 11
0
 public static bool VerifyArchiveIntegrity(MPQ archive)
 {
     return(true);
 }
Ejemplo n.º 12
0
 private static void InternalSignString(MPQ archive)
 {
 }
Ejemplo n.º 13
0
 private static void InternalSignWeak(MPQ archive)
 {
 }
Ejemplo n.º 14
0
 public static void SignArchive(MPQ archive, Strength signingStrength)
 {
 }
Ejemplo n.º 15
0
 private static void InternalSignWeak(MPQ archive)
 {
 }
Ejemplo n.º 16
0
 public static bool VerifyArchiveIntegrity(MPQ archive)
 {
     return true;
 }
Ejemplo n.º 17
0
        private void exitTPT()
        {
            try
            {
                RegistryKey saveKey = Registry.LocalMachine.CreateSubKey(@"software\Cypress\TrackpadTest");

                saveKey.SetValue("Total Tested", totalTestedNumber.ToString());
                saveKey.SetValue("Total Failed", totalFailedNumber.ToString());
                saveKey.SetValue("Yield Rate", yieldRate.ToString());

                saveKey.SetValue("Test ID", testID);
                saveKey.SetValue("Test Station", testStation);
                saveKey.SetValue("Test Site", testSite);
                agilentDevice = null;
                mpqDevice = null;
                testWellA = null;
                GC.Collect(0);
                System.Threading.Thread.Sleep(100);
            }
            catch(Exception ex)
            {
                Log.error(ex.Message);
            }
        }
Ejemplo n.º 18
0
        //****************************************//
        //            Programming IC              //
        //****************************************//
        /// <summary>
        /// Programming PSOC IC by MPQ programmer
        /// </summary>
        /// <param name="ImageID"></param> indicate firmware# in MPQ(i.e. 1 for produciton code)
        public void ProgrammingIC(byte ImageID)
        {
            byte[] ProgrammingStatus1;
            byte[] ProgrammingStatus2;
            bool MPQ1Stop = false;
            bool MPQ2Stop = false;

            SetupPowerSupply(VDD_PROGRAMMING, VDD_PROGRAMMING);
            PowerON();
            System.Threading.Thread.Sleep(500);
            try
            {
                m_MPQ.Address = MPQ_ADDRESS1;
                m_MPQ.ProgrammerInit(MPQ_PROG_VOLTAGE, DUT14_PortEnables);
                m_MPQ.Programming(ImageID);

                m_MPQ.Address = MPQ_ADDRESS2;
                m_MPQ.ProgrammerInit(MPQ_PROG_VOLTAGE, DUT58_PortEnalbes);
                m_MPQ.Programming(ImageID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            programTimeOut = false;
            System.Timers.Timer t = new System.Timers.Timer(PROGRAM_TIME_OUT);
            t.AutoReset = false;
            t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed);
            t.Start();
            try
            {
                do
                {
                    m_MPQ.Address = MPQ_ADDRESS1;
                    m_MPQ.CheckProgrammingStatus(out ProgrammingStatus1);
                    if (ProgrammingStatus1[1] == 0 || ProgrammingStatus1[2] == 0 || ProgrammingStatus1[3] == 0 || ProgrammingStatus1[4] == 0)
                    {
                        MPQ1Stop = true;
                    }
                    if (ProgrammingStatus1[1] > 2 && ProgrammingStatus1[2] > 2 && ProgrammingStatus1[3] > 2 && ProgrammingStatus1[4] > 2)
                    {
                        MPQ1Stop = true;
                    }

                    System.Threading.Thread.Sleep(DelayTime.CHECK_PROGRAMMING_STATUS);

                    m_MPQ.Address = MPQ_ADDRESS2;
                    m_MPQ.CheckProgrammingStatus(out ProgrammingStatus2);
                    if (ProgrammingStatus2[1] == 0 || ProgrammingStatus2[2] == 0 || ProgrammingStatus2[3] == 0 || ProgrammingStatus2[4] == 0)
                    {
                        MPQ2Stop = true;
                    }
                    if (ProgrammingStatus2[1] > 2 && ProgrammingStatus2[2] > 2 && ProgrammingStatus2[3] > 2 && ProgrammingStatus2[4] > 2)
                    {
                        MPQ2Stop = true;
                    }

                    for (int i = 0; i < 4; i++)
                    {
                        m_DUTArray[i].ProgrammingStatus = ProgrammingStatus1[i + 1];
                        m_DUTArray[i + 4].ProgrammingStatus = ProgrammingStatus2[i + 1];
                    }

                    System.Threading.Thread.Sleep(DelayTime.CHECK_PROGRAMMING_STATUS);    //delay 1s to decrease the check rate, free MPQ UART interrupt time.

                }
                while ((!programTimeOut) && (!(MPQ1Stop && MPQ2Stop)));
            }
            catch (Exception ex)
            {
                m_MPQ = null;
                MessageBox.Show(ex.Message, "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error);
                foreach (DUT dut in m_DUTArray)
                {
                    if (dut.ErrorCode == 0)
                    {
                        dut.ErrorCode = ErrorCode.ERROR_PROGRAM_FAILURE;
                    }
                }
            }

            t.Stop();
            t.Dispose();
            PowerOFF();

            foreach (DUT dut in m_DUTArray)
            {
                if (dut.ProgrammingStatus != 0)
                {
                    if (dut.ErrorCode == 0)
                    {
                        dut.ErrorCode = ErrorCode.ERROR_PROGRAM_FAILURE;
                    }
                }
            }

            SetupPowerSupply(VDD_PS_DEFAULT, VDD_IO_DEFAULT);
            UpdateDUT_Enables();
        }
Ejemplo n.º 19
0
 public static void SignArchive(MPQ archive, Strength signingStrength)
 {
 }