Beispiel #1
0
        public LotinfoDlg(LotInfo LotInfo, BasicInfo BasicInfo, Recipe Recipe)
        {
            InitializeComponent();

            lotInfo = LotInfo;

            txtTesterID.IsReadOnly = true;
            txtTesterID.Text       = BasicInfo.TesterID;

            txtProgramName.IsReadOnly = true;
            txtProgramName.Text       = BasicInfo.ProgramName;

            txtCustomerID.IsReadOnly = true;
            txtCustomerID.Text       = BasicInfo.CustomerID;

            txtDeviceName.IsReadOnly = true;
            txtDeviceName.Text       = BasicInfo.DeviceName;

            txtCustomerLotNo.IsReadOnly = true;
            txtCustomerLotNo.Text       = BasicInfo.CustomerLotNo;

            txtSubLotNo.IsReadOnly = true;
            txtSubLotNo.Text       = BasicInfo.SubLotNo;

            txtModeCode.IsReadOnly = true;
            txtModeCode.Text       = BasicInfo.ModeCode;

            ApplyPattern(Recipe);
        }
Beispiel #2
0
        /// <summary>
        /// 檢查首件是否檢驗完成,檢驗完成回傳 True,未完成回傳 False
        /// </summary>
        /// <param name="equipmentName"></param>
        /// <param name="lot"></param>
        /// <returns></returns>
        public static bool CheckFAI(string equipmentName, string lot)
        {
            /*
             * 在CST_EQP_FAI裡沒有資料代表沒有送驗,則視為FAI未完成
             * 在CST_EQP_FAI有資料,但是waitCount不等於0,代表FAI未完成
             * 在CST_EQP_FAI有資料,且waitCount = 0,代表FAI完成
             */

            //取得批號資料
            var lotData = LotInfo.GetLotByLot(lot);

            var faiData = CSTEquipmentFAIInfo.GetDataByEquipmentAndDevice(equipmentName, lotData.DeviceName);

            if (faiData == null)
            {
                //找不到首件檢驗的資料,請確認是否已執行調機作業!!!
                throw new CimesException(RuleMessage.Error.C00026());
            }

            if (faiData != null && faiData.WAITFAICOUNT <= 0)
            {
                return(true);
            }

            return(false);
        }
