Ejemplo n.º 1
0
        public int CreateAsicMapFile(string srcDir, string dstDir, string typeName, string lotNo, bool[] waferList, string explorerPath, out int[] waPassList, out int[] waFailList, out int passCount, out int failCount)
        {
            int               count      = 0;
            string            srcFile    = "";
            string            dstFile    = "";
            string            errMsg     = "";
            LotDatInformation lotDatInfo = null;
            WaferMap          waferData  = null;

            waPassList = new int[CommonConstants.WAFER_MAX];
            waFailList = new int[CommonConstants.WAFER_MAX];
            passCount  = 0;
            failCount  = 0;
            var testCount = 0;

            try
            {
                // LOT.DAT読込
                srcFile = srcDir + "\\" + CommonConstants.LOT_DAT_STRING;
                var rc = fileAccessClass.LotDataReadToClass(srcFile, ref lotDatInfo, ref errMsg);
                if (rc != CommonConstants.ECODE_OK)
                {
                    Utils.Utils.WriteLog(view, "LOT.DAT読込失敗 (" + typeName + ")");
                    return(rc);
                }

                // コピー先のファイルを削除
                fileCopyClass.LotDatFileDelete(dstDir);

                foreach (var w in waferList.Select((v, j) => new { v, j }))
                {
                    if (w.v)
                    {
                        srcFile = srcDir + "\\" + CommonConstants.WAFER_DAT_STRING +
                                  string.Format("{0:00}", (w.j + 1)) + ".dat";

                        rc = fileAccessClass.WaferDataReadToClass(srcFile, ref lotDatInfo, ref waferData, false, ref errMsg);

                        if (rc != CommonConstants.ECODE_OK)
                        {
                            Utils.Utils.WriteLog(view, "Error : WaferDataReadToClass");
                            return(rc);
                        }

                        if (Directory.Exists(dstDir) == false)
                        {
                            Directory.CreateDirectory(dstDir);
                        }

                        dstFile = dstDir + "\\" + CommonConstants.WAFER_DAT_STRING + string.Format("{0:00}", w.j + 1) +
                                  ".dat";

                        File.Copy(srcFile, dstFile);

                        // ファイルの情報を更新
                        fileAccessClass.WaDataUpDate(dstFile, (w.j + 1), ref errMsg);
                        waPassList[w.j] = waferData.wafer_test_sum_info.pass_total;
                        waFailList[w.j] = waferData.wafer_test_sum_info.fail_total;

                        passCount += waferData.wafer_test_sum_info.pass_total;
                        failCount += waferData.wafer_test_sum_info.fail_total;
                        testCount += waferData.wafer_test_sum_info.test_total;
                    }
                }

                // LOT.DATのコピー
                srcFile = srcDir + "\\" + CommonConstants.LOT_DAT_STRING;
                dstFile = dstDir + "\\" + CommonConstants.LOT_DAT_STRING;
                File.Copy(srcFile, dstFile);

                rc = fileAccessClass.LotData_UpdateSomeInfo(dstFile, typeName, lotNo, waferList, passCount, failCount,
                                                            testCount, ref errMsg);
                if (rc != CommonConstants.ECODE_OK)
                {
                    Utils.Utils.WriteLog(view, "Error : LotData_UpdateSomeInfo");
                    return(rc);
                }
            }
            catch (Exception ex)
            {
                return(CommonConstants.ECODE_ERROR);
            }

            return(CommonConstants.ECODE_OK);
        }
Ejemplo n.º 2
0
        public int CreateMapFile(string srcDir, string dstDir, string typeName, string lotNo, int quantity, string explorerPath, out int waPass, out int waFail)
        {
            int    i;
            int    count   = 0;
            string srcFile = "";
            string dstFile = "";
            string errMsg  = "";

            bool[]            waferList  = new bool[CommonConstants.WAFER_MAX];
            LotDatInformation lotDatInfo = null;
            WaferMap          waferData  = null;

            waPass = 0;
            waFail = 0;

            try
            {
                // LOT.DAT読込
                srcFile = srcDir + "\\" + CommonConstants.LOT_DAT_STRING;
                var rc = fileAccessClass.LotDataReadToClass(srcFile, ref lotDatInfo, ref errMsg);
                if (rc != CommonConstants.ECODE_OK)
                {
                    Utils.Utils.WriteLog(view, "LOT.DAT読込失敗 (" + typeName + ")");
                    return(rc);
                }

                // コピー先のファイルを削除
                fileCopyClass.LotDatFileDelete(dstDir);

                // WA-**.DATの検索
                for (i = 0; i < CommonConstants.WAFER_MAX; i++)
                {
                    srcFile = srcDir + "\\" + CommonConstants.WAFER_DAT_STRING + string.Format("{0:00}", (i + 1)) +
                              ".dat";
                    if (File.Exists(srcFile) == true)
                    {
                        break;
                    }
                }
                if (i >= CommonConstants.WAFER_MAX)
                {
                    Utils.Utils.WriteLog(view, "WA-xx.datが存在しません (" + typeName + ")");
                    return(CommonConstants.ECODE_ERROR);
                }

                // 未使用??
                var versionType = fileAccessClass.GetVersionType(srcDir + "\\" + CommonConstants.LOT_DAT_STRING);

                rc = fileAccessClass.WaferDataReadToClass(srcFile, ref lotDatInfo, ref waferData, false, ref errMsg);
                if (rc != CommonConstants.ECODE_OK)
                {
                    Utils.Utils.WriteLog(view, "Error : WaferDataReadToClass");
                    return(rc);
                }

                if (Directory.Exists(dstDir) == false)
                {
                    Directory.CreateDirectory(dstDir);
                }

                for (i = 0; i < quantity; i++)
                {
                    dstFile = dstDir + "\\" + CommonConstants.WAFER_DAT_STRING + string.Format("{0:00}", (i + 1)) +
                              ".dat";

                    File.Copy(srcFile, dstFile);

                    // ファイルの情報を更新
                    fileAccessClass.WaDataUpDate(dstFile, (i + 1), ref errMsg);
                    count++;
                }

                var passCount = waferData.wafer_test_sum_info.pass_total * count;
                var failCount = waferData.wafer_test_sum_info.fail_total * count;
                var testCount = waferData.wafer_test_sum_info.test_total * count;

                waPass = waferData.wafer_test_sum_info.pass_total;
                waFail = waferData.wafer_test_sum_info.fail_total;

                // LOT.DATのコピー
                srcFile = srcDir + "\\" + CommonConstants.LOT_DAT_STRING;
                dstFile = dstDir + "\\" + CommonConstants.LOT_DAT_STRING;
                File.Copy(srcFile, dstFile);

                // LOT.DATの情報更新
                for (i = 0; i < waferList.Length; i++)
                {
                    if (i < quantity)
                    {
                        waferList[i] = true;
                    }
                    else
                    {
                        waferList[i] = false;
                    }
                }

                rc = fileAccessClass.LotData_UpdateSomeInfo(dstFile, typeName, lotNo, waferList, passCount, failCount,
                                                            testCount, ref errMsg);
                if (rc != CommonConstants.ECODE_OK)
                {
                    Utils.Utils.WriteLog(view, "Error : LotData_UpdateSomeInfo");
                    return(rc);
                }
            }
            catch (Exception ex)
            {
                return(CommonConstants.ECODE_ERROR);
            }

            return(CommonConstants.ECODE_OK);
        }