Esempio n. 1
0
        public long GetMIDashBoard(dynamic lstInput, out DashBoard lstInfo)
        {
            long returnCode = -1;

            lstInfo = new DashBoard();
            using (TransactionScope transactionScope = new TransactionScope())
            {
                try
                {
                    returnCode = objMotorAppDAL.GetNewMIDashBoard(lstInput, out lstInfo);



                    transactionScope.Complete();
                    transactionScope.Dispose();
                }
                catch (Exception ex)
                {
                    transactionScope.Dispose();
                    //  throw ex;
                }

                return(returnCode);
            }
        }
Esempio n. 2
0
 public void validation()
 {
     if (!(textBoxUsername.Text == string.Empty))
     {
         if (!(textBoxPassword.Text == string.Empty))
         {
             using (SqlConnection connection = new SqlConnection(Helper.Helper.ConnectionString))
             {
                 const string query = "Select * from HrEmployee where UserName =@username And Password =@password";
                 using (SqlCommand sqlCommand = new SqlCommand(query, connection))
                 {
                     sqlCommand.Parameters.Add(new SqlParameter("@username", SqlDbType.VarChar));
                     sqlCommand.Parameters["@username"].Value = textBoxUsername.Text;
                     sqlCommand.Parameters.Add(new SqlParameter("@password", SqlDbType.VarChar));
                     sqlCommand.Parameters["@password"].Value = textBoxPassword.Text;
                     try
                     {
                         connection.Open();
                         using (SqlDataReader dataReader = sqlCommand.ExecuteReader())
                         {
                             int count = 0;
                             while (dataReader.Read())
                             {
                                 count = count + 1;
                             }
                             if (count == 1)
                             {
                                 MessageBox.Show("Login Successful !");
                                 DashBoard dashBoard = new DashBoard();
                                 dashBoard.Show();
                                 this.Hide();
                             }
                             else
                             {
                                 MessageBox.Show("Username or Password Incorrect !");
                             }
                             dataReader.Close();
                         }
                     }
                     catch (Exception ex)
                     {
                         MessageBox.Show(ex.Message);
                     }
                     finally
                     {
                         connection.Close();
                     }
                 }
             }
         }
         else
         {
             MessageBox.Show("Password Empty !");
         }
     }
     else
     {
         MessageBox.Show("Username Empty");
     }
 }
Esempio n. 3
0
        public long GetInfoYearWise(dynamic lstInput, int Years, out DashBoard lstInfo)
        {
            long returnCode = -1;

            lstInfo = new DashBoard();
            using (TransactionScope transactionScope = new TransactionScope())
            {
                try
                {
                    if (HttpContext.Current.Cache["InputData"].ToString() != "" && HttpContext.Current.Cache["InputData"] != null)
                    {
                        if (lstInput == null)
                        {
                            lstInput = (dynamic)HttpContext.Current.Cache["InputData"];
                        }
                        returnCode = objMotorAppDAL.GetYearwiseReport(lstInput, Years, out lstInfo);
                    }
                    else
                    {
                        returnCode = objMotorAppDAL.GetYearwiseReport(lstInput, Years, out lstInfo);
                        HttpContext.Current.Cache.Insert("InputData", lstInput);
                    }
                    transactionScope.Complete();
                    transactionScope.Dispose();
                }
                catch (Exception ex)
                {
                    transactionScope.Dispose();
                }

                return(returnCode);
            }
        }
Esempio n. 4
0
    void EnableObject(GameObject car)
    {
        car.SetActiveRecursively(true);
        if (car.transform.GetComponent <Setup>() != null)
        {
            car.transform.GetComponent <Setup>().enabled = true;
        }
        if (settingsMenu != null)
        {
            if (settingsMenu.stressTest == false)
            {
                car.transform.GetComponent <CarDynamics>().SetController("axis");
            }
        }
        else
        {
            car.transform.GetComponent <CarDynamics>().SetController("axis");
        }

/*      if (Time.fixedDeltaTime<=0.02f) {
 *                      foreach(Wheel w in car.transform.GetComponent<CarDynamics>().allWheels){
 *                              w.tirePressureEnabled=true;
 *                              w.SetTireStiffness();
 *                      }
 *              } */
        dashBoard = car.GetComponentInChildren <DashBoard>();
        if (dashBoard != null)
        {
            dashBoard.gameObject.active = true;
        }
        if (settingsMenu != null)
        {
            StartCoroutine(settingsMenu.ChangeCar(car));
        }
    }