Beispiel #3
0
        //Добавление нового лота
        static public void AddNewLot(LotInfo lot)
        {
            try
            {
                string sqlCommand = "Select * from LotInfo";
                using (SqlConnection connection = new SqlConnection(connectionString))
                {
                    connection.Open();

                    SqlDataAdapter adapter = new SqlDataAdapter(sqlCommand, connection);
                    DataSet        ds      = new DataSet();
                    adapter.Fill(ds);
                    DataTable dt = ds.Tables[0];

                    DataRow newRow = dt.NewRow();
                    newRow["nameLot"]    = lot.Name;
                    newRow["category"]   = lot.Category;
                    newRow["lotInfo"]    = lot.Info;
                    newRow["startPrice"] = lot.StartPrice;
                    newRow["lotImage"]   = LoadImage.BitmapImageToBytes(lot.LotImage);
                    dt.Rows.Add(newRow);
                    SqlCommandBuilder commandBuilder = new SqlCommandBuilder(adapter);
                    adapter.Update(ds);
                    MessageBox.Show("Новый лот был добавлен");
                }
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }
Beispiel #4
0
        protected void ttbBoxNo_TextChanged(object sender, EventArgs e)
        {
            try
            {
                // 清除資料與使用者介面
                ClearField();

                var convertInfo = WIPConvertInfoEx.GetWIPConvertInfoByTargetLot(ttbBoxNo.Text.Trim());
                if (convertInfo == null)
                {
                    throw new RuleCimesException(TextMessage.Error.T00030(lblBoxNo.Text, ttbBoxNo.Text.Trim()), ttbBoxNo);
                }

                // 取得批號
                _ProcessLot = LotInfo.GetLotByLot(ttbBoxNo.Text.Trim());
                // 若批號不存在拋錯
                if (_ProcessLot == null)
                {
                    throw new RuleCimesException(TextMessage.Error.T00045(GetUIResource("Lot")));
                }
                // 取得批號的所有資單元
                _ComponentList = ComponentInfo.GetLotAllComponents(_ProcessLot);
                // 資料繫結
                gvComponent.SetDataSource(_ComponentList, true);
            }
            catch (Exception ex)
            {
                HandleError(ex);
            }
        }
Beispiel #5
0
    LotInfo LotFromParentBlock()
    {
        LotInfo lot  = new LotInfo(GetComponent <Block>(), shiftedVerts, direction, left: LeftAnchor, right: RightAnchor, parentBlock: true);
        LotInfo lot2 = new LotInfo(GetComponent <Block>(), shiftedVerts, direction, left: LeftAnchor, right: RightAnchor, parentBlock: true, parentLot: lot);

        return(lot2);
    }
Beispiel #6
0
        public bool Parse(TenderInfo tender)
        {
            string url = $"http://market.mosreg.ru/Trade/ViewTrade/{tender.Id}";

            try
            {
                _doc = web.Load(url);
                HtmlNodeCollection objectWithAddress = _doc.DocumentNode.SelectNodes("//div[contains(@class,'informationAboutCustomer__informationPurchase')]/child::div//p");
                tender.DeliveryAddress = objectWithAddress[5].InnerText;
                tender.Lots            = new List <LotInfo>();
                HtmlNodeCollection objects = _doc.DocumentNode.SelectNodes("//div[contains(@class,'informationAboutCustomer__resultBlock objectPurchase')]/child::div//div//div//p");

                for (int i = 0; i < objects.Count; i++)
                {
                    LotInfo lotInfo = new LotInfo();
                    lotInfo.LotName = objects[i].LastChild.InnerText.Replace("\n", "").Replace("\r", "");
                    lotInfo.Unit    = objects[i + 3].LastChild.InnerText.Replace(" ", "").Replace("\n", "").Replace("\r", "");
                    var amount = objects[i + 4].LastChild.InnerText.Replace(" ", "").Replace("\n", "").Replace("\r", "");
                    lotInfo.Amount = decimal.Parse(amount);
                    var costString = objects[i + 5].LastChild.InnerText.Replace(" ", "").Replace("\n", "").Replace("\r", "");
                    lotInfo.CostPerOne = decimal.Parse(costString);
                    tender.Lots.Add(lotInfo);
                    i = i + 6;
                }
                return(true);
            }
            catch (WebException e)
            {
                Console.WriteLine("\nException Caught!");
                Console.WriteLine("Message :{0} ", e.Message);
                return(false);
            }
        }
Beispiel #7
0
        /// <summary>
        /// 取得預約工作站的序號
        /// </summary>
        /// <param name="lot"></param>
        /// <param name="ruleName"></param>
        /// <returns></returns>
        public static string GetAppointmentOperationSequence(string lot, string ruleName)
        {
            var    lotData = LotInfo.GetLotByLot(lot).ChangeTo <LotInfoEx>();
            string nextOperationSequence = "";

            //依據傳入的批號去取得預約表資訊
            var WIPReserveCheckInDataList = CSTWIPReserveCheckInInfo.GetDataByLot(lotData.Lot);

            //用批號去客製表找出所有預約紀錄,先比較currentRule是否存在於客製表,若有,則拋錯
            if (WIPReserveCheckInDataList.Count > 0)
            {
                //從預約表中找出相同的RuleName
                List <CSTWIPReserveCheckInInfo> matchReserveList = WIPReserveCheckInDataList.FindAll(x => x.RuleName == ruleName);

                if (matchReserveList.Count > 0)
                {
                    //批號:{0}已進行站點:{1}預約進站作業,請遵循作業規範
                    throw new Exception(RuleMessage.Error.C10001(lotData.Lot, lotData.OperationName));
                }

                //取得最後一次預約的工作站點名稱
                var lastAppointmentOperation = WIPReserveCheckInDataList[0].OperationName;

                //取得目前批號的流程線上版本
                RouteVersionInfo RouteVersion = RouteVersionInfo.GetRouteActiveVersion(lotData.RouteName);

                //以目前工作站名稱去查詢在所有流程中的序號
                var routeOperation = RouteOperationInfo.GetRouteAllOperations(RouteVersion).Find(p => p.OperationName == lastAppointmentOperation);

                //取得下一個工作站序號
                nextOperationSequence = string.Format("{0:000}", (Convert.ToDecimal(routeOperation.OperationSequence) + 1));
            }

            return(nextOperationSequence);
        }
Beispiel #8
0
        /// <summary>
        /// 取得預約工作站的第一個RuleName
        /// </summary>
        /// <param name="operationName"></param>
        /// <returns></returns>
        public static string GetFirstOperationTypeRuleByOperationName(LotInfo lot, string operationName, string ruleName)
        {
            //取得預約站點的第一個Rule
            var frstRuleType = OperationTypeRuleInfo.GetFirstOperationTypeRuleByOperationName(operationName);

            if (frstRuleType == null)
            {
                //站點:{0},找不到設定規則,請確認[工作站設定]
                throw new Exception(RuleMessage.Error.C10002(operationName));
            }

            //檢查目前使用程式的RuleName是否與預約站點的第一個Rule相同,如果不同,則拋出錯誤訊息
            if (frstRuleType.RuleName != ruleName)
            {
                //該批號作業為{0},不為此功能,請遵循作業規範
                throw new Exception(RuleMessage.Error.C10004(lot.CurrentRuleName));
            }

            //確認預約工作站是否有開啟預約功能
            var operationData = OperationInfo.GetOperationByName(operationName).ChangeTo <OperationInfoEx>();

            if (operationData.ReserveFlag == "N")
            {
                //工作站:{0} 系統屬性設定沒有開啟預約功能!
                throw new Exception(RuleMessage.Error.C10068(operationData.OperationName));
            }

            return(frstRuleType.RuleName);
        }
Beispiel #9
0
        public ActionResult RestoreLot(LotInfo lotInfo)
        {
            var lotid   = Convert.ToInt32(Request.Cookies["LotId"].Value);
            var message = new DataAccess().RestoreLot(lotid);

            return(RedirectToAction("Index", new { id = lotid, @errormsg = message }));
        }
Beispiel #10
0
        public ActionResult RemoveFromBookmarks(LotInfo lotInfo)
        {
            var lotid   = Convert.ToInt32(Request.Cookies["LotId"].Value);
            var message = new DataAccess().RemoveFromBookmarks(lotid, HttpContext.User.Identity.Name);

            return(RedirectToAction("Index", new { id = lotid, @errormsg = message }));
        }
Beispiel #11
0
        //Получения списка лотов из базы данных
        static public ObservableCollection <LotInfo> LoadLotsFromDataBase()
        {
            ObservableCollection <LotInfo> LotsCollection = new ObservableCollection <LotInfo>();

            byte[] dataImage;
            string sqlCommand = "Select * from LotInfo";

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                SqlDataAdapter adapter = new SqlDataAdapter(sqlCommand, connection);
                DataSet        ds      = new DataSet();
                adapter.Fill(ds);
                DataTable tableLots = ds.Tables[0];
                int       n         = tableLots.Rows.Count;
                LotInfo[] Lot       = new LotInfo[n];

                for (int i = 0; i < n; i++)
                {
                    Lot[i]            = new LotInfo();
                    Lot[i].ID         = (int)tableLots.Rows[i][0];
                    Lot[i].Name       = (string)tableLots.Rows[i][1];
                    Lot[i].Category   = (string)tableLots.Rows[i][2];
                    Lot[i].Info       = (string)tableLots.Rows[i][3];
                    Lot[i].StartPrice = (int)tableLots.Rows[i][4];
                    dataImage         = (byte[])tableLots.Rows[i][5];
                    Lot[i].LotImage   = LoadImage.BytesToBitmapImage(dataImage);
                }
                for (int i = 0; i < n; i++)
                {
                    LotsCollection.Add(Lot[i]);
                }
            }
            return(LotsCollection);
        }
