Esempio n. 1
0
        private GoBasicNode Drowing_Node(string lotID, Int32 xLevelNo
                                         , string yLevelNo, LotHistoryItem lotInfo, string seletedLotID)
        {
            int denominator = Convert.ToInt32(yLevelNo.Split('@')[0]);
            int numerator   = Convert.ToInt32(yLevelNo.Split('@')[1]);

            GoBasicNode node = new GoBasicNode();

            node.Shape           = new GoRoundedRectangle();
            node.Location        = new PointF(xLevelNo * 250 + 150, 100 * numerator);
            node.Text            = lotInfo.GetNodeText(lotID);
            node.Label.Multiline = true;

            if (seletedLotID.Equals(lotID))
            {
                node.Shape.BrushColor = Color.LightPink;
            }
            else
            {
                node.Shape.BrushColor = Color.LightGray;
            }

            node.LabelSpot = GoObject.MiddleCenter;
            goView1.Document.Add(node);

            return(node);
        }
Esempio n. 2
0
        private void DrawingLotPath(List <string> lotMappingList
                                    , Dictionary <string, LotHistoryItem> lotHistoryInfoFromLot
                                    , Dictionary <string, LotHistoryItem> lotHistoryInfoToLot
                                    , string seletedLotID)
        {
            this.goView1.Document.Clear();
            Dictionary <string, GoBasicNode> nodeInfo   = new Dictionary <string, GoBasicNode>();
            Dictionary <string, int>         xLevelInfo = GetXLevelInfo(lotMappingList);
            Dictionary <string, string>      yLevelInfo = GetYLevelInfo(xLevelInfo);
            List <string> printedLotList = new List <string>();

            foreach (string fromToLotID in lotMappingList)
            {
                string fromLotID = fromToLotID.Split('@')[0];
                string toLotID   = fromToLotID.Split('@')[1];

                int foreachIdx = 0;
                foreach (string lotID in new List <string>()
                {
                    fromLotID, toLotID
                })
                {
                    foreachIdx++;

                    int            xLevelNo = xLevelInfo[lotID];
                    string         yLevelNo = yLevelInfo[lotID];
                    LotHistoryItem lotInfo  = GetLotHistoryItem(lotHistoryInfoFromLot, lotHistoryInfoToLot, lotID);

                    if (printedLotList.Contains(lotID) == false ||
                        (fromLotID.Equals(toLotID) && foreachIdx == 2))
                    {
                        if (fromLotID.Equals(toLotID))
                        {
                            lotInfo.SetLotHistoryInfoKey(LotHistoryInfoKey.ISToLot);
                            xLevelNo++;
                        }

                        GoBasicNode node = Drowing_Node(lotID, xLevelNo, yLevelNo, lotInfo, seletedLotID);
                        printedLotList.Add(lotID);

                        if (fromLotID.Equals(toLotID) && nodeInfo.ContainsKey(CommonHelper.CreateKey(lotID, "M")) == false)
                        {
                            nodeInfo.Add(CommonHelper.CreateKey(lotID, "M"), node);
                        }
                        else if (nodeInfo.ContainsKey(lotID) == false)
                        {
                            nodeInfo.Add(lotID, node);
                        }
                    }
                }

                if (fromLotID.Equals(toLotID))
                {
                    toLotID = CommonHelper.CreateKey(toLotID, "M");
                }

                DrawingLink(nodeInfo[fromLotID], nodeInfo[toLotID]);
            }
        }
Esempio n. 3
0
        private Dictionary <string, LotHistoryItem> GetLotHistoryInfo(LotHistoryInfoKey keyType)
        {
            Dictionary <string, LotHistoryItem> lotHistoryInfo = new Dictionary <string, LotHistoryItem>();
            DataTable lotHistory = _result.LoadOutput(DataConsts.Out_LotHistory);

            foreach (DataRow row in lotHistory.Rows)
            {
                string   versionNo      = row.GetString("VERSION_NO");
                string   factoryID      = row.GetString("FACTORY_ID");
                string   fromShopID     = row.GetString("FROM_SHOP_ID");
                string   fromLotID      = row.GetString("FROM_LOT_ID");
                string   fromProcessID  = row.GetString("FROM_PROCESS_ID");
                string   fromProductID  = row.GetString("FROM_PRODUCT_ID");
                string   toLotID        = row.GetString("TO_LOT_ID");
                string   toProcessID    = row.GetString("TO_PROCESS_ID");
                string   toProductID    = row.GetString("TO_PRODUCT_ID");
                DateTime fromDate       = row.GetDateTime("FROM_DATE");
                DateTime toDate         = row.GetDateTime("TO_DATE");
                Int32    fromQty        = row.GetInt32("FROM_QTY");
                Int32    toQty          = row.GetInt32("TO_QTY");
                string   targetDemandID = row.GetString("TAR_DEMAND_ID");
                DateTime targetplanDate = row.GetDateTime("TARGET_PLAN_DATE");
                Int32    targetPlanQty  = row.GetInt32("TARGET_PLAN_QTY");

                string key = string.Empty;

                if (keyType == LotHistoryInfoKey.ISFromLot)
                {
                    key = fromLotID;
                }
                else if (keyType == LotHistoryInfoKey.ISToLot)
                {
                    key = toLotID;
                }
                else if (keyType == LotHistoryInfoKey.ISFromToLot)
                {
                    key = CommonHelper.CreateKey(fromLotID, toLotID);
                }

                if (lotHistoryInfo.ContainsKey(key) == false)
                {
                    lotHistoryInfo[key] = new LotHistoryItem();
                }

                lotHistoryInfo[key].AddItem(versionNo, factoryID, fromShopID, fromLotID, fromProcessID
                                            , fromProductID, toLotID, toProcessID, toProductID, fromDate, toDate
                                            , fromQty, toQty, targetDemandID, targetplanDate, targetPlanQty, keyType);
            }

            return(lotHistoryInfo);
        }
Esempio n. 4
0
        private LotHistoryItem GetLotHistoryItem(
            Dictionary <string, LotHistoryItem> lotHistoryInfoFromLot
            , Dictionary <string, LotHistoryItem> lotHistoryInfoToLot
            , string lotID)
        {
            LotHistoryItem lotInfo = new LotHistoryItem();

            if (lotHistoryInfoFromLot.ContainsKey(lotID))
            {
                lotInfo = lotHistoryInfoFromLot[lotID];
            }
            else if (lotHistoryInfoToLot.ContainsKey(lotID))
            {
                lotInfo = lotHistoryInfoToLot[lotID];
            }

            return(lotInfo);
        }