Esempio n. 5
0
            public void GivenLogIntoDashBoard_CreateANewLead()
            {
                Log.WriteStringLine();
                Log.Write("There was a problem in shifting bytes left!");
                Log.WriteLine();
                Log.WriteFormat("Test args {0} and {1}", "#first#", "#second#");
                Log.WriteLineFormat("Test args {0} and {1}", "#first#", "#second#");

                Log.Write(" The Start Time");

                Log log = new Log(driver);

                driver    = log.driver;
                driver    = Driver.Initialize(ConfigurationManager.AppSettings["BrowserIEName"]);
                url       = ConfigurationManager.AppSettings["EnvironmentUrl"];
                login     = new AdminLogin(driver);
                dashBoard = new DashBoard(driver);
                login.NavigateToLoginPage(driver, url);
                login.NavigateToDashBoard(driver, ConfigurationManager.AppSettings["BankerUserName"], ConfigurationManager.AppSettings["BankerPassword"]);
                var watch = System.Diagnostics.Stopwatch.StartNew();

                dashBoard.NavigateToClient(driver);
                watch.Stop();
                var elapsedMs = watch.ElapsedMilliseconds;

                Log.Write(" The elapsed time " + elapsedMs.ToString());
            }
Esempio n. 6
0
        public ActionResult TorneoHome(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            conf.configuracion.IdTorneo = id;
            var torneos_equipo    = db.TorneoEquipo.Where(te => te.torneo_id == conf.configuracion.IdTorneo);
            var jugadores         = db.Jugador;
            int ContadorJugadores = 0;

            foreach (var item in torneos_equipo)
            {
                foreach (var item2 in jugadores)
                {
                    if (item.equipo_id == item2.equipo_id)
                    {
                        ContadorJugadores++;
                    }
                }
            }
            var stats = new DashBoard()
            {
                TotalEquipos   = db.TorneoEquipo.Count(te => te.torneo_id == conf.configuracion.IdTorneo),
                TotalJugadores = ContadorJugadores,
                TotalTorneos   = db.Torneo.Count(),
                TotalNoticias  = db.Noticia.Count(n => n.torneo_id == conf.configuracion.IdTorneo)
            };

            return(View(stats));
        }
Esempio n. 7
0
        public DashBoard Count(Int64 ProjectId, int Date, Int64 EmployeeId)
        {
            IDbCommand    cmd = null;
            IDbConnection con = null;
            IDataReader   reader;
            DashBoard     objTrackerDashBoard = new DashBoard();

            using (con = DataFactory.CreateConnection())
            {
                con.Open();
                using (cmd = DataFactory.CreateCommand("Sp_TrackerDashBoardMainCount", con))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(DataFactory.CreateParameter("ProjectId", ProjectId));
                    cmd.Parameters.Add(DataFactory.CreateParameter("Date", Date));
                    cmd.Parameters.Add(DataFactory.CreateParameter("EmployeeId", EmployeeId));
                    reader = cmd.ExecuteReader();

                    while (reader.Read())
                    {
                        objTrackerDashBoard.AssignedHours  = DBNull.Value.Equals(reader["AssignedHours"]) ? 0 : Convert.ToInt32(reader["AssignedHours"]);
                        objTrackerDashBoard.ActiveHours    = DBNull.Value.Equals(reader["ActiveHours"]) ? 0 : Convert.ToInt32(reader["ActiveHours"]);
                        objTrackerDashBoard.CompletedHours = DBNull.Value.Equals(reader["CompletedHours"]) ? 0 : Convert.ToInt32(reader["CompletedHours"]);
                        objTrackerDashBoard.PendingHours   = DBNull.Value.Equals(reader["PendingHours"]) ? 0 : Convert.ToInt32(reader["PendingHours"]);
                    }
                    reader.Close();
                    return(objTrackerDashBoard);
                }
            }
        }