Beispiel #12
0
        public LotinfoDlg(LotInfo LotInfo, BasicInfo BasicInfo)
        {
            InitializeComponent();

            lotInfo = LotInfo;

            basicInfo = BasicInfo;

            txtTesterID.Text = string.IsNullOrEmpty(basicInfo.TesterID) ? "" : basicInfo.TesterID;

            txtProgramName.IsReadOnly = true;
            txtProgramName.Text       = LotInfo.ProgramName.ToString();

            txtOperatorID.Text = string.IsNullOrEmpty(basicInfo.OperatorID) ? "" : basicInfo.OperatorID;

            txtCustomerID.Text = string.IsNullOrEmpty(basicInfo.CustomerID) ? "" : basicInfo.CustomerID;

            txtDeviceName.Text = string.IsNullOrEmpty(basicInfo.DeviceName) ? "" : basicInfo.DeviceName;

            txtCustomerLotNo.Text = string.IsNullOrEmpty(basicInfo.CustomerLotNo) ? "" : basicInfo.CustomerLotNo;

            txtSubLotNo.Text = string.IsNullOrEmpty(basicInfo.SubLotNo) ? "" : basicInfo.SubLotNo;

            txtTestCode.Text = LotInfo.TestCode.ToString();
        }
Beispiel #13
0
        public void ParseLog(string logFilePath)
        {
            lotInfo = lotInfo.ReadLotInfoFromLog(logFilePath);

            // we rewrite whole logs. no appending
            if (!CsvHelper.OutputAlreadyPresent(lotInfo.GetUniqueLotId(), outputFolderPath, ref outputFilePath))
            {
                var logFileName = Path.GetFileNameWithoutExtension(logFilePath);
                outputFilePath = Path.Combine(outputFolderPath, logFileName + ".csv");
            }
            else
            {
                //startingMeasurementIndex = int.Parse(CsvHelper.GetLastMeasurementIndex(outputFilePath));
            }

            CsvHelper.InitializeOutputFileContents(outputFilePath, lotInfo.MakeMeasurementFileHeader());

            var normalizedMeasurements = ReadAndNormalizeMeasurements(logFilePath, lotInfo.ZeroThreshold);

            RemoveFakeMeasurements(normalizedMeasurements);
            // normalizedMeasurementsFilePath = Path.Combine(outputFolderPath, logFileName + ".out");
            // SaveListToFile(normalizedMeasurements, normalizedMeasurementsFilePath); // Generic list save does not work

            var finalMeasurements = ExtractFinalMeasurements(normalizedMeasurements, lotInfo.Package.NetWeight);

            RemoveLastMeasurementIfNotInTolerance(finalMeasurements);
            AddPositionToEachMeasurement(finalMeasurements, startingMeasurementIndex);
            SaveListToFile(finalMeasurements, outputFilePath);
        }
Beispiel #14
0
    // Use this for initialization
    public void init(LotInfo _info)
    {
        self      = GetComponent <Lot>();
        info      = _info;
        center    = info.Center;
        verts     = info.LotVerts;
        points    = info.points;
        left      = info.Left;
        right     = info.Right;
        direction = info.Direction;

        foreach (var v in verts)
        {
            //Instantiate(info.ParentBlock.marker, v, Quaternion.identity, transform);
        }
        Vector3 origin = Vector3.zero;

        foreach (var v in verts)
        {
            origin = origin + v;
        }
        origin = origin / verts.Count;
        Dictionary <float, Vector3> vertSortDict = new Dictionary <float, Vector3>();

        foreach (var v in verts)
        {
            if (origin.x < v.x)
            {
                vertSortDict.Add(Vector3.Angle(Vector3.forward, v - origin), v);
            }
            else
            {
                vertSortDict.Add(360 - Vector3.Angle(Vector3.forward, v - origin), v);
            }
        }
        SortedDictionary <float, Vector3> sortedVertSortDict = new SortedDictionary <float, Vector3>(vertSortDict);

        angles   = sortedVertSortDict.Keys.ToList();
        AdjVerts = sortedVertSortDict.Values.ToList();


        arr = Utils.V2dArray(AdjVerts);


        //   Array.Sort(arr,new ClockwiseComparer(origin));
        //for (int i = 0; i < arr.Length; i++) {
        //       AdjVerts.Add(new Vector3(arr[i].x,0,arr[i].y));
        //}
        SetMesh(AdjVerts, arr);
        col       = gameObject.AddComponent <MeshCollider>();
        road      = info.RoadSegment.road;
        segment   = info.RoadSegment;
        RoadPoint = info.RoadPoint;

        if (RoadPoint != null)
        {
            segment.AddLot(self);
        }
    }
Beispiel #15
0
        public LotinfoDlg(LotInfo LotInfo, Recipe Recipe)
        {
            InitializeComponent();

            lotInfo = LotInfo;

            ApplyPattern(Recipe);
        }
