public int ClearNonExistRecords()
        {
            int ret = 0;

            List <Controller> controllers = this.AuthService.GetControllers().ToList();

            if (controllers.Count > 0)
            {
                ControllerActionsList reflecteds = AuthorizationValidator.ControllerActionsList;// ControllerActionsList.Create<ReflectController>(AppDomain.CurrentDomain.GetAssemblies());

                foreach (Controller controller in controllers)
                {
                    ControllerActions ca = reflecteds.FirstOrDefault((item) => String.Equals(controller.Name, item.ControllerType.Name.Replace("Controller", "")));
                    if (null != ca)
                    {
                        List <Models.Action> actions = this.AuthService.GetActionsBy(controller.ControllerId).ToList();
                        foreach (Models.Action action in actions)
                        {
                            MethodInfo mi = ca[action.Name];
                            if (null == mi)//Mesela method silindi veya ismi değiştirildi.
                            {
                                ret = this.AuthService.DeleteRecordsByControllerAction(action);
                            }
                        }
                    }
                    else
                    {
                        ret += this.AuthService.DeleteRecordsByController(controller);
                    }
                }
            }

            return(ret);
        }
Beispiel #2
0
 void Awake()
 {
     Instance = this;
     _actions = ControllerActions.CreateWithDefaultBindings();
     InputManager.OnActiveDeviceChanged += OnDeviceChanged;
     InputManager.OnDeviceDetached      += OnDeviceChanged;
 }