Esempio n. 8
0
        public void AverageSalary(DashBoard dashboard, List <Users> getUsers)
        {
            List <decimal> salaries = new List <decimal>();

            foreach (Users user in getUsers)
            {
                Contracts contracts = contractsBLL.GetContracts().Find(m => m.ContractID == user.ContractID);
                if (contracts == null)
                {
                    contracts = Contracts.Null;
                }
                if (contracts.Salary != Contracts.Null.Salary)
                {
                    salaries.Add(contracts.Salary);
                }
                else
                {
                    contracts.Salary = Contracts.Null.Salary;
                }
            }
            //Get average
            decimal averageSalary = 0.0M;

            if (salaries.Count >= 1)
            {
                averageSalary = salaries.Sum() / salaries.Count;
            }
            //store in dashboard
            dashboard.AverageSalary = averageSalary;
        }
Esempio n. 9
0
        public override void Preview()
        {
            string wk     = gv.GetFocusedRowCellValue("Sheet_Workset").ToStringEx();
            int    intval = gv.GetFocusedRowCellValue("Sheet_Interval").ToIntEx();
            string p      = gv.GetFocusedRowCellValue("Sheet_Parameter").ToStringEx();
            object obj    = gv.GetFocusedRowCellValue("Sheet_Bytes");

            if (obj == DBNull.Value)
            {
                return;
            }
            byte[]    bytes = (byte[])obj;
            DashBoard db    = new DashBoard();

            db.intval    = intval;
            db.fileByte  = bytes;
            db.Workset   = wk;
            db.Parameter = p;
            int wint = gv.GetFocusedRowCellValue("Sheet_Width").ToIntEx();
            int hint = gv.GetFocusedRowCellValue("Sheet_Height").ToIntEx();

            if (wint > 0)
            {
                db.Width = Math.Max(wint, 80);
            }
            if (hint > 0)
            {
                db.Height = Math.Max(hint, 60);
            }
            db.Show();
        }
Esempio n. 10
0
        public HttpResponseMessage Update(string ticket, DashBoard dash)
        {
            var securityProvider = new SecurityProvider(_connectionString);

            var sessionInfo = securityProvider.GetSessionInfo(ticket);

            if (sessionInfo == null)
            {
                return(Request.CreateResponse(HttpStatusCode.Unauthorized));
            }

            var updateRequest = new UpdateDashboardRequest
            {
                DashBoard = dash, //TODO FIX HERE
                UserId    = sessionInfo.User.Id
            };

            var handler = new UpdateDashBoardHandler(_connectionString);

            var response = handler.Handle(updateRequest);

            var statusCode = ResolveStatusCode(response);

            return(Request.CreateResponse(statusCode, response));
        }
Esempio n. 11
0
    void DisableObject(GameObject car)
    {
        if (settingsMenu != null)
        {
            if (settingsMenu.stressTest == false)
            {
                car.transform.GetComponent <CarDynamics>().SetController("external");
            }
        }
        else
        {
            car.transform.GetComponent <CarDynamics>().SetController("external");
        }

/*      foreach(Wheel w in car.transform.GetComponent<CarDynamics>().allWheels){
 *                      w.tirePressureEnabled=false;
 *              }
 */     dashBoard = car.GetComponentInChildren <DashBoard>();
        if (dashBoard != null)
        {
            dashBoard.gameObject.active = false;
        }
        if (car.transform.GetComponent <CarDebug>() != null)
        {
            car.transform.GetComponent <CarDebug>().enabled = false;
        }
        if (settingsMenu != null)
        {
            settingsMenu.ChangeCar(null);
        }
    }
Esempio n. 12
0
 public ActionResult Index()
 {
     using (ApplicationDbContext db = new ApplicationDbContext())
     {
         if (!User.IsInRole("User"))
         {
             DashBoard dashbord = (from Clients in db.Clients
                                   let clients = db.Clients.Where(a => a.Delete != true).Count()
                                                 let customers = db.Customers.Where(a => a.Delete != true).Count()
                                                                 let admins = db.Users.Where(a => a.Deleted != true).Count()
                                                                              let Donetrips = db.Trips.Where(a => a.Status == (int)TripStatus.Completed || a.Status == (int)TripStatus.Canceled).Count()
                                                                                              let trips = db.Trips.Where(a => a.Status != (int)TripStatus.Completed && a.Status != (int)TripStatus.Canceled).Count()
                                                                                                          let offers = db.Offers.Count()
                                                                                                                       let maincat = db.Categories.Where(a => a.CategoryID == null).Count()
                                                                                                                                     let cat = db.Categories.Where(a => a.CategoryID != null).Count()
                                                                                                                                               let complains = db.Complains.Count()
                                                                                                                                                               select new DashBoard
             {
                 customers = customers,
                 clients = clients,
                 donetrips = Donetrips,
                 trips = trips,
                 offers = offers,
                 complains = complains,
                 admins = admins,
                 main_category = maincat,
                 category = cat
             }).Take(1).FirstOrDefault();
             return(View(dashbord));
         }
         else
         {
             DashBoard dashbord = (from Clients in db.Clients
                                   let clients = db.Clients.Where(a => a.Delete != true && a.User != null && a.User.UserName
                                                                  == User.Identity.Name).Count()
                                                 // let customers = db.Customers.Where(a => a.Delete != true).Count()
                                                 // let admins = db.Users.Where(a => a.Deleted != true).Count()
                                                 // let Donetrips = db.Trips.Where(a => a.Status == (int)TripStatus.Completed || a.Status == (int)TripStatus.Canceled).Count()
                                                 //let trips = db.Trips.Where(a => a.Status != (int)TripStatus.Completed && a.Status != (int)TripStatus.Canceled).Count()
                                                 //let offers = db.Offers.Count()
                                                 //let maincat = db.Categories.Where(a => a.CategoryID == null).Count()
                                                 //let cat = db.Categories.Where(a => a.CategoryID != null).Count()
                                                 //let complains = db.Complains.Count()
                                                 select new DashBoard
             {
                 // customers = customers,
                 clients = clients
                           // donetrips = Donetrips,
                           //trips = trips,
                           //offers = offers,
                           //complains = complains,
                           //admins = admins,
                           //main_category = maincat,
                           //category = cat
             }).Take(1).FirstOrDefault();
             return(View(dashbord));
         }
     }
 }
 public static FormCobros GetInstancia(DashBoard dash)
 {
     if (_instancia == null)
     {
         _instancia = new FormCobros(dash);
     }
     return(_instancia);
 }
Esempio n. 14
0
 static UserInterfaces()
 {
     Bitz.Initialise();
     DashBoard.Initialise();
     Reports.Initialise();
     Cargo.Initialise();
     Payroll.Initialise();
 }
Esempio n. 15
0
            /// <summary>
            /// Example object data used by Swagger to document the output of the webapi method
            /// </summary>
            /// <returns>DashBoard</returns>
            public object GetExamples()
            {
                IApiResponse <List <IDashBoard> > example = new ApiResponse <List <IDashBoard> >();

                example.Records      = DashBoard.GetDashBoardExample();
                example.TotalRecords = example.Records.Count;
                return(example);
            }
Esempio n. 16
0
        private void UpdateDashObject(DashBoard origin, DashBoard request)
        {
            if (!string.IsNullOrEmpty(request.Name))
            {
                origin.Name = request.Name;
            }

            origin.DateModified = DateTime.Now;
        }