Beispiel #16
0
        public static void AutoMerge(string invLot, TransactionStamp txs, ReasonCategoryInfo reasonCategory)
        {
            //找到相同的INVLot的序號
            var lots = LotInfoEx.GetLotListByInvertoryLot(invLot);
            //排除送過NG的序號
            var autoMergeLots = lots.FindAll(p => p.UserDefineColumn01.IsNullOrTrimEmpty());

            //利用小工單號確認是否還有QC未檢驗的資料(包含FAI、PQC、PPK)
            //只要有一張未檢,則代表檢驗未完成,回傳false,反之
            var qcFlag = CheckQCInspectionDone(lots[0].WorkOrderLot);

            //檢查數量是否可以做AUTOMERGE
            var waitMergeLots = autoMergeLots.FindAll(p => p.Status == "WaitMerge");

            if (waitMergeLots.Count == autoMergeLots.Count && qcFlag)
            {
                var customizeFunction = new CustomizeFunction();
                //取得命名規則
                //var naming = customizeFunction.GetNamingRule("SplitLot", txs.UserID, autoMergeLots[0], null);
                //拆批
                var split = SplitLotInfo.CreateSplitLotByLotAndQuantity(autoMergeLots[0].Lot, autoMergeLots[0].WorkOrderLot, 0, 0, txs.CategoryReasonCode, txs.Description);
                //母批不做結批
                var splitIndicator = WIPTxn.SplitIndicator.Create(null, null, null, TerminateBehavior.NoTerminate);
                WIPTxn.Default.SplitLot(autoMergeLots[0], split, splitIndicator, txs);
                //更新命名規則
                //if (naming.Second.Count > 0)
                //{
                //    DBCenter.ExecuteSQL(naming.Second);
                //}
                //再取一次批號資訊
                var newLot = LotInfo.GetLotByLot(split.Lot);
                //併批與子單元
                List <MergeLotInfo> mergeLotList = new List <MergeLotInfo>();
                waitMergeLots.ForEach(mergelot =>
                {
                    var compData = ComponentInfo.GetComponentByComponentID(mergelot.ComponentLot);
                    var mergeLot = MergeLotInfo.GetMergeLotByLotAndQuantity(mergelot.Lot, new List <ComponentInfo>()
                    {
                        compData
                    }, reasonCategory, txs.Description);
                    mergeLotList.Add(mergeLot);
                });
                WIPTransaction.MergeLot(newLot, mergeLotList, txs);
                //再取一次批號資訊
                var newMergeLot = LotInfo.GetLotByLot(split.Lot);

                //將批號狀態變更為wait
                WIPTransaction.ModifyLotSystemAttribute(newMergeLot, "STATUS", LotDefaultStatus.Wait.ToCimesString(), txs);
                //將COMPLOT、PROCESS_EQUIP欄位清空,因為這個時間點這個欄位已經沒意義了
                WIPTransaction.ModifyLotSystemAttribute(newMergeLot, "COMPLOT", string.Empty, txs);
                WIPTransaction.ModifyLotSystemAttribute(newMergeLot, "PROCESS_EQUIP", string.Empty, txs);

                //Dispatch到下一站
                WIPTransaction.DispatchLot(newMergeLot, txs);
            }
        }
Beispiel #17
0
        protected void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                var reasonCategory = ReasonCategoryInfo.GetReasonCategoryByCategoryNameAndReason("CustomizeReason", "ManualMerge");
                if (reasonCategory == null)
                {
                    //[00030]{0}:{1}不存在!
                    throw new CimesException(TextMessage.Error.T00030(GetUIResource("ReasonCode"), "CustomizeReason- ManualMerge"));
                }

                var baseLot = _LotDatas.Find(p => p.Status == "WaitMerge");
                // 定義交易戳記
                var txnStamp = new TransactionStamp(User.Identity.Name, ProgramRight, ProgramRight, ApplicationName);
                using (var cts = CimesTransactionScope.Create())
                {
                    //拆批
                    var split          = SplitLotInfo.CreateSplitLotByLotAndQuantity(baseLot.Lot, baseLot.WorkOrderLot, 0, 0, reasonCategory, "");
                    var splitIndicator = WIPTxn.SplitIndicator.Create();
                    WIPTxn.Default.SplitLot(baseLot, split, splitIndicator, txnStamp);

                    //再取一次批號資訊
                    var newLot = LotInfo.GetLotByLot(split.Lot);
                    //併批與子單元
                    List <MergeLotInfo> mergeLotList = new List <MergeLotInfo>();
                    _LotDatas.ForEach(mergelot =>
                    {
                        var lstCompData = mergelot.GetLotAllComponents();
                        var mergeLot    = MergeLotInfo.GetMergeLotByLotAndQuantity(mergelot.Lot, lstCompData, reasonCategory, "");
                        mergeLotList.Add(mergeLot);
                    });
                    WIPTransaction.MergeLot(newLot, mergeLotList, txnStamp);
                    //再取一次批號資訊
                    var newMergeLot = LotInfo.GetLotByLot(split.Lot);

                    //將批號狀態變更為wait
                    WIPTransaction.ModifyLotSystemAttribute(newMergeLot, "STATUS", LotDefaultStatus.Wait.ToCimesString(), txnStamp);
                    //將COMPLOT、PROCESS_EQUIP欄位清空,因為這個時間點這個欄位已經沒意義了
                    WIPTransaction.ModifyLotSystemAttribute(newMergeLot, "COMPLOT", string.Empty, txnStamp);
                    WIPTransaction.ModifyLotSystemAttribute(newMergeLot, "PROCESS_EQUIP", string.Empty, txnStamp);

                    //Dispatch到下一站
                    WIPTransaction.DispatchLot(newMergeLot, txnStamp);
                    cts.Complete();
                }

                ClearField();
                ttbWorkOrderLot.Text = "";
                AjaxFocus(ttbWorkOrderLot);
                _ProgramInformationBlock.ShowMessage(TextMessage.Hint.T00614(""));
            }
            catch (Exception ex)
            {
                HandleError(ex);
            }
        }
