コード例 #1
0
ファイル: Vehicle_Physics.cs プロジェクト: CyberSys/UTA
        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);
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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));
        }
コード例 #4
0
ファイル: Admin.cs プロジェクト: kiril0id/HostelProject
 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;
     }
 }
コード例 #5
0
        /// <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);
        }
コード例 #6
0
        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());
        }
コード例 #7
0
 public void HideBrain()
 {
     DeleteNeurons();
     selectedEntity   = null;
     selectedHandling = null;
     brainToDraw      = null;
 }
コード例 #8
0
ファイル: Functions.cs プロジェクト: mskl/fit-bi-zum-spacex
    // 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);
    }
コード例 #9
0
ファイル: Admin.cs プロジェクト: kiril0id/HostelProject
        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;
            }
        }
コード例 #10
0
 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)));
コード例 #11
0
        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);
        }
コード例 #12
0
        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);
        }
コード例 #13
0
 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();
             }
         }
     }
 }
コード例 #14
0
        public void reportHandlingEvent(EventSequenceNumber sequenceNumber)
        {
            HandlingEvent handlingEvent    = handlingEventRepository.find(sequenceNumber);
            Handling      handling         = assembleFrom(handlingEvent);
            string        trackingIdString = handlingEvent.Cargo.TrackingId.Value;

            reportSubmission.submitHandling(trackingIdString, handling);
        }
コード例 #15
0
        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();
        }
コード例 #16
0
 public PreprocessingDataPost(Handling handling)
 {
     _handling = handling;
     _openingLocalPullAction = new List <ElementSendServer>();
     _openingLocalPushAction = new List <ElementSendServer>();
     _openingLocalDisconnect = new List <ElementSendServer>();
     ImplementClassifyData();
 }
コード例 #17
0
        //ToDo generic?
        public void Receive(object obj)
        {
            var message = DeserializeHelper <T> .Deserialize(obj.ToString());

            if (message != null)
            {
                Handling.Invoke(message);
            }
        }
コード例 #18
0
 public void ChangeHandling(GameObject obj, Handling before,
                            Handling after)
 {
     if (obj != null && GetObjects(before).Contains(obj))
     {
         Remove(obj, before, false);
         Add(obj, after);
     }
 }
コード例 #19
0
        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);
        }
コード例 #20
0
ファイル: VehicleBase.cs プロジェクト: Vaskrol/Break-In
        public void Update()
        {
            Handling.Update();
            Firing.Update();

            if (Destroyer.DestroyNeeded())
            {
                BlowUpVehicle();
            }
        }
コード例 #21
0
    void ShowBrain(RaycastHit hit)
    {
        DeleteNeurons();

        selectedEntity   = hit.transform.gameObject;
        selectedHandling = selectedEntity.GetComponent <Handling>();
        brainToDraw      = selectedHandling.entityBrain;

        SpawnNeurons();
    }
コード例 #22
0
    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;
    }
コード例 #23
0
        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)));
        }
コード例 #24
0
    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));
    }
コード例 #25
0
 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();
 }
コード例 #26
0
        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);
                }
            }
        }
コード例 #27
0
        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);
        }
コード例 #28
0
        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));
        }
コード例 #29
0
        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();
        }
コード例 #30
0
 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);
     }
 }
コード例 #31
0
        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
        }