Esempio n. 17
0
        public App()
        {
            InitializeComponent();

            //DependencyService.Register<MockDataStore>();

            MainPage = new DashBoard();
            //MainPage = new NavigationPage(new DashBoard());
        }
        public void gotoManageHome()
        {
            this.Show();

            DashBoard dash = new DashBoard();

            contain.Children.Clear();
            contain.Children.Add(dash);
        }
Esempio n. 19
0
        public DashBoard GetDashBoardProperties()
        {
            DashBoard db = new DashBoard();

            db.alias    = System.Web.HttpContext.Current.User.Identity.Name.Substring(System.Web.HttpContext.Current.User.Identity.Name.IndexOf("\\") + 1);
            db.fromdate = DateTime.Now.AddMonths(-1).ToString("MM/dd/yyyy");
            db.todate   = DateTime.Now.ToString("MM/dd/yyyy");
            return(db);
        }
Esempio n. 20
0
        static void Main(string[] args)
        {
            DashBoard dashBoard = DashBoard.Instance;

            InitializeDachboardSampleData(dashBoard);


            dashBoard.TraverseList();
        }
Esempio n. 21
0
        public DashdoardCoordinator(string id, DashBoard dashBoard)
        {
            _id            = id;
            this.DashBoard = dashBoard;

            Receive <GetGatewaysBoard>(msg =>
                                       Sender.Tell(dashBoard.Gateways));

            Receive <GatewayDashBoardCreated>(msg =>
            {
                if (DashBoard.Gateways.FirstOrDefault(o => o.Id == msg.Source) == null)
                {
                    DashBoard.Gateways.Add(new GatewayDashBoard(msg.Source));
                }

                Context.TellOrc(new StatusChanged());
            });

            Receive <DeviceDashBoardCreated>(msg =>
                                             GatewayExcecute(msg.Source.Gateway, g => g.Add(new DeviceDashBoard(msg.Source.Source))));

            Receive <GatewayDashBoardDroped>(msg =>
                                             DashBoard.Gateways = DashBoard.Gateways.Where(o => o.Id != msg.Source).ToList());

            Receive <DeviceDashBoardDroped>(msg =>
                                            GatewayExcecute(msg.Source.Gateway, g => g.Remove(new DeviceDashBoard(msg.Source.Source))));

            Receive <GatewayDashBoardDisconnected>(msg =>
                                                   GatewayExcecute(msg.Source, g => g.Disconnected()));

            Receive <GatewayDashBoardStarted>(msg =>
                                              GatewayExcecute(msg.Source, g => g.Start(msg.Ip)));

            Receive <GatewayDashBoardSended>(msg =>
                                             GatewayExcecute(msg.Source, g => g.Set(msg.Value)));

            Receive <GatewayDashBoardSet>(msg =>
                                          GatewayExcecute(msg.Source, g => g.Set(msg.Value)));

            Receive <GatewayDashBoardUpdate>(msg =>
                                             GatewayExcecute(msg.Source, g => g.Update(msg.Name)));

            Receive <DeviceDashBoardDisconnected>(msg =>
                                                  GatewayExcecute(msg.Source.Gateway, g => g.DeviceDisconnectd(msg.Source.Source)));

            Receive <DeviceDashBoardStarted>(msg =>
                                             GatewayExcecute(msg.Source.Gateway, g => g.DeviceStart(msg.Source.Source)));

            Receive <DeviceDashBoardSended>(msg =>
                                            GatewayExcecute(msg.Source.Gateway, g => g.DeviceSet(msg.Source.Source, msg.Value)));

            Receive <DeviceDashBoardSet>(msg =>
                                         GatewayExcecute(msg.Source.Gateway, g => g.DeviceSet(msg.Source.Source, msg.Value)));

            Receive <DeviceDashBoardUpdate>(msg =>
                                            GatewayExcecute(msg.Source.Gateway, g => g.DeviceUpdate(msg.Source.Source, msg.Name)));
        }
