/// <summary> /// 处理外形检测 /// </summary> /// <param name="tskID">子作业ID</param> /// <param name="distance">轴距</param> /// <param name="carSize">车辆尺寸-取物时为无效</param> /// <returns></returns> public int DealCheckCar(int tskID, int distance, string carSize) { CMasterTask mtsk = null; CTask htsk = null; motsk.GetMTaskAndCTaskOfTid(tskID, out mtsk, out htsk); if (mtsk == null || htsk == null) { return(101); } if (mtsk.IsTemp == true) //取物后存车流程 { CLocation toLct = new CWLocation().SelectLctFromAddrs(htsk.ToLctAdrs); if (toLct.Status != CLocation.EnmLocationStatus.Temping || toLct.ICCardCode != "") //车位上有车 { motsk.IDealCheckedCar(htsk.ID, htsk.CarSize, distance); //依就近原则分配 } else { motsk.ITempDealCheckCar(htsk.ID, mtsk.ID, distance, htsk.CarSize, toLct.Address); } } else { motsk.IDealCheckedCar(htsk.ID, carSize, distance); } return(100); }
public async Task <ActionResult <CTask> > PostCTask(CTask cTask) { _context.CTask.Add(cTask); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCTask", new { id = cTask.Id }, cTask)); }
public static CReportExporterBase GetReportClass(CTask Task) { switch (Task.m_ReportType) { case enReportTypes.Qualif: case enReportTypes.Qualif2: return(new CQualifExporter(Task)); case enReportTypes.OneEighthFinal: case enReportTypes.QuaterFinal: case enReportTypes.SemiFinal: return(new CMiddleSheetsExporter(Task)); case enReportTypes.Final: return(new CFinalExporter(Task)); case enReportTypes.Total: return(new CTotalExporter(Task)); case enReportTypes.Team: return(new CTeamExporter(Task)); case enReportTypes.Personal: return(new CPersonalExporter(Task)); default: return(null); } }
public void Read(TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.Struct) { Task = new CTask(); Task.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }
private void OnEvent_OneTaskDel(CTask task) { // 删除某个任务 Transform child = GetTaskUiItem(task.mGuid); if (child != null) { switch (task.mConfig.taskTimeType) { case TASK_TIME_TYPE.TTT_Daily: { LoadUiResource.ClearOneChild(mDailyTaskGrid.transform, child.name); mDailyTaskGrid.Reposition(); } break; case TASK_TIME_TYPE.TTT_Infinite: { LoadUiResource.ClearOneChild(mInfiniteTaskGrid.transform, child.name); mInfiniteTaskGrid.Reposition(); } break; } } }
//Return Task Set after loading from //File is formatted like //0 T1 //1 T1 //2 T2 //... public CTaskExecutionTrace ParseTaskExecutionTrace(string FileContents) { string[] sArray, sArray_1; long time; CTask task; CTaskExecutionTrace et = new CTaskExecutionTrace(); try { sArray = FileContents.Split('\n'); foreach (string s in sArray) { sArray_1 = s.Split('\t'); time = Convert.ToInt32(sArray_1[0]); task = new CTask(sArray_1[1], 0, 0, 0, 0, 0); et.Add(time, task); } return(et); } catch (Exception e) { _message = e.Message; return(null); } }
private void OnEvent_OneTaskAdd(CTask task) { // 增加某个任务 switch (task.mConfig.taskTimeType) { case TASK_TIME_TYPE.TTT_Daily: { GameObject addobj = LoadUiResource.AddChildObject(mDailyTaskGrid.transform, GameConstDefine.LoadDailyTaskUI); addobj.name = Convert.ToString(task.mGuid); addobj.transform.FindChild("TaskName").GetComponent <UILabel>().text = task.mConfig.taskDesc; UpdateTaskToUI(addobj, task); mDailyTaskGrid.Reposition(); } break; case TASK_TIME_TYPE.TTT_Infinite: { GameObject addobj = LoadUiResource.AddChildObject(mInfiniteTaskGrid.transform, GameConstDefine.LoadInfiniteTaskUI); addobj.name = Convert.ToString(task.mGuid); addobj.transform.FindChild("TaskName").GetComponent <UILabel>().text = task.mConfig.taskDesc; UpdateTaskToUI(addobj, task); mInfiniteTaskGrid.Reposition(); } break; } }
public static void ShowTaskAward(CUIFormScript formScript, CTask task, GameObject awardContainer) { if (((formScript != null) && (awardContainer != null)) && (task.m_baseId != 0)) { ResTaskReward resAward = task.resAward; if (resAward != null) { for (int i = 0; i < LevelRewardData.TASK_REWARD_MAX_COUNT; i++) { ResTaskRewardDetail detail = resAward.astRewardInfo[i]; GameObject gameObject = awardContainer.GetComponent <Transform>().FindChild(string.Format("itemCell{0}", i)).gameObject; if ((detail != null) && (detail.iCnt > 0)) { CUseable itemUseable = CUseableManager.CreateUsableByServerType((RES_REWARDS_TYPE)detail.dwRewardType, detail.iCnt, detail.dwRewardID); CUICommonSystem.SetItemCell(formScript, gameObject, itemUseable, true, false); gameObject.transform.FindChild("lblIconCount").GetComponent <Text>().text = string.Format("x{0}", detail.iCnt.ToString()); gameObject.gameObject.CustomSetActive(true); } else { gameObject.CustomSetActive(false); } } } } }
public async Task <IActionResult> PutCTask(int id, CTask cTask) { if (id != cTask.Id) { return(BadRequest()); } _context.Entry(cTask).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CTaskExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public static void ShowTaskAward(CUIFormScript formScript, CTask task, GameObject awardContainer, int awardItemcount = 2) { if (formScript == null || awardContainer == null || task.m_baseId == 0u) { return; } ResTaskReward resAward = task.resAward; if (resAward == null) { return; } for (int i = 0; i < awardItemcount; i++) { ResTaskRewardDetail resTaskRewardDetail = resAward.astRewardInfo[i]; GameObject gameObject = awardContainer.GetComponent <Transform>().FindChild(string.Format("itemCell{0}", i)).gameObject; if (resTaskRewardDetail != null && resTaskRewardDetail.iCnt > 0) { RES_REWARDS_TYPE dwRewardType = (RES_REWARDS_TYPE)resTaskRewardDetail.dwRewardType; CUseable itemUseable = CUseableManager.CreateUsableByServerType(dwRewardType, resTaskRewardDetail.iCnt, resTaskRewardDetail.dwRewardID); CUICommonSystem.SetItemCell(formScript, gameObject, itemUseable, true, false, false, false); gameObject.transform.FindChild("lblIconCount").GetComponent <Text>().set_text(string.Format("x{0}", resTaskRewardDetail.iCnt.ToString())); gameObject.gameObject.CustomSetActive(true); } else { gameObject.CustomSetActive(false); } } }
public CTaskSet ParseTaskSet(string FileContents) { string[] mainArray; string[] sa; string s; mainArray = FileContents.Split('\n'); CTaskSet ts = new CTaskSet(); foreach (string sTmp in mainArray) { s = sTmp.Replace('\r', ' '); //Format of String : Event ID, priority, S, P, C if (!s.StartsWith("//") && s.Trim() != "") { sa = s.Split(','); CTask T = new CTask(sa[0], Convert.ToInt32(sa[1]), Convert.ToDouble(sa[3]), Convert.ToDouble(sa[4]), Convert.ToDouble(sa[2]), 0); ts.Add(T); //4 has a higher priority than 1 } } return(ts); }
protected override void UnloadData() { try { if (SuppressWc) { return; } if (!PTask.IsComplete) { PTask.Wait(); } if (!CTask.IsComplete) { CTask.Wait(); } if (!ITask.IsComplete) { ITask.Wait(); } if (IsServer || DedicatedServer) { MyAPIGateway.Multiplayer.UnregisterMessageHandler(ServerPacketId, ProccessServerPacket); } else { MyAPIGateway.Multiplayer.UnregisterMessageHandler(ClientPacketId, ClientReceivedPacket); MyAPIGateway.Multiplayer.UnregisterMessageHandler(StringPacketId, StringReceived); } if (HandlesInput) { MyAPIGateway.Utilities.MessageEntered -= ChatMessageSet; } MyAPIGateway.Utilities.UnregisterMessageHandler(7771, Handler); MyAPIGateway.TerminalControls.CustomControlGetter -= CustomControlHandler; MyEntities.OnEntityCreate -= OnEntityCreate; MyAPIGateway.Gui.GuiControlCreated -= MenuOpened; MyAPIGateway.Gui.GuiControlRemoved -= MenuClosed; MyVisualScriptLogicProvider.PlayerDisconnected -= PlayerDisconnected; MyVisualScriptLogicProvider.PlayerRespawnRequest -= PlayerConnected; ApiServer.Unload(); PurgeAll(); Log.Line("Logging stopped."); Log.Close(); } catch (Exception ex) { Log.Line($"Exception in UnloadData: {ex}"); } }
/// <summary> /// 跳转到主界面场景 /// </summary> /// <returns></returns> public async CTask GoHomeScene() { //await Mgr.UI.Show<HomeUI>().Await(); if (SceneManager.GetActiveScene().name != "Home") { await CSF.Mgr.Assetbundle.LoadScene("Home"); } await CTask.WaitForSeconds(0.25f); }
/// <summary> /// 将数据库实体类列表转化成人物类实体列表 /// </summary> /// <param name="cTask"></param> /// <returns></returns> public CrawlTaskDetail ReadInner(CTask cTask) { CrawlTaskDetail crawlTaskDetail = new CrawlTaskDetail(); crawlTaskDetail.ID = cTask.Id; crawlTaskDetail.Url = cTask.Url; return(crawlTaskDetail); }
public void createTask(CTask task) { #if !SILVERLIGHT send_createTask(task); recv_createTask(); #else var asyncResult = Begin_createTask(null, null, task); End_createTask(asyncResult); #endif }
public void dump(CTask task) { #if !SILVERLIGHT send_dump(task); recv_dump(); #else var asyncResult = Begin_dump(null, null, task); End_dump(asyncResult); #endif }
public void On_List_ElementEnable(CUIEvent uievent) { int srcWidgetIndexInBelongedList = uievent.m_srcWidgetIndexInBelongedList; CTask task = this._get_current_info((RES_TASK_TYPE)this.m_tabIndex, srcWidgetIndexInBelongedList); CTaskShower component = uievent.m_srcWidget.GetComponent <CTaskShower>(); if ((component != null) && (task != null)) { component.ShowTask(task, this.m_CUIForm); } }
private bool presentInQ(CTask E, ArrayList Q) { foreach (CTask T in Q) { _stepsTotal++; if (T.iPriority == E.iPriority) { return(true); } } return(false); }
public void send_dump(CTask task) #endif { oprot_.WriteMessageBegin(new TMessage("dump", TMessageType.Call, seqid_)); dump_args args = new dump_args(); args.Task = task; args.Write(oprot_); oprot_.WriteMessageEnd(); #if SILVERLIGHT return oprot_.Transport.BeginFlush(callback, state); #else oprot_.Transport.Flush(); #endif }
private void CalcChildLevels(CTask root, IEnumerable <CTaskRel> rels, List <GraphLevel> levels, int level) { var childs = rels.Where(r => r.TaskMasterId == root.Id).Select(r => r.TaskSlave).ToList(); List <CTask> parents = new List <CTask>(); for (int i = 0; i < level; i++) { parents.AddRange(levels[i].Tasks); } var notDirectChild = childs.Where(c => rels.Where(r => r.TaskSlaveId == c.Id).Any(r1 => !parents.Exists(p => p.Id == r1.TaskMasterId))); levels[level].Tasks.AddRange(childs.Where(c => !notDirectChild.Any(nc => nc.Id == c.Id))); }
private void OnEvent_OneTaskUpdate(CTask task) { // 更新某个任务 Transform child = GetTaskUiItem(task.mGuid); if (child != null) { if (DailyBonusCtrl.Instance.mIsHadTaskFinished) { mNewDailyLabel.gameObject.SetActive(true); } UpdateTaskToUI(child.gameObject, task); } }
public void send_dump(CTask task) #endif { oprot_.WriteMessageBegin(new TMessage("dump", TMessageType.Call, seqid_)); dump_args args = new dump_args(); args.Task = task; args.Write(oprot_); oprot_.WriteMessageEnd(); #if SILVERLIGHT return(oprot_.Transport.BeginFlush(callback, state)); #else oprot_.Transport.Flush(); #endif }
public TimeSpan PredictTimeForTask(string userName, CTask task) { if (task.Tags.Count == 0) { return(TimeSpan.FromSeconds(timeStub)); } double commonTime = task.Tags.AsParallel(). Select(q => PredictTimeForTag(userName, q)). Aggregate((x, y) => x + y); commonTime = System.Math.Round(commonTime / task.Tags.Count); return(TimeSpan.FromSeconds(commonTime)); }
public async CTask CheckVersionUpdate() { bool isUpdate = await CSF.Mgr.VersionCheck.CheckRemoteUpdate(); if (isUpdate) { await CTask.WaitForNextFrame(); Confirm.AlertLangTop(() => { Mgr.Dispose(); Mgr.UI.Show <LoginUI>(); //Mgr.Net.Close(false); }, "Version.Update", "Version.UpdateTitle").Run(); //更新提示 } }
/// <summary> /// 播放挥鞭动画 /// </summary> public async CTask PlayRunWhip(bool isOnce = true) { if (m_Animator == null) { return; } m_Animator.SetBool(AnimParam.IsWhip, true); if (isOnce) { await CTask.WaitForNextFrame(); if (m_Animator != null) { m_Animator.SetBool(AnimParam.IsWhip, false); } } }
private void OnEvent_OneTaskRewards(CTask task) { // 奖励某个任务 Transform child = GetTaskUiItem(task.mGuid); if (child != null) { EventCenter.Broadcast(EGameEvent.eGameEvent_PurchaseSuccessWindowEnter); int pos = -1; foreach (string itemStr in task.mConfig.n32ItemID) { ++pos; int count = Convert.ToInt32(task.mConfig.n32ItemNum[pos]); UInt32 itemID = Convert.ToUInt32(itemStr);//根据id获取图片id,显示图片和数量和名称 if (itemID == 1) { EventCenter.Broadcast <EPurchaseType, string, string, int>(EGameEvent.eGameEvent_PurchaseRuneSuccessWin, EPurchaseType.EPT_Gold, "金币", "", count); } else if (itemID == 2) { EventCenter.Broadcast <EPurchaseType, string, string, int>(EGameEvent.eGameEvent_PurchaseRuneSuccessWin, EPurchaseType.EPT_Crystal, "钻石", "", count); } else if (itemID > 100000 && itemID < 110000) { EventCenter.Broadcast <EPurchaseType, string, string, int>(EGameEvent.eGameEvent_PurchaseRuneSuccessWin, EPurchaseType.EPT_Hero, ConfigReader.HeroBuyXmlInfoDict[(int)itemID].Name, ConfigReader.HeroBuyXmlInfoDict[(int)itemID].DefaultIcon, count); } else if (itemID > 110000 && itemID < 120000) { } else if (itemID > 120000 && itemID < 130000) { EventCenter.Broadcast <EPurchaseType, string, string, int>(EGameEvent.eGameEvent_PurchaseRuneSuccessWin, EPurchaseType.EPT_Rune, "符文AA", "", count); } else if (itemID > 130000 && itemID < 140000) { EventCenter.Broadcast <EPurchaseType, string, string, int>(EGameEvent.eGameEvent_PurchaseRuneSuccessWin, EPurchaseType.EPT_TrialCard, ConfigReader.OtherItemXmlInfoDic[itemID].sName, "", count); } } } }
private static async CTask showAnim(string content) { Tips tips; if (cacheTipsList.Count < 1) { tips = new Tips(); await tips._openUI(content); } else { tips = cacheTipsList.Dequeue(); tips.transform.SetParent(tips.transform.parent); tips.ResetTipsAnim(content); } await CTask.WaitForSeconds(0.3f); }
private void LoadTask() { flowLayoutPanel1.Controls.Clear(); //获取小车的数据模型 SortingLineTaskQueue.GetInstance().LoadSortingLineTasks(); foreach (SortingLineTask sortingLineTask in SortingLineTaskQueue.GetInstance().SortingLineTasks) { if (sortingLineTask != null) { CTask cuCTask = new CTask(); cuCTask.labindexno.Text = sortingLineTask.INDEXNO.ToString(); cuCTask.labcustname.Text = sortingLineTask.ShortName; cuCTask.txtlocation.DataBindings.Add(new Binding("value", sortingLineTask, "PLCADDRESS")); cuCTask.Width = _width; flowLayoutPanel1.Controls.Add(cuCTask); } } }
private void UpdateTaskToUI(GameObject uiTask, CTask task) { uint curCount = task.mCurCount; if (task.mCurCount == UInt32.MaxValue) {//已领取 uiTask.transform.FindChild("Complete").gameObject.SetActive(false); uiTask.transform.FindChild("Done").gameObject.SetActive(true); UIEventListener.Get(uiTask.transform.gameObject).onClick = null; curCount = task.mConfig.taskMaxCount; } else if (task.mCurCount == task.mConfig.taskMaxCount) {//已完成 uiTask.transform.FindChild("Complete").gameObject.SetActive(true); uiTask.transform.FindChild("Done").gameObject.SetActive(false); UIEventListener.Get(uiTask.transform.gameObject).onClick += OnTaskFinishBtnClick; } uiTask.transform.FindChild("ProgressLabel").GetComponent <UILabel>().text = Convert.ToString(curCount) + "/" + Convert.ToString(task.mConfig.taskMaxCount); }
private CJob getJob() { CJob job = new CJob(); job.name = m_name; //tasks, inputs and outputs foreach (MonitoredExperimentViewModel experiment in m_monitoredExperiments) { CTask task = new CTask(); //we are assuming the same exe file is used in all the experiments!!! //IMPORTANT task.name = experiment.name; task.exe = experiment.exeFile; task.arguments = experiment.filePath + " -pipe=" + experiment.pipeName; task.pipe = experiment.pipeName; job.tasks.Add(task); //add EXE files if (!job.inputFiles.Contains(task.exe)) { job.inputFiles.Add(task.exe); } //add prerrequisites foreach (string pre in experiment.prerrequisites) { if (!job.inputFiles.Contains(pre)) { job.inputFiles.Add(pre); } } //add experiment file to inputs if (!job.inputFiles.Contains(experiment.filePath)) { job.inputFiles.Add(experiment.filePath); } Utility.getInputsAndOutputs(experiment.exeFile, experiment.filePath, ref job); } return(job); }
/// <summary> /// 异步加载资源 /// </summary> /// <param name="assetName">资源名</param> /// <param name="priority">优先级</param> public async CTask <object> LoadAsset(string assetName, int priority = 0) { bool isSuccess = false; object callBack = null; Component.LoadAsset(assetName, priority, new LoadAssetCallbacks( (backAssetName, asset, duration, userData) => { callBack = asset; isSuccess = true; }, (backAssetName, status, errorMessage, userData) => { Log.Error($"资源 :{assetName} 加载失败,errorMessage:{errorMessage}"); isSuccess = false; })); await CTask.WaitUntil(() => isSuccess); return(callBack); }
public static ITask CreateTask() { CTask task = new CTask(); return task as ITask; }
public IAsyncResult Begin_dump(AsyncCallback callback, object state, CTask task) { return send_dump(callback, state, task); }
public IAsyncResult send_dump(AsyncCallback callback, object state, CTask task)
public IAsyncResult send_createTask(AsyncCallback callback, object state, CTask task)
public IAsyncResult Begin_createTask(AsyncCallback callback, object state, CTask task) { return send_createTask(callback, state, task); }
public void Read (TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.Struct) { Task = new CTask(); Task.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }