public override void Update(uint elapsed) { mTimer += Time.deltaTime; switch (mCurStep) { case UIStep.STEP_ORIGINAL: { IconTween.resetOnPlay = true; mTimer = 0.0f; mCurStep = UIStep.STEP_0; } break; case UIStep.STEP_0: { IconTween.Play(true); mTimer = 0.0f; mCurStep = UIStep.STEP_Stop; } break; case UIStep.STEP_Stop: { } break; } }
protected override void OnLoad() { base.OnLoad(); FloorNum = FindComponent <UILabel>("container/Main/Content/FloorNum"); Scribe = FindComponent <UILabel>("container/Main/Content/Scribe"); mBack = FindComponent <UIButton>("container/Main/Content/BtnGrid/Back"); Sweep = FindComponent <UIButton>("container/Main/Content/BtnGrid/Sweep"); Continue = FindComponent <UIButton>("container/Main/Content/BtnGrid/Continue"); BtnGrid = FindComponent <UIGrid>("container/Main/Content/BtnGrid"); CurScore = FindComponent <UILabel>("container/Main/Content/CurScore"); MaxScore = FindComponent <UILabel>("container/Main/Content/MaxScore"); Jilu = FindComponent <UISpriteAnimation>("container/Main/Content/jilu"); Jilu.gameObject.SetActive(false); Main = FindChild("container/Main"); AchieveOne = new AchieveItemUI(FindChild("container/Main/Content/AchieveGrid/Achieve1")); AchieveTwo = new AchieveItemUI(FindChild("container/Main/Content/AchieveGrid/Achieve2")); AchieveThree = new AchieveItemUI(FindChild("container/Main/Content/AchieveGrid/Achieve3")); MContainer = FindChild("container"); WaitUI = FindChild("container/Waiting"); Background = FindChild("container/Main/Background"); mTween = FindComponent <UIPlayTween>("container"); mBackTween = FindComponent <UIPlayTween>("container/Main/Content/BtnGrid/Back"); mBackTween.resetOnPlay = true; mContinueTween = FindComponent <UIPlayTween>("container/Main/Content/BtnGrid/Continue"); mContinueTween.resetOnPlay = true; mSweepTween = FindComponent <UIPlayTween>("container/Main/Content/BtnGrid/Sweep"); mSweepTween.resetOnPlay = true; mAwardW = new AwardWidgetUI(FindChild("container/AwardWidget")); mAwardW.setShow(false); mCurStep = UIStep.STEP_5; }
protected override void OnOpen(object param = null) { WindowManager.Instance.CloseUI("challengecountdown"); mModule = ModuleManager.Instance.FindModule <ChallengeModule>(); EventDelegate.Add(mBack.onClick, OnBack); EventDelegate.Add(Continue.onClick, OnContinue); EventDelegate.Add(Sweep.onClick, OnSweep); UIEventListener.Get(Background).onClick = OnBackgroundClick; EventSystem.Instance.addEventListener(ChallengeEvent.SWEEP_DROP, RefreshBtn); mParam = param as ChallengeCompleteParam; if (mParam == null) { return; } MState = UIState.ShowDrop; FloorNum.text = String.Format(StringHelper.GetString("floornum2"), mParam.mFloor); var tableItem = DataManager.ChallengeTable[mParam.mFloor] as ChallengeTableItem; if (tableItem != null) { Scribe.text = tableItem.mDropTip; } CurScore.text = tableItem.mFloorScore.ToString(); MaxScore.text = String.Format(StringHelper.GetString("histortyScore"), mParam.mHistortyScore); mAwardW.SetShowInfo(mParam); AchieveOne.mMaxNum = tableItem.mAchieveScoreOne; AchieveTwo.mMaxNum = tableItem.mAchieveScoreTwo; AchieveThree.mMaxNum = tableItem.mAchieveScoreThree; AchieveOne.mNum.enabled = mParam.mAchieveOne; AchieveTwo.mNum.enabled = mParam.mAchieveTwo; AchieveThree.mNum.enabled = mParam.mAchieveThree; mCurStep = UIStep.STEP_ORIGINAL; }
public virtual void OnStepEnd(UIStep step) { if (!step.IsBlocking) { return; } if (m_currentStepIndex < m_steps.Count - 1) { m_currentStepIndex++; LaunchNextStep(); } else { Stop(); } }
//界面打开 protected override void OnOpen(object param = null) { EventDelegate.Add(OkBtn.onClick, OnClickClose); PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>(); QuestAwardData mCurAwardInfo = PlayerDataPool.Instance.MainData.mQuestData.GetAward(); QuestTableItem qti = DataManager.QuestTable[mCurAwardInfo.mQuestId] as QuestTableItem; QuestName.text = qti.questName; ObjectCommon.DestoryChildren(DropGrid.gameObject); if (mAwardUIList != null) { mAwardUIList.Clear(); } else { mAwardUIList = new List <AwardItemUI>(); } for (int i = 0; i < mCurAwardInfo.mAwardList.Count; i++) { AwardItemUI temp = new AwardItemUI(mCurAwardInfo.mAwardList[i].mResId, (int)mCurAwardInfo.mAwardList[i].mNum); temp.gameObject.transform.parent = DropGrid.gameObject.transform; temp.gameObject.transform.localScale = Vector3.one; } DropGrid.repositionNow = true; mCurStep = UIStep.STEP_ORIGINAL; //强制隐藏引导 GuideModule module = ModuleManager.Instance.FindModule <GuideModule>(); module.ForceHideGuide(true); }
List <Data.Character> retrayPlayerCaracters; // リトライ時の記録・再現用 public BattleScene(string scriptPath) { scriptAPI = new ScriptAPI(); script = new Emugen.Script.Script <ScriptAPI>(scriptPath, scriptAPI); script.Run(); var data = Data.DataCreater.Instance; if (scriptAPI.__bgmPath != null) { var bgm = new Emugen.Sound.SoundPlayer(scriptAPI.__bgmPath, 0.20f, true, Emugen.Sound.SoundPlayer.SoundType.BGM); } SetupPlayers(); SetupEnemys(); { PlayerCards = new UI.PlayerCard.PlayerCards(); layer.Add(PlayerCards, 30); } { EnemyCards = new UI.EnemyCard.EnemyCards(); layer.Add(EnemyCards, 20); } { var bmp = new System.Drawing.Bitmap(scriptAPI.__backGroundImagePath); var texture = new Texture(bmp); var w = 1600; var h = (int)((double)bmp.Height / (double)bmp.Width * w); var sprite = new ImageSprite(texture, new Rect(new Vector2D(0, 0), new Vector2D(w, h)), new Color(1, 1, 1, 1)); layer.Add(sprite, 10); } { var skillCards = new UI.SkillCard.SkillCards(); layer.Add(skillCards, 40); SkillCards = skillCards; } { var sprite = new PlaneSprite(new Rect(new Vector2D(20, 100), new Vector2D(200, 1)), new Color(0.5, 1, 1, 1)); layer.Add(sprite, 10); } { foreach (var chara in data.playerCharacters) { PlayerCards.Add(chara); } PlayerCards.SetupCardPos(); } SetupEnemysCard(); { PlayerCards.OnSelected += (selectCards) => { switch (uiStep) { case UIStep.None: { var i = (List <UI.PlayerCard.PlayerCard>)selectCards; if (i[0].character.HP.Now == 0) { // 戦闘不能 } else { SkillCards.SetStep(UI.SkillCard.SkillCards.Step.ShowPlayerCharacterSkills, i[0].character); var soundPlayer = new Emugen.Sound.SoundPlayer(MainConfig.SoundEffect.UISelect01, 0.10f, false, Emugen.Sound.SoundPlayer.SoundType.SE); uiStep = UIStep.SkillSelect; SelectPlayerCard = selectCards[0]; } } break; case UIStep.SkillSelect: break; case UIStep.SkillTargetSelect: if (!isInputEventNowFrame) { isInputEventNowFrame = true; new Emugen.Sound.SoundPlayer(MainConfig.SoundEffect.UISelect01, 0.10f, false, Emugen.Sound.SoundPlayer.SoundType.SE); uiStep = UIStep.None; EnemyCards.uITargetSelectType = UI.EnemyCard.EnemyCards.UITargetSelectType.None; PlayerCards.uITargetSelectType = UI.PlayerCard.PlayerCards.UITargetSelectType.None; var i = (List <UI.PlayerCard.PlayerCard>)selectCards; //var i = (List<FafTk.UI.EnemyCard.EnemyCard>)selectCards; var targetCharacters = new List <Data.Character>(); foreach (var j in i) { targetCharacters.Add(j.character); } SelectPlayerCard.character.Action(SelectSkillCard.actionSkill, targetCharacters); } break; } }; } { SkillCards.OnSelected += (selectCard) => { switch (uiStep) { case UIStep.None: break; case UIStep.SkillSelect: if (!isInputEventNowFrame) { isInputEventNowFrame = true; var soundPlayer = new Emugen.Sound.SoundPlayer(MainConfig.SoundEffect.UISelect01, 0.10f, false, Emugen.Sound.SoundPlayer.SoundType.SE); uiStep = UIStep.SkillTargetSelect; SelectSkillCard = selectCard; if (SelectSkillCard.actionSkill.Main.TargetWord.IndexOf("横列") == 0) { var command = SelectSkillCard.actionSkill.Main.TargetWord.Split(' '); EnemyCards.uITargetSelectType = UI.EnemyCard.EnemyCards.UITargetSelectType.LineHorizontal; EnemyCards.uITargetSelectTypePalams = new int[] { int.Parse(command[1]), int.Parse(command[2]), int.Parse(command[3]) }; PlayerCards.uITargetSelectType = UI.PlayerCard.PlayerCards.UITargetSelectType.LineHorizontal; PlayerCards.uITargetSelectTypePalams = new int[] { int.Parse(command[1]), int.Parse(command[2]), int.Parse(command[3]) }; } else { var command = SelectSkillCard.actionSkill.Main.TargetWord.Split(' '); EnemyCards.uITargetSelectType = UI.EnemyCard.EnemyCards.UITargetSelectType.One; EnemyCards.uITargetSelectTypePalams = new int[] { int.Parse(command[1]) }; PlayerCards.uITargetSelectType = UI.PlayerCard.PlayerCards.UITargetSelectType.One; PlayerCards.uITargetSelectTypePalams = new int[] { int.Parse(command[1]) }; } } break; case UIStep.SkillTargetSelect: break; } }; SkillCards.OnClose += () => { switch (uiStep) { case UIStep.None: break; case UIStep.SkillSelect: if (!isInputEventNowFrame) { isInputEventNowFrame = true; var soundPlayer = new Emugen.Sound.SoundPlayer(MainConfig.SoundEffect.UICancel01, 0.15f, false, Emugen.Sound.SoundPlayer.SoundType.SE); uiStep = UIStep.None; EnemyCards.uITargetSelectType = UI.EnemyCard.EnemyCards.UITargetSelectType.None; PlayerCards.uITargetSelectType = UI.PlayerCard.PlayerCards.UITargetSelectType.None; } break; case UIStep.SkillTargetSelect: break; } }; } { EnemyCards.OnSelected += (selectCards) => { switch (uiStep) { case UIStep.None: break; case UIStep.SkillSelect: break; case UIStep.SkillTargetSelect: if (!isInputEventNowFrame) { isInputEventNowFrame = true; uiStep = UIStep.None; EnemyCards.uITargetSelectType = UI.EnemyCard.EnemyCards.UITargetSelectType.None; PlayerCards.uITargetSelectType = UI.PlayerCard.PlayerCards.UITargetSelectType.None; //var result = false; var targetCharacters = new List <Character>(); var i = (List <UI.EnemyCard.EnemyCard>)selectCards; foreach (var j in i) { targetCharacters.Add(j.character); } var result = SelectPlayerCard.character.Action(SelectSkillCard.actionSkill, targetCharacters); if (result) { new Emugen.Sound.SoundPlayer(MainConfig.SoundEffect.UISelect01, 0.10f, false, Emugen.Sound.SoundPlayer.SoundType.SE); } else { new Emugen.Sound.SoundPlayer(MainConfig.SoundEffect.UICancel01, 0.10f, false, Emugen.Sound.SoundPlayer.SoundType.SE); } } break; } }; } }
public override void Update() { isInputEventNowFrame = false; //uiStep switch (uiStep) { case UIStep.None: break; case UIStep.SkillSelect: break; case UIStep.SkillTargetSelect: { if ((InputCore.Instance.GetKeyEventType(InputCore.KeyEventCode.MouseRightButton) == InputCore.KeyEventType.Up)) { if (!isInputEventNowFrame) { isInputEventNowFrame = true; uiStep = UIStep.None; new Emugen.Sound.SoundPlayer(MainConfig.SoundEffect.UICancel01, 0.10f, false, Emugen.Sound.SoundPlayer.SoundType.SE); } } } break; } if (battleStep == BattleStep.Main) { Data.DataCreater.Instance.Update(); // 行動シンボルの増加を戦闘中のみに限定するためのif文 } SkillCards.Update(); PlayerCards.Update(); EnemyCards.Update(); switch (battleStep) { case BattleStep.Main: if (actionTimer == 0) { Action action = null; Data.Character character = null; foreach (var i in DataCreater.Instance.playerCharacters) { if (i.ActionStock != null) { action = i.ActionStock; character = i; } } foreach (var i in DataCreater.Instance.enemyCharacters) { if (i.ActionStock != null) { action = i.ActionStock; character = i; } } if (action != null) { action(); character.ActionStock = null; } actionTimer = actionTimerMax; } else { actionTimer--; } if (EnemyCards.Count == 0) { battleStep = BattleStep.End; var bgm = new Emugen.Sound.SoundPlayer(Config.MainConfig.BattleScene.BGMStageClear, 0.20f, true, Emugen.Sound.SoundPlayer.SoundType.BGM); } else if (DataCreater.Instance.IsPlayerCharacterAllDead()) { battleStep = BattleStep.LostClickWait; var choice = new UI.Talk.Choice(new string[] { "もう一度戦う", "タイトルに戻る" }); layer.Add(choice, 200); LostClickWaitChoice = choice; var bgm = new Emugen.Sound.SoundPlayer(Config.MainConfig.BattleScene.BGMGameOver, 0.20f, true, Emugen.Sound.SoundPlayer.SoundType.BGM); } else { var data = Data.DataCreater.Instance; var tmp = new List <Data.Character>(); foreach (var i in data.enemyCharacters.Where(x => x.HP.Now <= 0)) { tmp.Add(i); } foreach (var i in tmp) { EnemyCards.Del(i.enemyCard); data.enemyCharacters.Remove(i); } } break; case BattleStep.LostClickWait: { LostClickWaitChoice.Update(); var input = Emugen.Input.InputCore.Instance; if ((input.GetKeyEventType(Emugen.Input.InputCore.KeyEventCode.MouseLeftButton) == Emugen.Input.InputCore.KeyEventType.Up)) { var tmp = LostClickWaitChoice.GetChoiseText(); switch (tmp) { case "もう一度戦う": { var data = Data.DataCreater.Instance; var i = 0; foreach (var v in retrayPlayerCaracters) { var chara = data.playerCharacters[i]; chara.HP.Now = v.HP.Now; chara.elementTimer = v.elementTimer; chara.ElementLing.pos = v.ElementLing.pos; chara.Elements.Clear(); foreach (var element in v.Elements) { chara.Elements.Add(new Element(element.Name)); } i++; } WindowManager.nextScene = new Scene.BattleScene(this.script.Path); } break; case "タイトルに戻る": { WindowManager.nextScene = new Scene.TitleScene(); } break; } } } break; case BattleStep.End: { var input = Emugen.Input.InputCore.Instance; if ((input.GetKeyEventType(Emugen.Input.InputCore.KeyEventCode.MouseLeftButton) == Emugen.Input.InputCore.KeyEventType.Up)) { WindowManager.nextScene = new Scene.TalkScene(scriptAPI.__nextTalkScriptPath); } } break; } }
// Update is called once per frame public override void Update(uint elapsed) { if (mParam == null) { return; } if (MState == UIState.Waiting) { mWaitTime += Time.deltaTime; if (!(mWaitTime >= mMaxWaitTime)) { return; } WindowManager.Instance.CloseUI("challengeDrop"); mModule.ContinueChallenge(); } else { mTimer += Time.deltaTime; switch (mCurStep) { case UIStep.STEP_ORIGINAL: { mBack.gameObject.SetActive(false); Continue.gameObject.SetActive(false); Sweep.gameObject.SetActive(false); UIAtlasHelper.SetSpriteGrey(AchieveOne.mIcon, true); UIAtlasHelper.SetSpriteGrey(AchieveTwo.mIcon, true); UIAtlasHelper.SetSpriteGrey(AchieveThree.mIcon, true); AchieveOne.Reset(); AchieveTwo.Reset(); AchieveThree.Reset(); mTimer = 0.0f; mCurStep = UIStep.STEP_Wait; mTween.resetOnPlay = true; MContainer.SetActive(false); Jilu.gameObject.SetActive(false); } break; case UIStep.STEP_Wait: { if (mTimer < STEPTIME_Wait) { return; } MContainer.SetActive(true); mTween.Play(true); mTimer = 0; mCurStep = UIStep.STEP_0; } break; case UIStep.STEP_0: { if (!(mTimer > STEPTIME_0)) { return; } mTimer = 0.0f; mCurStep = UIStep.STEP_AchieveAnim; } break; case UIStep.STEP_AchieveAnim: { if (ActionAchieve()) { return; } mTimer = 0.0f; mCurStep = UIStep.STEP_1; } break; case UIStep.STEP_1: { if (ActionScrollNum()) { return; } mTimer = 0.0f; mCurStep = UIStep.STEP_2; } break; case UIStep.STEP_2: { if (mParam.mScore > mParam.mHistortyScore) { Jilu.gameObject.SetActive(true); Jilu.Reset(); } RefreshBtn(); if (mBackTween.gameObject.activeSelf) { mBackTween.Play(true); } if (mContinueTween.gameObject.activeSelf) { mContinueTween.Play(true); } if (mSweepTween.gameObject.activeSelf) { mSweepTween.Play(true); } mTimer = 0.0f; mCurStep = UIStep.STEP_3; } break; case UIStep.STEP_3: { if (mParam.mDrops.Count > 0) { if (!(mTimer > STEPTIME_3)) { return; } mTimer = 0.0f; mCurStep = UIStep.STEP_4; } else { mTimer = 0.0f; mCurStep = UIStep.STEP_5; } } break; case UIStep.STEP_4: { mAwardW.setShow(true); mAwardW.PlayTween(); mTimer = 0.0f; mCurStep = UIStep.STEP_5; } break; case UIStep.STEP_5: break; } } }
// Use this for initialization void Start() { uiStep = UIStep.start; CoinData(); }
public static Dictionary <Tuple <string, string>, UIProcess> LoadProcessStep(MicronBEAssy.ResultDataContext resultDataContext) { Dictionary <Tuple <string, string>, UIProcess> processList = new Dictionary <Tuple <string, string>, UIProcess>(); foreach (ProcessStep info in resultDataContext.ModelContext.ProcessStep) { Tuple <string, string> key = new Tuple <string, string>(info.LINE_ID, info.PROCESS_ID); UIProcess process; if (processList.TryGetValue(key, out process) == false) { process = new UIProcess(info.LINE_ID, info.PROCESS_ID); processList.Add(key, process); } UIStep step = new UIStep(process, info.STEP_ID, info.SEQUENCE, info.STEP_GROUP); process.AddStep(step); } string dieBank = "DIE BANK"; string dieAttach = "DIE ATTACH"; string wireBond = "WIRE BOND"; List <string> stockSteps = new List <string> { "LOTS RECEIVED", "WAFER STORAGE INV", "DIE BANK" }; foreach (UIProcess process in processList.Values) { #if DEBUG if (process.ProcessID == "(MSB ASSY) M60A-X8_VFBGA-63/120_2.0") { Console.WriteLine(); } #endif List <UIStep> stepList = new List <UIStep>(process.Steps.Values); stepList.Sort((x, y) => x.Sequence.CompareTo(y.Sequence)); UIStep dieBankStep = null; UIStep firstDAStep = null; UIStep lastCR2Step = null; int daCnt = 0; foreach (UIStep step in stepList) { if (dieBankStep == null && step.StepID == dieBank) { dieBankStep = step; } if (firstDAStep == null && step.StepGroup == dieAttach) { firstDAStep = step; } if ((step.StepGroup == wireBond || step.StepGroup == dieAttach) && (lastCR2Step == null || lastCR2Step.Sequence < step.Sequence)) { lastCR2Step = step; } if (step.StepID.Length > 0 && (step.StepGroup == dieAttach || step.StepGroup == wireBond)) { process.DAWBProcess += step.StepID[0]; } if (step.StepGroup == dieAttach) { daCnt++; if (process.DaSteps.ContainsKey(daCnt) == false) { process.DaSteps.Add(daCnt, step); } } step.DaThroughCount = daCnt; } foreach (UIStep step in stepList) { if ((dieBankStep != null && step.Sequence <= dieBankStep.Sequence) || stockSteps.Contains(step.StepID)) { step.Categroy = UIStepCategory.STOCK; } else if (firstDAStep == null || step.Sequence < firstDAStep.Sequence) { step.Categroy = UIStepCategory.CR1; } else if (lastCR2Step != null && step.Sequence <= lastCR2Step.Sequence) { step.Categroy = UIStepCategory.CR2; } else { step.Categroy = UIStepCategory.EPE; } } } return(processList); }
/// <summary> /// 显示/隐藏页面 /// </summary> /// <param name="_isShow">显示true;隐藏false</param> /// <param name="_ext1">扩展参数1</param> public void ShowOrHideUI(UIStep _step, bool _isShow, string _ext1 = null) { switch (_step) { case UIStep.StartMenu: startMenu.SetActive(_isShow); LocalData.GetInstance().SaveLocalData(); break; case UIStep.ExitPanel: //startMenu.transform.Find("ExitPanel").gameObject.SetActive(_isShow); exitPanel.SetActive(_isShow); break; case UIStep.SelectLevel: selectLevel.SetActive(_isShow); if (_isShow) { selectLevel.GetComponent <SelectLevel>().InitData(); } break; case UIStep.TipsPanel: tipsPanel.SetActive(_isShow); if (_isShow) { tipsPanel.GetComponent <TipsPanel>().InitBaseData(_ext1, currentUIStep); } break; case UIStep.Game: game.SetActive(_isShow); if (_isShow) { GameController.GetInstance().InitGameData(); game.GetComponent <Game>().InitGame(); } break; case UIStep.Pause: pausePanel.SetActive(_isShow); break; case UIStep.Win: winPanel.SetActive(_isShow); if (_isShow) { winPanel.GetComponent <WinPanel>().InitData(); } break; case UIStep.Lose: losePanel.SetActive(_isShow); if (_isShow) { losePanel.GetComponent <LosePanel>().InitData(); } break; case UIStep.Shop: shopPanel.SetActive(_isShow); if (_isShow) { shopPanel.GetComponent <ShopPanel>().InitData(); } break; } if (_isShow) { currentUIStep = _step; } }
void Start() { currentUIStep = UIStep.StartMenu; }
private void CollectPegWip(Dictionary <Tuple <string, string>, ResultData> resultDatas) { string lotsReceived = "LOTS RECEIVED"; string run = "RUN"; string dieAttach = "DIE ATTACH"; foreach (PegHistory info in this._resultDataContext.PegHistory) { UIProductDetail productDetail = FindProductDetail(info.LINE_ID, info.PRODUCT_ID); UIStep step = productDetail.Process.FindStep(info.STEP_ID); UIProduct moProduct = FindProduct(info.LINE_ID, info.MO_PRODUCT_ID); UIProduct product = FindProduct(info.LINE_ID, info.PRODUCT_ID); UIProduct wipProduct = null; int daThroughCount = step.DaThroughCount; if (step.StepGroup == dieAttach && info.LOT_STATE != run) { daThroughCount = daThroughCount - 1; } if (product != null) { if (product.StepID == lotsReceived) { wipProduct = product; } else if (product.MaxSequence == daThroughCount) { wipProduct = product; } else if (daThroughCount > 0) { wipProduct = FindProduct(info.LINE_ID, info.PRODUCT_ID, true, true, daThroughCount); } else { wipProduct = FindProduct(info.LINE_ID, info.PRODUCT_ID, true, false, 1); } } else { wipProduct = FindProduct(info.LINE_ID, info.PRODUCT_ID, true, false, info.COMP_SEQ); } #if DEBUG if (wipProduct == null) { Console.WriteLine(); } if (info.MO_PRODUCT_ID == "227128") { Console.WriteLine(); } #endif Tuple <string, string> resultKey = new Tuple <string, string>(info.LINE_ID, info.MO_PRODUCT_ID); ResultData resultData; if (resultDatas.TryGetValue(resultKey, out resultData)) { if (moProduct == wipProduct) { foreach (UIProduct inProd in wipProduct.AssyParts) { ResultDataAssyPart rdap; if (resultData.AssyInResultData.TryGetValue(inProd.CompSeq, out rdap) == false) { rdap = new ResultDataAssyPart(resultData, inProd); resultData.AssyInResultData.Add(inProd.CompSeq, rdap); } if (step.Categroy == UIStepCategory.EPE) { rdap.EPEWipQty += info.PEG_QTY; } else if (step.Categroy == UIStepCategory.CR2) { rdap.CR2WipQty += info.PEG_QTY * rdap.Product.CompQty; } else { //이런 재공 있으면 이상 Data Console.WriteLine(); } } } else if (wipProduct.IsMidPart) { foreach (UIProduct inProd in moProduct.AssyParts) { ResultDataAssyPart rdap; if (resultData.AssyInResultData.TryGetValue(inProd.CompSeq, out rdap) == false) { rdap = new ResultDataAssyPart(resultData, inProd); resultData.AssyInResultData.Add(inProd.CompSeq, rdap); } if (inProd.CompSeq <= wipProduct.CompSeq) { if (step.Categroy == UIStepCategory.EPE) { //MidPart인데 EPE재공으로 집계될 수 없음. 확인후 조치필요 Console.WriteLine(); } else if (step.Categroy == UIStepCategory.CR2) { rdap.CR2WipQty += info.PEG_QTY * rdap.Product.CompQty; } else { //이런 재공 있으면 이상 Data Console.WriteLine(); } } } } else { ResultDataAssyPart rdap; if (resultData.AssyInResultData.TryGetValue(wipProduct.CompSeq, out rdap) == false) { rdap = new ResultDataAssyPart(resultData, wipProduct); resultData.AssyInResultData.Add(wipProduct.CompSeq, rdap); } if (step.Categroy == UIStepCategory.EPE) { //이상 Data - 확인후 조치필요 Console.WriteLine(); } else if (step.Categroy == UIStepCategory.CR2) { rdap.CR2WipQty += info.PEG_QTY; } else if (step.Categroy == UIStepCategory.CR1) { rdap.CR1WipQty += info.PEG_QTY; } else if (step.Categroy == UIStepCategory.STOCK && wipProduct.IsWaferPart == false) { rdap.StockWipQty += info.PEG_QTY; } else { rdap.NoKitQty += info.PEG_QTY; } } } } }
private void CollectUnpegWip(Dictionary <Tuple <string, string>, ResultData> resultDatas) { string excess = "EXCESS"; string lotsReceived = "LOTS RECEIVED"; string dieAttach = "DIE ATTACH"; string run = "RUN"; foreach (UnPegHistory info in _resultDataContext.UnPegHistory) { if (info.REASON != excess) { continue; } #if DEBUG if (info.PRODUCT_ID == "284231") { Console.WriteLine(); } #endif UIProductDetail productDetail = FindProductDetail(info.LINE_ID, info.PRODUCT_ID); UIStep step = productDetail.Process.FindStep(info.STEP_ID); UIProduct product = FindProduct(info.LINE_ID, info.PRODUCT_ID); UIProduct wipProduct = null; int daThroughCount = step.DaThroughCount; if (step.StepGroup == dieAttach && info.LOT_STATE != run) { daThroughCount = daThroughCount - 1; } if (product != null) { if (product.StepID == lotsReceived) { wipProduct = product; } else if (product.MaxSequence == daThroughCount) { wipProduct = product; } else if (daThroughCount > 0) { wipProduct = FindProduct(info.LINE_ID, info.PRODUCT_ID, true, true, daThroughCount); } else { wipProduct = FindProduct(info.LINE_ID, info.PRODUCT_ID, true, false, 1); } } else { foreach (UIProduct prod in _prodInfos.Values) { if (prod.ProductID == info.PRODUCT_ID && prod.LineID == info.LINE_ID) { wipProduct = prod; break; } } } if (wipProduct == null) { continue; } #if DEBUG if (wipProduct == null) { Console.WriteLine(); } #endif if (wipProduct.IsWaferPart) { foreach (ResultData result in resultDatas.Values) { foreach (ResultDataAssyPart rdap in result.AssyInResultData.Values) { if (wipProduct.Nexts.Contains(rdap.Product)) { rdap.NoKitQty += info.UNPEG_QTY; } } } } else if (wipProduct.IsMcpPart == false) { Tuple <string, string> key = new Tuple <string, string>(wipProduct.LineID, wipProduct.ProductID); ResultData result; if (resultDatas.TryGetValue(key, out result)) { foreach (UIProduct inProd in result.Product.AssyParts) { ResultDataAssyPart rdap; if (result.AssyInResultData.TryGetValue(inProd.CompSeq, out rdap) == false) { rdap = new ResultDataAssyPart(result, inProd); result.AssyInResultData.Add(inProd.CompSeq, rdap); } if (step.Categroy == UIStepCategory.EPE) { rdap.EPEWipQty += info.UNPEG_QTY; } else if (step.Categroy == UIStepCategory.CR2) { rdap.CR2WipQty += info.UNPEG_QTY * rdap.Product.CompQty; } else { //이런 재공 있으면 이상 Data Console.WriteLine(); } } } } else if (wipProduct.IsMidPart) { Tuple <string, string> key = new Tuple <string, string>(wipProduct.LineID, wipProduct.ProductID); ResultData result; if (resultDatas.TryGetValue(key, out result)) { foreach (UIProduct inProd in result.Product.AssyParts) { ResultDataAssyPart rdap; if (result.AssyInResultData.TryGetValue(inProd.CompSeq, out rdap) == false) { rdap = new ResultDataAssyPart(result, inProd); result.AssyInResultData.Add(inProd.CompSeq, rdap); } if (inProd.CompSeq <= wipProduct.CompSeq) { if (step.Categroy == UIStepCategory.EPE) { //MidPart인데 EPE재공으로 집계될 수 없음. 확인후 조치필요 Console.WriteLine(); } else if (step.Categroy == UIStepCategory.CR2) { rdap.CR2WipQty += info.UNPEG_QTY * rdap.Product.CompQty; } else { //이런 재공 있으면 이상 Data Console.WriteLine(); } } } } } else { foreach (UIProduct prod in wipProduct.FinalProducts) { Tuple <string, string> key = new Tuple <string, string>(prod.LineID, prod.ProductID); ResultData result; if (resultDatas.TryGetValue(key, out result)) { foreach (ResultDataAssyPart rdap in result.AssyInResultData.Values) { if (rdap.Product.ProductID != wipProduct.ProductID) { continue; } if (step.Categroy == UIStepCategory.EPE) { //이상 Data - 확인후 조치필요 Console.WriteLine(); } else if (step.Categroy == UIStepCategory.CR2) { rdap.CR2WipQty += info.UNPEG_QTY; } else if (step.Categroy == UIStepCategory.CR1) { rdap.CR1WipQty += info.UNPEG_QTY; } else if (step.Categroy == UIStepCategory.STOCK && wipProduct.IsWaferPart == false) { rdap.StockWipQty += info.UNPEG_QTY; } else { rdap.NoKitQty += info.UNPEG_QTY; } } } } } } }