Exemple #1
0
        public void SetProfile(TSProfilePoint[] profile)
        {
            tsp = new TSProfilePoint[profile.Length];
            Array.Copy(profile, tsp, profile.Length);

            Zmin = tsp[0].Z;
            Zmax = tsp[tsp.Length - 1].Z;

            double tmax = tsp[0].T;
            double tmin = tmax;
            double smax = tsp[0].S;
            double smin = smax;

            for (int i = 1; i < tsp.Length; i++)
            {
                if (tsp[i].T > tmax)
                {
                    tmax = tsp[i].T;
                }

                if (tsp[i].T < tmin)
                {
                    tmin = tsp[i].T;
                }

                if (tsp[i].S > smax)
                {
                    smax = tsp[i].S;
                }

                if (tsp[i].S < smin)
                {
                    smin = tsp[i].S;
                }
            }

            Tmax = tmax;
            Tmin = tmin;
            Smax = smax;
            Smin = smin;

            tRange = Convert.ToSingle(Math.Abs(Tmax - Tmin));
            sRange = Convert.ToSingle(Math.Abs(Smax - Smin));
            tStep  = tRange / tsTicks;
            sStep  = sRange / tsTicks;

            if (tsp.Length <= 30)
            {
                ZTicks = tsp.Length;
            }
            else
            {
                ZTicks = 10;
            }

            //ZStep = FitAxisStep(Zmax - Zmin) / ZTicks;
            ZStep = FitAxisStepByRange(Zmax - Zmin);

            ProfileChangedEvent.Rise(this, new EventArgs());
        }
Exemple #2
0
        public static void OnWindowLoaded()
        {
            if (LastProfile == null)
            {
                LastProfile = Options.DEFAULT_SETTINGS_FILENAME;
            }

            Options.Load(LastProfile, Options.CurrentOptions);
            ProfileChangedEvent?.Invoke(LastProfile);
        }
        private static void PlayerInitialized( PlayerMobile player )
        {
            if ( !_linkedProfiles.ContainsKey( player.Serial ) )
            {
                return;
            }

            string profile = _linkedProfiles[player.Serial];

            Engine.Dispatcher.Invoke( () =>
            {
                Options.Save( Options.CurrentOptions );
                Options.CurrentOptions = new Options { Name = profile };
                Options.Load( profile, Options.CurrentOptions );
                ProfileChangedEvent?.Invoke( profile );
            } );
        }