Esempio n. 22
0
        public long GetUserInfo(dynamic tempUser, out string UserName, out string Password, out long RoleIdd, out DashBoard lstInfo)
        {
            UserName = string.Empty;
            Password = string.Empty;
            RoleIdd  = 0;
            lstInfo  = new DashBoard();
            var res = objMotorAppDAL.IsExistsUser(tempUser, out UserName, out Password, out RoleIdd);

            return(objMotorAppDAL.GetUserInsuranceMultiple(UserName, Password, RoleIdd, out lstInfo));
        }
        public async Task <IActionResult> Create([Bind("ID,AdminName,Password")] DashBoard dashBoard)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dashBoard);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(dashBoard));
        }
Esempio n. 24
0
        private RTDE aRTDE;                  //RTDE instance, port: 30004
        public Form1()
        {
            InitializeComponent();
            // create instance of robot communication class
            aDashBoard = new DashBoard(textBox1.Text);
            aRTClient  = new RTClient(textBox1.Text);
            aRTDE      = new RTDE(System.Windows.Forms.Application.StartupPath + "\\RTDEConfig.xml", textBox1.Text);

            //aRTDE = new RTDE(@"D:\UR Work\020 VS Projects\DEMO_URSDK\DEMO_URSDK\bin\Debug\RTDEConfig.xml", textBox1.Text);
            timer1.Interval = Convert.ToInt32(textBox10.Text);
        }
Esempio n. 25
0
 public void MyTeamName(Users users, DashBoard dashboard, Team freeAgent)
 {
     if (users.TeamID != freeAgent.TeamID)
     {
         dashboard.MyTeam = team.GetTeams().Find(m => m.TeamID == users.TeamID).TeamName;
     }
     else
     {
         dashboard.MyTeam = Team.Null.TeamName;
     }
 }
Esempio n. 26
0
        private static Team NoTeamNotifications(DashBoard dashboard)
        {
            Team         freeAgent = team.GetTeams().Find(m => m.TeamName == Team.Null.TeamName);
            List <Users> getUser   = usersBLL.GetUsers().FindAll(m => m.TeamID == Team.Null.TeamID);

            getUser.AddRange(usersBLL.GetUsers().FindAll(m => m.TeamID == freeAgent.TeamID));
            dashboard.NoTeam = getUser.Count;

            dashboard.FreeAgents = getUser;
            return(freeAgent);
        }
        public IEnumerable <DBResult> getDashBDetails([FromBody] string[] UserInfo)
        {
            List <DBResult> lstDBResult = new List <DBResult>();

            try
            {
                DashBoardBAL           objDashBoardBAL = new DashBoardBAL();
                DataSet                ds              = objDashBoardBAL.getDashBDtls(UserInfo[0], UserInfo[1]);
                List <ApplicationType> lstAppType      = ds.Tables[0].ConvertToList <ApplicationType>();
                DataTable              dtList          = ds.Tables[1];
                List <DBLinks>         lstDBLinksTotal = dtList.ConvertToList <DBLinks>();
                DashBoard              objDashBoard;
                List <DashBoard>       lstDashBoard = new List <DashBoard>();
                if (dtList.Rows.Count > 0)
                {
                    var distinctValues = dtList.AsEnumerable()
                                         .Select(row => new
                    {
                        AppHead = row.Field <string>("AppHead")
                    })
                                         .Distinct();

                    DataTable      dtChlds = new DataTable();
                    List <DBLinks> lstDBLinks;
                    foreach (var item in distinctValues.ToList())
                    {
                        if (item.AppHead != null && item.AppHead != "")
                        {
                            dtChlds = dtList.Select("AppHead='" + item.AppHead + "'").CopyToDataTable();
                            if (dtChlds != null && dtChlds.Rows.Count > 0)
                            {
                                lstDBLinks         = new List <DBLinks>();
                                lstDBLinks         = dtChlds.ConvertToList <DBLinks>();
                                objDashBoard       = new DashBoard();
                                objDashBoard.head  = item.AppHead;
                                objDashBoard.items = lstDBLinks;
                                lstDashBoard.Add(objDashBoard);
                            }
                        }
                    }
                }
                DBResult objDBResult = new DBResult();
                objDBResult.AppTypeList   = lstAppType;
                objDBResult.DashBoardList = lstDashBoard;
                objDBResult.DBLinksList   = lstDBLinksTotal;
                lstDBResult.Add(objDBResult);
            }
            catch (Exception ex)
            {
                ErrorLog error = new ErrorLog();
                error.LogError("GTKSSOAPI.Controllers.DashBoardController", "getDashBDetails", ex.ToString(), UserInfo[0]);
            }
            return(lstDBResult);
        }