Beispiel #3
0
        public static void Process_1(object argObject, ControllerActions argAction)
        {
            //based on mapping, display specific form
            foreach (ObjectMappingEntry objMapping in _ObjectMappings)
            {
                //find the right business object
                if (argObject.GetType().Name.CompareTo(
                        objMapping.BusinessObjectName) == 0)
                {
                    //find the right action
                    if (objMapping.Action == argAction)
                    {
                        //start the viewer
                        Type typeViewer = Assembly.GetExecutingAssembly().GetType(
                            objMapping.Viewer);

                        Form formViewer = (Form)Activator.CreateInstance(typeViewer);
                        formViewer.MdiParent   = _ParentForm;
                        formViewer.WindowState = FormWindowState.Maximized;
                        formViewer.Show();

                        break;
                    }
                }
            }
            return;
        }
        public void SetHomeSensorAzimuth(decimal azimuth)
        {
            Logger.Info().Message("Set home sensor azimuth to {azimuth}", azimuth).Write();
            decimal ticksPerDegree   = DomeCircumference / 360.0m;
            decimal homeStepPosition = azimuth * ticksPerDegree;

            ControllerActions.SetHomeSensorPosition((int)homeStepPosition);
            TransitionToState(new RequestStatusState(this));
        }
 public ActionResult Edit(ControllerActions controlleractions)
 {
     if (ModelState.IsValid)
     {
         db.Entry(controlleractions).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(controlleractions);
 }
Beispiel #6
0
    void Awake()
    {
        rb       = GetComponent <Rigidbody2D>();
        controls = new ControllerActions();

        controls.Gameplay.Jump.performed += ctx => Jump();

        controls.Gameplay.Move.performed += ctx => move = ctx.ReadValue <Vector2>();
        controls.Gameplay.Move.canceled  += ctx => move = Vector2.zero;
    }
        public ActionResult Create(ControllerActions controlleractions)
        {
            if (ModelState.IsValid)
            {
                db.ControllerActions.Add(controlleractions);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(controlleractions);
        }
Beispiel #8
0
        public Task SaveOrUpdateAsync(ControllerActionsModel model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("ControllerActions ArgumentNullException Insert Async");
            }

            ControllerActions dto = AutoMapperGenericHelper <ControllerActionsModel, ControllerActions> .Convert(model);

            _controllerActionsRepository.SaveOrUpdate(dto);

            return(Task.FromResult <object>(null));
        }
        public RouteGenerator(
            RouteCollection routes, RequestContext requestContext,
            ControllerActions controllerActions
            )
        {
            Contract.Requires(routes != null);
            Contract.Requires(requestContext != null);
            Contract.Requires(controllerActions != null);

            _routes = routes;
            _controllerActions = controllerActions;
            _requestContext = requestContext;

            _javaScriptSerializer = new JavaScriptSerializer();
        }
Beispiel #10
0
        public int ClearNonExistRecords()
        {
            int ret = 0;

            using (DbClient client = ionixFactory.CreateDbClient())
            {
                ControllerRepository controllerRepository = new ControllerRepository(client.Cmd);
                List <Controller>    controllers          = controllerRepository.Select().ToList();

                if (controllers.Count > 0)
                {
                    ActionRepository actionRepository = new ActionRepository(client.Cmd);

                    ControllerActionsList reflecteds = AuthorizationValidator.ControllerActionsList;// ControllerActionsList.Create<ReflectController>(AppDomain.CurrentDomain.GetAssemblies());

                    foreach (Controller controller in controllers)
                    {
                        ControllerActions ca = reflecteds.FirstOrDefault((item) => String.Equals(controller.Name, item.ControllerType.Name.Replace("Controller", "")));
                        if (null != ca)
                        {
                            List <Server.Models.Action> actions = actionRepository.SelectByControllerId(controller.Id).ToList();
                            foreach (Server.Models.Action action in actions)
                            {
                                MethodInfo mi = ca[action.Name];
                                if (null == mi)//Mesela method silindi veya ismi değiştirildi.
                                {
                                    ret = DeleteRecordsByControllerAction(action);
                                }
                            }
                        }
                        else
                        {
                            ret += DeleteRecordsByController(controller);
                        }
                    }
                }
            }

            return(ret);
        }
Beispiel #11
0
        public static void Process(object argObject, ControllerActions argAction)
        {
            //based on mapping, display specific form
            foreach (ObjectMappingEntry objMapping in _ObjectMappings)
            {
                //find the right business object
                if (argObject.GetType().Name.CompareTo(
                        objMapping.BusinessObjectName) == 0)
                {
                    //find the right action
                    if (objMapping.Action == argAction)
                    {
                        Assembly asm = Assembly.Load(objMapping.Viewer.Substring(0,
                                                                                 objMapping.Viewer.IndexOf('.')));

                        Type typeViewer = asm.GetType(objMapping.Viewer);

                        FrameworkViewer formViewer =
                            (FrameworkViewer)Activator.CreateInstance(typeViewer);

                        if (objMapping.BusinessObjectName.EndsWith("Collection"))
                        {
                            formViewer.BusinessObjectCollection = (BusinessRules.BusinessObjectCollection)argObject;
                        }
                        else
                        {
                            formViewer.BusinessObject = (BusinessRules.BusinessObject)argObject;
                        }

                        formViewer.ViewMode  = argAction;
                        formViewer.MdiParent = _ParentForm;
                        formViewer.Show();
                        break;
                    }
                }
            }

            return;
        }
Beispiel #12
0
 void Awake()
 {
     controls = new ControllerActions();
 }
Beispiel #13
0
 public void SavePersistentSettings()
 {
     Logger.Info("Saving persistent settings").Write();
     ControllerActions.SavePersistentSettings();
 }
Beispiel #14
0
 public void AllStop()
 {
     Log.Warn().Message("Emergency Stop requested").Write();
     ControllerActions.PerformEmergencyStop();
 }
Beispiel #15
0
 public void AllStop()
 {
     Logger.Warn().Message("Emergency Stop requested").Write();
     ControllerActions.PerformEmergencyStop();
     RotatorState.HardStopRequested();
 }
Beispiel #16
0
 internal void RequestHardwareStatus() => ControllerActions.RequestHardwareStatus();
Beispiel #17
0
 /// <summary>
 ///     Sends configuration data to the shutter. Normally called upon Offline -> Online state
 ///     transition.
 /// </summary>
 internal void ConfigureShutter()
 {
     ControllerActions.ConfigureShutter((uint)Options.ShutterMaximumSpeed,
                                        (uint)Options.ShutterRampTime.TotalMilliseconds,
                                        Options.EnableAutoCloseOnLowBattery ? Options.ShutterLowBatteryThresholdVolts.VoltsToAdu() : 0);
 }
Beispiel #18
0
    //摇杆行为绑定按键
    public static ControllerActions CreateWithDefaultBindings()
    {
        var p = new ControllerActions();

        p.Get(EControllerBtns.Debug).AddDefaultBinding(Key.F);

        //sure
        p.Get(EControllerBtns.Sure).AddDefaultBinding(Key.Return);
        p.Get(EControllerBtns.Sure).AddDefaultBinding(Key.Z);
        p.Get(EControllerBtns.Sure).AddDefaultBinding(Key.J);
        p.Get(EControllerBtns.Sure).AddDefaultBinding(InputControlType.Action1);

        //back
        p.Get(EControllerBtns.Cancel).AddDefaultBinding(Key.Escape);
        p.Get(EControllerBtns.Cancel).AddDefaultBinding(Key.X);
        p.Get(EControllerBtns.Cancel).AddDefaultBinding(Key.K);
        p.Get(EControllerBtns.Cancel).AddDefaultBinding(InputControlType.Action2);

        //pause
        p.Get(EControllerBtns.Pause).AddDefaultBinding(Key.Escape);
        p.Get(EControllerBtns.Pause).AddDefaultBinding(InputControlType.Action4);

        //shoot
        p.Get(EControllerBtns.Shoot).AddDefaultBinding(Key.Z);
        p.Get(EControllerBtns.Shoot).AddDefaultBinding(Key.J);
        p.Get(EControllerBtns.Shoot).AddDefaultBinding(InputControlType.Action1);

        //slowmove
        p.Get(EControllerBtns.SlowMove).AddDefaultBinding(Key.L);
        p.Get(EControllerBtns.SlowMove).AddDefaultBinding(Key.LeftShift);
        p.Get(EControllerBtns.SlowMove).AddDefaultBinding(InputControlType.Action3);

        //move
        p.Get(EControllerBtns.Up).AddDefaultBinding(Key.UpArrow);
        p.Get(EControllerBtns.Down).AddDefaultBinding(Key.DownArrow);
        p.Get(EControllerBtns.Left).AddDefaultBinding(Key.LeftArrow);
        p.Get(EControllerBtns.Right).AddDefaultBinding(Key.RightArrow);

        p.Get(EControllerBtns.Up).AddDefaultBinding(Key.W);
        p.Get(EControllerBtns.Down).AddDefaultBinding(Key.S);
        p.Get(EControllerBtns.Left).AddDefaultBinding(Key.A);
        p.Get(EControllerBtns.Right).AddDefaultBinding(Key.D);


        p.Get(EControllerBtns.Up).AddDefaultBinding(InputControlType.LeftStickUp);
        p.Get(EControllerBtns.Down).AddDefaultBinding(InputControlType.LeftStickDown);
        p.Get(EControllerBtns.Left).AddDefaultBinding(InputControlType.LeftStickLeft);
        p.Get(EControllerBtns.Right).AddDefaultBinding(InputControlType.LeftStickRight);

        //turn
        p.Get(EControllerBtns.TurnLeft).AddDefaultBinding(InputControlType.RightStickLeft);
        p.Get(EControllerBtns.TurnRight).AddDefaultBinding(InputControlType.RightStickRight);
        p.Get(EControllerBtns.TurnUp).AddDefaultBinding(InputControlType.RightStickUp);
        p.Get(EControllerBtns.TurnDown).AddDefaultBinding(InputControlType.RightStickDown);


        p.ListenOptions.IncludeUnknownControllers = true;
        p.ListenOptions.MaxAllowedBindings        = 4;
        //playerActions.ListenOptions.MaxAllowedBindingsPerType = 1;
        //playerActions.ListenOptions.AllowDuplicateBindingsPerSet = true;
        p.ListenOptions.UnsetDuplicateBindingsOnSet = true;
        //playerActions.ListenOptions.IncludeMouseButtons = true;
        //playerActions.ListenOptions.IncludeModifiersAsFirstClassKeys = true;
        //playerActions.ListenOptions.IncludeMouseButtons = true;
        //playerActions.ListenOptions.IncludeMouseScrollWheel = true;

        /*
         *  playerActions.ListenOptions.OnBindingFound = (action, binding) => {
         *      if (binding == new KeyBindingSource(Key.Escape))
         *      {
         *          action.StopListeningForBinding();
         *          return false;
         *      }
         *      return true;
         *  };*/


        p.ListenOptions.OnBindingAdded += (action, binding) => {
            Debug.Log("Binding added... " + binding.DeviceName + ": " + binding.Name);
        };

        p.ListenOptions.OnBindingRejected += (action, binding, reason) => {
            Debug.Log("Binding rejected... " + reason);
        };

        return(p);
    }
Beispiel #19
0
 public abstract float getAction(ControllerActions action);
Beispiel #20
0
 public int getActionButton(ControllerActions action)
 {
     return(ActionMap[action]);
 }
Beispiel #21
0
 void Awake()
 {
     controls = new ControllerActions();
     controls.Gameplay.TurretFire.started += ctx => Fire();
 }
Beispiel #22
0
 public override float getAction(ControllerActions action)
 {
     return(getState((PSGamePadLayout)getActionButton(action)));
 }