Beispiel #18
0
        protected void btnOK_Click(object sender, EventArgs e)
        {
            try
            {
                if (_ProcessLot == null)
                {
                    throw new RuleCimesException(TextMessage.Error.T00826(lblUnPackingInventoryLot.Text));
                }

                // 定義交易戳記
                var txnStamp = new TransactionStamp(User.Identity.Name, ProgramRight, ProgramRight, ApplicationName);
                using (var cts = CimesTransactionScope.Create())
                {
                    // 將入庫批取消完工
                    WIPTransaction.UndoFinish(_ProcessLot, txnStamp);
                    var unPackingLot = LotInfo.GetLotByLot(ttbBoxNo.Text.Trim());
                    // 取得拆包Component
                    var lstUnPackingComp = unPackingLot.GetLotAllComponents();
                    // 將轉為子單元的批號還原,例如可使用於拆包
                    var txn = WIPTxn.Default.ConvertToLot(unPackingLot, lstUnPackingComp, txnStamp);
                    txn.LotList.ForEach(lot => {
                        //寫入WMSMaster & Detail
                        var wmsMaster = CSTWMSMastInfo.GetMaterialLotDataByMaterialLot(lot["INVLOT"].ToString());
                        if (wmsMaster == null)
                        {
                            wmsMaster            = InfoCenter.Create <CSTWMSMastInfo>();
                            wmsMaster.Lot        = lot["INVLOT"].ToString();
                            wmsMaster.DeviceName = lot.DeviceName;
                            wmsMaster.RuleName   = txnStamp.RuleName;
                            wmsMaster.InsertToDB(txnStamp.UserID, txnStamp.RecordTime);
                        }
                        //理論上只會有一個Comp
                        lot.GetLotAllComponents().ForEach(comp => {
                            var wmsDetail         = InfoCenter.Create <CSTWMSDetailInfo>();
                            wmsDetail.Lot         = lot["INVLOT"].ToString();
                            wmsDetail.ComponentID = comp.ComponentID;
                            wmsDetail.Quantity    = comp.ComponentQuantity;
                            wmsDetail.InsertToDB(txnStamp.UserID, txnStamp.RecordTime);
                        });
                        WIPTransaction.TerminateLot(lot, txnStamp);
                    });

                    cts.Complete();
                }
                // 返回定義的預設網頁
                ReturnToPortal();
            }
            catch (Exception ex)
            {
                HandleError(ex);
            }
        }
Beispiel #19
0
        public DataService(EnvironmentConfig enviConfig, LotInfo LotInfo, Recipe Recipe = null, string subcon = "")
        {
            lotInfo         = LotInfo;
            lotInfo.SETUP_T = DateTime.Now;
            lotInfo.START_T = DateTime.Now;
            transferMode    = enviConfig.TransferMode;

            ftpUpload = new FtpWeb(enviConfig.ServerDataIP.IP, string.Empty, enviConfig.ServerDataIP.User, enviConfig.ServerDataIP.Password);

            if (subcon == "JCET" && Recipe != null)
            {
                string tc             = ConvertTestCode(lotInfo.TestCode.ToString(), Recipe.TestCodeConvertConfiguration.dictTestCode);
                string prefixDir      = ApplyNameRule(Recipe.DatalogConfiguration.datalog_name_rule_1, subcon, tc);
                string prefixDirLocal = enviConfig.LocalDlogDir + prefixDir;
                string csvDirLocal    = prefixDirLocal + "\\csvdir\\";
                CreateLocalDir(csvDirLocal);
                string singlefileDirLocal = prefixDirLocal + "\\SingleFile\\";
                CreateLocalDir(singlefileDirLocal);
                string fulllotfileDirLocal = prefixDirLocal + "\\FullLotFile\\";
                CreateLocalDir(fulllotfileDirLocal);
                string stdtxtDirLocal = prefixDirLocal + "\\STD_TXT\\";
                CreateLocalDir(stdtxtDirLocal);

                CreateServerDir(enviConfig.ServerDlogDir, prefixDir);

                string logname = ApplyNameRule(Recipe.DatalogConfiguration.datalog_name_rule_2, subcon, tc);
                stdfPath   = singlefileDirLocal + logname + ".stdf";
                csvPath    = csvDirLocal + logname + ".csv";
                configPath = csvDirLocal + lotInfo.ModeCode.ToString() + "_" + lotInfo.TesterID.ToString() + "_config.txt";
                htmlPath   = fulllotfileDirLocal + logname + "_" + lotInfo.ModeCode.ToString() + ".html";
                csvsumPath = fulllotfileDirLocal + logname + "_" + lotInfo.ModeCode.ToString() + ".csv";
                mtcsvPath  = singlefileDirLocal + logname + ".csv";
            }
            else
            {
                string dirLocal = Path.Combine(enviConfig.LocalDlogDir, lotInfo.ProgramName.ToString());
                CreateLocalDir(dirLocal);
                string dirLocalFullLot = Path.Combine(dirLocal, "FullLot");
                CreateLocalDir(dirLocalFullLot);

                string logname     = lotInfo.ProgramName.ToString() + "_" + lotInfo.SubLotNo.ToString() + "_" + lotInfo.TestCode.ToString() + "_" + string.Format("{0:yyyyMMddHHmmss}", lotInfo.START_T);
                string logname_sum = lotInfo.ProgramName.ToString() + "_" + lotInfo.SubLotNo.ToString() + "_" + lotInfo.TestCode.ToString() + "_SUM_" + string.Format("{0:yyyyMMddHHmmss}", lotInfo.START_T);
                stdfPath   = Path.Combine(dirLocal, logname + ".stdf");
                mtcsvPath  = Path.Combine(dirLocal, logname + ".csv");
                csvPath    = Path.Combine(dirLocal, logname_sum + ".csv");
                configPath = Path.Combine(dirLocal, lotInfo.TesterID.ToString() + "_sum_history.txt");
                htmlPath   = Path.Combine(dirLocalFullLot, logname + ".html");
                csvsumPath = Path.Combine(dirLocalFullLot, logname + ".csv");
            }

            stdfService = new STDFService(stdfPath);
        }
Beispiel #20
0
    void LeftRightSubdivide(LotInfo lot, Utils.Direction v_dir)
    {
        if (lot.Frontage < 2.7f)
        {
            return;
        }

        LotInfo LotL = SubdivideBlock(lot, Utils.Left, v_dir);
        LotInfo LotR = SubdivideBlock(lot, Utils.Right, v_dir);

        LeftRightSubdivide(LotL, v_dir);
        LeftRightSubdivide(LotR, v_dir);
    }
