private HtmlTableRow CreateRow(JobInfo item) { HtmlTableRow row = new HtmlTableRow(); row.Cells.Add(CreateCell(item.NameKey)); row.Cells.Add(CreateCell(item.DataValue)); return row; }
public UploadFilesTask(JobInfo jobInfo, IUploadProgressReporter progressReporter, CancellationToken token, IApiHelper apiHelper) : base(apiHelper) { _jobInfo = jobInfo; _progressReporter = progressReporter; _token = token; }
public AuthenticateTask(JobInfo jobInfo, string loginName, string serviceUrl, string deviceToken, IApiHelper apiHelper, ILoginUserInteraction loginUi = null) : base(apiHelper) { _jobInfo = jobInfo; _serviceUrl = serviceUrl; DeviceToken = deviceToken; _loginName = loginName; _loginUi = loginUi ?? new LoginUserInteraction(); }
public GUBPBranchConfig(IEnumerable<UnrealTargetPlatform> InHostPlatforms, string InBranchName, BranchInfo InBranch, GUBPBranchHacker.BranchOptions InBranchOptions, bool bInForceIncrementalCompile, JobInfo JobInfo) { HostPlatforms = new List<UnrealTargetPlatform>(InHostPlatforms); BranchName = InBranchName; Branch = InBranch; BranchOptions = InBranchOptions; bForceIncrementalCompile = bInForceIncrementalCompile; this.JobInfo = JobInfo; }
private void Ready() { Receive<GetJobsToRun>(process => { var self = Self; // closure Task.Run(() => { var jobList = new List<JobInfo>(); try { var jobCount = 10; for (int i = 0; i < jobCount; i++) { var jobName = new JobInfo("MyPetMonkey" + i); jobList.Add(jobName); } for (int i = 0; i < jobCount; i++) { var jobName = new JobInfo("MonsterTruck" + i); jobList.Add(jobName); } } catch (Exception ex) { _logger.Error(ex, "GetJobsToRun"); } return jobList; }, _cancel.Token).ContinueWith(x => { if (x.IsCanceled || x.IsFaulted) return new Finished(new List<JobInfo>(), x.Exception); _logger.Info("Starting {0} Jobs.", x.Result.Count()); return new Finished(x.Result, null); }, TaskContinuationOptions.AttachedToParent & TaskContinuationOptions.ExecuteSynchronously) .PipeTo(self); // switch behavior Become(Working); }); ReceiveAny(task => { _logger.Error(" [x] Oh Snap! JobsToRunData.Ready.ReceiveAny: \r\n{0}", task); }); }
internal void UpdateLog(string result, JobInfo info) { if (InvokeRequired) { Invoke(new MethodInvoker(() => UpdateLog(result, info))); return; } info.updateTextbox.Text += result + Environment.NewLine; info.updateTextbox.SelectionStart = info.updateTextbox.Text.Length; info.updateTextbox.ScrollToCaret(); }
// Use this for initialization void Start() { //GameObject gameScript = GameObject.Find("GameScript"); name = "Ghost"; renderer = GetComponentInChildren<Renderer>(); renderer.material = BuildMode.Instance.ghostGreen; renderer.receiveShadows = false; gameObject.layer = LayerMask.NameToLayer("Ghost"); renderer.gameObject.layer = LayerMask.NameToLayer("Ghost"); positionScript = GetComponent<PositionScript>(); leftCorner = positionScript.LeftCorner(); jobInfo = GetComponent<JobInfo>(); MouseController.Instance.RegisterTileChanged(ChangePosition); MouseController.Instance.ghost = this; MouseController.Instance.TurnOnHouseMode(); }
public EstimateFileTransferTimeTask(int bufferSize, JobInfo jobInfo, CancellationToken token, IUploadProgressReporter progressReporter, IApiHelper apiHelper) : base( apiHelper) { _jobInfo = jobInfo; _progressReporter = progressReporter; _token = token; byte[] random = new byte[bufferSize]; new Random().NextBytes(random); var tempDir = CreateTempDirectory(); _tempFilePath = Path.Combine(tempDir, "uploadtest.dat"); _tempFileSize = random.Length; using (var upStream = new FileStream(_tempFilePath, FileMode.Create)) { upStream.Write(random, 0, random.Length); } }
private JobStatus ResolveJobStatus(JobInfo jobInfo) { if (jobInfo.IsCancelled) { return JobStatus.Cancelled; } if (jobInfo.IsFinished) { return JobStatus.Finished; } if (jobInfo.PointDictionary.Any()) { return jobInfo.NeedsPoint ? JobStatus.Partly : JobStatus.Running; } return JobStatus.Pending; }
internal void UpdatePercentage(int result, int maxValue, JobInfo info) { if (InvokeRequired) { Invoke(new MethodInvoker(() => UpdatePercentage(result, maxValue, info))); return; } if (result >= 0) { ((DataGridViewProgressCell)info.rowShown.Cells[1]).Maximum = maxValue; info.rowShown.Cells[1].Value = result; } else { foreach (DataGridViewCell item in info.rowShown.Cells) item.Style.ForeColor = Color.Red; } }
private static void CreateScheduledJob(JobInfo information) { IJobDetail jobDetail = JobBuilder.Create<EntitlementProcessor>() .WithIdentity(String.Format("myJob-{0}", information.jobName), "Group1") .Build(); jobDetail.JobDataMap["Information"] = information; ITrigger trigger = TriggerBuilder.Create() .WithIdentity(String.Format("DailyTrigger-{0}", information.jobName), "Group1") .StartNow() .WithCronSchedule(cronExpressionRecurring) .Build(); sched.ScheduleJob(jobDetail, trigger); var nextFireTime = trigger.GetNextFireTimeUtc(); Console.WriteLine("Scheduled job for PacMay Entitlement Insertion has been created."); Console.WriteLine("Next Fire Time: " + nextFireTime.Value); }
static void Main(string[] args) { Console.WriteLine("Welcome to PacMay Entitlement Insertion Task Scheduler!"); ISchedulerFactory schedFact = new StdSchedulerFactory(); sched = schedFact.GetScheduler(); sched.Start(); bool processRecurring = Convert.ToBoolean(ConfigurationManager.AppSettings["processRecurring"]); if (processRecurring) { Console.WriteLine("Creating job..."); JobInfo information = new JobInfo() { jobName = "ProcessRecurring" }; CreateScheduledJob(information); } while (true) { Thread.Sleep(7200000); Console.WriteLine("Thread is sleeping. DateTime: " + DateTime.UtcNow); } }
public JobLogEntity(JobInfo jobInfo) { PartitionKey = jobInfo.StoreId; RowKey = DateTime.UtcNow.Ticks + "_" + jobInfo.ProcessorId + "_" + jobInfo.Id; Scheduled = jobInfo.ScheduledRunTime; Started = jobInfo.StartTime; Completed = jobInfo.ProcessingCompleted; JobType = (int)jobInfo.JobType; TimeTaken = jobInfo.StartTime.HasValue && jobInfo.ProcessingCompleted.HasValue ? jobInfo.ProcessingCompleted.Value.Subtract(jobInfo.StartTime.Value).TotalSeconds : 0.0; ApparentTimeTaken = jobInfo.ScheduledRunTime.HasValue && jobInfo.ProcessingCompleted.HasValue ? jobInfo.ProcessingCompleted.Value.Subtract(jobInfo.ScheduledRunTime.Value). TotalSeconds : 0.0; TimeQueued = jobInfo.StartTime.HasValue && jobInfo.ScheduledRunTime.HasValue ? jobInfo.StartTime.Value.Subtract(jobInfo.ScheduledRunTime.Value).TotalSeconds : 0.0; JobCompletedSuccessfully = jobInfo.Status == JobStatus.CompletedOk; StatusMessage = jobInfo.StatusMessage; RetryCount = jobInfo.RetryCount; }
public override void DoWork(JobInfo job) { Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //ObjectContainer.Resolve<IScheduleService>().StopTask("测试"); }
public Result Run(JobInfo jobInfo) { return(Execute(() => SchedulerManager.Singleton.CreateJob(jobInfo))); }
private void a(OrganizationData A_0) { string str; string str1; DateTime localTime; Guid id = A_0.Id; this.a("###################################"); this.a(string.Concat("Entering configureUIForSelectedOrgAndJobType(\"", id.ToString(), "\") FriendlyName: ", A_0.FriendlyName)); if (this.comboBox4.SelectedItem != null) { JobInfo selectedItem = this.comboBox4.SelectedItem as JobInfo; this.a(string.Concat("calling retrieveJobData for job type: ", selectedItem.JobTypeCode)); OrganizationMaintenanceJobData[] organizationMaintenanceJobDataArray = this.a(id, selectedItem.JobTypeCode, false); OrganizationMaintenanceJobData organizationMaintenanceJobDatum = organizationMaintenanceJobDataArray[0]; this.textBox1.Text = organizationMaintenanceJobDatum.LastResultCode.ToString(); this.label10.Text = organizationMaintenanceJobDatum.LastResultData ?? "None"; DateTime dateTime = DateTime.SpecifyKind(organizationMaintenanceJobDatum.NextRuntime, DateTimeKind.Utc); DateTime dateTime1 = DateTime.SpecifyKind(organizationMaintenanceJobDatum.RecurrenceStartTime, DateTimeKind.Utc); DateTime minValue = DateTime.MinValue; try { this.toolTip.SetToolTip(this.label3, ""); minValue = DateTime.SpecifyKind(organizationMaintenanceJobDatum.LastRuntime, DateTimeKind.Utc); Label label = this.label3; localTime = minValue.ToLocalTime(); label.Text = localTime.ToString(); } catch (NullReferenceException nullReferenceException1) { NullReferenceException nullReferenceException = nullReferenceException1; this.label3.Text = (string)this.rscMgrTypeResources.GetObject("JobNotRun"); this.a(string.Concat(new object[] { "Caught NullReference exception in main DisplayDetailedJobDataMethod: ", nullReferenceException.Message, "\r\n", nullReferenceException.StackTrace, "\r\n", nullReferenceException.Source, "\r\n", nullReferenceException.InnerException })); } int year = DateTime.Now.Year; int month = DateTime.Now.Month; localTime = DateTime.Now; dateTime1 = new DateTime(year, month, localTime.Day, dateTime1.Hour, dateTime1.Minute, dateTime1.Second, DateTimeKind.Utc); if (!selectedItem.NextRunTimeEditable || selectedItem.NextRunDateEditable) { this.toolTip.SetToolTip(this.dateTime1, ""); this.toolTip.SetToolTip(this.label7, ""); this.label7.Text = this.label7.Text.TrimEnd(new char[] { '*' }); } else { string str2 = string.Format((string)this.rscMgrTypeResources.GetObject("ToolTipTimeOnly"), new object[0]); this.toolTip.SetToolTip(this.dateTime1, str2); this.toolTip.SetToolTip(this.label7, str2); this.label7.Text = string.Concat(this.label7.Text.TrimEnd(new char[] { '*' }), "*"); } this.dateTime1.Value = dateTime.ToLocalTime(); object[] value = new object[] { "test dtNextRun.Value: ", this.dateTime1.Value, " Kind: ", null }; localTime = this.dateTime1.Value; value[3] = localTime.Kind; this.a(string.Concat(value)); this.dateTime2.Value = dateTime1.ToLocalTime(); int length = (int)organizationMaintenanceJobDataArray.Length; this.a(string.Concat("retreived ", length.ToString(), " Jobs")); this.a(string.Concat(new object[] { "job.LastRuntime (local): ", minValue.ToLocalTime(), " UTC: ", minValue })); this.a(string.Concat(new object[] { "job.NextRuntime (local): ", dateTime.ToLocalTime(), " UTC: ", dateTime })); this.a(string.Concat(new object[] { "job.RecurrenceStartTime (local): ", dateTime1.ToLocalTime(), " UTC: ", dateTime1 })); this.a(string.Concat("job.RecurrencePattern: ", organizationMaintenanceJobDatum.RecurrencePattern)); this.organizationMaintenanceJobData = organizationMaintenanceJobDatum; this.a(this.organizationMaintenanceJobData.RecurrencePattern, out str, out str1); int num = 0; while (num < this.comboBox2.Items.Count) { if (((frequencyVals)this.comboBox2.Items[num])._ActualName != str) { num++; } else { this.comboBox2.SelectedIndex = num; break; } } this.comboBox3.Text = str1; } }
public void BeginInvoke(Action <JobInfo> addMethod, JobInfo jobInfo) { addMethod(jobInfo); }
private void StartEvolution() { var sourceImage = new SourceImage { Pixels = SetupSourceColorMatrix(picPattern.Image as Bitmap), Width = picPattern.Width, Height = picPattern.Height }; var info = new JobInfo { Settings = Project.Settings, SourceImage = sourceImage, }; //IEvolutionJob job = new LayeredEvolutionJob(sourceImage, 4); //DefaultEvolutionJob job = new DefaultEvolutionJob(sourceImage, currentDrawing); //IEvolutionJob job = new DefaultEvolutionJob(info); IEvolutionJob job = new ClusteredEvolutionJob(info); while (Project.IsRunning) { double newErrorLevel = job.GetNextErrorLevel(); var defJob = job as DefaultEvolutionJob; if (defJob != null) { Project.Generations += defJob.Generations; } Project.Mutations++; if (newErrorLevel <= Project.ErrorLevel) { Project.Selected++; if (newErrorLevel < Project.ErrorLevel) { Project.Positive++; } else { Project.Neutral++; } DnaDrawing newDrawing = job.GetDrawing(); if (currentDrawing == null) // to make always lockable... { currentDrawing = new DnaDrawing(); } lock (currentDrawing) { currentDrawing = newDrawing; Project.Drawing = currentDrawing.Clone(); } Project.ErrorLevel = newErrorLevel; SaveAnimationImage(newDrawing); } } }
void UpdateSourceDrawingWork(JobInfo job) { //begin rendering on this context //should this have been done earlier? //do i need to check this on an intel video card to see if running excessively is a problem? (it used to be in the FinalTarget command below, shouldnt be a problem) //GraphicsControl.Begin(); GlobalWin.GL.BeginScene(); //run filter chain Texture2d texCurr = null; RenderTarget rtCurr = null; int rtCounter = 0; bool inFinalTarget = false; foreach (var step in CurrentFilterProgram.Program) { switch (step.Type) { case FilterProgram.ProgramStepType.Run: { int fi = (int)step.Args; var f = CurrentFilterProgram.Filters[fi]; f.SetInput(texCurr); f.Run(); var orec = f.FindOutput(); if (orec != null) { if (orec.SurfaceDisposition == SurfaceDisposition.Texture) { texCurr = f.GetOutput(); rtCurr = null; } } break; } case FilterProgram.ProgramStepType.NewTarget: { var size = (Size)step.Args; rtCurr = ShaderChainFrugalizers[rtCounter++].Get(size); rtCurr.Bind(); CurrentFilterProgram.CurrRenderTarget = rtCurr; break; } case FilterProgram.ProgramStepType.FinalTarget: { var size = (Size)step.Args; inFinalTarget = true; rtCurr = null; CurrentFilterProgram.CurrRenderTarget = null; GL.BindRenderTarget(null); break; } } } GL.EndScene(); if (job.offscreen) { job.offscreenBB = rtCurr.Texture2d.Resolve(); } else { Debug.Assert(inFinalTarget); //apply the vsync setting (should probably try to avoid repeating this) bool vsync = Global.Config.VSyncThrottle || Global.Config.VSync; //ok, now this is a bit undesireable. //maybe the user wants vsync, but not vsync throttle. //this makes sense... but we dont have the infrastructure to support it now (we'd have to enable triple buffering or something like that) //so what we're gonna do is disable vsync no matter what if throttling is off, and maybe nobody will notice. if (Global.DisableSecondaryThrottling) vsync = false; if (LastVsyncSetting != vsync || LastVsyncSettingGraphicsControl != presentationPanel.GraphicsControl) { if (LastVsyncSetting == null && vsync) { // Workaround for vsync not taking effect at startup (Intel graphics related?) presentationPanel.GraphicsControl.SetVsync(false); } presentationPanel.GraphicsControl.SetVsync(vsync); LastVsyncSettingGraphicsControl = presentationPanel.GraphicsControl; LastVsyncSetting = vsync; } //present and conclude drawing presentationPanel.GraphicsControl.SwapBuffers(); //nope. dont do this. workaround for slow context switching on intel GPUs. just switch to another context when necessary before doing anything //presentationPanel.GraphicsControl.End(); NeedsToPaint = false; //?? } }
private void ProcessJob(JobInfo jobInfo) { Debug.LogFormat("processing job: {0} ({1})", jobInfo.name, jobInfo.comment); var tempPath = jobInfo.path + PartExt; if (_fileStream != null) { _fileStream.Close(); _fileStream = null; } var dataChecker = GetDataChecker(jobInfo); while (true) { string error = null; var partialSize = 0; var success = true; var wsize = jobInfo.size; var wchecksum = jobInfo.checksum; var url = GetUrl(jobInfo); dataChecker.Reset(); if (_fileStream == null) { try { var fileInfo = new FileInfo(tempPath); if (fileInfo.Exists) // 处理续传 { _fileStream = fileInfo.Open(FileMode.OpenOrCreate, FileAccess.ReadWrite); partialSize = (int)fileInfo.Length; if (partialSize > jobInfo.size) // 目标文件超过期望大小, 直接废弃 { _fileStream.SetLength(0); partialSize = 0; } else if (partialSize <= jobInfo.size) // 续传 { dataChecker.Update(_fileStream); // Debug.LogFormat("partial check {0} && {1} ({2})", partialSize, jobInfo.size, // dataChecker.hex); } } else // 创建下载文件 { if (!Directory.Exists(fileInfo.DirectoryName)) { Directory.CreateDirectory(fileInfo.DirectoryName); } _fileStream = File.Open(tempPath, FileMode.OpenOrCreate, FileAccess.ReadWrite); _fileStream.SetLength(0); } } catch (Exception exception) { Debug.LogErrorFormat("file exception: {0}\n{1}", jobInfo.path, exception); error = $"file exception: {exception}"; success = false; } } else { _fileStream.SetLength(0L); } if (success && (jobInfo.size <= 0 || partialSize < jobInfo.size)) { try { var uri = new Uri(url); var req = WebRequest.CreateHttp(uri); req.Method = WebRequestMethods.Http.Get; req.ContentType = BundleContentType; req.ReadWriteTimeout = 10000; if (_timeout > 0) { req.Timeout = _timeout; } if (partialSize > 0) { req.AddRange(partialSize); } using (var rsp = req.GetResponse()) { using (var webStream = rsp.GetResponseStream()) { var recvAll = 0L; var recvCalc = 0L; var stopwatch = new Stopwatch(); stopwatch.Start(); while (recvAll < rsp.ContentLength) { var _bpms = Math.Max(1, jobInfo.bytesPerSecond / 10); var recv = webStream.Read(_buffer, 0, Math.Min(_bpms, _buffer.Length)); if (recv > 0 && !_destroy) { recvCalc += recv; if (recvCalc >= _bpms) { var millisecs = stopwatch.ElapsedMilliseconds; var delay = (int)(100.0 * recvCalc / _bpms - millisecs); // Debug.LogFormat("net ++ {0} {1} sbps {2} recv {3}", delay, millisecs, _bpms, recvCalc); if (delay > 0) { Thread.Sleep(delay); } stopwatch.Restart(); recvCalc -= _bpms; } recvAll += recv; _fileStream.Write(_buffer, 0, recv); dataChecker.Update(_buffer, 0, recv); jobInfo.bytes = (int)(recvAll + partialSize); // PrintDebug($"{recvAll + partialSize}, {_size}, {_progress}"); } else { break; } } } } } catch (Exception exception) { Debug.LogErrorFormat("network exception: {0}\n{1}", url, exception); error = $"network exception: {exception}"; success = false; } } if (success && _fileStream.Length != jobInfo.size) { if (jobInfo.size > 0) { error = string.Format("filesize exception: {0} {1} != {2}", jobInfo.name, _fileStream.Length, jobInfo.size); Debug.LogError(error); success = false; } else { wsize = (int)_fileStream.Length; } } if (success) { // dirty code, md5 目前不能分段计算 if (dataChecker.hex == null) { _fileStream.Seek(0, SeekOrigin.Begin); dataChecker.ComputeHashFull(_fileStream); } if (dataChecker.hex != jobInfo.checksum) { if (!string.IsNullOrEmpty(jobInfo.checksum)) { error = string.Format("corrupted file: {0} {1} != {2}", jobInfo.name, dataChecker.hex, jobInfo.checksum); Debug.LogError(error); success = false; } else { wchecksum = dataChecker.hex; } } } if (_destroy) { success = false; } if (success) { try { // _WriteStream(buffer, fileStream, finalPath); _fileStream.Close(); _fileStream = null; if (File.Exists(jobInfo.path)) { File.Delete(jobInfo.path); } File.Move(tempPath, jobInfo.path); // 写入额外的 meta var meta = new Metadata() { checksum = wchecksum, size = wsize, }; var json = JsonUtility.ToJson(meta); var metaPath = jobInfo.path + Metadata.Ext; File.WriteAllText(metaPath, json); Complete(jobInfo); break; } catch (Exception exception) { error = string.Format("write exception: {0}\n{1}", jobInfo.name, exception); Debug.LogError(error); success = false; } } jobInfo.tried++; if (jobInfo.retry > 0 && jobInfo.tried >= jobInfo.retry) { if (_fileStream != null) { _fileStream.Close(); _fileStream = null; } jobInfo.error = error ?? "unknown error"; Complete(jobInfo); break; } Thread.Sleep(2000); Debug.LogErrorFormat("[retry] download failed: {0}\n{1}", url, error); } }
void UpdateSourceDrawingWork(JobInfo job) { //begin rendering on this context //should this have been done earlier? //do i need to check this on an intel video card to see if running excessively is a problem? (it used to be in the FinalTarget command below, shouldnt be a problem) //GraphicsControl.Begin(); //CRITICAL POINT for yabause+GL GlobalWin.GL.BeginScene(); //run filter chain Texture2d texCurr = null; RenderTarget rtCurr = null; int rtCounter = 0; bool inFinalTarget = false; foreach (var step in CurrentFilterProgram.Program) { switch (step.Type) { case FilterProgram.ProgramStepType.Run: { int fi = (int)step.Args; var f = CurrentFilterProgram.Filters[fi]; f.SetInput(texCurr); f.Run(); var orec = f.FindOutput(); if (orec != null) { if (orec.SurfaceDisposition == SurfaceDisposition.Texture) { texCurr = f.GetOutput(); rtCurr = null; } } break; } case FilterProgram.ProgramStepType.NewTarget: { var size = (Size)step.Args; rtCurr = ShaderChainFrugalizers[rtCounter++].Get(size); rtCurr.Bind(); CurrentFilterProgram.CurrRenderTarget = rtCurr; break; } case FilterProgram.ProgramStepType.FinalTarget: { var size = (Size)step.Args; inFinalTarget = true; rtCurr = null; CurrentFilterProgram.CurrRenderTarget = null; GL.BindRenderTarget(null); break; } } } GL.EndScene(); if (job.offscreen) { job.offscreenBB = rtCurr.Texture2d.Resolve(); job.offscreenBB.DiscardAlpha(); } else { Debug.Assert(inFinalTarget); //apply the vsync setting (should probably try to avoid repeating this) bool vsync = Global.Config.VSyncThrottle || Global.Config.VSync; //ok, now this is a bit undesireable. //maybe the user wants vsync, but not vsync throttle. //this makes sense... but we dont have the infrastructure to support it now (we'd have to enable triple buffering or something like that) //so what we're gonna do is disable vsync no matter what if throttling is off, and maybe nobody will notice. if (Global.DisableSecondaryThrottling) { vsync = false; } if (LastVsyncSetting != vsync || LastVsyncSettingGraphicsControl != presentationPanel.GraphicsControl) { if (LastVsyncSetting == null && vsync) { // Workaround for vsync not taking effect at startup (Intel graphics related?) presentationPanel.GraphicsControl.SetVsync(false); } presentationPanel.GraphicsControl.SetVsync(vsync); LastVsyncSettingGraphicsControl = presentationPanel.GraphicsControl; LastVsyncSetting = vsync; } //present and conclude drawing presentationPanel.GraphicsControl.SwapBuffers(); //nope. dont do this. workaround for slow context switching on intel GPUs. just switch to another context when necessary before doing anything //presentationPanel.GraphicsControl.End(); NeedsToPaint = false; //?? } }
FilterProgram UpdateSourceInternal(JobInfo job) { //no drawing actually happens. it's important not to begin drawing on a control if (!job.simulate) { GlobalWin.GLManager.Activate(CR_GraphicsControl); } IVideoProvider videoProvider = job.videoProvider; bool simulate = job.simulate; Size chain_outsize = job.chain_outsize; //simulate = true; int vw = videoProvider.BufferWidth; int vh = videoProvider.BufferHeight; if (Global.Config.DispFixAspectRatio) { if (Global.Config.DispManagerAR == Config.EDispManagerAR.System) { vw = videoProvider.VirtualWidth; vh = videoProvider.VirtualHeight; } if (Global.Config.DispManagerAR == Config.EDispManagerAR.Custom) { vw = Global.Config.DispCustomUserARWidth; vh = Global.Config.DispCustomUserARHeight; } if (Global.Config.DispManagerAR == Config.EDispManagerAR.CustomRatio) { FixRatio(Global.Config.DispCustomUserARX, Global.Config.DispCustomUserARY, videoProvider.BufferWidth, videoProvider.BufferHeight, out vw, out vh); } } var padding = CalculateCompleteContentPadding(true, false); vw += padding.Horizontal; vh += padding.Vertical; int[] videoBuffer = videoProvider.GetVideoBuffer(); int bufferWidth = videoProvider.BufferWidth; int bufferHeight = videoProvider.BufferHeight; bool isGlTextureId = videoBuffer.Length == 1; BitmapBuffer bb = null; Texture2d videoTexture = null; if (!simulate) { if (isGlTextureId) { //FYI: this is a million years from happening on n64, since it's all geriatric non-FBO code //is it workable for saturn? videoTexture = GL.WrapGLTexture2d(new IntPtr(videoBuffer[0]), bufferWidth, bufferHeight); } else { //wrap the videoprovider data in a BitmapBuffer (no point to refactoring that many IVideoProviders) bb = new BitmapBuffer(bufferWidth, bufferHeight, videoBuffer); bb.DiscardAlpha(); //now, acquire the data sent from the videoProvider into a texture videoTexture = VideoTextureFrugalizer.Get(bb); //lets not use this. lets define BizwareGL to make clamp by default (TBD: check opengl) //GL.SetTextureWrapMode(videoTexture, true); } } //record the size of what we received, since lua and stuff is gonna want to draw onto it currEmuWidth = bufferWidth; currEmuHeight = bufferHeight; //build the default filter chain and set it up with services filters will need Size chain_insize = new Size(bufferWidth, bufferHeight); var filterProgram = BuildDefaultChain(chain_insize, chain_outsize, job.includeOSD); filterProgram.GuiRenderer = Renderer; filterProgram.GL = GL; //setup the source image filter Filters.SourceImage fInput = filterProgram["input"] as Filters.SourceImage; fInput.Texture = videoTexture; //setup the final presentation filter Filters.FinalPresentation fPresent = filterProgram["presentation"] as Filters.FinalPresentation; fPresent.VirtualTextureSize = new Size(vw, vh); fPresent.TextureSize = new Size(bufferWidth, bufferHeight); fPresent.BackgroundColor = videoProvider.BackgroundColor; fPresent.GuiRenderer = Renderer; fPresent.Flip = isGlTextureId; fPresent.Config_FixAspectRatio = Global.Config.DispFixAspectRatio; fPresent.Config_FixScaleInteger = Global.Config.DispFixScaleInteger; fPresent.Padding = ClientExtraPadding; fPresent.GL = GL; filterProgram.Compile("default", chain_insize, chain_outsize, !job.offscreen); if (simulate) { } else { CurrentFilterProgram = filterProgram; UpdateSourceDrawingWork(job); } //cleanup: if (bb != null) { bb.Dispose(); } return(filterProgram); }
/// <summary> /// Attempts to calculate a good client size with the given zoom factor, considering the user's DisplayManager preferences /// TODO - this needs to be redone with a concept different from zoom factor. /// basically, each increment of a 'zoomlike' factor should definitely increase the viewable area somehow, even if it isnt strictly by an entire zoom level. /// </summary> public Size CalculateClientSize(IVideoProvider videoProvider, int zoom) { bool ar_active = Global.Config.DispFixAspectRatio; bool ar_system = Global.Config.DispManagerAR == Config.EDispManagerAR.System; bool ar_custom = Global.Config.DispManagerAR == Config.EDispManagerAR.Custom; bool ar_customRatio = Global.Config.DispManagerAR == Config.EDispManagerAR.CustomRatio; bool ar_correct = ar_system || ar_custom || ar_customRatio; bool ar_unity = !ar_correct; bool ar_integer = Global.Config.DispFixScaleInteger; int bufferWidth = videoProvider.BufferWidth; int bufferHeight = videoProvider.BufferHeight; int virtualWidth = videoProvider.VirtualWidth; int virtualHeight = videoProvider.VirtualHeight; if (ar_custom) { virtualWidth = Global.Config.DispCustomUserARWidth; virtualHeight = Global.Config.DispCustomUserARHeight; } if (ar_customRatio) { FixRatio(Global.Config.DispCustomUserARX, Global.Config.DispCustomUserARY, videoProvider.BufferWidth, videoProvider.BufferHeight, out virtualWidth, out virtualHeight); } var padding = CalculateCompleteContentPadding(true, false); virtualWidth += padding.Horizontal; virtualHeight += padding.Vertical; padding = CalculateCompleteContentPadding(true, true); bufferWidth += padding.Horizontal; bufferHeight += padding.Vertical; //Console.WriteLine("DISPZOOM " + zoom); //test //old stuff var fvp = new FakeVideoProvider(); fvp.BufferWidth = bufferWidth; fvp.BufferHeight = bufferHeight; fvp.VirtualWidth = virtualWidth; fvp.VirtualHeight = virtualHeight; Size chain_outsize = new Size(fvp.BufferWidth * zoom, fvp.BufferHeight * zoom); if (ar_active) { if (ar_correct) { if (ar_integer) { Vector2 VS = new Vector2(virtualWidth, virtualHeight); Vector2 BS = new Vector2(bufferWidth, bufferHeight); Vector2 AR = Vector2.Divide(VS, BS); float target_par = (AR.X / AR.Y); //this would malfunction for AR <= 0.5 or AR >= 2.0 //EDIT - in fact, we have AR like that coming from PSX, sometimes, so maybe we should solve this better Vector2 PS = new Vector2(1, 1); //here's how we define zooming, in this case: //make sure each step is an increment of zoom for at least one of the dimensions (or maybe both of them) //look for the increment which helps the AR the best //TODO - this cant possibly support scale factors like 1.5x //TODO - also, this might be messing up zooms and stuff, we might need to run this on the output size of the filter chain for (int i = 1; i < zoom; i++) { //would not be good to run this per frame, but it seems to only run when the resolution changes, etc. Vector2[] trials = new [] { PS + new Vector2(1, 0), PS + new Vector2(0, 1), PS + new Vector2(1, 1) }; int bestIndex = -1; float bestValue = 1000.0f; for (int t = 0; t < trials.Length; t++) { //I. float test_ar = trials[t].X / trials[t].Y; //II. //Vector2 calc = Vector2.Multiply(trials[t], VS); //float test_ar = calc.X / calc.Y; //not clear which approach is superior float deviation_linear = Math.Abs(test_ar - target_par); float deviation_geom = test_ar / target_par; if (deviation_geom < 1) { deviation_geom = 1.0f / deviation_geom; } float value = deviation_linear; if (value < bestValue) { bestIndex = t; bestValue = value; } } //is it possible to get here without selecting one? doubtful. //EDIT: YES IT IS. it happened with an 0,0 buffer size. of course, that was a mistake, but we shouldnt crash if (bestIndex != -1) //so, what now? well, this will result in 0,0 getting picked, so thats probably all we can do { PS = trials[bestIndex]; } } chain_outsize = new Size((int)(bufferWidth * PS.X), (int)(bufferHeight * PS.Y)); } else { //obey the AR, but allow free scaling: just zoom the virtual size chain_outsize = new Size(virtualWidth * zoom, virtualHeight * zoom); } } else { //ar_unity: //just choose to zoom the buffer (make no effort to incorporate AR) chain_outsize = new Size(bufferWidth * zoom, bufferHeight * zoom); } } else { //!ar_active: //just choose to zoom the buffer (make no effort to incorporate AR) chain_outsize = new Size(bufferWidth * zoom, bufferHeight * zoom); } chain_outsize.Width += ClientExtraPadding.Horizontal; chain_outsize.Height += ClientExtraPadding.Vertical; var job = new JobInfo { videoProvider = fvp, simulate = true, chain_outsize = chain_outsize, }; var filterProgram = UpdateSourceInternal(job); var size = filterProgram.Filters[filterProgram.Filters.Count - 1].FindOutput().SurfaceFormat.Size; return(size); }
public byte[] Serialize(JobInfo jobInfo, IJobTypeProvider typeProvider) { var serializedEnvelope = ToSerializedEnvelope(jobInfo, typeProvider); return(SerializeEnvelope(jobInfo.ArgsType, serializedEnvelope)); }
public static void Schedule <TJob>(this Container container, JobInfo jobInfo) where TJob : IJob { jobInfo.Type = typeof(TJob); container.RegisterJob <TJob>(); CrossJobs.Current.Schedule(jobInfo); }
/// <summary> /// This will receive an emulated output frame from an IVideoProvider and run it through the complete frame processing pipeline /// Then it will stuff it into the bound PresentationPanel. /// --- /// If the int[] is size=1, then it contains an openGL texture ID (and the size should be as specified from videoProvider) /// Don't worry about the case where the frontend isnt using opengl; it isnt supported yet, and it will be my responsibility to deal with anyway /// </summary> public void UpdateSource(IVideoProvider videoProvider) { bool displayNothing = Global.Config.DispSpeedupFeatures == 0; var job = new JobInfo { videoProvider = videoProvider, simulate = displayNothing, chain_outsize = GraphicsControl.Size, includeOSD = true, }; UpdateSourceInternal(job); }
/// <summary> /// Attempts to calculate a good client size with the given zoom factor, considering the user's DisplayManager preferences /// TODO - this needs to be redone with a concept different from zoom factor. /// basically, each increment of a 'zoomlike' factor should definitely increase the viewable area somehow, even if it isnt strictly by an entire zoom level. /// </summary> public Size CalculateClientSize(IVideoProvider videoProvider, int zoom) { bool ar_active = Global.Config.DispFixAspectRatio; bool ar_system = Global.Config.DispManagerAR == Config.EDispManagerAR.System; bool ar_custom = Global.Config.DispManagerAR == Config.EDispManagerAR.Custom; bool ar_customRatio = Global.Config.DispManagerAR == Config.EDispManagerAR.CustomRatio; bool ar_correct = ar_system || ar_custom || ar_customRatio; bool ar_unity = !ar_correct; bool ar_integer = Global.Config.DispFixScaleInteger; int bufferWidth = videoProvider.BufferWidth; int bufferHeight = videoProvider.BufferHeight; int virtualWidth = videoProvider.VirtualWidth; int virtualHeight = videoProvider.VirtualHeight; if (ar_custom) { virtualWidth = Global.Config.DispCustomUserARWidth; virtualHeight = Global.Config.DispCustomUserARHeight; } if (ar_customRatio) { FixRatio(Global.Config.DispCustomUserARX, Global.Config.DispCustomUserARY, videoProvider.BufferWidth, videoProvider.BufferHeight, out virtualWidth, out virtualHeight); } var padding = CalculateCompleteContentPadding(true, false); virtualWidth += padding.Horizontal; virtualHeight += padding.Vertical; padding = CalculateCompleteContentPadding(true, true); bufferWidth += padding.Horizontal; bufferHeight += padding.Vertical; //Console.WriteLine("DISPZOOM " + zoom); //test //old stuff var fvp = new FakeVideoProvider(); fvp.BufferWidth = bufferWidth; fvp.BufferHeight = bufferHeight; fvp.VirtualWidth = virtualWidth; fvp.VirtualHeight = virtualHeight; Size chain_outsize = new Size(fvp.BufferWidth * zoom, fvp.BufferHeight * zoom); if (ar_active) { if (ar_correct) { if (ar_integer) { Vector2 VS = new Vector2(virtualWidth, virtualHeight); Vector2 BS = new Vector2(bufferWidth, bufferHeight); Vector2 AR = Vector2.Divide(VS, BS); float target_par = (AR.X / AR.Y); //this would malfunction for AR <= 0.5 or AR >= 2.0 //EDIT - in fact, we have AR like that coming from PSX, sometimes, so maybe we should solve this better Vector2 PS = new Vector2(1, 1); //here's how we define zooming, in this case: //make sure each step is an increment of zoom for at least one of the dimensions (or maybe both of them) //look for the increment which helps the AR the best //TODO - this cant possibly support scale factors like 1.5x //TODO - also, this might be messing up zooms and stuff, we might need to run this on the output size of the filter chain for (int i = 1; i < zoom;i++) { //would not be good to run this per frame, but it seems to only run when the resolution changes, etc. Vector2[] trials = new [] { PS + new Vector2(1, 0), PS + new Vector2(0, 1), PS + new Vector2(1, 1) }; int bestIndex = -1; float bestValue = 1000.0f; for (int t = 0; t < trials.Length; t++) { //I. float test_ar = trials[t].X / trials[t].Y; //II. //Vector2 calc = Vector2.Multiply(trials[t], VS); //float test_ar = calc.X / calc.Y; //not clear which approach is superior float deviation_linear = Math.Abs(test_ar - target_par); float deviation_geom = test_ar / target_par; if (deviation_geom < 1) deviation_geom = 1.0f / deviation_geom; float value = deviation_linear; if (value < bestValue) { bestIndex = t; bestValue = value; } } //is it possible to get here without selecting one? doubtful. //EDIT: YES IT IS. it happened with an 0,0 buffer size. of course, that was a mistake, but we shouldnt crash if(bestIndex != -1) //so, what now? well, this will result in 0,0 getting picked, so thats probably all we can do PS = trials[bestIndex]; } chain_outsize = new Size((int)(bufferWidth * PS.X), (int)(bufferHeight * PS.Y)); } else { //obey the AR, but allow free scaling: just zoom the virtual size chain_outsize = new Size(virtualWidth * zoom, virtualHeight * zoom); } } else { //ar_unity: //just choose to zoom the buffer (make no effort to incorporate AR) chain_outsize = new Size(bufferWidth * zoom, bufferHeight * zoom); } } else { //!ar_active: //just choose to zoom the buffer (make no effort to incorporate AR) chain_outsize = new Size(bufferWidth * zoom, bufferHeight * zoom); } chain_outsize.Width += ClientExtraPadding.Horizontal; chain_outsize.Height += ClientExtraPadding.Vertical; var job = new JobInfo { videoProvider = fvp, simulate = true, chain_outsize = chain_outsize, }; var filterProgram = UpdateSourceInternal(job); var size = filterProgram.Filters[filterProgram.Filters.Count - 1].FindOutput().SurfaceFormat.Size; return size; }
private void LoadUnitXML(string sFileName) { if (JobInfoMng.Instance.set) { return; } //XML파일을 텍스트에셋으로 불러오기 TextAsset textAsset = (TextAsset)Resources.Load("XML/" + sFileName); //불러온 텍스트에셋을 XmlDocument 형식으로 불러오는 작업 XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(textAsset.text); //인간 노드 리스트 불러오기 XmlNodeList JobNodes = xmlDoc.SelectNodes("UnitInfo/Job/Field"); foreach (XmlNode node in JobNodes) { //노드의 내용물 불러와서 아이템 정보에 저장 후 아이템 매니져에 추가하는 작업 byte id; //= byte.Parse(node.Attributes.GetNamedItem("id").Value); byte.TryParse(node.Attributes.GetNamedItem("id").InnerText, out id); string name = node.Attributes.GetNamedItem("name").InnerText; string face = node.Attributes.GetNamedItem("face").InnerText; float Size = float.Parse(node.Attributes.GetNamedItem("size").InnerText); float ColRadius = float.Parse(node.Attributes.GetNamedItem("colradius").InnerText); float ColHeight = float.Parse(node.Attributes.GetNamedItem("colheight").InnerText); float MoveSpeed = float.Parse(node.Attributes.GetNamedItem("movespeed").InnerText); float RotateSpeed = float.Parse(node.Attributes.GetNamedItem("rotatespeed").InnerText); float AtkSpeed = float.Parse(node.Attributes.GetNamedItem("atkspeed").InnerText); float ViewRange = float.Parse(node.Attributes.GetNamedItem("viewrange").InnerText); float AtkRange = float.Parse(node.Attributes.GetNamedItem("atkrange").InnerText); int Health = int.Parse(node.Attributes.GetNamedItem("health").InnerText); int AtkPower = int.Parse(node.Attributes.GetNamedItem("atkpower").InnerText); int DefValue = int.Parse(node.Attributes.GetNamedItem("defvalue").InnerText); //Debug.Log(id+","+ name + "," + face + "," + Size + "," + ColRadius + "," + ColHeight + "," + MoveSpeed + "," + RotateSpeed + "," + Health + "," + AtkPower + "," + AtkSpeed + "," + DefValue + "," + ViewRange + "," + AtkRange); JobInfo info = new JobInfo(id, name, face, Size, ColRadius, ColHeight, MoveSpeed, RotateSpeed, Health, AtkPower, AtkSpeed, DefValue, ViewRange, AtkRange); JobInfoMng.Instance.AddJob(info); } //직업장비 노드 리스트 불러오기 XmlNodeList JobEquipNodes = xmlDoc.SelectNodes("UnitInfo/JobEquip/Field"); foreach (XmlNode node in JobEquipNodes) { //노드의 내용물 불러와서 블록 정보에 저장 후 블록 매니져에 추가하는 작업 byte id = byte.Parse(node.Attributes.GetNamedItem("id").InnerText); string head = node.Attributes.GetNamedItem("head").InnerText; string rhand = node.Attributes.GetNamedItem("rhand").InnerText; string lhand = node.Attributes.GetNamedItem("lhand").InnerText; string chest = node.Attributes.GetNamedItem("chest").InnerText; string projectile = node.Attributes.GetNamedItem("projectile").InnerText; string atkreadyani = node.Attributes.GetNamedItem("atkreadyani").InnerText; string atkingani = node.Attributes.GetNamedItem("atkingani").InnerText; JobEquipInfo info = new JobEquipInfo(id, head, rhand, lhand, chest, projectile, atkreadyani, atkingani); JobEquipInfoMng.Instance.AddJobEquip(info); } }
public void AddFirst(JobInfo jobInfo) { }
private PrintJobViewModel CreateSomePrintJobViewModelWithJobInfo(JobInfo jobInfo) { return(CreateMockedPrintJobViewModel(MockRepository.GenerateStub <IJobInfoQueue>(), jobInfo)); }
public Result Remove(JobInfo jobInfo) { return(Execute(() => SchedulerManager.Singleton.Remove(jobInfo))); }
private PrintJobViewModel CreateMockedPrintJobViewModel(IJobInfoQueue jobInfoQueue, JobInfo jobInfo, string applicationName = "PDFCreator") { var appSettings = new ApplicationSettings(); var profiles = new List <ConversionProfile>(); var selectedProfile = new ConversionProfile(); profiles.Add(selectedProfile); var interaction = new PrintJobInteraction(jobInfo, selectedProfile); var settings = new PdfCreatorSettings(MockRepository.GenerateStub <IStorage>()); settings.ApplicationSettings = appSettings; settings.ConversionProfiles = profiles; var settingsHelper = Substitute.For <ISettingsProvider>(); settingsHelper.Settings.Returns(settings); var settingsManager = Substitute.For <ISettingsManager>(); settingsManager.GetSettingsProvider().Returns(settingsHelper); var translator = new BasicTranslator("default", _translationData); var userGuideHelper = Substitute.For <IUserGuideHelper>(); var printJobViewModel = new PrintJobViewModel(settingsManager, jobInfoQueue, translator, new DragAndDropEventHandler(MockRepository.GenerateStub <IFileConversionHandler>()), MockRepository.GenerateStub <IInteractionInvoker>(), userGuideHelper, new ApplicationNameProvider(applicationName)); printJobViewModel.SetInteraction(interaction); printJobViewModel.FinishInteraction = () => { }; return(printJobViewModel); }
public Task Register(JobInfo jobInfo) { throw new NotImplementedException(); }
private static void GetJobInfo(string html) { HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(html); var dt = new DataTable(); dt.Columns.Add("Name", typeof(string)); dt.Columns.Add("Value", typeof(string)); int count = 0; var jobinfos = new List <JobInfo>(); foreach (HtmlNode table in doc.DocumentNode.SelectNodes("//table")) { foreach (HtmlNode row in table.SelectNodes("tr")) { if (!row.InnerText.Contains("举办日期")) { var jobInfo = new JobInfo(); //foreach (var cell in row.SelectNodes("td")) //{ // jobInfo.CollegeName = cell.InnerText; //} for (int i = 0; i < row.SelectNodes("td").Count(); i++) { jobInfo.CollegeName = row.SelectNodes("td")[i].InnerText; } } } HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://my.yingjiesheng.com/xjh-000-818-836.html"); req.Method = "GET"; req.Accept = "text/html"; req.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)"; try { Encoding GB18030 = Encoding.GetEncoding("GB18030"); // GB18030兼容GBK和GB2312 Encoding _encoding = GB18030; string html2 = null; HttpWebResponse res = (HttpWebResponse)req.GetResponse(); using (StreamReader reader = new StreamReader(res.GetResponseStream(), _encoding)) { html2 = reader.ReadToEnd(); if (!string.IsNullOrEmpty(html2)) { Console.WriteLine("Download OK!\n"); } } GetJobInfo2(html2); string[] links = GetLinks(html2); } catch (WebException we) { Console.WriteLine(we.Message); } } }
protected void SubmitButton_Click(object sender, EventArgs e) { int jobID = -1; JobInfo info = new JobInfo(); Control currentControl = null; int jobTypeID = int.Parse(Session["JobTypeID"].ToString()); string specialInstructions = ""; int quantity = -1; string deliveryOrPickup = ""; Guid customerID = Guid.Empty; DateTime promiseDate = DateTime.Today.AddYears(-400); List<string> jobAssets = new List<string>(); List<JobInfo> jobInfo = new List<JobInfo>(); bool getFiles = false; string filename = Server.MapPath("../../Admin/Settings.xml"); XPathDocument document = new XPathDocument(filename); XPathNavigator navigator = document.CreateNavigator(); XPathExpression expression = navigator.Compile("/appSettings/initialJobStatus"); XPathNodeIterator iterator = navigator.Select(expression); iterator.MoveNext(); XPathNavigator nav2 = iterator.Current.Clone(); int jobStatus = Brentwood.GetJobStatusByName("Pending Approval").JobStatusID; try { customerID = (Brentwood.LookupCustomerByUsername(User.Identity.Name)).UserId; promiseDate = Utils.GetPromiseDate(jobTypeID); } catch (Exception ex) { FormMessage.Text = ex.Message; FormMessage.ForeColor = Color.Red; } foreach (HtmlTableRow row in ((HtmlTable)Session["CurrentForm"]).Rows) { info = new JobInfo(); info.NameKey = (row.Cells[0].Controls[0] as Label).Text; currentControl = FormPanel.FindControl(row.Cells[1].Controls[0].ID); if (currentControl.ID == "500TextBoxQuantityTextbox") { if ((currentControl as TextBox).Text != "") { quantity = int.Parse((currentControl as TextBox).Text.Trim()); } } else if (currentControl.ID == "501TextBoxSpecialInstructionsTextbox") { specialInstructions = (currentControl as TextBox).Text.Trim(); } else if (currentControl.ID == "502CheckBoxDeliveryCheckbox") { if ((currentControl as CheckBox).Checked) { deliveryOrPickup = "D"; } else { deliveryOrPickup = "P"; } } else { if (row.Cells[1].Controls[0] is TextBox) { info.DataValue = ((TextBox)currentControl).Text.Trim(); jobInfo.Add(info); } else if (row.Cells[1].Controls[0] is CheckBox) { if (((CheckBox)currentControl).Checked) { info.DataValue = "true"; jobInfo.Add(info); } else { info.DataValue = "false"; jobInfo.Add(info); } } else if (row.Cells[1].Controls[0] is Controls_MultiFileUpload) { getFiles = true; } else { FormMessage.Text = "Control type invalid."; FormMessage.ForeColor = Color.Red; } } } try { jobID = Brentwood.AddJob(jobTypeID, specialInstructions, quantity, deliveryOrPickup, customerID, promiseDate); Brentwood.InitializeJobJobStatus(jobID, (Brentwood.LookupCustomerByUsername(User.Identity.Name.ToString())).UserId); Brentwood.AddInfoToJob(jobInfo, jobID); if (getFiles) { string physicalPath = ""; string virtualPath = ""; // Get the HttpFileCollection HttpFileCollection hfc = Request.Files; for (int i = 0; i < hfc.Count; i++) { HttpPostedFile hpf = hfc[i]; if (hpf.ContentLength > 0) { physicalPath = WebUtils.GetFolderPath(User.Identity.Name, jobID, Server) + "\\" + System.IO.Path.GetFileName(hpf.FileName); virtualPath = WebUtils.ResolveVirtualPath(physicalPath); hpf.SaveAs(Server.MapPath(virtualPath)); jobAssets.Add(physicalPath); } } } Brentwood.AddAssetsToJob(jobAssets, jobID); FormMessage.Text = "Job successfully submitted!"; FormMessage.ForeColor = Color.Green; Context.Items.Add("JobID", jobID); Server.Transfer("OrderCompletePage.aspx"); } catch (Exception ex) { FormMessage.Text = ex.Message; FormMessage.ForeColor = Color.Red; } //End of SubmitButton_Click method }
public void SetJobInfo(JobInfo.FALotJobInfo lotJobInfo) { if (lotJobInfo.FoamPadCoveringJobInfo == null) { Manager.MessageWindowManager.Instance.Show("JobInfoLoadFail", "FoamPadCoveringJobInfo is null"); return; } lotJobInfo.FoamPadCoveringJobInfo.CopyTo(FoamPadCoveringJobInfo); //FoamPadCoveringJobInfo.CoveringUnitPosition.ReceptionPosition.CopyTo(FoamPadCoveringUnit.FoamPadGripperTransferServo.FoamPadReceptionPos); FoamPadCoveringJobInfo.CoveringUnitPosition.CoveringPosition.CopyTo(FoamPadCoveringUnit.FoamPadGripperTransferServo.FoamPadCoveringPos); FoamPadCoveringJobInfo.CoveringUnitPosition.GuidePosition.CopyTo(FoamPadCoveringUnit.FoamPadGripperTransferServo.FoamPadGuidePos); }
internal static int Randomize(this int self, JobInfo info, int min, int max) { return(self + info.GetRandomNumber(min, max)); }
FilterProgram UpdateSourceInternal(JobInfo job) { _glManager.Activate(CR_GraphicsControl); IVideoProvider videoProvider = job.videoProvider; bool simulate = job.simulate; Size chain_outsize = job.chain_outsize; int vw = videoProvider.BufferWidth; int vh = videoProvider.BufferHeight; if (Global.Config.DispFixAspectRatio) { if (Global.Config.DispManagerAR == Config.EDispManagerAR.System) { vw = videoProvider.VirtualWidth; vh = videoProvider.VirtualHeight; } if (Global.Config.DispManagerAR == Config.EDispManagerAR.Custom) { vw = Global.Config.DispCustomUserARWidth; vh = Global.Config.DispCustomUserARHeight; } } int[] videoBuffer = videoProvider.GetVideoBuffer(); TESTEROO: int bufferWidth = videoProvider.BufferWidth; int bufferHeight = videoProvider.BufferHeight; bool isGlTextureId = videoBuffer.Length == 1; //TODO - need to do some work here for GDI+ to repair gl texture ID importing BitmapBuffer bb = null; Texture2d videoTexture = null; if (!simulate) { if (isGlTextureId) { videoTexture = GL.WrapGLTexture2d(new IntPtr(videoBuffer[0]), bufferWidth, bufferHeight); } else { //wrap the videoprovider data in a BitmapBuffer (no point to refactoring that many IVideoProviders) bb = new BitmapBuffer(bufferWidth, bufferHeight, videoBuffer); //now, acquire the data sent from the videoProvider into a texture videoTexture = VideoTextureFrugalizer.Get(bb); GL.SetTextureWrapMode(videoTexture, true); } //TEST (to be removed once we have an actual example of bring in a texture ID from opengl emu core): //if (!isGlTextureId) //{ // videoBuffer = new int[1] { videoTexture.Id.ToInt32() }; // goto TESTEROO; //} } //record the size of what we received, since lua and stuff is gonna want to draw onto it currEmuWidth = bufferWidth; currEmuHeight = bufferHeight; //build the default filter chain and set it up with services filters will need Size chain_insize = new Size(bufferWidth, bufferHeight); var filterProgram = BuildDefaultChain(chain_insize, chain_outsize, job.includeOSD); filterProgram.GuiRenderer = Renderer; filterProgram.GL = GL; //setup the source image filter BizHawk.Client.EmuHawk.Filters.SourceImage fInput = filterProgram["input"] as BizHawk.Client.EmuHawk.Filters.SourceImage; fInput.Texture = videoTexture; //setup the final presentation filter BizHawk.Client.EmuHawk.Filters.FinalPresentation fPresent = filterProgram["presentation"] as BizHawk.Client.EmuHawk.Filters.FinalPresentation; fPresent.VirtualTextureSize = new Size(vw, vh); fPresent.TextureSize = new Size(bufferWidth, bufferHeight); fPresent.BackgroundColor = videoProvider.BackgroundColor; fPresent.GuiRenderer = Renderer; fPresent.GL = GL; filterProgram.Compile("default", chain_insize, chain_outsize, !job.offscreen); if (simulate) { } else { CurrentFilterProgram = filterProgram; UpdateSourceDrawingWork(job); } //cleanup: if (bb != null) bb.Dispose(); return filterProgram; }
/// <summary> /// 获取 jobDetail /// </summary> /// <param name="jobInfo"></param> /// <param name="jobKey"></param> /// <returns></returns> private IJobDetail GetJobDetail(JobInfo jobInfo, out JobKey jobKey) { jobKey = GetJobKey(jobInfo); return(Scheduler.GetJobDetail(jobKey).Result); }
public NewJobInfoEventArgs(JobInfo jobInfo) { JobInfo = jobInfo; }
/// <summary> /// 获取 Trigger /// </summary> /// <param name="jobInfo"></param> /// <param name="triKey"></param> /// <returns></returns> private ITrigger GetTrigger(JobInfo jobInfo, out TriggerKey triKey) { triKey = GetTriggerKey(jobInfo); return(Scheduler.GetTrigger(triKey).Result); }
/// <summary> /// 获取jobKey /// </summary> /// <param name="jobInfo"></param> /// <returns></returns> private JobKey GetJobKey(JobInfo jobInfo) { return(new JobKey(jobInfo.JobName, jobInfo.JobGroup)); }
public void SetJobInfo(JobInfo.FALotJobInfo lotJobInfo) { if (lotJobInfo.SSDInletJobInfo == null) { Manager.MessageWindowManager.Instance.Show("JobInfoLoadFail", "SSDInletJobInfo is null"); return; } lotJobInfo.CopyTo(LotJobInfo); lotJobInfo.SSDInletJobInfo.CopyTo(JobInfo); JobInfo.ServoPositions.GuidePosition.CopyTo(SSDBoxInletUnit.SideGuideServo.GuidePos); JobInfo.ServoPositions.AlignPosition.CopyTo(SSDBoxInletUnit.SideGuideServo.AlignPos); }
/// <summary> /// 获取triggerKey /// </summary> /// <param name="jobInfo"></param> /// <returns></returns> private TriggerKey GetTriggerKey(JobInfo jobInfo) { return(new TriggerKey(jobInfo.JobName, jobInfo.JobGroup)); }
/// <summary> /// This will receive an emulated output frame from an IVideoProvider and run it through the complete frame processing pipeline /// Then it will stuff it into the bound PresentationPanel. /// --- /// If the int[] is size=1, then it contains an openGL texture ID (and the size should be as specified from videoProvider) /// Don't worry about the case where the frontend isnt using opengl; it isnt supported yet, and it will be my responsibility to deal with anyway /// </summary> public void UpdateSource(IVideoProvider videoProvider) { var job = new JobInfo { videoProvider = videoProvider, simulate = false, chain_outsize = GraphicsControl.Size, includeOSD = true }; UpdateSourceInternal(job); }
public bool Remove(JobInfo jobInfo, bool deleteFiles) { return(true); }
public void SetJobInfo(JobInfo.FALotJobInfo lotJobInfo) { if (lotJobInfo.SmallBoxStackJobInfo == null) { Manager.MessageWindowManager.Instance.Show("JobInfoLoadFail", "JobInfo is null. Small Box Stack Module"); return; } lotJobInfo.CopyTo(JobInfo); }
void AddNodesForBranch(List<UnrealTargetPlatform> InitialHostPlatforms, JobInfo JobInfo, out List<BuildNode> AllNodes, out List<AggregateNode> AllAggregates, ref int TimeQuantum) { string BranchName; if (P4Enabled) { BranchName = P4Env.BuildRootP4; } else { BranchName = ParseParamValue("BranchName", ""); } GUBPBranchHacker.BranchOptions BranchOptions = GetBranchOptions(BranchName); if (BranchOptions.QuantumOverride != 0) { TimeQuantum = BranchOptions.QuantumOverride; } bool bForceIncrementalCompile = ParseParam("ForceIncrementalCompile"); bool bNoAutomatedTesting = ParseParam("NoAutomatedTesting") || BranchOptions.bNoAutomatedTesting; List<UnrealTargetPlatform> HostPlatforms = new List<UnrealTargetPlatform>(InitialHostPlatforms); foreach(UnrealTargetPlatform PlatformToRemove in BranchOptions.PlatformsToRemove) { HostPlatforms.Remove(PlatformToRemove); } BranchInfo Branch = new BranchInfo(HostPlatforms); List<UnrealTargetPlatform> ActivePlatforms; if (IsBuildMachine || ParseParam("AllPlatforms")) { ActivePlatforms = new List<UnrealTargetPlatform>(); List<BranchInfo.BranchUProject> BranchCodeProjects = new List<BranchInfo.BranchUProject>(); BranchCodeProjects.Add(Branch.BaseEngineProject); BranchCodeProjects.AddRange(Branch.CodeProjects); BranchCodeProjects.RemoveAll(Project => BranchOptions.ExcludeNodes.Contains(Project.GameName)); foreach (var GameProj in BranchCodeProjects) { foreach (var Kind in BranchInfo.MonolithicKinds) { if (GameProj.Properties.Targets.ContainsKey(Kind)) { var Target = GameProj.Properties.Targets[Kind]; foreach (var HostPlatform in HostPlatforms) { var Platforms = Target.Rules.GUBP_GetPlatforms_MonolithicOnly(HostPlatform); var AdditionalPlatforms = Target.Rules.GUBP_GetBuildOnlyPlatforms_MonolithicOnly(HostPlatform); var AllPlatforms = Platforms.Union(AdditionalPlatforms); foreach (var Plat in AllPlatforms) { if (Target.Rules.SupportsPlatform(Plat) && !ActivePlatforms.Contains(Plat)) { ActivePlatforms.Add(Plat); } } } } } } } else { ActivePlatforms = new List<UnrealTargetPlatform>(CommandUtils.KnownTargetPlatforms); } var SupportedPlatforms = new List<UnrealTargetPlatform>(); foreach(var Plat in ActivePlatforms) { if(!BranchOptions.PlatformsToRemove.Contains(Plat)) { SupportedPlatforms.Add(Plat); } } ActivePlatforms = SupportedPlatforms; foreach (var Plat in ActivePlatforms) { LogVerbose("Active Platform: {0}", Plat.ToString()); } bool bNoIOSOnPC = HostPlatforms.Contains(UnrealTargetPlatform.Mac); if (HostPlatforms.Count >= 2) { // make sure each project is set up with the right assumptions on monolithics that prefer a platform. foreach (var CodeProj in Branch.CodeProjects) { var OptionsMac = CodeProj.Options(UnrealTargetPlatform.Mac); var OptionsPC = CodeProj.Options(UnrealTargetPlatform.Win64); var MacMonos = GamePlatformMonolithicsNode.GetMonolithicPlatformsForUProject(UnrealTargetPlatform.Mac, ActivePlatforms, CodeProj, false, bNoIOSOnPC); var PCMonos = GamePlatformMonolithicsNode.GetMonolithicPlatformsForUProject(UnrealTargetPlatform.Win64, ActivePlatforms, CodeProj, false, bNoIOSOnPC); if (!OptionsMac.bIsPromotable && OptionsPC.bIsPromotable && (MacMonos.Contains(UnrealTargetPlatform.IOS) || PCMonos.Contains(UnrealTargetPlatform.IOS))) { throw new AutomationException("Project {0} is promotable for PC, not promotable for Mac and uses IOS monothics. Since Mac is the preferred platform for IOS, please add Mac as a promotable platform.", CodeProj.GameName); } if (OptionsMac.bIsPromotable && !OptionsPC.bIsPromotable && (MacMonos.Contains(UnrealTargetPlatform.Android) || PCMonos.Contains(UnrealTargetPlatform.Android))) { throw new AutomationException("Project {0} is not promotable for PC, promotable for Mac and uses Android monothics. Since PC is the preferred platform for Android, please add PC as a promotable platform.", CodeProj.GameName); } } } GUBPBranchConfig BranchConfig = new GUBPBranchConfig(HostPlatforms, BranchName, Branch, BranchOptions, bForceIncrementalCompile, JobInfo); BranchConfig.AddNode(new VersionFilesNode()); foreach (var HostPlatform in HostPlatforms) { BranchConfig.AddNode(new ToolsForCompileNode(BranchConfig, HostPlatform, ParseParam("Launcher"))); if (!BranchOptions.ExcludePlatformsForEditor.Contains(HostPlatform)) { BranchConfig.AddNode(new RootEditorNode(BranchConfig, HostPlatform)); } BranchConfig.AddNode(new ToolsNode(BranchConfig, HostPlatform)); if (!BranchOptions.ExcludePlatformsForEditor.Contains(HostPlatform)) { BranchConfig.AddNode(new InternalToolsNode(BranchConfig, HostPlatform)); if (HostPlatform == UnrealTargetPlatform.Win64 && ActivePlatforms.Contains(UnrealTargetPlatform.Linux)) { if (!BranchOptions.ExcludePlatformsForEditor.Contains(UnrealTargetPlatform.Linux)) { BranchConfig.AddNode(new ToolsCrossCompileNode(BranchConfig, HostPlatform)); } } foreach (var ProgramTarget in Branch.BaseEngineProject.Properties.Programs) { if (!BranchOptions.ExcludeNodes.Contains(ProgramTarget.TargetName)) { bool bInternalOnly; bool SeparateNode; bool CrossCompile; if (ProgramTarget.Rules.GUBP_AlwaysBuildWithTools(HostPlatform, out bInternalOnly, out SeparateNode, out CrossCompile) && ProgramTarget.Rules.SupportsPlatform(HostPlatform) && SeparateNode) { if (bInternalOnly) { BranchConfig.AddNode(new SingleInternalToolsNode(BranchConfig, HostPlatform, ProgramTarget)); } else { BranchConfig.AddNode(new SingleToolsNode(BranchConfig, HostPlatform, ProgramTarget)); } } if (ProgramTarget.Rules.GUBP_IncludeNonUnityToolTest()) { BranchConfig.AddNode(new NonUnityToolNode(HostPlatform, ProgramTarget)); } } } foreach(var CodeProj in Branch.CodeProjects) { foreach(var ProgramTarget in CodeProj.Properties.Programs) { if (!BranchOptions.ExcludeNodes.Contains(ProgramTarget.TargetName)) { bool bInternalNodeOnly; bool SeparateNode; bool CrossCompile; if (ProgramTarget.Rules.GUBP_AlwaysBuildWithTools(HostPlatform, out bInternalNodeOnly, out SeparateNode, out CrossCompile) && ProgramTarget.Rules.SupportsPlatform(HostPlatform) && SeparateNode) { if (bInternalNodeOnly) { BranchConfig.AddNode(new SingleInternalToolsNode(BranchConfig, HostPlatform, ProgramTarget)); } else { BranchConfig.AddNode(new SingleToolsNode(BranchConfig, HostPlatform, ProgramTarget)); } } if (ProgramTarget.Rules.GUBP_IncludeNonUnityToolTest()) { BranchConfig.AddNode(new NonUnityToolNode(HostPlatform, ProgramTarget)); } } } } BranchConfig.AddNode(new EditorAndToolsNode(this, HostPlatform)); } bool DoASharedPromotable = false; int NumSharedCode = 0; foreach (var CodeProj in Branch.CodeProjects) { var Options = CodeProj.Options(HostPlatform); if (Options.bIsPromotable && !Options.bSeparateGamePromotion) { NumSharedCode++; } } var NonCodeProjectNames = new Dictionary<string, List<UnrealTargetPlatform>>(); var NonCodeFormalBuilds = new Dictionary<string, List<TargetRules.GUBPFormalBuild>>(); { var Target = Branch.BaseEngineProject.Properties.Targets[TargetRules.TargetType.Editor]; foreach (var Codeless in Target.Rules.GUBP_NonCodeProjects_BaseEditorTypeOnly(HostPlatform)) { var Proj = Branch.FindGame(Codeless.Key); if (Proj == null) { LogVerbose("{0} was listed as a codeless project by GUBP_NonCodeProjects_BaseEditorTypeOnly, however it does not exist in this branch.", Codeless.Key); } else if (Proj.Properties.bIsCodeBasedProject) { if (!Branch.NonCodeProjects.Contains(Proj)) { Branch.NonCodeProjects.Add(Proj); NonCodeProjectNames.Add(Codeless.Key, Codeless.Value); } } else { NonCodeProjectNames.Add(Codeless.Key, Codeless.Value); } } var TempNonCodeFormalBuilds = Target.Rules.GUBP_GetNonCodeFormalBuilds_BaseEditorTypeOnly(); var HostMonos = GamePlatformMonolithicsNode.GetMonolithicPlatformsForUProject(HostPlatform, ActivePlatforms, Branch.BaseEngineProject, true, bNoIOSOnPC); foreach (var Codeless in TempNonCodeFormalBuilds) { if (NonCodeProjectNames.ContainsKey(Codeless.Key)) { var PlatList = Codeless.Value; var NewPlatList = new List<TargetRules.GUBPFormalBuild>(); foreach (var PlatPair in PlatList) { if (HostMonos.Contains(PlatPair.TargetPlatform)) { NewPlatList.Add(PlatPair); } } if (NewPlatList.Count > 0) { NonCodeFormalBuilds.Add(Codeless.Key, NewPlatList); } } else { LogVerbose("{0} was listed as a codeless formal build GUBP_GetNonCodeFormalBuilds_BaseEditorTypeOnly, however it does not exist in this branch.", Codeless.Key); } } } DoASharedPromotable = NumSharedCode > 0 || NonCodeProjectNames.Count > 0 || NonCodeFormalBuilds.Count > 0; if (!BranchOptions.ExcludePlatformsForEditor.Contains(HostPlatform)) { BranchConfig.AddNode(new NonUnityTestNode(BranchConfig, HostPlatform)); } if (DoASharedPromotable) { var AgentSharingGroup = "Shared_EditorTests" + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform); var Options = Branch.BaseEngineProject.Options(HostPlatform); if (!Options.bIsPromotable || Options.bSeparateGamePromotion) { throw new AutomationException("We assume that if we have shared promotable, the base engine is in it."); } if (!bNoAutomatedTesting && HostPlatform == UnrealTargetPlatform.Win64) //temp hack till automated testing works on other platforms than Win64 { var EditorTests = Branch.BaseEngineProject.Properties.Targets[TargetRules.TargetType.Editor].Rules.GUBP_GetEditorTests_EditorTypeOnly(HostPlatform); var EditorTestNodes = new List<string>(); foreach (var Test in EditorTests) { EditorTestNodes.Add(BranchConfig.AddNode(new UATTestNode(BranchConfig, HostPlatform, Branch.BaseEngineProject, Test.Key, Test.Value, AgentSharingGroup))); foreach (var NonCodeProject in Branch.NonCodeProjects) { if (!NonCodeProjectNames.ContainsKey(NonCodeProject.GameName)) { continue; } if (HostPlatform == UnrealTargetPlatform.Mac) continue; //temp hack till mac automated testing works EditorTestNodes.Add(BranchConfig.AddNode(new UATTestNode(BranchConfig, HostPlatform, NonCodeProject, Test.Key, Test.Value, AgentSharingGroup))); } } if (EditorTestNodes.Count > 0) { BranchConfig.AddNode(new GameAggregateNode(HostPlatform, Branch.BaseEngineProject, "AllEditorTests", EditorTestNodes)); } } var ServerPlatforms = new List<UnrealTargetPlatform>(); var GamePlatforms = new List<UnrealTargetPlatform>(); foreach (var Kind in BranchInfo.MonolithicKinds) { if (Branch.BaseEngineProject.Properties.Targets.ContainsKey(Kind)) { var Target = Branch.BaseEngineProject.Properties.Targets[Kind]; var Platforms = Target.Rules.GUBP_GetPlatforms_MonolithicOnly(HostPlatform); if (Platforms.Contains(HostPlatform)) { // we want the host platform first since some some pseudodependencies look to see if the shared promotable exists. Platforms.Remove(HostPlatform); Platforms.Insert(0, HostPlatform); } foreach (var Plat in Platforms) { if (!Platform.Platforms[HostPlatform].CanHostPlatform(Plat)) { throw new AutomationException("Project {0} asked for platform {1} with host {2}, but the host platform cannot build that platform.", Branch.BaseEngineProject.GameName, Plat.ToString(), HostPlatform.ToString()); } if (bNoIOSOnPC && Plat == UnrealTargetPlatform.IOS && HostPlatform == UnrealTargetPlatform.Win64) { continue; } if (ActivePlatforms.Contains(Plat)) { if (Kind == TargetRules.TargetType.Server && !ServerPlatforms.Contains(Plat)) { ServerPlatforms.Add(Plat); } if (Kind == TargetRules.TargetType.Game && !GamePlatforms.Contains(Plat)) { GamePlatforms.Add(Plat); } if (!BranchConfig.HasNode(GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, Branch.BaseEngineProject, Plat))) { if(GamePlatformMonolithicsNode.HasPrecompiledTargets(Branch.BaseEngineProject, HostPlatform, Plat)) { BranchConfig.AddNode(new GamePlatformMonolithicsNode(BranchConfig, HostPlatform, ActivePlatforms, Branch.BaseEngineProject, Plat, InPrecompiled: true)); } BranchConfig.AddNode(new GamePlatformMonolithicsNode(BranchConfig, HostPlatform, ActivePlatforms, Branch.BaseEngineProject, Plat)); } if (Plat == UnrealTargetPlatform.Win32 && Target.Rules.GUBP_BuildWindowsXPMonolithics() && Kind == TargetRules.TargetType.Game) { if (!BranchConfig.HasNode(GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, Branch.BaseEngineProject, Plat, true))) { BranchConfig.AddNode(new GamePlatformMonolithicsNode(BranchConfig, HostPlatform, ActivePlatforms, Branch.BaseEngineProject, Plat, true)); } } } } } } var CookedSharedAgentSharingGroup = "Shared_CookedTests" + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform); var CookedSampleAgentSharingGroup = "Sample_CookedTests" + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform); var GameTestNodes = new List<string>(); var GameCookNodes = new List<string>(); //var FormalAgentSharingGroup = "Shared_FormalBuilds" + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform); //foreach (var Kind in BranchInfo.MonolithicKinds)//for now, non-code projects don't do client or server. { var Kind = TargetRules.TargetType.Game; if (Branch.BaseEngineProject.Properties.Targets.ContainsKey(Kind)) { var Target = Branch.BaseEngineProject.Properties.Targets[Kind]; var Platforms = Target.Rules.GUBP_GetPlatforms_MonolithicOnly(HostPlatform); foreach (var Plat in Platforms) { if (!Platform.Platforms[HostPlatform].CanHostPlatform(Plat)) { throw new AutomationException("Project {0} asked for platform {1} with host {2}, but the host platform cannot build that platform.", Branch.BaseEngineProject.GameName, Plat.ToString(), HostPlatform.ToString()); } if (bNoIOSOnPC && Plat == UnrealTargetPlatform.IOS && HostPlatform == UnrealTargetPlatform.Win64) { continue; } if (ActivePlatforms.Contains(Plat)) { string CookedPlatform = Platform.Platforms[Plat].GetCookPlatform(Kind == TargetRules.TargetType.Server, Kind == TargetRules.TargetType.Client, ""); if (!BranchConfig.HasNode(CookNode.StaticGetFullName(HostPlatform, Branch.BaseEngineProject, CookedPlatform))) { GameCookNodes.Add(BranchConfig.AddNode(new CookNode(BranchConfig, HostPlatform, Branch.BaseEngineProject, Plat, CookedPlatform))); } if (!BranchConfig.HasNode(GamePlatformCookedAndCompiledNode.StaticGetFullName(HostPlatform, Branch.BaseEngineProject, Plat))) { BranchConfig.AddNode(new GamePlatformCookedAndCompiledNode(BranchConfig, HostPlatform, Branch.BaseEngineProject, Plat, false)); } var GameTests = Target.Rules.GUBP_GetGameTests_MonolithicOnly(HostPlatform, GetAltHostPlatform(HostPlatform), Plat); var RequiredPlatforms = new List<UnrealTargetPlatform> { Plat }; if (!bNoAutomatedTesting) { var ThisMonoGameTestNodes = new List<string>(); foreach (var Test in GameTests) { var TestName = Test.Key + "_" + Plat.ToString(); ThisMonoGameTestNodes.Add(BranchConfig.AddNode(new UATTestNode(BranchConfig, HostPlatform, Branch.BaseEngineProject, TestName, Test.Value, CookedSharedAgentSharingGroup, false, RequiredPlatforms))); } if (ThisMonoGameTestNodes.Count > 0) { GameTestNodes.Add(BranchConfig.AddNode(new GameAggregateNode(HostPlatform, Branch.BaseEngineProject, "CookedTests_" + Plat.ToString() + "_" + Kind.ToString() + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform), ThisMonoGameTestNodes))); } } foreach (var NonCodeProject in Branch.NonCodeProjects) { if (!NonCodeProjectNames.ContainsKey(NonCodeProject.GameName) || !NonCodeProjectNames[NonCodeProject.GameName].Contains(Plat)) { continue; } if (BranchOptions.ProjectsToCook.Contains(NonCodeProject.GameName) || BranchOptions.ProjectsToCook.Count == 0) { if (!BranchConfig.HasNode(CookNode.StaticGetFullName(HostPlatform, NonCodeProject, CookedPlatform))) { GameCookNodes.Add(BranchConfig.AddNode(new CookNode(BranchConfig, HostPlatform, NonCodeProject, Plat, CookedPlatform))); } if (!BranchConfig.HasNode(GamePlatformCookedAndCompiledNode.StaticGetFullName(HostPlatform, NonCodeProject, Plat))) { BranchConfig.AddNode(new GamePlatformCookedAndCompiledNode(BranchConfig, HostPlatform, NonCodeProject, Plat, false)); if (NonCodeFormalBuilds.ContainsKey(NonCodeProject.GameName)) { var PlatList = NonCodeFormalBuilds[NonCodeProject.GameName]; foreach (var PlatPair in PlatList) { if (PlatPair.TargetPlatform == Plat) { var NodeName = BranchConfig.AddNode(new FormalBuildNode(BranchConfig, NonCodeProject, HostPlatform, new List<UnrealTargetPlatform>() { Plat }, new List<UnrealTargetConfiguration>() { PlatPair.TargetConfig })); // we don't want this delayed // this would normally wait for the testing phase, we just want to build it right away BranchConfig.RemovePseudodependencyFromNode( CookNode.StaticGetFullName(HostPlatform, NonCodeProject, CookedPlatform), WaitForTestShared.StaticGetFullName()); string BuildAgentSharingGroup = ""; if (Options.bSeparateGamePromotion) { BuildAgentSharingGroup = NonCodeProject.GameName + "_MakeFormalBuild_" + Plat.ToString() + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform); if (Plat == UnrealTargetPlatform.IOS || Plat == UnrealTargetPlatform.Android) // These trash build products, so we need to use different agents { BuildAgentSharingGroup = ""; } BranchConfig.FindNode(CookNode.StaticGetFullName(HostPlatform, NonCodeProject, CookedPlatform)).AgentSharingGroup = BuildAgentSharingGroup; BranchConfig.FindNode(NodeName).AgentSharingGroup = BuildAgentSharingGroup; } else { //GUBPNodes[NodeName].AgentSharingGroup = FormalAgentSharingGroup; if (Plat == UnrealTargetPlatform.XboxOne) { BranchConfig.FindNode(NodeName).AgentSharingGroup = ""; } } if (PlatPair.bTest) { BranchConfig.AddNode(new FormalBuildTestNode(BranchConfig, NonCodeProject, HostPlatform, Plat, PlatPair.TargetConfig)); } } } } } if (!bNoAutomatedTesting) { if (HostPlatform == UnrealTargetPlatform.Mac || HostPlatform == UnrealTargetPlatform.Linux) continue; //temp hack till Linux and Mac automated testing works var ThisMonoGameTestNodes = new List<string>(); foreach (var Test in GameTests) { var TestName = Test.Key + "_" + Plat.ToString(); string CookedAgentSharingGroup = GamePlatformMonolithicsNode.IsSample(BranchConfig, NonCodeProject)? CookedSampleAgentSharingGroup : CookedSharedAgentSharingGroup; ThisMonoGameTestNodes.Add(BranchConfig.AddNode(new UATTestNode(BranchConfig, HostPlatform, NonCodeProject, TestName, Test.Value, CookedAgentSharingGroup, false, RequiredPlatforms))); } if (ThisMonoGameTestNodes.Count > 0) { GameTestNodes.Add(BranchConfig.AddNode(new GameAggregateNode(HostPlatform, NonCodeProject, "CookedTests_" + Plat.ToString() + "_" + Kind.ToString() + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform), ThisMonoGameTestNodes))); } } } } } } } } #if false //for now, non-code projects don't do client or server. foreach (var ServerPlatform in ServerPlatforms) { var ServerTarget = Branch.BaseEngineProject.Properties.Targets[TargetRules.TargetType.Server]; foreach (var GamePlatform in GamePlatforms) { var Target = Branch.BaseEngineProject.Properties.Targets[TargetRules.TargetType.Game]; foreach (var NonCodeProject in Branch.NonCodeProjects) { if (!NonCodeProjectNames.ContainsKey(NonCodeProject.GameName) || !NonCodeProjectNames.ContainsKey(NonCodeProject.GameName) || !NonCodeProjectNames[NonCodeProject.GameName].Contains(ServerPlatform) || !NonCodeProjectNames[NonCodeProject.GameName].Contains(GamePlatform) ) { continue; } var ClientServerTests = Target.Rules.GUBP_GetClientServerTests_MonolithicOnly(HostPlatform, GetAltHostPlatform(HostPlatform), ServerPlatform, GamePlatform); var RequiredPlatforms = new List<UnrealTargetPlatform> { ServerPlatform }; if (ServerPlatform != GamePlatform) { RequiredPlatforms.Add(GamePlatform); } foreach (var Test in ClientServerTests) { GameTestNodes.Add(AddNode(new UATTestNode(this, HostPlatform, NonCodeProject, Test.Key + "_" + GamePlatform.ToString() + "_" + ServerPlatform.ToString(), Test.Value, false, RequiredPlatforms, true))); } } } } #endif if (GameTestNodes.Count > 0) { BranchConfig.AddNode(new GameAggregateNode(HostPlatform, Branch.BaseEngineProject, "AllCookedTests", GameTestNodes)); } } if(HostPlatform == MakeFeaturePacksNode.GetDefaultBuildPlatform(HostPlatforms) && !BranchOptions.bNoInstalledEngine) { BranchConfig.AddNode(new MakeFeaturePacksNode(HostPlatform, Branch.AllProjects.Where(x => MakeFeaturePacksNode.IsFeaturePack(x)))); } foreach (var CodeProj in Branch.CodeProjects) { var Options = CodeProj.Options(HostPlatform); if (!Options.bIsPromotable && !Options.bTestWithShared && !Options.bIsNonCode && !Options.bBuildAnyway) { continue; // we skip things that aren't promotable and aren't tested - except noncode as code situations } var AgentShareName = CodeProj.GameName; if (!Options.bSeparateGamePromotion) { if(GamePlatformMonolithicsNode.IsSample(BranchConfig, CodeProj)) { AgentShareName = "Sample"; } else { AgentShareName = "Shared"; } } if (!BranchOptions.ExcludePlatformsForEditor.Contains(HostPlatform) && !Options.bIsNonCode) { EditorGameNode Node = (EditorGameNode)BranchConfig.TryFindNode(EditorGameNode.StaticGetFullName(HostPlatform, CodeProj)); if(Node == null) { BranchConfig.AddNode(new EditorGameNode(BranchConfig, HostPlatform, CodeProj)); } else { Node.AddProject(CodeProj); } } if (!bNoAutomatedTesting && HostPlatform == UnrealTargetPlatform.Win64) //temp hack till automated testing works on other platforms than Win64 { if (CodeProj.Properties.Targets.ContainsKey(TargetRules.TargetType.Editor)) { var EditorTests = CodeProj.Properties.Targets[TargetRules.TargetType.Editor].Rules.GUBP_GetEditorTests_EditorTypeOnly(HostPlatform); var EditorTestNodes = new List<string>(); string AgentSharingGroup = ""; if (EditorTests.Count > 1) { AgentSharingGroup = AgentShareName + "_EditorTests" + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform); } foreach (var Test in EditorTests) { EditorTestNodes.Add(BranchConfig.AddNode(new UATTestNode(BranchConfig, HostPlatform, CodeProj, Test.Key, Test.Value, AgentSharingGroup))); if (!Options.bTestWithShared || !BranchConfig.HasNode(WaitForTestShared.StaticGetFullName())) { BranchConfig.RemovePseudodependencyFromNode((UATTestNode.StaticGetFullName(HostPlatform, CodeProj, Test.Key)), WaitForTestShared.StaticGetFullName()); } } if (EditorTestNodes.Count > 0) { BranchConfig.AddNode(new GameAggregateNode(HostPlatform, CodeProj, "AllEditorTests", EditorTestNodes)); } } } var CookedAgentSharingGroup = AgentShareName + "_CookedTests" + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform); //var FormalAgentSharingGroup = "Shared_FormalBuilds" + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform); var ServerPlatforms = new List<UnrealTargetPlatform>(); var GamePlatforms = new List<UnrealTargetPlatform>(); var GameTestNodes = new List<string>(); foreach (var Kind in BranchInfo.MonolithicKinds) { if (CodeProj.Properties.Targets.ContainsKey(Kind)) { var Target = CodeProj.Properties.Targets[Kind]; var Platforms = Target.Rules.GUBP_GetPlatforms_MonolithicOnly(HostPlatform); var AdditionalPlatforms = Target.Rules.GUBP_GetBuildOnlyPlatforms_MonolithicOnly(HostPlatform); var AllPlatforms = Platforms.Union(AdditionalPlatforms); foreach (var Plat in AllPlatforms) { if (!Platform.Platforms[HostPlatform].CanHostPlatform(Plat)) { throw new AutomationException("Project {0} asked for platform {1} with host {2}, but the host platform cannot build that platform.", CodeProj.GameName, Plat.ToString(), HostPlatform.ToString()); } if (bNoIOSOnPC && Plat == UnrealTargetPlatform.IOS && HostPlatform == UnrealTargetPlatform.Win64) { continue; } if(Plat == UnrealTargetPlatform.Win32 && Target.Rules.GUBP_BuildWindowsXPMonolithics()) { if(!BranchConfig.HasNode(GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, CodeProj, Plat, true))) { BranchConfig.AddNode(new GamePlatformMonolithicsNode(BranchConfig, HostPlatform, ActivePlatforms, CodeProj, Plat, true)); } } if (ActivePlatforms.Contains(Plat)) { if (Kind == TargetRules.TargetType.Server && !ServerPlatforms.Contains(Plat)) { ServerPlatforms.Add(Plat); } if (Kind == TargetRules.TargetType.Game && !GamePlatforms.Contains(Plat)) { GamePlatforms.Add(Plat); } if (!BranchConfig.HasNode(GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, CodeProj, Plat))) { if(GamePlatformMonolithicsNode.HasPrecompiledTargets(CodeProj, HostPlatform, Plat)) { BranchConfig.AddNode(new GamePlatformMonolithicsNode(BranchConfig, HostPlatform, ActivePlatforms, CodeProj, Plat, InPrecompiled: true)); } BranchConfig.AddNode(new GamePlatformMonolithicsNode(BranchConfig, HostPlatform, ActivePlatforms, CodeProj, Plat)); } var FormalBuildConfigs = Target.Rules.GUBP_GetConfigsForFormalBuilds_MonolithicOnly(HostPlatform); if (!AdditionalPlatforms.Contains(Plat) && (BranchOptions.ProjectsToCook.Contains(CodeProj.GameName) || BranchOptions.ProjectsToCook.Count == 0)) { string CookedPlatform = Platform.Platforms[Plat].GetCookPlatform(Kind == TargetRules.TargetType.Server, Kind == TargetRules.TargetType.Client, ""); if (Target.Rules.GUBP_AlternateCookPlatform(HostPlatform, CookedPlatform) != "") { CookedPlatform = Target.Rules.GUBP_AlternateCookPlatform(HostPlatform, CookedPlatform); } if (!BranchConfig.HasNode(CookNode.StaticGetFullName(HostPlatform, CodeProj, CookedPlatform))) { BranchConfig.AddNode(new CookNode(BranchConfig, HostPlatform, CodeProj, Plat, CookedPlatform)); } if (!BranchConfig.HasNode(GamePlatformCookedAndCompiledNode.StaticGetFullName(HostPlatform, CodeProj, Plat))) { BranchConfig.AddNode(new GamePlatformCookedAndCompiledNode(BranchConfig, HostPlatform, CodeProj, Plat, true)); } foreach (var Config in FormalBuildConfigs) { string FormalNodeName = null; if (Kind == TargetRules.TargetType.Client) { if (Plat == Config.TargetPlatform) { FormalNodeName = BranchConfig.AddNode(new FormalBuildNode(BranchConfig, CodeProj, HostPlatform, InClientTargetPlatforms: new List<UnrealTargetPlatform>() { Config.TargetPlatform }, InClientConfigs: new List<UnrealTargetConfiguration>() { Config.TargetConfig }, InClientNotGame: true)); } } else if (Kind == TargetRules.TargetType.Server) { if (Plat == Config.TargetPlatform) { FormalNodeName = BranchConfig.AddNode(new FormalBuildNode(BranchConfig, CodeProj, HostPlatform, InServerTargetPlatforms: new List<UnrealTargetPlatform>() { Config.TargetPlatform }, InServerConfigs: new List<UnrealTargetConfiguration>() { Config.TargetConfig })); } } else if (Kind == TargetRules.TargetType.Game) { if (Plat == Config.TargetPlatform) { FormalNodeName = BranchConfig.AddNode(new FormalBuildNode(BranchConfig, CodeProj, HostPlatform, InClientTargetPlatforms: new List<UnrealTargetPlatform>() { Config.TargetPlatform }, InClientConfigs: new List<UnrealTargetConfiguration>() { Config.TargetConfig })); } } if (FormalNodeName != null) { // we don't want this delayed // this would normally wait for the testing phase, we just want to build it right away BranchConfig.RemovePseudodependencyFromNode( CookNode.StaticGetFullName(HostPlatform, CodeProj, CookedPlatform), WaitForTestShared.StaticGetFullName()); string BuildAgentSharingGroup = ""; if (Options.bSeparateGamePromotion) { BuildAgentSharingGroup = CodeProj.GameName + "_MakeFormalBuild_" + Plat.ToString() + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform); if (Plat == UnrealTargetPlatform.IOS || Plat == UnrealTargetPlatform.Android || Plat == UnrealTargetPlatform.XboxOne) // These trash build products, so we need to use different agents { BuildAgentSharingGroup = ""; } BranchConfig.FindNode(CookNode.StaticGetFullName(HostPlatform, CodeProj, CookedPlatform)).AgentSharingGroup = BuildAgentSharingGroup; BranchConfig.FindNode(FormalNodeName).AgentSharingGroup = BuildAgentSharingGroup; } else { //GUBPNodes[FormalNodeName].AgentSharingGroup = FormalAgentSharingGroup; if (Plat == UnrealTargetPlatform.XboxOne) { BranchConfig.FindNode(FormalNodeName).AgentSharingGroup = ""; } } if (Config.bTest) { BranchConfig.AddNode(new FormalBuildTestNode(BranchConfig, CodeProj, HostPlatform, Plat, Config.TargetConfig)); } } } if (!bNoAutomatedTesting && FormalBuildConfigs.Count > 0) { if (HostPlatform == UnrealTargetPlatform.Mac || HostPlatform == UnrealTargetPlatform.Linux) continue; //temp hack till Linux and Mac automated testing works var GameTests = Target.Rules.GUBP_GetGameTests_MonolithicOnly(HostPlatform, GetAltHostPlatform(HostPlatform), Plat); var RequiredPlatforms = new List<UnrealTargetPlatform> { Plat }; var ThisMonoGameTestNodes = new List<string>(); foreach (var Test in GameTests) { var TestNodeName = Test.Key + "_" + Plat.ToString(); ThisMonoGameTestNodes.Add(BranchConfig.AddNode(new UATTestNode(BranchConfig, HostPlatform, CodeProj, TestNodeName, Test.Value, CookedAgentSharingGroup, false, RequiredPlatforms))); if (!Options.bTestWithShared || !BranchConfig.HasNode(WaitForTestShared.StaticGetFullName())) { BranchConfig.RemovePseudodependencyFromNode((UATTestNode.StaticGetFullName(HostPlatform, CodeProj, TestNodeName)), WaitForTestShared.StaticGetFullName()); } } if (ThisMonoGameTestNodes.Count > 0) { GameTestNodes.Add(BranchConfig.AddNode(new GameAggregateNode(HostPlatform, CodeProj, "CookedTests_" + Plat.ToString() + "_" + Kind.ToString() + HostPlatformNode.StaticGetHostPlatformSuffix(HostPlatform), ThisMonoGameTestNodes))); } } } } } } } if (!bNoAutomatedTesting) { foreach (var ServerPlatform in ServerPlatforms) { foreach (var GamePlatform in GamePlatforms) { if (HostPlatform == UnrealTargetPlatform.Mac || HostPlatform == UnrealTargetPlatform.Linux) continue; //temp hack till Linux and Mac automated testing works var Target = CodeProj.Properties.Targets[TargetRules.TargetType.Game]; var ClientServerTests = Target.Rules.GUBP_GetClientServerTests_MonolithicOnly(HostPlatform, GetAltHostPlatform(HostPlatform), ServerPlatform, GamePlatform); var RequiredPlatforms = new List<UnrealTargetPlatform> { ServerPlatform }; if (ServerPlatform != GamePlatform) { RequiredPlatforms.Add(GamePlatform); } foreach (var Test in ClientServerTests) { var TestNodeName = Test.Key + "_" + GamePlatform.ToString() + "_" + ServerPlatform.ToString(); GameTestNodes.Add(BranchConfig.AddNode(new UATTestNode(BranchConfig, HostPlatform, CodeProj, TestNodeName, Test.Value, CookedAgentSharingGroup, false, RequiredPlatforms))); } } } if (GameTestNodes.Count > 0) { BranchConfig.AddNode(new GameAggregateNode(HostPlatform, CodeProj, "AllCookedTests", GameTestNodes)); } } } } BranchConfig.AddNode(new WaitForTestShared(this)); BranchConfig.AddNode(new WaitToPackageSamplesNode(BranchConfig.HostPlatforms)); AddCustomNodes(BranchConfig, HostPlatforms, ActivePlatforms); if (BranchConfig.HasNode(ToolsForCompileNode.StaticGetFullName(UnrealTargetPlatform.Win64))) { if (BranchConfig.HasNode(GamePlatformMonolithicsNode.StaticGetFullName(UnrealTargetPlatform.Mac, Branch.BaseEngineProject, UnrealTargetPlatform.IOS)) && BranchConfig.HasNode(ToolsNode.StaticGetFullName(UnrealTargetPlatform.Win64))) { //AddNode(new IOSOnPCTestNode(this)); - Disable IOSOnPCTest until a1011 crash is fixed } //AddNode(new VSExpressTestNode(this)); if (ActivePlatforms.Contains(UnrealTargetPlatform.Linux) && !BranchOptions.ExcludePlatformsForEditor.Contains(UnrealTargetPlatform.Linux)) { BranchConfig.AddNode(new RootEditorCrossCompileLinuxNode(BranchConfig, UnrealTargetPlatform.Win64)); } // Don't run clean on temp shared storage for preflight builds. They might have broken the clean, and it extends to storage beyond this job. if (!BranchConfig.JobInfo.IsPreflight) { BranchConfig.AddNode(new CleanSharedTempStorageNode(this, BranchConfig)); } } #if false // this doesn't work for lots of reasons...we can't figure out what the dependencies are until far later if (bPreflightBuild) { GeneralSuccessNode PreflightSuccessNode = new GeneralSuccessNode("Preflight"); foreach (var NodeToDo in GUBPNodes) { if (NodeToDo.Value.RunInEC()) { PreflightSuccessNode.AddPseudodependency(NodeToDo.Key); } } AddNode(PreflightSuccessNode); } #endif // Remove all the pseudo-dependencies on nodes specified in the branch options foreach(string NodeToRemovePseudoDependencies in BranchOptions.NodesToRemovePseudoDependencies) { GUBPNode Node = BranchConfig.TryFindNode(NodeToRemovePseudoDependencies); if(Node != null) { Node.FullNamesOfPseudodependencies.Clear(); } } // Add aggregate nodes for every project in the branch foreach (BranchInfo.BranchUProject GameProj in Branch.AllProjects) { List<string> NodeNames = new List<string>(); foreach(GUBP.GUBPNode Node in BranchConfig.GUBPNodes.Values) { if (Node.GameNameIfAnyForTempStorage() == GameProj.GameName) { NodeNames.Add(Node.GetFullName()); } } if (NodeNames.Count > 0) { BranchConfig.AddNode(new FullGameAggregateNode(GameProj.GameName, NodeNames)); } } // Calculate the frequency overrides Dictionary<string, int> FrequencyOverrides = ApplyFrequencyBarriers(BranchConfig.GUBPNodes, BranchConfig.GUBPAggregates, BranchOptions.FrequencyBarriers); // Get the legacy node to new node mapping Dictionary<GUBP.GUBPNode, BuildNode> LegacyToNewNodes = BranchConfig.GUBPNodes.Values.ToDictionary(x => x, x => x.GetBuildNode(this)); // Convert the GUBPNodes and GUBPAggregates maps into lists AllNodes = new List<BuildNode>(); AllNodes.AddRange(LegacyToNewNodes.Values); AllAggregates = new List<AggregateNode>(); AllAggregates.AddRange(BranchConfig.GUBPAggregates.Values.Select(x => new LegacyAggregateNode(x))); // Calculate the frequencies for each node FindFrequenciesForNodes(BranchConfig, LegacyToNewNodes, FrequencyOverrides); // Get the email list for each node FindEmailsForNodes(BranchName, AllNodes); }
public BitmapBuffer RenderOffscreen(IVideoProvider videoProvider, bool includeOSD) { var job = new JobInfo { videoProvider = videoProvider, simulate = false, chain_outsize = GraphicsControl.Size, offscreen = true, includeOSD = includeOSD }; UpdateSourceInternal(job); return job.offscreenBB; }
private HtmlTableRow CreateRow(JobInfo item) { HtmlTableRow row = new HtmlTableRow(); row.Cells.Add(CreateCell(item.NameKey, item.JobInfoID)); row.Cells.Add(CreateInputCell(item.JobInfoID.ToString(), item.DataValue)); JobInformation.Add(new JobData(item.JobInfoID, item.NameKey, item.DataValue, item.DataValue + "TextBox", item.JobID)); return row; }
FilterProgram UpdateSourceInternal(JobInfo job) { //no drawing actually happens. it's important not to begin drawing on a control if (!job.simulate) { GlobalWin.GLManager.Activate(CR_GraphicsControl); } IVideoProvider videoProvider = job.videoProvider; bool simulate = job.simulate; Size chain_outsize = job.chain_outsize; //simulate = true; int vw = videoProvider.BufferWidth; int vh = videoProvider.BufferHeight; if (Global.Config.DispFixAspectRatio) { if (Global.Config.DispManagerAR == Config.EDispManagerAR.System) { vw = videoProvider.VirtualWidth; vh = videoProvider.VirtualHeight; } if (Global.Config.DispManagerAR == Config.EDispManagerAR.Custom) { vw = Global.Config.DispCustomUserARWidth; vh = Global.Config.DispCustomUserARHeight; } if (Global.Config.DispManagerAR == Config.EDispManagerAR.CustomRatio) { FixRatio(Global.Config.DispCustomUserARX, Global.Config.DispCustomUserARY, videoProvider.BufferWidth, videoProvider.BufferHeight, out vw, out vh); } } var padding = CalculateCompleteContentPadding(true,false); vw += padding.Horizontal; vh += padding.Vertical; int[] videoBuffer = videoProvider.GetVideoBuffer(); int bufferWidth = videoProvider.BufferWidth; int bufferHeight = videoProvider.BufferHeight; bool isGlTextureId = videoBuffer.Length == 1; BitmapBuffer bb = null; Texture2d videoTexture = null; if (!simulate) { if (isGlTextureId) { //FYI: this is a million years from happening on n64, since it's all geriatric non-FBO code //is it workable for saturn? videoTexture = GL.WrapGLTexture2d(new IntPtr(videoBuffer[0]), bufferWidth, bufferHeight); } else { //wrap the videoprovider data in a BitmapBuffer (no point to refactoring that many IVideoProviders) bb = new BitmapBuffer(bufferWidth, bufferHeight, videoBuffer); bb.DiscardAlpha(); //now, acquire the data sent from the videoProvider into a texture videoTexture = VideoTextureFrugalizer.Get(bb); //lets not use this. lets define BizwareGL to make clamp by default (TBD: check opengl) //GL.SetTextureWrapMode(videoTexture, true); } } //record the size of what we received, since lua and stuff is gonna want to draw onto it currEmuWidth = bufferWidth; currEmuHeight = bufferHeight; //build the default filter chain and set it up with services filters will need Size chain_insize = new Size(bufferWidth, bufferHeight); var filterProgram = BuildDefaultChain(chain_insize, chain_outsize, job.includeOSD); filterProgram.GuiRenderer = Renderer; filterProgram.GL = GL; //setup the source image filter Filters.SourceImage fInput = filterProgram["input"] as Filters.SourceImage; fInput.Texture = videoTexture; //setup the final presentation filter Filters.FinalPresentation fPresent = filterProgram["presentation"] as Filters.FinalPresentation; fPresent.VirtualTextureSize = new Size(vw, vh); fPresent.TextureSize = new Size(bufferWidth, bufferHeight); fPresent.BackgroundColor = videoProvider.BackgroundColor; fPresent.GuiRenderer = Renderer; fPresent.Config_FixAspectRatio = Global.Config.DispFixAspectRatio; fPresent.Config_FixScaleInteger = Global.Config.DispFixScaleInteger; fPresent.Padding = ClientExtraPadding; fPresent.GL = GL; filterProgram.Compile("default", chain_insize, chain_outsize, !job.offscreen); if (simulate) { } else { CurrentFilterProgram = filterProgram; UpdateSourceDrawingWork(job); } //cleanup: if (bb != null) bb.Dispose(); return filterProgram; }
private void Receives() { Receive<AttemptJobStart>(attempt => { CommandRouter.Ask<Routees>(new GetRoutees()).ContinueWith(tr => { var route = new StartJobRoutes(tr.Result.Members.Count()); return route; }, TaskContinuationOptions.AttachedToParent & TaskContinuationOptions.ExecuteSynchronously).PipeTo(Self, Sender); }); Receive<StartJobRoutes>(ic => ic.NodeCount == 0, ic => { Sender.Tell(ic); }); Receive<StartJobRoutes>(ic => { Sender.Tell(ic); // TODO: Need to create a task to get the markts and to run them all. JobInfo job = new JobInfo("RunMe"); var startJob = new StartJob(new Job(job), Sender); CommandRouter.Tell(startJob); JobInfo job2 = new JobInfo("MyPetMonkey1"); var startJob2 = new StartJob(new Job(job2), Sender); CommandRouter.Tell(startJob2); JobInfo job3 = new JobInfo("AkkaNet"); var startJob3 = new StartJob(new Job(job3), Sender); CommandRouter.Tell(startJob3); }); Receive<AttemptSubscription>(attempt => { CommandRouter.Tell(new SubscribeToAllJobs(Sender), Self); CommandRouter.Ask<Routees>(new GetRoutees()).ContinueWith(tr => { var message = string.Empty; if (!tr.Result.Members.Any()) { message = "Could not find item tasker. Is the Tasker service running?"; } else { message = "Item tasker is running."; } return new SignalRItemStatusActor.ClusterRoutes(message); }, TaskContinuationOptions.AttachedToParent & TaskContinuationOptions.ExecuteSynchronously).PipeTo(Sender); Sender.Tell(new SubscribeToAllJobs(Sender), Self); }); Receive<AttemptUnSubscribe>(attempt => { CommandRouter.Tell(new UnSubscribeToAllJobs(Sender), Self); CommandRouter.Ask<Routees>(new GetRoutees()).ContinueWith(tr => { var grrr = new SignalRItemStatusActor.ClusterRoutes(string.Format("{0} has {1} routees: {2}", CommandRouter, tr.Result.Members.Count(), string.Join(",", tr.Result.Members.Select( y => y.ToString())))); return grrr; }, TaskContinuationOptions.AttachedToParent & TaskContinuationOptions.ExecuteSynchronously).PipeTo(Sender); Sender.Tell(new UnSubscribeToAllJobs(Sender), Self); }); }
public bool Remove(JobInfo jobInfo) { return(true); }
public Result Upgrade(JobInfo jobInfo) { return(Execute(() => SchedulerManager.Singleton.Upgrade(jobInfo))); }
protected void UpdateButton_Click(object sender, EventArgs e) { List<JobInfo> data = new List<JobInfo>(); JobInfo info; foreach (JobData item in JobInformation) { info = new JobInfo(); info.JobInfoID = item.ID; info.NameKey = item.key; info.DataValue = item.value; info.JobID = item.jobID; } try { Job job = Brentwood.GetJob(int.Parse(Session["JobID"].ToString())); job.SpecialInstructions = (ControlsPanel.FindControl("Special InstructionsTextBox") as TextBox).Text.Trim(); job.Quantity = int.Parse((ControlsPanel.FindControl("QuantityTextBox") as TextBox).Text.Trim()); job.DeliveryOrPickup = (ControlsPanel.FindControl("Delivery or PickupTextBox") as Label).Text.Trim(); Brentwood.UpdateJob(job); Brentwood.UpdateJobInfo(data); FormMessage.Text = "Job successfully updated."; FormMessage.ForeColor = Color.Blue; } catch (Exception ex) { FormMessage.Text = ex.Message; FormMessage.ForeColor = Color.Red; } }
public void Add(JobInfo jobInfo) { }
private HtmlTableRow CreateRow(object key, object value) { JobInfo item = new JobInfo(); if (value != null) item.DataValue = value.ToString(); else item.DataValue = "Not specified"; item.NameKey = key.ToString(); HtmlTableRow row = new HtmlTableRow(); HtmlTableCell cell = new HtmlTableCell(); Label label = new Label(); label.ID = item.NameKey + "Label"; label.Text = item.NameKey; cell.Controls.Add(label); row.Cells.Add(cell); cell = new HtmlTableCell(); TextBox textbox = new TextBox(); textbox.ID = key + "TextBox"; textbox.Text = item.DataValue; cell.Controls.Add(textbox); row.Cells.Add(cell); JobInformation.Add(new JobData(item.JobInfoID, item.NameKey, item.DataValue, item.DataValue + "TextBox", item.JobID)); return row; }
public List <JobInfo> GetJobInfoByRange(JobInfo jobInfo) { List <JobInfo> jobInfoList = jobGetway.GetJobInfoByRange(jobInfo); return(jobInfoList); }
public void SetJobInfo(JobInfo.FALotJobInfo lotJobInfo) { if (lotJobInfo.SmallBoxFormingJobInfo == null) { Manager.MessageWindowManager.Instance.Show("JobInfoLoadFail", FullName + " SmallBoxFormingJobInfo is null"); return; } lotJobInfo.SmallBoxFormingJobInfo.CopyTo(JobInfo); }
private void UpdateJobLead(Guid jobListingId, JobInfo jobInfo) { leadManager.UpdateJobLead(jobListingId, jobInfo); }