Esempio n. 28
0
        public void ContractExpires(Users users, DashBoard dashboard)
        {
            if (users.ContractDuration != 0)
            {
                dashboard.ContractExpires = users.ContractStart.AddDays(users.ContractDuration * 365);
            }
            TimeSpan time          = (dashboard.ContractExpires - DateTime.Now);
            string   daysRemaining = time.Days.ToString() + " Days, " + time.Hours.ToString() + " Hours, " + time.Minutes.ToString() + " Minutes";

            dashboard.DaysRemaining = daysRemaining;
        }
Esempio n. 29
0
        /// <summary>
        /// Main method
        /// </summary>
        public static void Main()
        {
            ISettingsProvider  settingsProvider  = new JsonSettingsProvider();
            IInputOutputDevice inputOutputDevice = new ConsoleInputOutputDevice();
            IPhraseProvider    phraseProvider    = new JsonPhraseProvider();
            IBoard             board             = new DashBoard();
            IFigureProvider    figureProvider    = new FigureProvider();

            new Game(settingsProvider, inputOutputDevice, phraseProvider, board, figureProvider)
            {
            }.Start();
        }
Esempio n. 30
0
    public void Start()
    {
        startUI.gameObject.SetActive(true);
        DashBoard carDB = car.dashBoard;

        carDB.enabled = false;

        startUI.button.onClick.AddListener(() =>
        {
            carDB.enabled = true;
        });
    }
Esempio n. 31
0
        private List<DashBoard> ListGroupDashboards(string groupName)
        {
            string groupId = GetGroupId(groupName);

            List<DashBoard> res = new List<DashBoard>();

            using (var httpClient = new HttpClient {BaseAddress = _baseAddress})
            {
                httpClient.DefaultRequestHeaders.TryAddWithoutValidation("authorization",
                    $"Bearer {HttpContext.Request.Cookies["Authorize"]?["access_token"]}");

                HttpResponseMessage response = httpClient.GetAsync($"beta/myorg/groups/{groupId}/dashboards").Result;
                string result = response.Content.ReadAsStringAsync().Result;

                dynamic dyn = JObject.Parse(result);

                for (int i = 0; i < dyn.value.Count; i++)
                {
                    var newD = new DashBoard
                    {
                        GroupId = groupId,
                        GroupName = groupName,
                        Id = dyn.value[i].id,
                        Name = dyn.value[i].displayName,
                        Tiles = ListTilesForDashboard(dyn.value[i].id.ToString(), groupId)
                    };
                    res.Add(newD);
                }
            }
            return res;
        }
Esempio n. 32
0
	void Awake(){
		body=rigidbody;
		originalCenterOfMass=body.centerOfMass;
		myTransform=transform;
		drivetrain= GetComponent<Drivetrain>();
		axisCarController = GetComponent <AxisCarController>();
		mouseCarcontroller = GetComponent <MouseCarController>();
		mobileCarController = GetComponent <MobileCarController>();
		brakeLights=GetComponent <BrakeLights>();
		dashBoard = myTransform.GetComponentInChildren <DashBoard>();
		steeringWheel = transform.GetComponentInChildren <SteeringWheel>();
		soundController=GetComponent<SoundController>();
		SetController(controller.ToString());
		axles=GetComponent<Axles>();
		//frontWheels=axles.frontAxle.wheels;
		//rearWheels=axles.rearAxle.wheels;
		//otherWheels=axles.otherWheels;
		//axles.allWheels=axles.axles.allWheels;
		invAllWheelsLength=1f/axles.allWheels.Length;
		fixedTimeStepScalar=0.02f/Time.fixedDeltaTime;
		invFixedTimeStepScalar=1/fixedTimeStepScalar;		
	}