Beispiel #21
0
        private LotInfo SplitLot(LotInfo distinctLot, bool isRelative, TransactionStamp txnStamp)
        {
            LotInfo lotData = LotInfo.GetLotByLot(distinctLot.Lot);

            List <SqlAgent>      splitLotArchiSQLList = new List <SqlAgent>();
            List <ComponentInfo> lsComponentDatas     = new List <ComponentInfo>();

            if (isRelative)
            {
                // 找出相同批號的所有Component
                _RelativePackingList.FindAll(lot => lot.LotInfo.Lot == lotData.Lot).ForEach(pack =>
                {
                    lsComponentDatas.Add(ComponentInfo.GetComponentByComponentID(pack.ComponentID));
                });
            }
            else
            {
                // 找出相同批號的所有Component
                _PackingList.FindAll(lot => lot.LotInfo.Lot == lotData.Lot).ForEach(pack =>
                {
                    lsComponentDatas.Add(ComponentInfo.GetComponentByComponentID(pack.ComponentID));
                });
            }

            var generator = NamingIDGenerator.GetRule("SplitLot");

            if (generator == null)
            {
                //WRN-00411,找不到可產生的序號,請至命名規則維護設定,規則名稱:{0}!!!
                throw new Exception(TextMessage.Error.T00437("SplitLot"));
            }
            var serialData = generator.GenerateNextIDs(1, lotData, new string[] { }, User.Identity.Name);

            splitLotArchiSQLList = serialData.Second;
            var splitLotID = serialData.First[0];

            var          reasonCategoryInfo = ReasonCategoryInfo.GetReasonCategoryByCategoryNameAndReason("Common", "OTHER");
            SplitLotInfo splitLotData       = SplitLotInfo.CreateSplitLotByLotAndQuantity(lotData.Lot, splitLotID, lsComponentDatas, reasonCategoryInfo, "Pack");

            WIPTxn.SplitIndicator splitInd = WIPTxn.SplitIndicator.Create();
            // 拆批交易
            WIPTxn.Default.SplitLot(lotData, splitLotData, splitInd, txnStamp);

            //若子單元為自動產生,更新序號至DB
            if (splitLotArchiSQLList != null && splitLotArchiSQLList.Count > 0)
            {
                DBCenter.ExecuteSQL(splitLotArchiSQLList);
            }

            return(LotInfo.GetLotByLot(splitLotID));
        }
Beispiel #22
0
        /// <summary>
        /// 更新FAI,檢驗完成回壓FAICount,第一次首件回壓FAIDevice
        /// </summary>
        /// <param name="equipmentName"></param>
        /// <param name="lot"></param>
        public static void UpdateFAI(string equipmentName, string lot, bool initFlag, TransactionStamp txs)
        {
            //取得批號資料
            var lotData = LotInfo.GetLotByLot(lot);

            var faiData = CSTEquipmentFAIInfo.GetDataByEquipmentAndDevice(equipmentName, lotData.DeviceName);

            if (faiData == null)
            {
                return;
            }

            if (faiData.INSPTYPE == FAIType.CN.ToCimesString())
            {
                #region 連N測試,只要一支NG,就要reset檢驗次數,重新送件

                //判定NG的時候回壓初始化FAICount,判定OK則WAITFAICOUNT減1
                if (initFlag) //NG
                {
                    //取得料號版本的資料
                    var deviceVerExData = DeviceVersionInfo.GetDeviceVersion(lotData.DeviceName, lotData.DeviceVersion).ChangeTo <DeviceVersionInfoEx>();

                    //檢查料號的FAICount有無設定
                    if (deviceVerExData.FAICount.ToString().IsNullOrTrimEmpty())
                    {
                        //T00541
                        //料號:xxx的系統屬性:xxx 未設定,請洽IT人員!) error code:T00031
                        throw new Exception(TextMessage.Error.T00541(deviceVerExData.DeviceName, "FAICount"));
                    }

                    faiData.WAITFAICOUNT = deviceVerExData.FAICount;
                }
                else //OK
                {
                    faiData.WAITFAICOUNT = faiData.WAITFAICOUNT - 1;
                }
                #endregion
            }
            else
            {
                //首N測試,判定OK將WAITFAICOUNT減1就好,判定NG不須動作
                if (!initFlag)
                {
                    faiData.WAITFAICOUNT = faiData.WAITFAICOUNT - 1;
                }
            }

            faiData.UpdateToDB(txs.UserID, txs.RecordTime);
            LogCenter.LogToDB(faiData, LogCenter.LogIndicator.Create(ActionType.Set, txs.UserID, txs.RecordTime));
        }
