private void threadChange_DoWork(object sender, DoWorkEventArgs e)
        {
            object[] arguments = e.Argument as object[];
            string   workerId  = arguments[0] as string;
            string   cardId    = arguments[1] as string;
            bool     result    = OtherController.ChangeWorkerId(workerId, cardId);

            e.Result = result;
        }
        public async Task GetAllOthersReturnsNotNullAndNotEmpty()
        {
            _repository = new OtherRepository();
            var controller = new OtherController(_service);
            var others     = await controller.GetOthers();

            Assert.NotNull(others);
            Assert.True(others.Others.Any());
        }
 private void Start()
 {
     otc  = FindObjectOfType <OtherController>();
     matc = FindObjectOfType <MainATC>();
     if (otc == null)
     {
         Debug.Log("Cant find otherController");
     }
     ballistaTag = string.Empty;
 }
Пример #4
0
    private void Start()
    {
        otc   = FindObjectOfType <OtherController>();
        score = 10.0f;

        // FindObjectOfType<ARCoreSession>().SessionConfig.PlaneFindingMode =
        //     DetectedPlaneFindingMode.Disabled;

        // FindObjectOfType<ARCoreSession>().SessionConfig.EnablePlaneFinding = false;
    }
 public void Init()
 {
     TestUtil.DeleteDataInDatabase();
     TestUtil.InsertDataDatabase();
     AutoMapperConfiguration.Configure();
     _repository         = new OtherRepository();
     _context            = new MicrobrewitContext();
     _otherElasticsearch = new OtherElasticsearch();
     _service            = new OtherService(_otherElasticsearch, _repository);
     _controller         = new OtherController(_service);
 }
        public ArchiveDetailWindow()
        {
            InitializeComponent();
            SelectedPatientId = -1;

            gallery.onChangeSelectedItem += (BitmapImage bitmapImage) =>
            {
                SelectedImage = bitmapImage;
            };
            otherController = new OtherController();
        }
Пример #7
0
 private void Start()
 {
     sb  = FindObjectOfType <SpawnBallista>();
     gs  = FindObjectOfType <GameSession>();
     otc = FindObjectOfType <OtherController>();
     bt  = sb.getBallistaTag();
     rb  = GetComponent <Rigidbody>();
     if (bt == "BallistaP1")
     {
         oppBT = "BallistaP2";
     }
     else
     {
         oppBT = "BallistaP1";
     }
 }
Пример #8
0
    //bool isOwn = false;

    // Start is called before the first frame update
    void Start()
    {
        sb  = FindObjectOfType <SpawnBallista>();
        mtc = FindObjectOfType <MainATC>();
        gs  = FindObjectOfType <GameSession>();
        otc = FindObjectOfType <OtherController>();
        bt  = sb.getBallistaTag();

        if ((otc.isPlayerHoster() && bt == "BallistaP1") ||
            otc.isPlayerResolver() && bt == "BallistaP2")
        {
            //isOwn = true;
            InvokeRepeating("setPlank", 2.0f, 0.1f);
            Debug.Log("Plank setting owned");
        }
    }
Пример #9
0
        /// <summary>
        /// 初始化UI
        /// </summary>
        public void InitUI()
        {
            #region
            OtherController.BindCBQuestionType(this.cbQuestiontype);
            OtherController.BindCBQuestionScope(this.cbQuestionScope);

            if (this._frmState != ExamQuestionState.NormalAdd)
            {
                this.tbQuestion.Text = this.QuestionRow[ExamQuestionData.questionName].ToString();
                this.cbQuestiontype.SelectedValue  = this.QuestionRow[ExamQuestionData.questionTypeId];
                this.cbQuestionScope.SelectedValue = this.QuestionRow[ExamQuestionData.questionScopeId];
            }
            switch (this._frmState)
            {
            case ExamQuestionState.NormalAdd:
                this.showFirstTab();
                break;

            case ExamQuestionState.NormalEdit:
                this.cbQuestiontype.IsEnabled = false;
                this.showFirstTab();
                break;

            case ExamQuestionState.DirectEditEssay:
                this.showEssayTab();
                break;

            case ExamQuestionState.DirectEditEstimate:

                this.showEstimateTab();
                break;

            case ExamQuestionState.DirectEditSelect:
                this.tbQuestionSelect.Text = this.tbQuestion.Text;
                this.showSelectTab();
                break;

            default:
                break;
            }
            #endregion
        }
