Beispiel #1
0
        private void exportBtn_Click(object sender, EventArgs e)
        {
            if (_WaferDieDic.Count == 0)
            {
                return;
            }

            string device, product, excelFile;

            if (Parameter.CurrentDevice == DeviceType.HL9309)
            {
                device    = "1HL9309";
                product   = Parameter.DeviceHL9309.ProductName;
                excelFile = Path.GetDirectoryName(Parameter.DeviceHL9309.FilePath) + "\\" + Path.GetFileNameWithoutExtension(Parameter.DeviceHL9309.FilePath) + ".xlsx";
            }
            else
            {
                device    = "1HL9308";
                product   = Parameter.DeviceHL9308.ProductName;
                excelFile = Path.GetDirectoryName(Parameter.DeviceHL9308.FilePath) + "\\" + Path.GetFileNameWithoutExtension(Parameter.DeviceHL9308.FilePath) + ".xlsx";
            }

            Application.UseWaitCursor = true;
            this.Cursor       = Cursors.WaitCursor;
            exportBtn.Enabled = false;
            closeBtn.Enabled  = false;

            if (WaferFile.SaveToExcel(excelFile, device, product, Path.GetFileName(_Filepath), _WaferDieDic) == 0)
            {
                MessageBox.Show("Save to " + excelFile, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            exportBtn.Enabled         = true;
            closeBtn.Enabled          = true;
            Application.UseWaitCursor = false;
            this.Cursor = Cursors.Default;
        }
Beispiel #2
0
        private void exportBtn_Click(object sender, EventArgs e)
        {
            if (productComboBox.Text == "" || fileComboBox.Text == "")
            {
                return;
            }

            int    result;
            string excelFile, device;
            Dictionary <string, WaferDie> wafers = new Dictionary <string, WaferDie>();

            if (Parameter.CurrentDevice == DeviceType.HL9309)
            {
                if (_hl9309WaferDieDic.Count == 0)
                {
                    return;
                }

                device    = "1HL9309";
                excelFile = Path.GetDirectoryName(Parameter.DeviceHL9309.FilePath) + "\\" + Path.GetFileNameWithoutExtension(Parameter.DeviceHL9309.FilePath) + ".xlsx";

                foreach (string key in _hl9309WaferDieDic.Keys)
                {
                    wafers.Add(key, _hl9309WaferDieDic[key]);
                }
            }
            else
            {
                if (_hl9308WaferDieDic.Count == 0)
                {
                    return;
                }

                device    = "1HL9308";
                excelFile = Path.GetDirectoryName(Parameter.DeviceHL9308.FilePath) + "\\" + Path.GetFileNameWithoutExtension(Parameter.DeviceHL9308.FilePath) + ".xlsx";

                foreach (string key in _hl9308WaferDieDic.Keys)
                {
                    wafers.Add(key, _hl9308WaferDieDic[key]);
                }
            }

            Application.UseWaitCursor = true;
            this.Cursor = Cursors.WaitCursor;
            EnableControls(false);

            result = WaferFile.SaveToExcel(excelFile, device, productComboBox.Text, fileComboBox.Text, wafers);

            if (result == 0)
            {
                MessageBox.Show("Save to " + excelFile, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }

            EnableControls(true);
            Application.UseWaitCursor = false;
            this.Cursor = Cursors.Default;

            wafers.Clear();
            wafers = null;

            GC.Collect();
        }