Beispiel #23
0
        /// <summary>
        /// 生成批号
        /// </summary>
        /// <param name="item"></param>
        /// <param name="lotCode"></param>
        /// <param name="actualLength"></param>
        public static LotMaster.EntityKey CreateLot(ItemMaster item, string lotCode, int actualLength)
        {
            if (item.InventoryInfo.LotParamKey == null)
            {
                throw new Exception(string.Format("料品{0}没有启用批号管理,不能生成批号档案!", item.Code));
            }

            LotMaster lot = LotMaster.Finder.Find(string.Format("LotCode='{0}'and ItemCode = '{1}' ", lotCode, item.Code));

            if (lot != null)
            {
                return(lot.Key);
            }

            // 生成批号主挡
            LotRequestDTO lotReqDTO = new LotRequestDTO();

            lotReqDTO.Item = item.Key;
            //lotReqDTO.ItemCode = item.Code;
            lotReqDTO.ItemOrg   = item.OrgKey;
            lotReqDTO.QueryTime = Base.Context.LoginDateTime;
            lotReqDTO.UsingOrg  = Base.Context.LoginOrg.Key;
            lotReqDTO.Lot       = lotCode;

            lotReqDTO.EffectiveTime = Base.Context.LoginDate;
            lotReqDTO.InvalidTime   = DateTime.Parse("3000-1-1");
            lotReqDTO.ValidDays     = (lotReqDTO.InvalidTime - lotReqDTO.EffectiveTime).Days;
            //段长
            lotReqDTO.DescFlexSegments             = new Base.FlexField.DescFlexField.DescFlexSegments();
            lotReqDTO.DescFlexSegments.PubDescSeg1 = actualLength.ToString();

            CreateLotOnlineSV onlineLot = new CreateLotOnlineSV();

            onlineLot.LotRequestDTO = lotReqDTO;
            LotInfo lotInfo = onlineLot.Do();

            if (lotInfo == null)
            {
                return(null);
            }
            if (lotInfo.LotMaster == null)
            {
                return(null);
            }
            if (lotInfo.LotMaster.EntityID <= 0L)
            {
                return(null);
            }
            return(new LotMaster.EntityKey(lotInfo.LotMaster.EntityID));
        }
Beispiel #24
0
 static public bool IsValidAddLot(LotInfo lot)
 {
     if (lot.Name == "")
     {
         MessageBox.Show("Не заполнено поле названия лота!");
         return(false);
     }
     if (lot.Category == "")
     {
         MessageBox.Show("Не заполнено поле категории лота!");
         return(false);
     }
     return(true);
 }
Beispiel #25
0
        private void WriteMir(LotInfo lotinfo)
        {
            Mir mir = new Mir();

            mir.SETUP_T = lotinfo.SETUP_T;
            mir.RecordHeader.REC_LEN += 4;
            mir.START_T = lotinfo.START_T;
            mir.RecordHeader.REC_LEN += 4;
            mir.STAT_NUM              = 1;
            mir.RecordHeader.REC_LEN += 1;
            mir.MODE_COD              = lotinfo.MODE_COD;
            mir.RTST_COD              = lotinfo.RTST_COD;
            mir.LOT_ID = lotinfo.CustomerLotNo.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.LOT_ID.Length + 1);
            mir.PART_TYP              = lotinfo.DeviceName.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.PART_TYP.Length + 1);
            mir.NODE_NAM              = lotinfo.TesterID.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.NODE_NAM.Length + 1);
            mir.TSTR_TYP              = lotinfo.TSTR_TYP;
            mir.RecordHeader.REC_LEN += (ushort)(mir.TSTR_TYP.Length + 1);
            mir.JOB_NAM = lotinfo.ProgramName.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.JOB_NAM.Length + 1);
            mir.JOB_REV = lotinfo.JOB_REV;
            mir.RecordHeader.REC_LEN += (ushort)(mir.JOB_REV.Length);
            mir.EXEC_TYP              = lotinfo.EXEC_TYP;
            mir.RecordHeader.REC_LEN += (ushort)(mir.EXEC_TYP.Length);
            mir.EXEC_VER              = lotinfo.EXEC_VER;
            mir.RecordHeader.REC_LEN += (ushort)(mir.EXEC_VER.Length);
            mir.OPER_NAM              = lotinfo.OperatorID.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.OPER_NAM.Length);
            mir.FAMLY_ID              = lotinfo.CustomerID.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.FAMLY_ID.Length);
            mir.SBLOT_ID              = lotinfo.SubLotNo.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.SBLOT_ID.Length);
            mir.TEST_COD              = lotinfo.ModeCode.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.TEST_COD.Length);
            mir.USER_TXT              = lotinfo.TestBinNo.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.USER_TXT.Length);
            mir.FLOW_ID = lotinfo.TestCode.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.FLOW_ID.Length);
            mir.TST_TEMP              = lotinfo.TST_TEMP;
            mir.RecordHeader.REC_LEN += (ushort)(mir.TST_TEMP.Length);
            mir.FACIL_ID              = lotinfo.FACIL_ID;
            mir.RecordHeader.REC_LEN += (ushort)(mir.FACIL_ID.Length);
            mir.SETUP_ID              = lotinfo.SETUP_ID;
            mir.RecordHeader.REC_LEN += (ushort)(mir.SETUP_ID.Length);
            mir.DSGN_REV              = lotinfo.DeviceName.ToString();
            mir.RecordHeader.REC_LEN += (ushort)(mir.DSGN_REV.Length);
            sfw.WriteRecord(mir);
        }
Beispiel #26
0
        /// <summary>
        /// 檢查傳入機台是否符合工單上線別內可使用機台名稱
        /// </summary>
        /// <param name="equipmentName"></param>
        /// <param name="lotData"></param>
        /// <returns></returns>
        public static bool CheckEqpGruopAndDivision(string equipmentName, LotInfo lot)
        {
            bool checkResult = false;

            //找出工單上的線別(division),再用線別名稱去工作站的機台設定,找出同名稱的機台群組,再比照機台的正確性

            //取得批號目前的工作站資料
            var operationData = OperationInfo.GetOperationByName(lot.OperationName);

            if (operationData == null)
            {
                //機台:{0},不在可用機台範圍,請至 [工作站設定] 確認機台設定
                throw new Exception(RuleMessage.Error.C10005(equipmentName));
            }

            //依據批號工作站找出歸屬的機台群組清單
            List <OperationResourceInfoEx> resourceDataList = OperationResourceInfoEx.GetDataByOperSID(operationData.OperationSID);

            if (resourceDataList.Count == 0)
            {
                //機台:{0},不在可用機台範圍,請至 [工作站設定] 確認機台設定
                throw new Exception(RuleMessage.Error.C10005(equipmentName));
            }

            foreach (var resourceData in resourceDataList)
            {
                //找出同名稱的機台群組
                var equipGroupData = EquipmentGroupInfo.GetEquipmentGroupByID(resourceData.ResourceID);

                //找出工單上的線別(Division)
                var workOrder = WorkOrderInfo.GetWorkOrderByWorkOrder(lot.WorkOrder).ChangeTo <WorkOrderInfoEx>();

                if (equipGroupData.GroupName == workOrder.Division)
                {
                    //用群組SID找出在該群組下的工作站
                    List <EquipGroupEquipInfoEx> eqGroupDataList = EquipGroupEquipInfoEx.GetEquipGroupByGroupSID(equipGroupData.ID);
                    if (eqGroupDataList.Find(p => p.EquipmentName == equipmentName) != null)
                    {
                        checkResult = true;
                    }
                }
            }

            return(checkResult);
        }
