override public void createSlices() { base.createSlices(); this.Library = (L)BackEnd.createSlice(this, UID, "library", "library", new Type[] {}); this.Facet_setup = (E)BackEnd.createSlice(this, UID, "setup", "facet", new Type[] {}); this.Facet_matrix = (M)BackEnd.createSlice(this, UID, "matrix", "facet", new Type[] {}); }
public void RenderBackends(StringBuilder sb) { foreach (var b in BackEnd.OrderBy(b2 => b2.Name)) { RenderBackEnd(sb, b); } }
public string[] resolve(string contract) { AbstractComponentFunctorApplication acfa = build_contract(contract); string[] cs = BackEnd.resolveUnit(contract); return(cs); }
private void CloseMap() { if (Map == null) { return; } MapReloader.Enabled = false; IEnumerable <View> views = from view in Viewport.Views where view.Value.Control is View select view.Value.Control as View; Application.Instance.Invoke(() => StatusDisplay.Text = "Dropping map from backend..."); Map.InitializedInBackEnd = false; BackEnd.DeleteMap(Map, views); Settings.Updatables.Remove(Map); Map = null; Application.Instance.Invoke(() => { StatusDisplay.Text = ""; ProgressBar.Value = 0; }); }
/* * XML é visto como um array de bytes, chamado data. * esse array é salvo em "path" e lido por AppLoader gerando um objeto Component Type, * passado ao DGAC */ public string deployHashComponent(byte[] data, string userName, string password, string curDir, bool flag_compile) { try { string filename = Path.GetTempFileName(); File.WriteAllBytes(filename, data); if (data != null) { ComponentType c = LoaderApp.DeserializeObject(filename); int res; if (c.header.baseType != null && c.header.baseType.extensionType.ItemElementName == ItemChoiceType.implements) { res = BackEnd.registerConcreteComponentTransaction(c, userName, password, curDir, flag_compile); } else { res = BackEnd.registerAbstractComponentTransaction(c, userName, password, curDir, flag_compile); } if (res >= 0) { string component_reference = c.header.packagePath + "." + c.header.name; File.Copy(filename, Constants.PATH_TEMP_WORKER + component_reference + ".hpe", true); } } } catch (Exception e) { Console.Error.WriteLine(e.Message); return("-- Message -- \n " + e.Message + "\n\n -- Stack Trace --\n" + e.StackTrace + "\n\n -- Inner Exception -- \n" + e.InnerException); } return(null); }
protected override void OnStop() { Trace.Write("OnStop called..."); BackEnd.stopWorkers(session_id); stopManagerServer(); Console.WriteLine("OK !"); }
public string deploy(string config_contents) { int res = -1; try { string filename = Path.GetTempFileName(); File.WriteAllText(filename, config_contents); ComponentType c = LoaderApp.DeserializeObject(filename); if (c.header.baseType != null && c.header.baseType.extensionType.ItemElementName == ItemChoiceType.implements) { res = BackEnd.registerConcreteComponentTransaction(c, null, null, ""); } else { res = BackEnd.registerAbstractComponentTransaction(c, null, null, ""); } if (res >= 0) { string component_reference = c.header.packagePath + "." + c.header.name; File.Copy(filename, Constants.PATH_TEMP_WORKER + component_reference + ".hpe", true); } } catch (Exception e) { Console.Error.WriteLine(e.Message); return("-- Message -- \n " + e.Message + "\n\n -- Stack Trace --\n" + e.StackTrace + "\n\n -- Inner Exception -- \n" + e.InnerException); } return("deployed " + res); }
public void createApplicationInstance (string session_id_string, // Identification of the session of the application workflow. string instance_name, // Name of the component instance in the application. string instantiator_string) // Description of the component and its placement. { BackEnd.createSystemComponentInstance(instance_name, instantiator_string, session_id_string); }
// in: AssemblyNames[], projectPath public static void Main(string[] args) { var assemblyName = "CostEffectiveCode.WebApi2.Example2"; // args[0] var backEnd = new BackEnd(new[] { assemblyName }); var appConfig = backEnd.Configure("WebApi2.Example2"); }
override public void createSlices() { base.createSlices(); this.Element_type = (NUM)BackEnd.createSlice(this, UID, "numeric_type", "element_type", new Type[] {}); this.Matrix_property = (MPT)BackEnd.createSlice(this, UID, "matrix_property", "matrix_property", new Type[] { typeof(LIB) }); this.Lssdomain = (ILSSDomainHYPRE <LIB, COM>)BackEnd.createSlice(this, UID, "domain", "lssdomain", null); }
override public void createSlices() { base.createSlices(); this.Element_type = (NUM)BackEnd.createSlice(this, UID, "element_type", "element_type", new Type[] {}); this.Library = (LIB)BackEnd.createSlice(this, UID, "library", "library", new Type[] {}); this.Lssdomain = (ILSSDomainHYPRE <LIB, COM>)BackEnd.createSlice(this, UID, "domain", "lssdomain", null); }
override public void createSlices() { base.createSlices(); this.Function = (F)BackEnd.createSlice(this, UID, "function", "function", new Type[] {}); this.Xsup = (IDouble)BackEnd.createSlice(this, UID, "b", "double", new Type[] {}); this.Xinf = (IDouble)BackEnd.createSlice(this, UID, "a", "double", new Type[] {}); }
protected void Page_Load(object sender, EventArgs e) { String s = Request.QueryString["ID"]; if (s == null) { s = "2014-45-0001"; //just for debugging. remember to delete.. } //return; literalCaseId.Text = s; literalCaseId.DataBind(); BackEnd backEnd = new BackEnd(); Case requestedCase = backEnd.GetCaseByID(s); if (requestedCase == null) { //abort } List <Case> caseList = new List <Case>(); caseList.Add(requestedCase); formViewSpecificCrime.DataSource = caseList; formViewSpecificCrime.DataBind(); }
public override void Refresh() { var s = (VeldridSurface)Content; BackEnd.CommandList = BackEnd.Factory.CreateCommandList(); BackEnd.CommandList.Begin(); BackEnd.CommandList.SetFramebuffer(s.Swapchain.Framebuffer); BackEnd.CommandList.ClearColorTarget(0, ClearColor); BackEnd.CommandList.ClearDepthStencil(1.0f); if (Map != null && Map.InitializedInBackEnd) { Camera.AspectRatio = (float)Width / (float)Height; BackEnd.DrawMap(Map, this, Camera); } BackEnd.CommandList.End(); s.GraphicsDevice.SubmitCommands(BackEnd.CommandList); s.GraphicsDevice.SwapBuffers(s.Swapchain); BackEnd.CommandList.Dispose(); }
protected override void OnStart(string[] args) { Trace.Write("OnStart called..."); startManagerServer(); BackEnd.startWorkers(session_id, null, null, System.Environment.CurrentDirectory); Console.WriteLine("OK !"); }
private static async Task DemoRunAsync(IMediator mediator) { ChatRoom SSWGroup = new ChatRoom(); FrontEnd Nancy = new FrontEnd("Nancy"); FrontEnd Andrew = new FrontEnd("Andrew"); BackEnd Janet = new BackEnd("Janet"); BackEnd Michael = new BackEnd("Michael"); await mediator.Send(new ChatRoomRegister(SSWGroup, Nancy)); await mediator.Send(new ChatRoomRegister(SSWGroup, Andrew)); await mediator.Send(new ChatRoomRegister(SSWGroup, Janet)); await mediator.Send(new ChatRoomRegister(SSWGroup, Michael)); await mediator.Send(new SendMessage(SSWGroup, "Nancy", "Andrew", "You Idiot")); await mediator.Send(new SendMessage(SSWGroup, "Andrew", "Janet", "message 1")); await mediator.Send(new SendMessage(SSWGroup, "Janet", "Michael", "message 2")); await mediator.Send(new SendMessage(SSWGroup, "Michael", "Nancy", "message 3")); }
protected void Page_Load(object sender, EventArgs e) { //Request the ID String s = Request.QueryString["ID"]; //Defend against null strings. Makes sense in a debug //environment. if (s == null) { s = "2014-45-0001"; } //Set the case ID on top of page literalCaseId.Text = s; literalCaseId.DataBind(); //Get the Case object from the ID BackEnd backEnd = new BackEnd(); Case requestedCase = backEnd.GetCaseByID(s); if (requestedCase == null) { //TODO: throw meaningful error message. } //Collect the case in a list bind it as data source List <Case> caseList = new List <Case>(); caseList.Add(requestedCase); formViewSpecificCrime.DataSource = caseList; formViewSpecificCrime.DataBind(); //Get the empoyee list and bind dropDownEmployees.DataSource = backEnd.GetEmployeeList(); dropDownEmployees.DataBind(); dropDownEmployees.Items.Insert(0, new ListItem("Välj alla", "0")); }
public EM_StatisticsBackEndResponder(BackEnd _backEnd, Template _template, List <FilePackageContent> _filePackages, List <Template.TemplateInfo.UserVariable> _userInput = null, string responderKey = null) : base(responderKey) { backEnd = _backEnd; template = _template; filePackages = _filePackages; userInput = _userInput; if (userInput != null) { template.info.TakeUserInput(userInput); } PrepareAndStartCalculatingResults(); // Do NOT add the responses until you are ready to respond! These should be at the end of the constructor... ;) if (!responses.ContainsKey(LOAD_STATISTICS_HTML)) { responses.Add(LOAD_STATISTICS_HTML, BuildResponse_LoadStatisticsHtml); } if (!responses.ContainsKey(LOAD_STATISTICS)) { responses.Add(LOAD_STATISTICS, BuildResponse_LoadStatistics); } if (!responses.ContainsKey(SAVE_AS_EXCEL)) { responses.Add(SAVE_AS_EXCEL, BuildResponse_SaveAsExcel); } }
override public void createSlices() { base.createSlices(); this.Manager = (IManager <IIntegralCase <F>, IDistributeIntervalSend <F, IIntegralCase <F> >, IDouble, ISum <IDouble> >)BackEnd.createSlice(this, UID, "farm", "manager", new Type[] { typeof(IIntegralCase <F>), typeof(IDistributeIntervalSend <F, IIntegralCase <F> >), typeof(IDouble), typeof(ISum <IDouble>) }); this.Mpi = (IMPIDirect)BackEnd.createSlice(this, UID, "mpi", "mpi", new Type[] {}); this.Input_data = (IIntegralCase <F>)BackEnd.createSlice(this, UID, "input", "integral_case", new Type[] { typeof(F) }); this.Output_data = (IDouble)BackEnd.createSlice(this, UID, "output", "double", new Type[] {}); }
public ActionResult Create([Bind(Include = "ImgLogo,NmEmpresa,AddrEndereco,TelTelefone,BoolGostei,VlrMinPreco,VlrMaxPreco,TxtSobre,TxtCortesia,TxtLocalizacao,IdLocalizacao")] Empresa empresa) { if (ModelState.IsValid) { return(Json(BackEnd.PostEmpresa(empresa), JsonRequestBehavior.AllowGet)); } return(Json("{Error:Houve um erro}", JsonRequestBehavior.AllowGet)); }
public void run(string component_ref) { status += platform_ref + ": * GO!!! BEGIN " + component_ref + "\n"; BackEnd.runSolutionComponent(session.Services, component_ref); status += platform_ref + ": * GO!!! STARTED " + component_ref + "\n"; }
override public void createSlices() { base.createSlices(); this.Receive = (S)BackEnd.createSlice(this, UID, "scatter", "receive", new Type[] { typeof(J) }); this.Send = (G)BackEnd.createSlice(this, UID, "gather", "send", new Type[] { typeof(R) }); this.Work = (W)BackEnd.createSlice(this, UID, "work", "work", new Type[] { typeof(J), typeof(R) }); this.Job = (J)BackEnd.createSlice(this, UID, "job", "data", new Type[] {}); this.Result = (R)BackEnd.createSlice(this, UID, "result", "data", new Type[] {}); }
public void closeSession(string session_id) { BackEnd.finishSession(session_id); foreach (string sid in BackEnd.getSessions()) { Console.WriteLine(sid); } }
public ActionResult ChangeCompanyEdit(Empresa empresa) { if (ModelState.IsValid) { var p = BackEnd.PutEmpresa(empresa); return(Json(new object[] { "sucesso:", "alteração salva.", p }, JsonRequestBehavior.AllowGet)); } return(View()); }
public ActionResult ChangeTimeEdit(Periodo periodo) { if (ModelState.IsValid) { var p = BackEnd.PutTime(periodo); return(Json(new object[] { "sucesso:", "alteração salva.", p }, JsonRequestBehavior.AllowGet)); } return(View()); }
static void Main(string [] args) { IPeerImpl <ITestingFunction> peers = new IPeerImpl <ITestingFunction>(); BackEnd.DGACInit("00240000048000009400000006020000002400005253413100040000110000006d05c82bff26ad72150a252c8c9742c86f6c62e6fe0cb696e223e19c0441a20a249526c60ee5553b2eddc609f73c569a23cfd334b51d25d1bd36d608dc901932e635a71bce017f93a1aabc8a129f65b9a7d3d384b42ae038d9d1006b984abdf11cc686520195bdac3acc399a24871f11885f37168f0ac04580fbce53d438e394", "peers", peers, args); peers.createSlices(); peers.compute(); BackEnd.DGACFinalize(); }
public static void SaveTemporary(IPersistentObject obj) { using (var stream = new FileStream(GetTempLocation().FullName, FileMode.Create)) using (var writer = new BinaryWriter(stream)) { writer.Write(KTempVersion); writer.Write((byte)SaveType.Temporary); BackEnd.Persist(stream, obj.EnumeratePersistedObjects()); } }
public ActionResult MakeLocalizacao([Bind(Exclude = "IdLocalizacao")] Localizacao localizacao) { if (ModelState.IsValid) { BackEnd.PostLocalizacao(localizacao); // return Json(BackEnd.PostTime(periodo), JsonRequestBehavior.AllowGet); return(View()); } return(Json("{Error:Houve um erro}", JsonRequestBehavior.AllowGet)); }
override public void createSlices() { base.createSlices(); this.M = (M)BackEnd.createSlice(this, UID, "matrix", "facet_unit", new Type[] {}); this.Comm = (ICommunicator)BackEnd.createSlice(this, UID, "comm", "comm", new Type[] {}); this.R = (R)BackEnd.createSlice(this, UID, "solver", "facet_unit", new Type[] {}); this.S = (S)BackEnd.createSlice(this, UID, "setup", "facet_unit", new Type[] {}); this.P = (P)BackEnd.createSlice(this, UID, "pre_conditioner", "facet_unit", new Type[] {}); this.V = (V)BackEnd.createSlice(this, UID, "vector", "facet_unit", new Type[] {}); }
public ActionResult MakeBox([Bind(Exclude = "IdBox")] Box box) { if (ModelState.IsValid) { BackEnd.PostBox(box); return(View()); // return RedirectToAction("MakeTime"); // return Json(BackEnd.PostBox(box), JsonRequestBehavior.AllowGet); } return(Json("{Error:Houve um erro}", JsonRequestBehavior.AllowGet)); }
public override void OnCameraLocationChanged(BackEnd.CameraLocation newCameraLocation) { // Note, this call is called on some IPC thread - dispatch to the UI thread before doing anything else this.Page.Dispatcher.BeginInvoke(() => { base.OnCameraLocationChanged(newCameraLocation); if (newCameraLocation == BackEnd.CameraLocation.Front) { this.CameraToggleButtonText = CallStatusViewModel.CameraToggleBack; this.LittleHeadPreviewUri = frontFacingCameraStreamUri; CameraRotation = -90; } else if (newCameraLocation == BackEnd.CameraLocation.Back) { // we only have two supported camera locations this.CameraToggleButtonText = CallStatusViewModel.CameraToggleFront; this.LittleHeadPreviewUri = rearFacingCameraStreamUri; CameraRotation = 90; } this.IsCameraToggleButtonEnabled = true; this.IsHangUpButtonEnabled = true; this.IsHoldButtonEnabled = true; }); }
/// <summary> /// The camera location value has changed /// </summary> /// <summary> /// The audio route or the available audio devices has changed /// </summary> /// <param name="newRoute"></param> public override void OnCallAudioRouteChanged(BackEnd.CallAudioRoute newRoute) { // Note, this call is called on some IPC thread - dispatch to the UI thread before doing anything else this.Page.Dispatcher.BeginInvoke(() => { // Call the base class method first base.OnCallAudioRouteChanged(newRoute); // Now, update the states of the various audio route buttons this.UpdateAudioRouteButtonStates(newRoute); }); }
/// <summary> /// Update the state of the various audio route buttons /// </summary> private void UpdateAudioRouteButtonStates(BackEnd.CallAudioRoute audioRoute) { if (base.CallStatus == BackEnd.CallStatus.InProgress) { // There is a call in progress - update the audio routing button states // First, get the available audio devices BackEnd.CallAudioRoute availableDevices = BackgroundProcessController.Instance.CallController.AvailableAudioRoutes; // Enable/disable buttons based on availability this.IsEarpieceButtonEnabled = ((availableDevices & BackEnd.CallAudioRoute.Earpiece) != BackEnd.CallAudioRoute.None); this.IsSpeakerButtonEnabled = ((availableDevices & BackEnd.CallAudioRoute.Speakerphone) != BackEnd.CallAudioRoute.None); this.IsBluetoothButtonEnabled = ((availableDevices & BackEnd.CallAudioRoute.Bluetooth) != BackEnd.CallAudioRoute.None); // Set the border color of the currently selected audio route button Brush accentBrush = (Brush)App.Current.Resources["PhoneAccentBrush"]; Brush borderBrush = (Brush)App.Current.Resources["PhoneForegroundBrush"]; this.EarpieceButtonBorder = (audioRoute == BackEnd.CallAudioRoute.Earpiece) ? accentBrush : borderBrush; this.SpeakerButtonBorder = (audioRoute == BackEnd.CallAudioRoute.Speakerphone) ? accentBrush : borderBrush; this.BluetoothButtonBorder = (audioRoute == BackEnd.CallAudioRoute.Bluetooth) ? accentBrush : borderBrush; } else { // There is no call in progress - disable audio routing buttons this.DisableAllAudioRouteButtons(); } }
/// <summary> /// Change the audio route for this call /// </summary> public void SetAudioRoute(BackEnd.CallAudioRoute newRoute) { // We must have a call at this point Debug.Assert(base.CallStatus != BackEnd.CallStatus.None); // Change the audio route, if it has changed if (newRoute != BackgroundProcessController.Instance.CallController.AudioRoute) { BackgroundProcessController.Instance.CallController.AudioRoute = newRoute; // Disable all audio route buttons, so the user doesn't press them again and again. // The buttons will get re-enabled if required when the audio route changes. this.DisableAllAudioRouteButtons(); } }
public override void OnMediaOperationsChanged(BackEnd.MediaOperations newOperations) { // Note, this call is called on some IPC thread - dispatch to the UI thread before doing anything else this.Page.Dispatcher.BeginInvoke(() => { // Call the base class method first base.OnMediaOperationsChanged(newOperations); // Now, update the states of the various media elements // Are we rendering video? if ((newOperations & BackEnd.MediaOperations.VideoRender) != BackEnd.MediaOperations.None) { // Yes, we are rendering video Debug.WriteLine("[CallStatusViewModel.OnMediaOperationsChanged] => Showing BigHead"); this.BigHeadPreviewUri = CallStatusViewModel.renderStreamUri; this.BigHeadVisibility = Visibility.Visible; } else { // No, we are not rendering video Debug.WriteLine("[CallStatusViewModel.OnMediaOperationsChanged] => Hiding BigHead"); this.BigHeadPreviewUri = null; this.BigHeadVisibility = Visibility.Collapsed; } // Are we capturing video? if ((newOperations & BackEnd.MediaOperations.VideoCapture) != BackEnd.MediaOperations.None) { // Yes, we are capturing video Debug.WriteLine("[CallStatusViewModel.OnMediaOperationsChanged] => Showing LittleHead"); if (base.CameraLocation == BackEnd.CameraLocation.Front) { this.LittleHeadPreviewUri = CallStatusViewModel.frontFacingCameraStreamUri; } else { this.LittleHeadPreviewUri = CallStatusViewModel.rearFacingCameraStreamUri; } this.LittleHeadVisibility = Visibility.Visible; this.IsCameraToggleButtonEnabled = true; } else { // No, we are not capturing video Debug.WriteLine("[CallStatusViewModel.OnMediaOperationsChanged] => Hiding LittleHead"); this.LittleHeadPreviewUri = null; this.LittleHeadVisibility = Visibility.Collapsed; this.IsCameraToggleButtonEnabled = false; } }); }