Пример #10
0
        private void HandleGrabbing()
        {
            if (OtherController.IsTracking && !HasLock())
            {
                OtherController.TryAcquireFocus(out _OtherLock);
            }

            if (HasLock() && OtherController.Input.GetPressDown(SECONDARY_SCALE_BUTTON))
            {
                _ScaleInitialized = false;
            }

            if (HasLock() && OtherController.Input.GetPressDown(SECONDARY_ROTATE_BUTTON))
            {
                _RotationInitialized = false;
            }


            if (Controller.GetPress(EVRButtonId.k_EButton_Grip))
            {
                if (HasLock() && (OtherController.Input.GetPress(SECONDARY_ROTATE_BUTTON) || OtherController.Input.GetPress(SECONDARY_SCALE_BUTTON)))
                {
                    var newFromTo = (OtherController.transform.position - transform.position).normalized;

                    if (OtherController.Input.GetPress(SECONDARY_SCALE_BUTTON))
                    {
                        InitializeScaleIfNeeded();
                        var   controllerDistance = Vector3.Distance(OtherController.transform.position, transform.position) * (_InitialIPD / VR.Settings.IPDScale);
                        float ratio = controllerDistance / _InitialControllerDistance;
                        VR.Settings.IPDScale      = ratio * _InitialIPD;
                        _ProspectedPlayArea.Scale = VR.Settings.IPDScale;
                    }

                    if (OtherController.Input.GetPress(SECONDARY_ROTATE_BUTTON))
                    {
                        InitializeRotationIfNeeded();
                        var angleDiff = Calculator.Angle(_PrevFromTo, newFromTo) * VR.Settings.RotationMultiplier;
                        VR.Camera.SteamCam.origin.transform.RotateAround(VR.Camera.Head.position, Vector3.up, angleDiff);// Mathf.Max(1, Controller.velocity.sqrMagnitude) );

                        _ProspectedPlayArea.Rotation += angleDiff;
                    }

                    _PrevFromTo = (OtherController.transform.position - transform.position).normalized;
                }
                else
                {
                    var diffPos = transform.position - _PrevControllerPos;
                    var diffRot = Quaternion.Inverse(_PrevControllerRot * Quaternion.Inverse(transform.rotation)) * (transform.rotation * Quaternion.Inverse(transform.rotation));
                    if (Time.unscaledTime - _GripStartTime > GRIP_TIME_THRESHOLD || Calculator.Distance(diffPos.magnitude) > GRIP_DIFF_THRESHOLD)
                    {
                        var forwardA  = Vector3.forward;
                        var forwardB  = diffRot * Vector3.forward;
                        var angleDiff = Calculator.Angle(forwardA, forwardB) * VR.Settings.RotationMultiplier;

                        VR.Camera.SteamCam.origin.transform.position -= diffPos;
                        _ProspectedPlayArea.Height -= diffPos.y;
                        //VRLog.Debug("Rotate: {0}", NormalizeAngle(diffRot.eulerAngles.y));
                        if (!VR.Settings.GrabRotationImmediateMode && Controller.GetPress(ButtonMask.Trigger | ButtonMask.Touchpad))
                        {
                            VR.Camera.SteamCam.origin.transform.RotateAround(VR.Camera.Head.position, Vector3.up, -angleDiff);
                            _ProspectedPlayArea.Rotation -= angleDiff;
                        }

                        _GripStartTime = 0; // To make sure that pos is not reset
                    }
                }
            }
            if (Controller.GetPressUp(EVRButtonId.k_EButton_Grip))
            {
                EnterState(WarpState.None);
                if (Time.unscaledTime - _GripStartTime < GRIP_TIME_THRESHOLD)
                {
                    Owner.StartRumble(new RumbleImpulse(800));
                    _ProspectedPlayArea.Height = 0;
                    _ProspectedPlayArea.Scale  = _IPDOnStart;
                }
            }

            if (VR.Settings.GrabRotationImmediateMode && Controller.GetPressUp(ButtonMask.Trigger | ButtonMask.Touchpad))
            {
                // Rotate
                var originalLookDirection = Vector3.ProjectOnPlane(transform.position - VR.Camera.Head.position, Vector3.up).normalized;
                var currentLookDirection  = Vector3.ProjectOnPlane(VR.Camera.Head.forward, Vector3.up).normalized;
                var angleDeg = Calculator.Angle(originalLookDirection, currentLookDirection);

                VR.Camera.SteamCam.origin.transform.RotateAround(VR.Camera.Head.position, Vector3.up, angleDeg);
                _ProspectedPlayArea.Rotation = angleDeg;
            }

            _PrevControllerPos = transform.position;
            _PrevControllerRot = transform.rotation;

            CheckRotationalPress();
        }
