Exemple #1
0
        public PartialViewResult EditTune(int tuneID)
        {
            UserTuneViewModel userTuneViewModel = new UserTuneViewModel();

            userTuneViewModel = userTuneViewModel.GetUserTuneDetail(tuneID);

            return(PartialView("~/Views/_AddEditTune.cshtml", userTuneViewModel));
        }
Exemple #2
0
        public PartialViewResult GetPIDTable(int fcControllerSoftwareID, int tuneID, bool isEditable)
        {
            UserTuneViewModel userTuneViewModel = new UserTuneViewModel();

            if (tuneID != 0)
            {
                userTuneViewModel = userTuneViewModel.GetUserTuneDetail(tuneID);
            }
            else
            {
                userTuneViewModel.Roll_P        = 0;
                userTuneViewModel.Pitch_P       = 0;
                userTuneViewModel.Yaw_P         = 0;
                userTuneViewModel.Roll_I        = 0;
                userTuneViewModel.Pitch_I       = 0;
                userTuneViewModel.Yaw_I         = 0;
                userTuneViewModel.Roll_D        = 0;
                userTuneViewModel.Pitch_D       = 0;
                userTuneViewModel.Yaw_D         = 0;
                userTuneViewModel.Roll_Rate     = 0;
                userTuneViewModel.Pitch_Rate    = 0;
                userTuneViewModel.Yaw_Rate      = 0;
                userTuneViewModel.Yaw_RCRate    = 0;
                userTuneViewModel.Pitch_RCRate  = 0;
                userTuneViewModel.Roll_RCRate   = 0;
                userTuneViewModel.Roll_RCCurve  = 0;
                userTuneViewModel.Pitch_RCCurve = 0;
                userTuneViewModel.Yaw_RCCurve   = 0;
                userTuneViewModel.Roll_RCExpo   = 0;
                userTuneViewModel.Pitch_RCExpo  = 0;
                userTuneViewModel.Yaw_RCExpo    = 0;
            }

            userTuneViewModel.isEditable = isEditable;

            //use tuneID to get all the pid info for the tune and populate some viewmodel with it and send the viewmodel back with corosponding pid partial view.
            switch (fcControllerSoftwareID)
            {
            case 1:
                return(PartialView("~/Views/_KissPIDS.cshtml", userTuneViewModel));

            case 2:
                return(PartialView("~/Views/_CleanFlightPIDS.cshtml", userTuneViewModel));

            case 3:
                return(PartialView("~/Views/_CleanFlightPIDS.cshtml", userTuneViewModel));

            default:
                return(null);
            }
        }