Esempio n. 33
0
	public IEnumerator ChangeCar(GameObject mselectedCar){
		if(mselectedCar!=null){
			mTransform=mselectedCar.transform;
			mrigidbody = mselectedCar.GetComponent<Rigidbody>();
			carDynamics = mselectedCar.GetComponent<CarDynamics>();
			drivetrain = mselectedCar.GetComponent<Drivetrain>();
			aerodynamicResistance = mselectedCar.GetComponent<AerodynamicResistance>();
			carDebug =  mTransform.GetComponent<CarDebug>();
			carDamage = mselectedCar.GetComponent<CarDamage>();
			carController = mselectedCar.GetComponent<CarDynamics>().carController;
			dashBoard=mselectedCar.transform.GetComponentInChildren<DashBoard>();
			arcader=mselectedCar.transform.GetComponentInChildren<Arcader>();
			setup= mselectedCar.GetComponent<Setup>();
			axles=mselectedCar.GetComponent<Axles>();
			fuelTanks=mselectedCar.GetComponentsInChildren<FuelTank>();
			currentFuels=new float[fuelTanks.Length];
			
			if (setup!=null && setup.enabled==true) {while (setup.loadingSetup==true) yield return new WaitForSeconds(0.02f);}
			if (drivetrain.engineTorqueFromFile==true) drivetrain.CalcValues(factor,drivetrain.engineTorqueFromFile);
			drivetrain.engineTorqueFromFile=false;

			if (Application.isEditor && setup!=null && setup.enabled==true){
				GridEntrys = new string[] {"Engine", "Transmission", "Suspensions", "Brakes" ,"Tires", "Body", "Assistance","Save Setup"};
				entrysCount=8;
			}
			else{
				GridEntrys = new string[] {"Engine", "Transmission", "Suspensions", "Brakes" ,"Tires", "Body", "Assistance"};
				entrysCount=7;
			}			
			
			if (arcader) arcader.enabled=false;
			m_maxTorque=drivetrain.maxTorque;
			//ESP=carController.ESP;
			selectedCar=mselectedCar;
			//carDynamics.SetTiresType();
			tiresTypeFront=(int)axles.frontAxle.tires;
			tiresTypeRear=(int)axles.rearAxle.tires;
			//drivetrain.SetTransmission(drivetrain.transmission);
			transmissionType=oldTransmissionType=(int)drivetrain.transmission;
			//SetCOGPosition(carDynamics.zlocalPosition);
			
			boundingSize=carDynamics.BoundingSize(selectedCar.GetComponentsInChildren<Collider>());
			zlocalPositionLimit=0.8f*boundingSize.x/4.5f;
						
			engageRPM=drivetrain.engageRPM;
			maxRPM=(Mathf.CeilToInt(drivetrain.maxRPM/1000)+1)*1000;
			maxKmh=Mathf.RoundToInt(maxRPM*axles.frontAxle.leftWheel.radius*2*0.1885f/(drivetrain.gearRatios[drivetrain.gearRatios.Length-1]*drivetrain.finalDriveRatio)); // Mathf.PI*3.6f/60 -> 0.1885
			mass=mrigidbody.mass;
			
			StartSize = new Vector2(Screen.width, Screen.height);
			if (grid!=null) floor=(grid.height - gridHeight)/2;
			top=gridHeight+Mathf.RoundToInt(gridHeight*0.17f)+floor;
			RectCalculation(StartSize);
			ScrollRectCalculation(StartSize, drivetrain.gearRatios.Length-2);					
			factor=1;
			if (grid!=null){
				switch(GridInt) {
					case 0: ApplyEngineTorque();break;
					case 1: ApplyGears();break;
				}
			}
		}
	}