/// <summary> /// Creates the given model. /// </summary> /// <typeparam name="T">Type of Model</typeparam> /// <param name="model">Model to be added. Do not nest models, this should be one model at a time.</param> /// <param name="validatePermissions">Validates that the current user and current application have access to do this. Hooks and rules will typically have this as false.</param> /// <returns></returns> public T Create <T>(T model, bool validatePermissions = true) where T : Model { var logName = string.Format("for {0}", typeof(T).Name); this.Logger.AppendLine(string.Format("Create started {0}", logName)); if (validatePermissions && _securityContext == null) { throw new InvalidAccessTokenException(); } var sw = Stopwatch.StartNew(); var createHelper = new CreateHelper <T>(model, this, validatePermissions); createHelper.Execute(); sw.Stop(); this.Logger.AppendLine(string.Format("Create done {0}: {1} ms", logName, sw.ElapsedMilliseconds)); //wanted to call GetSingle here to refresh the model, but if permissions are set to not read, that's a problem. //If you can create this guy, surely you can read him back, so attach all the includes here return(this.GetModel <T>(model.Id)); }
/// <summary> /// 游戏框架组件初始化。 /// </summary> protected override void Awake() { base.Awake(); m_DataTableManager = CentorPivot.This.GetComponent <DataTableComponent>(); if (m_DataTableManager == null) { Log.Fatal("Data table manager is invalid."); return; } m_EventComponent = CentorPivot.This.GetComponent <EventComponent>(); if (m_EventComponent == null) { Log.Fatal("Event component is invalid."); return; } m_DataTableManager.SetResourceManager(CentorPivot.This.GetComponent <ResourceComponent>()); DataTableHelperBase dataTableHelper = (DataTableHelperBase)CreateHelper.Create(m_DataTableHelperTypeName); if (dataTableHelper == null) { Log.Error("Can not create data table helper."); return; } m_DataTableManager.SetDataProviderHelper(dataTableHelper); }
public CxGameObject AddObject(BornVO bornVO) { var obj = CreateHelper.Create <CxGameObject>(bornVO.ObjectType, bornVO); //objList.Add(obj); return(obj); }
public static void InitPM(this FabEqp eqp) { if (eqp.PMList == null) { eqp.PMList = new List <PMSchedule>(); } List <PMSchedule> pmlist = DownMaster.GetPmList(eqp); if (eqp.State == ResourceState.Down && eqp.StatusInfo.MesStatus == MesEqpStatus.PM) { //EqpStatus PM 상태 반영 FabPMSchedule initPM = CreateHelper.CreateFabPMSchedule(eqp.StatusInfo.StartTime, (int)eqp.StatusInfo.Duration, ScheduleType.PM, 0, 0); eqp.PMList.Add(initPM); //설비상태가 PM일경우 24시간 이내 PM은 무시 DateTime pmFenceDate = ModelContext.Current.StartTime.AddDays(1); foreach (PMSchedule item in pmlist) { if (item.StartTime < pmFenceDate) { continue; } eqp.PMList.Add(item); } } else { eqp.PMList.AddRange(pmlist); } }
private void PrePareTarget_Fab(MergedPegPart mpp) { if (InputMart.Instance.GlobalParameters.ApplyCellOutPlan == false) { mpp.Items.Clear(); foreach (var mm in InputMart.Instance.FabMoMaster.Values) { if (BopHelper.IsCellShop(mm.ShopID)) { continue; } FabPegPart pp = new FabPegPart(mm, mm.Product); foreach (FabMoPlan mo in mm.MoPlanList) { FabPegTarget pt = CreateHelper.CreateFabPegTarget(pp, mo); pp.AddPegTarget(pt); if (pp.SampleMs == null) { pp.SampleMs = pt; } } mpp.Merge(pp); } } }
/// <summary> /// 游戏框架组件初始化。 /// </summary> protected override void Awake() { base.Awake(); m_FileSystemManager = CentorPivot.This.GetComponent <FileSystemComponent>(); if (m_FileSystemManager == null) { Log.Fatal("File system manager is invalid."); return; } FileSystemHelperBase fileSystemHelper = CreateHelper.Create(m_FileSystemHelperTypeName, m_CustomFileSystemHelper); if (fileSystemHelper == null) { Log.Error("Can not create fileSystem helper."); return; } fileSystemHelper.name = "FileSystem Helper"; Transform transform = fileSystemHelper.transform; transform.SetParent(this.transform); transform.localScale = Vector3.one; m_FileSystemManager.SetFileSystemHelper(fileSystemHelper); }
public static float GetSetupTime(AoEquipment aeqp, string shopID, string stepID, string productID, string prodVer, string ownerType, string ownerID, bool markingAcid = false) { FabAoEquipment eqp = aeqp.ToFabAoEquipment(); //if(eqp.EqpID == "THATS300") // Console.WriteLine("B"); //if (CheckLastPlan(eqp, shopID, stepID, productID, prodVer, ownerType, ownerID)) // return 0; SetupInfo info = CreateHelper.CreateSetupInfo(eqp, shopID, stepID, productID, prodVer, ownerType, ownerID); string eqpGroup = eqp.TargetEqp.EqpGroup; float setupTime = GetSetupTime(eqpGroup, info); float acidChangeTime = AcidMaster.GetAcidChangeTime(eqp, stepID, productID); float totalSetupTime = setupTime + acidChangeTime; //용액교체 Setup 발생시 EqpPlan 기록을 위해 표시 if (markingAcid && acidChangeTime > 0) { AcidMaster.SetSetupMark(eqp, true); } return(totalSetupTime); }
public static void AddWip(FabWipInfo wip) { DateTime outTime = wip.WipStateTime; OutInfo info = CreateHelper.CreateOutInfo(wip, outTime); AddOut(info); }
private static List <FabLot> CreateCellInputLot(this CellInProfile profile) { List <FabLot> list = new List <FabLot>(); var infos = profile.CellInfos; if (infos == null || infos.Count == 0) { return(list); } var prod = profile.Product; FabStep step = prod.Process.FirstStep as FabStep; foreach (InInfo info in infos) { DateTime avalableTime = info.ReleaseTime; int unitQty = info.Qty; string lotID = EntityHelper.CreateCellInLotID(prod); FabWipInfo wip = CreateHelper.CreateWipInfo(lotID, prod, step, unitQty); FabLot lot = CreateHelper.CreateLot(wip, Mozart.SeePlan.Simulation.LotState.CREATE); lot.ReleaseTime = LcdHelper.Max((DateTime)avalableTime, ModelContext.Current.StartTime); lot.LotState = Mozart.SeePlan.Simulation.LotState.CREATE; lot.FrontInTarget = info.InTarget; list.Add(lot); } return(list); }
internal static FabLot CreateFrontInLot(FabProduct product, ProductType prodType, int inQty, BatchInfo batch) { FabStep step = product.Process.FirstStep as FabStep; //TODO : 2019.8.27 미사용파악 //FabWipInfo info = CreateHelper.CreateWipInfoDummy( // CreateFrontInLotID(product), // batch, // product, // product.Process as FabProcess, // step, // prodType, // Constants.NULL_ID, // 2, // inQty, // EntityState.WAIT, // null, // string.Empty, // AoFactory.Current.NowDT, // DateTime.MinValue); FabWipInfo info = new FabWipInfo(); EntityHelper.AddBatchInfo(batch, step, inQty); FabLot lot = CreateHelper.CreateLot(info, LotState.CREATE); lot.LotState = Mozart.SeePlan.Simulation.LotState.CREATE; return(lot); }
internal static void AddBranchStep(BranchStep entity) { if (entity == null) { return; } string eqpGroup = entity.EQP_GROUP_ID; string runMode = entity.RUN_MODE; if (string.IsNullOrEmpty(eqpGroup) || string.IsNullOrEmpty(runMode)) { return; } var infos = BranchStepMaster.BranchSteps; string key = CreateKey(eqpGroup, runMode); List <BranchStepInfo> list; if (infos.TryGetValue(key, out list) == false) { infos.Add(key, list = new List <BranchStepInfo>()); } var item = CreateHelper.CreateBranchStepInfo(entity); list.Add(item); }
/// <summary> /// Method to find a view by its name or create a new one /// if nothing was found. /// </summary> #endregion protected IView FindOrCreateView(string viewName) { IView result = views[viewName] as IView; if (result == null) { WinformsViewInfo viewInf = ViewInfos[viewName] as WinformsViewInfo; if (viewInf == null) { throw new ViewInfoNotFoundException(viewName); } result = CreateHelper.Create(ViewInfos[viewName].ViewType) as IView; if (result == null) { throw new ViewCreationException(viewName, ViewInfos[viewName].ViewType); } result.ViewName = viewName; if (result is UserControl) { InitializeUserControlView(result as UserControl); } else if (result is Form) { InitializeFormView(result as Form, viewInf); } } return(result); }
/// <summary> /// 增加声音代理辅助器。 /// </summary> /// <param name="soundGroupName">声音组名称。</param> /// <param name="soundGroupHelper">声音组辅助器。</param> /// <param name="index">声音代理辅助器索引。</param> /// <returns>是否增加声音代理辅助器成功。</returns> private bool AddSoundAgentHelper(string soundGroupName, SoundGroupHelperBase soundGroupHelper, int index) { SoundAgentHelperBase soundAgentHelper = CreateHelper.Create(m_SoundAgentHelperTypeName, default(SoundAgentHelperBase)); if (soundAgentHelper == null) { Log.Error("Can not create sound agent helper."); return(false); } soundAgentHelper.name = Utility.Text.Format("Sound Agent Helper - {0} - {1}", soundGroupName, index.ToString()); Transform transform = soundAgentHelper.transform; transform.SetParent(soundGroupHelper.transform); transform.localScale = Vector3.one; if (m_AudioMixer != null) { AudioMixerGroup[] audioMixerGroups = m_AudioMixer.FindMatchingGroups(Utility.Text.Format("Master/{0}/{1}", soundGroupName, index.ToString())); if (audioMixerGroups.Length > 0) { soundAgentHelper.AudioMixerGroup = audioMixerGroups[0]; } else { soundAgentHelper.AudioMixerGroup = soundGroupHelper.AudioMixerGroup; } } m_SoundMethods.AddSoundAgentHelper(soundGroupName, soundAgentHelper); return(true); }
public void CreateObj() { A a = CreateHelper.Create <A>(1, 2); Assert.AreEqual(a.num1, 1); Assert.AreEqual(a.num2, 2); }
public void TestCreateConstraintsEmptyReturnEmptyDict() { List <string> constraint = new List <string>(); var tool = new CreateHelper(); Dictionary <string, string> ret = tool.CreateConstraints(constraint); Assert.AreEqual(ret.Count, 0); }
/// <summary> /// </summary> /// <param name="context"/> public void OnAction_ProcessStep(Mozart.Task.Execution.Persists.IPersistContext context) { try { InputMart.Instance.ProcessStep.DefaultView.Sort = "SEQUENCE ASC"; foreach (ProcessStep processStep in InputMart.Instance.ProcessStep.DefaultView) { MicronBEAssyProcess process; Tuple <string, string> key = Tuple.Create(processStep.LINE_ID, processStep.PROCESS_ID); if (InputMart.Instance.MicronBEAssyProcess.TryGetValue(key, out process) == false) { process = NewHelper.NewProcess(processStep.LINE_ID, processStep.PROCESS_ID); InputMart.Instance.MicronBEAssyProcess.Add(key, process); } MicronBEAssyBEStep step = CreateHelper.CreateStep(processStep); if (Constants.DieAttach == step.StepGroup) { process.DieAttachSteps.Add(step); } if (Constants.DieAttach == step.StepGroup || Constants.WireBond == step.StepGroup) { if (step.StepID.Length > 0) { process.BottleneckSteps += step.StepID[0]; } process.CR2OutStep = step; } step.DaThroughCount = process.DieAttachSteps.Count; process.Steps.Add(step); } foreach (MicronBEAssyProcess process in InputMart.Instance.MicronBEAssyProcess.Values) { process.LinkSteps(); if (process.DieAttachSteps.Count > 0 && process.CR2OutStep.StepGroup == Constants.DieAttach && process.CR2OutStep.StepID != "CONTRL SUB ATTACH") { WriteHelper.WriteMasterDataErrorLog(MasterDataErrorEventType.PROCESS, process.LineID, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, 0, string.Empty, "CR2 out step is not WIRE BOND", string.Format("PROCESS ID : {0}, BottleneckSteps : {1}", process.ProcessID, process.BottleneckSteps), "ProcessStep"); } } } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); } }
public ActionResult Create([Bind(Include = "ID,Description,phone")] AdTable adTable, HttpPostedFileBase image1, HttpPostedFileBase image2) //ttpPostedFileBase image was new { try { if (image1 == null && image2 == null) { db.AdTable.Add(adTable); db.SaveChanges(); return(RedirectToAction("Index", "AdTables")); } else if (image1 == null && image2 != null) { ViewBag.Ms = "Please upload image #1 first"; return(View()); } else if (CreateHelper.pictureNotImage1(image1)) { ViewBag.Ms = "Only Image can be uploaded"; return(View()); } else if (image1 != null && image2 == null) { adTable.image = new byte[image1.ContentLength]; image1.InputStream.Read(adTable.image, 0, image1.ContentLength); db.AdTable.Add(adTable); db.SaveChanges(); return(RedirectToAction("Index", "AdTables")); } else if (CreateHelper.pictureNotImage(image1, image2) ) { ViewBag.Ms = "Only Image can be uploaded"; return(View()); } else if (ModelState.IsValid) { adTable.image = new byte[image1.ContentLength]; image1.InputStream.Read(adTable.image, 0, image1.ContentLength); adTable.image1 = new byte[image2.ContentLength]; image2.InputStream.Read(adTable.image1, 0, image2.ContentLength); db.AdTable.Add(adTable); db.SaveChanges(); return(RedirectToAction("Index", "AdTables")); } } catch { ViewBag.Ms = "Only Images can be uploaded"; return(View()); } return(View(adTable)); }
public void Init() { CLILogsTest.SurchargeLogs(); FakeHTTP = new FakeHTTPHandler(); FormatTable = new FormatterFactory.TableFormatter(); FalsePrinter = new PrintSurchargeVoid(); Tool = new CreateHelper(); FakeApi = new FakeConnectionWrapper(FakeHTTP); }
public static float GetSetupTime(FabSubEqp subEqp, string shopID, string stepID, string productID, string prodVer, string ownerType, string ownerID, bool markingAcid = false) { SetupInfo info = CreateHelper.CreateSetupInfo(subEqp, shopID, stepID, productID, prodVer, ownerType, ownerID); string eqpGroup = (subEqp.Parent as FabEqp).EqpGroup; float setupTime = GetSetupTime(eqpGroup, info); return(setupTime); }
public async Task TC_2_SearchPet() { var petId = ApiHelper.GeneratePetId().Result; await CreateHelper.CreatePet(petId); var searchPetId = await CreateHelper.SearchPet(petId); Assert.AreEqual(searchPetId, petId.ToString()); }
protected virtual void Construct(TKey key, out TConcreteFlyweight flyweight) { Contract.Requires <ArgumentNullException>(key != null, "Argument key cannot be null"); Contract.Ensures(flyweight != null); var args = new object[1]; args[0] = key; flyweight = CreateHelper <TConcreteFlyweight> .CreateFromPrivateConstructor(args); }
/// <summary> /// </summary> /// <param name="hb"/> /// <param name="handled"/> /// <param name="prevReturnValue"/> /// <returns/> public WorkStep ADD_WORK_LOT0(IHandlingBatch hb, ref bool handled, WorkStep prevReturnValue) { try { MicronBEAssyBELot lot = hb as MicronBEAssyBELot; AssyMcpPart mcpPart = lot.Product as AssyMcpPart; if (mcpPart != null && mcpPart.IsBase == false) { return(null); } var agentInitControl = ServiceLocator.Resolve <JobChangeInit>(); var wagentName = agentInitControl.GetWorkAgentName(hb); if (string.IsNullOrEmpty(wagentName)) { return(null); } var wmanager = AoFactory.Current.JobChangeManger; var wagent = wmanager.GetAgent(wagentName); if (wagent == null) { return(null); } var wgroupKey = agentInitControl.GetWorkGroupKey(hb, wagent); if (wgroupKey == null) { return(null); } var wgroup = wagent.GetGroup(wgroupKey); var wstepKey = agentInitControl.GetWorkStepKey(hb, wgroup); if (wstepKey == null) { return(null); } var targetStep = agentInitControl.GetTargetStep(hb, wgroup, wstepKey); if (targetStep == null) { return(null); } var wstep = wgroup.GetStep(wstepKey, targetStep); var availableTime = agentInitControl.GetAvailableTime(hb, wstep, targetStep); MicronBEAssyWorkLot wlot = CreateHelper.CreateWorkLot(hb, availableTime, wstepKey, targetStep, lot.ReservationEqp); wstep.AddWip(wlot); return(wstep); } catch (Exception e) { WriteHelper.WriteErrorHistory(ErrorLevel.FATAL, string.Format("ErrorMessage : {0} MethodName : {1}", e.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name)); return(default(WorkStep)); } }
public LocalizationHelperBase GetLocalizationHelper() { LocalizationHelperBase m_LocalizationHelper = (LocalizationHelperBase)CreateHelper.Create(m_LocalizationHelperTypeName); if (m_LocalizationHelper == null) { Log.Error("Can not create Localization helper."); return(null); } return(m_LocalizationHelper); }
public async Task TC_4_DeletePet() { var petId = ApiHelper.GeneratePetId().Result; await CreateHelper.CreatePet(petId); await CreateHelper.DeletePet(petId); var message = await CreateHelper.SearchPet(petId, shouldFind : false); Assert.AreEqual(message, "Pet not found"); }
//Input Perstist EqpStepTime 에서 가능설비 로딩 public static void AddStep(string eqpID, string productID, FabStep step) { InFlowSteps inflowSteps = ArrangeStepsByEqpID.Get(eqpID, productID); if (inflowSteps == null) { inflowSteps = CreateHelper.CreateInFlowSteps(eqpID, productID); ArrangeStepsByEqpID.Set(eqpID, productID, inflowSteps); } inflowSteps.Steps.Add(step); }
public void TestCreateConstantsWrongLinesReturnNull() { List <string> constant = new List <string>() { "testLineNotTake", "testanotherLineNotTake&é\"'(-è_çà)+¹~#{[|`\\^@]}¤─./§%µ,;:!ù*", }; var tool = new CreateHelper(); Dictionary <string, string> ret = tool.CreateConstants(constant); Assert.AreEqual(ret.Count, 0); }
/// <summary> /// 增加下载代理辅助器。 /// </summary> /// <param name="index">下载代理辅助器索引。</param> private void AddDownloadAgentHelper() { DownloadAgentHelperBase downloadAgentHelper = (DownloadAgentHelperBase)CreateHelper.Create(m_DownloadAgentHelperTypeName); if (downloadAgentHelper == null) { Log.Error("Can not create download agent helper."); return; } m_DownloadComponent.AddDownloadAgentHelper(downloadAgentHelper); }
public void TestCreateConstraints() { List <string> constraint = new List <string>() { "constant1=value1=2", "constant2=value3", }; var tool = new CreateHelper(); Dictionary <string, string> ret = tool.CreateConstraints(constraint); Assert.AreEqual(ret["constant1"], "value1=2"); Assert.AreEqual(ret["constant2"], "value3"); }
private void BuildFabJig(Tool item) { int qty = item.QTY; for (int i = 1; i <= qty; i++) { string jigID = string.Format("{0}_{1}", item.TOOL_ID, i); FabMask mask = CreateHelper.CreateFabMask(item, jigID); JigMaster.AddTool(mask); } }
public async Task TC_3_UpdatePet() { var petId = ApiHelper.GeneratePetId().Result; var updatedName = "UpdatedPetName"; await CreateHelper.CreatePet(petId); await CreateHelper.UpdatePet(petId, updatedName); var name = await CreateHelper.SearchPet(petId, "name"); Assert.AreEqual(name, updatedName); }