private void InitializePhysics() { _geometryParts.AttachCollisionModel(transform, true); _rigidBody = gameObject.GetComponent <Rigidbody>(); HandlingData = Handling.Get <Handling.Car>(Definition.HandlingName); VConsts.Changed += UpdateValues; var vals = VConsts.Instance; foreach (var wheel in _wheels) { var front = (wheel.Alignment & WheelAlignment.Front) == WheelAlignment.Front; wheel.Parent.position -= Vector3.up * HandlingData.SuspensionLowerLimit; var scale = front ? Definition.WheelScaleFront : Definition.WheelScaleRear; var mf = wheel.Child.GetComponent <MeshFilter>(); if (mf != null) { var size = mf.sharedMesh.bounds.size.y; wheel.Child.localScale = Vector3.one * scale / size; } wheel.Collider = wheel.Parent.gameObject.AddComponent <WheelCollider>(); wheel.Collider.radius = scale * .5f; wheel.Collider.suspensionDistance = HandlingData.SuspensionUpperLimit - HandlingData.SuspensionLowerLimit; } UpdateValues(vals); }
async void Handle_ItemTapped(object sender, ItemTappedEventArgs e) { if (e.Item == null) { return; } await PopupNavigation.Instance.PushAsync(new LoadingScreen(), true); // Show loading screen Handling handling = ((Handling)((ListView)sender).SelectedItem); try { Process p = await new ProcessKeeper().GetProcess(handling.ProcessId); if (PopupNavigation.Instance.PopupStack.Any()) { await PopupNavigation.Instance.PopAllAsync(true); } // Hide loading screen await Navigation.PushAsync(new ProcessPage(handling.PlaceId, p)); } catch (Exception ex) { if (PopupNavigation.Instance.PopupStack.Any()) { await PopupNavigation.Instance.PopAllAsync(true); } // Hide loading screen await DisplayAlert(RuntimeSettings.ConnectionErrorTitle, RuntimeSettings.ConnectionErrorText, "OK"); } ((ListView)sender).SelectedItem = null; }
public async Task <ActionResult <HandlingViewModel> > Create(string containerNumber, CreateHandlingViewModel model) { Container container = await _containerContext.Containers .AsNoTracking() .Select(_container => new Container { Id = _container.Id, Number = _container.Number }) .FirstOrDefaultAsync(_container => _container.Number == containerNumber); if (container is null) { return(NotFound()); } Handling handling = _mapper.Map <Handling>(model); handling.ContainerId = container.Id; _ = await _containerContext.Handlings.AddAsync(handling); _ = await _containerContext.SaveChangesAsync(); HandlingViewModel viewModel = _mapper.Map <HandlingViewModel>(handling); return(CreatedAtAction(nameof(GetById), new { containerId = container.Id, handlingId = handling.Id }, viewModel)); }
public bool EditHandling(HandlingBl handling) { try { Handling handling1 = new Handling { Id = handling.Id, IdClient = handling.IdClient, InCheck = handling.InCheck, OutCheck = handling.OutCheck, IdRoom = handling.IdRoom, //IdService = handling.IdService, //IdService2 = handling.IdService2, //IdService3 = handling.IdService3, IdService = null, IdService2 = null, IdService3 = null, IdBooking = null, IdEmployee = handling.IdEmployee, }; _context.Handling.Update(handling1); _context.SaveChanges(); return(true); } catch (Exception) { throw; } }
/// <summary> /// Waits for a message on the preconfigured queue. /// Blocks until a message in received or the connection is closed. /// </summary> /// <returns>Read message. Null if the connection is closed.</returns> public string Receive() { ITextMessage message = null; try { logger.Info("wait for new message"); message = consumer.Receive() as ITextMessage; logger.Info("recieved new message. Processing..."); } catch (Exception e) { logger.WarnFormat("Exception caught in receivethread. Maybe OpenEngSB terminated - {0} ({1}).", e.Message, e.GetType().Name); Handling.Changed += delegate(object[] obj) { return(Receive()); }; return(Handling.HandleException(e).ToString()); } if (message == null) { return(null); } logger.DebugFormat("recieved message: {0}", message.Text); return(message.Text); }
public string ToString(string itemName) { StringBuilder result = new StringBuilder(); if (Handling != Handling.NoHandling) { result.Append(Handling.ToString()); result.Append(' '); } if (Enhancement != Enhancement.NoEnhancement) { result.Append(Enhancement.ToString()); result.Append(' '); } if (Status != Status.NoStatus) { result.Append(Status.ToString()); result.Append(' '); } result.Append(itemName); if (Affiliation != Affiliation.NoAffiliation) { result.Append(" of "); result.Append(Affiliation.ToString()); } string resultString = result.ToString(); return(resultString.ToLower().ToUpperFirstChar()); }
public void HideBrain() { DeleteNeurons(); selectedEntity = null; selectedHandling = null; brainToDraw = null; }
// Vezme z GameObjektů mozky a udělá z nich sorted list public static Dictionary <float, Brain> EntitiesToBrainDictionary(List <GameObject> listGO) { var knihovnaMozku = new Dictionary <float, Brain>(); int landedCount = 0; foreach (GameObject go in listGO) { Handling Handling = go.GetComponent <Handling>(); Brain mozek = Handling.entityBrain; float fitness = Handling.fitness; if (Handling.landed) { landedCount++; } // Pokud by knihovna už hodnotu obsahovala, přičti +1 a získej tak unikátní hodnotu while (knihovnaMozku.ContainsKey(fitness)) { fitness++; } knihovnaMozku.Add(fitness, mozek); } PlotGraph.Instance.AddValueCount(landedCount); return(knihovnaMozku); }
public bool CreateHandling(HandlingBl handling) { try { Handling handling1 = new Handling { IdClient = handling.IdClient, InCheck = handling.InCheck, OutCheck = handling.OutCheck, IdRoom = handling.IdRoom, IdService = handling.IdService == 0 ? null : handling.IdService, IdService2 = handling.IdService2 == 0 ? null : handling.IdService2, IdService3 = handling.IdService3 == 0 ? null : handling.IdService3, IdBooking = handling.IdBooking == 0 ? null : handling.IdBooking, IdEmployee = handling.IdEmployee, }; _context.Handling.Add(handling1); _context.SaveChanges(); return(true); } catch (Exception ex) { return(false); throw; } }
private async Task <TResult> WithWrappedDbContextAsync <TResult>( Func <TDbContext, Task <TResult> > operation) where TResult : Result => await Handling.WithCommonHandlingAsync(async() => await Disposable.UsingAsync( () => new TDbContext(), dc => operation(dc)));
public ProcessPageViewModel(int PlaceId, Process Process, bool isQrConfirmed) { _thisProcess = Process; _thisProcess.PlaceId = PlaceId; IsQrConfirmed = isQrConfirmed; _this = new Handling(); _this.PlaceId = PlaceId; IsProcessOpen = true; if (!_thisProcess.IsActive && !_thisProcess.IsFrozen) { IsNew = true; } if (!string.IsNullOrEmpty(_thisProcess.MesId)) { IsMesRelated = true; MesString = new MesString { SetName = _thisProcess.SetName, ActionTypeName = _thisProcess.ActionTypeName, MesId = _thisProcess.MesId, MesDate = _thisProcess.MesDate, Reason = _thisProcess.Reason }; } if (_thisProcess.IsCompleted == true || _thisProcess.IsSuccessfull == true) { //process is closed and open from history IsProcessOpen = false; _this.Status = "Zakończony"; OnPropertyChanged(nameof(NextState)); OnPropertyChanged(nameof(NextStateColor)); OnPropertyChanged(nameof(IsOpen)); } SetUpMessagingCenter(); //Initialize(_this.ActionTypeId); }
public bool Pull(ref Handling handling) { bool isSuccess = false; if (IsMepSubject()) { MEPProcess mEPProcess = new MEPProcess(_document, _projectName); isSuccess = mEPProcess.Pull(ref handling); ListObjHasSynch = mEPProcess.ListObjHasSynch; ListObjBelowLocal = mEPProcess.ListObjBelowLocal; ListObjOnStack = mEPProcess.ListObjOnStack; } else if (IsStructure()) { StructureProcess structureProcess = new StructureProcess(_document, _projectName); isSuccess = structureProcess.Pull(ref handling); ListObjHasSynch = structureProcess.ListObjHasSynch; ListObjBelowLocal = structureProcess.ListObjBelowLocal; ListObjOnStack = structureProcess.ListObjOnStack; } GroupDrawings = new ObservableCollection <string>(); GroupDrawings.Add("Group: " + _drawingGroupName); foreach (DrawingsName str in _drawingInDrawingGroupName) { GroupDrawings.Add(str.Name); } return(isSuccess); }
public static void RemoveTemplate(string utid) { while (true) { try { LockTemplates.AcquireWriterLock(Options.LockTimeOut); try { AvailableTemplates.Remove(utid); } catch (Exception ex) { throw Handling.GetException("Unexpected", ex); } return; } catch (ApplicationException ex) { Thread.Sleep(100); throw Handling.GetException("ReaderWriterLock", ex); } finally { if (LockTemplates.IsWriterLockHeld) { LockTemplates.ReleaseWriterLock(); } } } }
public void reportHandlingEvent(EventSequenceNumber sequenceNumber) { HandlingEvent handlingEvent = handlingEventRepository.find(sequenceNumber); Handling handling = assembleFrom(handlingEvent); string trackingIdString = handlingEvent.Cargo.TrackingId.Value; reportSubmission.submitHandling(trackingIdString, handling); }
private void View(object sender, EventArgs e) { int id = Convert.ToInt32(dgItems.Rows[dgItems.CurrentCell.RowIndex].Cells[0].Value); Handling Handling = new Handling(); Handling = Keeper.Items.Where(u => u.HandlingId == id).FirstOrDefault(); }
public PreprocessingDataPost(Handling handling) { _handling = handling; _openingLocalPullAction = new List <ElementSendServer>(); _openingLocalPushAction = new List <ElementSendServer>(); _openingLocalDisconnect = new List <ElementSendServer>(); ImplementClassifyData(); }
//ToDo generic? public void Receive(object obj) { var message = DeserializeHelper <T> .Deserialize(obj.ToString()); if (message != null) { Handling.Invoke(message); } }
public void ChangeHandling(GameObject obj, Handling before, Handling after) { if (obj != null && GetObjects(before).Contains(obj)) { Remove(obj, before, false); Add(obj, after); } }
private Handling assembleFrom(HandlingEvent handlingEvent) { Handling handling = new Handling(); handling.setLocation(handlingEvent.Location.Name); handling.setType(handlingEvent.Activity.Type.ToString()); handling.setVoyage(handlingEvent.Voyage.VoyageNumber.Value); return(handling); }
public void Update() { Handling.Update(); Firing.Update(); if (Destroyer.DestroyNeeded()) { BlowUpVehicle(); } }
void ShowBrain(RaycastHit hit) { DeleteNeurons(); selectedEntity = hit.transform.gameObject; selectedHandling = selectedEntity.GetComponent <Handling>(); brainToDraw = selectedHandling.entityBrain; SpawnNeurons(); }
private void SpawnEntity(Vector2 _position, Brain _brain) { // Create the gameobject GameObject ga = Instantiate(prefab, _position, Quaternion.identity); // Get the handling script Handling ha = ga.GetComponent <Handling>(); // Assign the brain ha.entityBrain = _brain; }
public void reportHandling() { reportPusher.reportHandlingEvent(eventSequenceNumber); Handling expected = new Handling(); expected.setLocation("Hongkong"); expected.setType("RECEIVE"); expected.setVoyage(""); reportSubmission.AssertWasCalled(s => s.submitHandling(Arg.Is("ABC"), Arg.Is(expected))); }
public float GetAverageFitness() { double fitness_sum = 0; foreach (GameObject ent in entities) { Handling ha = ent.GetComponent <Handling>(); fitness_sum += ha.fitness; } return((float)(fitness_sum / brains.Count)); }
public ProcessPageViewModel(int PlaceId, bool isQrConfirmed) { _thisProcess = new Process(); _thisProcess.PlaceId = PlaceId; IsQrConfirmed = isQrConfirmed; _this = new Handling(); _this.PlaceId = PlaceId; IsNew = true; IsProcessOpen = false; //not known till we have it checked SetUpMessagingCenter(); //Initialize(); }
private void CreateOpeningOnStack(Transaction transaction, Handling handling) { List <CompareCoupleWithManager> compareCoupleWithManagers = handling.NewOpeningFromStack; foreach (CompareCoupleWithManager compareCoupleWithManager in compareCoupleWithManagers) { if (compareCoupleWithManager.Action == Model.Action.PULL) { LoadFammilyInstance(transaction, compareCoupleWithManager); } } }
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { UIDocument uidoc = commandData.Application.ActiveUIDocument; _document = uidoc.Document; string userName = commandData.Application.Application.Username; drawingName = _document.Title.Replace($"_{userName}", ""); drawingName = drawingName.Replace($"-{userName}", ""); _info = GetInfo(); #region get data from server var category = Repository.GetCategoryName(drawingName); if (string.IsNullOrEmpty(category)) { Utils.MessageError(Define.DrawingNotFound); return(Result.Failed); } var timeOut = Repository.GetTimeout(); if (timeOut != "Ok") { Utils.MessageError("Expiry date"); return(Result.Failed); } var DrawingGroupName = Repository.GetDrawingGroupName(drawingName); // get data form server var openingsOnStack = Repository.GetOpeningOnServer(drawingName); var openingsSync = Repository.GetManagerExept(drawingName, DrawingGroupName); var versionOpeningsGeometry = Repository.GetElementWithVersionCurrent(drawingName); // init data for UI _handlingGlobal = new Handling(openingsOnStack, openingsSync, versionOpeningsGeometry); ProcessData processData = new ProcessData(_document, drawingName, category); processData.PushServerInvoke += PushDataFromLocal; processData.IsTimeOut += CheckTimeOut; processData.ReleaseAuthen += ReleaseAuthen; processData.ShowDialog(_handlingGlobal, DrawingGroupName); //PushDataFromLocal(); //123 #endregion get data from server return(Result.Succeeded); }
public async Task <ActionResult <HandlingViewModel> > GetById(int containerId, int handlingId) { Handling handling = await _containerContext.Handlings .AsNoTracking() .Where(handling => handling.Id == handlingId && handling.ContainerId == containerId) .FirstOrDefaultAsync(); if (handling is null) { return(NotFound()); } return(_mapper.Map <HandlingViewModel>(handling)); }
static void Main(string[] args) { Handling handling = new Handling(); IPlayOperation playingOperation = new PlayingOperation(handling); playingOperation.GroupPlaying("User1", "User2", "User3", "User4", "User5"); handling.GetIndividualScore(); handling.GetNoOfWins(); }
public void Push(Handling handling) { if (IsMepSubject()) { MEPProcess mEPProcess = new MEPProcess(_document, _projectName); mEPProcess.Push(handling); } else if (IsStructure()) { StructureProcess structureProcess = new StructureProcess(_document, _projectName); structureProcess.Push(handling); } }
public ProjectDebugForm(Handling.Project project) { InitializeComponent(); Text = Lang.Get["TitleDebug"]; btnReprocess.Text = Lang.Get["DebugProjectReprocess"]; btnLoadOriginal.Text = Lang.Get["DebugProjectLoadOriginal"]; btnDebug.Text = Lang.Get["DebugProjectDebug"]; foreach(File file in project.SearchData.Files.Where(file => HandlerList.GetFileHandler(file) is AbstractLanguageFileHandler)){ entries.Add(new RelativeFile(project.SearchData.Root, file)); } textBoxFilterFiles_TextChanged(textBoxFilterFiles, new EventArgs()); listBoxFiles_SelectedValueChange(listBoxFiles, new EventArgs()); #if WINDOWS SendMessage(textBoxCode.Handle, 0x00CB, new IntPtr(1), new []{ 16 }); #endif }