Beispiel #27
0
        private void Form1_Load(object sender, EventArgs e)
        {
            dataGridViewHistory.DataSource = historyTable;
            comboBoxOperator.Items.Clear();
            comboBoxOperator.Items.AddRange(SqlOperations.GetListOfOperators());
            var screen = Screen.FromControl(this).Bounds;

            this.Height    = screen.Height;
            this.Width     = screen.Width / 2;
            currentLotInfo = new LotInfo("", "", 0, "", "", "", "", "", "");

            FinalFrame          = new VideoCaptureDevice();
            deviceMonikerString = CameraTools.CheckDeviceMonikerString(CaptureDevice);
            ProductionHistory.LoadHistoryFromTextFile(ref historyTable);
#if DEBUG
            buttonDebug.Visible = true;
#endif
        }
Beispiel #28
0
        private void WriteSdr(int numberOfSites, LotInfo lotInfo)
        {
            Sdr sdr = new Sdr();

            sdr.HEAD_NUM              = 1;
            sdr.RecordHeader.REC_LEN += 1;
            sdr.SITE_GRP              = 1;
            sdr.RecordHeader.REC_LEN += 1;
            sdr.SITE_CNT              = (byte)numberOfSites;
            sdr.RecordHeader.REC_LEN += 1;
            sdr.SITE_NUM              = sitesGenerator(numberOfSites);// new byte[] { 1, 2, 3, 4, ... };
            sdr.RecordHeader.REC_LEN += (ushort)sdr.SITE_NUM.Length;
            sdr.HAND_ID = lotInfo.HAND_ID;
            sdr.RecordHeader.REC_LEN += (ushort)(sdr.HAND_ID.Length);
            sdr.LOAD_ID = lotInfo.LOAD_ID;
            sdr.RecordHeader.REC_LEN += (ushort)(sdr.LOAD_ID.Length);
            sfw.WriteRecord(sdr);
        }
Beispiel #29
0
        /// <summary>
        /// 依照輸入LotID取得相關欄位資料及相關Button設定
        /// </summary>
        /// <param name="LotID">批號名稱</param>
        private void LoadControlByLot(string LotID)
        {
            // 清除欄位資訊
            ClearField();
            if (cbxWO.Checked)
            {
                _LotData = LotInfoEx.GetLotByWorkOrderLot(LotID);
            }

            if (cbxLot.Checked)
            {
                _LotData = LotInfoEx.GetLotByLot(LotID);
            }

            if (cbxSN.Checked)
            {
                var lot = CustomizeFunction.ConvertDMCCode(LotID);

                var compInfo = ComponentInfoEx.GetComponentByComponentID(lot);
                if (compInfo == null)
                {
                    var compList = ComponentInfoEx.GetComponentByDMCCode(lot);
                    if (compList.Count != 0)
                    {
                        compInfo = compList[0];
                    }
                }

                if (compInfo != null)
                {
                    _LotData = LotInfo.GetLotByLot(compInfo.CurrentLot).ChangeTo <LotInfoEx>();
                }
            }

            // 若該批號無資料可顯示,離開程式並顯示訊息
            if (_LotData == null)
            {
                btnPrint.Enabled = false;
                AjaxFocus(ttbWOLot);
                throw new Exception(TextMessage.Error.T00060(LotID));
            }

            btnPrint.Enabled = true;
        }
Beispiel #30
0
    public void BlockRayButton()
    {
        BlockCenter = mesh.bounds.center;
        //Instantiate(marker, BlockCenter, Quaternion.identity);
        bool isVertical = false;

        AngleCheck();

        RightAnchor = Utils.ReturnMaximalVector(BlockRay(BlockCenter, RayVectorH, isVertical, baseLine: true), Utils.Right);
        LeftAnchor  = Utils.ReturnMaximalVector(BlockRay(BlockCenter, -RayVectorH, isVertical, baseLine: true), Utils.Left);
        UpAnchor    = Utils.ReturnMaximalVector(BlockRay(BlockCenter, RayVectorV, isVertical, baseLine: true), Utils.Up);
        DownAnchor  = Utils.ReturnMaximalVector(BlockRay(BlockCenter, -RayVectorV, isVertical, baseLine: true), Utils.Down);

        Utils.Direction[] h_directions = { Utils.Right, Utils.Left };
        Utils.Direction[] v_directions = { Utils.Up, Utils.Down };
        LotInfo           BlockLot     = LotFromParentBlock();

        LeftRightSubdivide(BlockLot, Utils.Up);
        LeftRightSubdivide(BlockLot, Utils.Down);
    }
Beispiel #31
0
        public static bool IsUpdateDMS(LotInfo lotinfo,out Supplier supt)
        {
            supt = null;
            if (lotinfo != null
                && lotinfo.LotMaster_EntityID != null
                )
            {
                string suptCode = lotinfo.LotMaster_EntityID.DescFlexSegments.PrivateDescSeg1;
                if (suptCode.IsNotNullOrWhiteSpace())
                {
                    supt = Supplier.Finder.Find("Code=@Code"
                        , new OqlParam(suptCode)
                        );

                    if (PubHelper.IsUpdateDMS(supt))
                    {
                        return true;
                    }
                }
            }
            return false;
        }