Пример #11
0
 // Start is called before the first frame update
 void Start()
 {
     gs  = FindObjectOfType <GameSession>();
     otc = FindObjectOfType <OtherController>();
     InvokeRepeating("doUpdate", 5.0f, 0.2f);
 }
Пример #12
0
        public void InitialVariables()
        {
            otherController = new OtherController();

            ovalPictureBox.BackgroundImageLayout = ImageLayout.Zoom;

            serialPortController           = new SerialPortController(true);
            serialPortController.PortOpen += () =>
            {
                // System.Windows.MessageBox.Show("port open");
                this.Dispatcher.Invoke(() =>
                {
                    imageSerialportStatus.Source = new BitmapImage(new Uri("/Resource/SerialPortSuccess.png", UriKind.Relative));
                });
            };
            serialPortController.PortClose += () =>
            {
                // System.Windows.MessageBox.Show("port closed");
                this.Dispatcher.Invoke(() =>
                {
                    imageSerialportStatus.Source = new BitmapImage(new Uri("/Resource/SerialPortFail.png", UriKind.Relative));
                });
            };
            serialPortController.NewDataReceived += (string data) =>
            {
                if (data.Substring(data.Length - 1, 1) == "\r")
                {
                    data = data.Substring(0, data.Length - 1);
                }
                //System.Windows.MessageBox.Show(data);
                switch (data)
                {
                case "LIVE":
                    new Task(() => LivePreView()).Start();
                    break;

                case "SAVE":
                    if (pedalController.SaveOnSave)
                    {
                        SaveToGallery();
                    }
                    if (pedalController.SetImageRightOnSave)
                    {
                        SetImageRight();
                    }
                    break;

                case "FREEZE":
                    CaptureJpeg();
                    StopLivePreView();
                    if (pedalController.SaveOnFreeze)
                    {
                        SaveToGallery();
                    }
                    break;
                }
            };

            dvrControl        = new DvrController();
            galleryController = new GalleryController();
            pedalController   = new PedalController();
            captureController = new CaptureController();

            patientDbContext = new PatientDbContext();

            dgTodayWorkBench.DataContext = patientDbContext.Patients.ToList();

            pateintTodayForm.nowRefresh      += LoadTodayPatientTable;
            pateintTodayForm.onSelectPatient += (int Id, string fullName) =>
            {
                mainTabControl.SelectedIndex = 1;
                PatientId = Id;
                galleryController.CreateAndOpenGalley(Id);
                galleryControl.setGalleryId(Id);
                patientWorkBenchName.Text = fullName;
                //picCapture.Source = null;


                partBottom.Visibility = Visibility.Collapsed;
            };


            galleryControl.onChangeSelectedItem += (BitmapImage bitmapImage) =>
            {
                this.Dispatcher.Invoke(() =>
                {
                    //ellipseGeometry.Center = new Point(bitmapImage.Width / 2, bitmapImage.Height / 2);

                    //int startX = (int)(bitmapImage.Width - bitmapImage.Height) / 2;

                    //int endX = (int)(bitmapImage.Width + startX);

                    ////CroppedBitmap croppedBitmap = new CroppedBitmap(bitmapImage, new Int32Rect(startX, 0, endX, (int)bitmapImage.Height));

                    //croppedBitmap.SourceRect = new Int32Rect(startX, 0, endX, (int)bitmapImage.Height);

                    picCapture.Source = bitmapImage;
                });
            };
        }
Пример #13
0
 void Start()
 {
     otc = FindObjectOfType <OtherController>();
 }
 public void MethodA()
 {
     OtherController.MethodB();     // This will work because MethodB is static
     // Like shown above you can call a static method from anywhere
 }