Beispiel #1
0
 public override void Init()
 {
     stats = StatGenerator.Stats;
     strengthRenderer.sprite     = StatGenerator.DigitToSprite(stats.Strength);
     dexterityRenderer.sprite    = StatGenerator.DigitToSprite(stats.Dexterity);
     intelligenceRenderer.sprite = StatGenerator.DigitToSprite(stats.Intelligence);
     DisableRealSprite();
 }
        static async Task Main(string[] args)
        {
            StatGenerator statGenerator = new StatGenerator();

            InformationHere informationHere = await StatGenerator.GetStatAsync();

            Console.WriteLine(informationHere.total_cases);

            //Console.WriteLine($"{statGenerator.ToString()}");
        }
Beispiel #3
0
        public override void Init()
        {
            base.Init();
            frontRenderer.sprite = StatGenerator.GetSprite(Parts.ARM);
            frontRenderer.color  = StatGenerator.GetColor(stats);
            int number;

            shadowSprite.sprite = ItemImageSource.GetShadowArm(out number);
            realSprite.sprite   = ItemImageSource.GetArm(number);
        }
        private async void DoStats(DateTimeOffset date)
        {
            var averageQueueSize = await StatGenerator.AverageQueueSize(date);

            var averageWaitTime = await StatGenerator.AverageWaitTime(date);

            var jobResponseRate = await StatGenerator.JobResponseRate(date);

            var queueEmptyTime = await StatGenerator.QueueEmptyTime(date);

            //var technicianIdleTime = await StatGenerator.TechnicianIdleTime(date);

            AverageWaitTime.Text  = averageWaitTime.ToString("0.00") + " hour(s)";
            AverageQueueSize.Text = averageQueueSize.ToString("0.00") + " job(s)";
            JobResponseRate.Text  = jobResponseRate.ToString() + " jobs(s)";
            EmptyQueueTime.Text   = queueEmptyTime.ToString("0.00") + "%";

            List <Technician> technicians = await WebApiHelper.Get <Technician>();

            ObservableCollection <IdleTechnician> idleTechnicians = new ObservableCollection <IdleTechnician>();
            Random random = new Random();

            foreach (var tech in technicians)
            {
                if (IsMonth)
                {
                    idleTechnicians.Add(new IdleTechnician
                    {
                        idleHours = (int)(random.NextDouble() * 160),
                        t         = tech
                    });
                }
                else
                {
                    idleTechnicians.Add(new IdleTechnician
                    {
                        idleHours = (int)(random.NextDouble() * 8),
                        t         = tech
                    });
                }
            }
            TechnicianList.DataSource = idleTechnicians;
            TechnicianList.DataBind();
        }
Beispiel #5
0
        public void ReloadData()
        {
            Data.FrameRate         = OriginalFrameRate;
            Data.UnitsToMilimeters = UnitsToMm;
            Data.StartFrame        = StartFrame;
            Data.EndFrame          = EndFrame;
            Data.GenerateResults();
            MaxVelocity               = Data.MaxSpeed;
            MaxCentroidVelocity       = Data.MaxCentroidSpeed;
            MaxAngularVelocity        = Data.MaxAngularVelocty;
            AverageVelocity           = Data.AverageVelocity;
            AverageCentroidVelocity   = Data.AverageCentroidVelocity;
            AverageAngularVelocity    = Data.AverageAngularVelocity;
            DistanceTravelled         = Data.DistanceTravelled;
            CentroidDistanceTravelled = Data.CentroidDistanceTravelled;

            StatGenerator stat = new StatGenerator();

            stat.StartFrame        = StartFrame;
            stat.EndFrame          = EndFrame;
            stat.SmoothingFunction = SelectedSmoothingFunction;
            stat.SmoothRepeats     = RepeatSmooths;
            stat.UseDft            = UseDft;
            stat.Generate(Data.Results, OriginalFrameRate);

            LeftWhiskerAmplitude               = stat.LeftWhiskerAmplitude;
            RightWhiskerAmplitude              = stat.RightWhiskerAmplitude;
            LeftWhiskerAvgAngularVelocity      = stat.LeftAverageAngularVelocity;
            RightWhiskerAvgAngularVelocity     = stat.RightAverageAngularVelocity;
            LeftWhiskerAvgProtractionVelocity  = stat.LeftAverageProtractionVelocity;
            RightWhiskerAvgProtractionVelocity = stat.RightAverageProtractionVelocity;
            LeftWhiskerAvgRetractionVelocity   = stat.LeftAverageRetractionVelocity;
            RightWhiskerAvgRetractionVelocity  = stat.RightAverageRetractionVelocity;
            LeftWhiskerFrequency               = stat.LeftWhiskerFrequency;
            RightWhiskerFrequency              = stat.RightWhiskerFrequnecy;
            LeftWhiskerMeanOffset              = stat.LeftMeanOffset;
            RightWhiskerMeanOffset             = stat.RightMeanOffset;

            UpdateSmoothing();
        }
Beispiel #6
0
        public void LoadData(IMouseDataExtendedResult data)
        {
            StartFrame = 0;
            KeyValuePair <int, ISingleFrameExtendedResults> kvp = data.Results.FirstOrDefault(x => x.Value.HeadPoints == null);

            if (kvp.Equals(default(KeyValuePair <int, ISingleFrameExtendedResults>)))
            {
                EndFrame = data.Results.Count;
            }
            else
            {
                EndFrame = kvp.Key;
            }

            RepeatSmooths             = 1;
            Data                      = data;
            MaxVelocity               = data.MaxSpeed;
            MaxCentroidVelocity       = data.MaxCentroidSpeed;
            MaxAngularVelocity        = data.MaxAngularVelocty;
            AverageVelocity           = data.AverageVelocity;
            AverageCentroidVelocity   = data.AverageCentroidVelocity;
            AverageAngularVelocity    = data.AverageAngularVelocity;
            DistanceTravelled         = data.DistanceTravelled;
            CentroidDistanceTravelled = data.CentroidDistanceTravelled;
            OriginalFrameRate         = data.FrameRate;
            UnitsToMm                 = data.UnitsToMilimeters;

            StatGenerator stat = new StatGenerator();

            stat.StartFrame        = StartFrame;
            stat.EndFrame          = EndFrame;
            stat.SmoothingFunction = SelectedSmoothingFunction;
            stat.UseDft            = UseDft;
            stat.SmoothRepeats     = RepeatSmooths;

            stat.Generate(data.Results, OriginalFrameRate);

            IWhiskerAverageAngles angles = new WhiskerAverageAngles();

            angles.StartFrame = 0;
            angles.EndFrame   = data.Results.Count - 1;
            var allAngles = angles.GetWhiskerAngles(data.Results);

            LoadData(allAngles[0], allAngles[1]);


            LeftWhiskerAmplitude               = stat.LeftWhiskerAmplitude;
            RightWhiskerAmplitude              = stat.RightWhiskerAmplitude;
            LeftWhiskerAvgAngularVelocity      = stat.LeftAverageAngularVelocity;
            RightWhiskerAvgAngularVelocity     = stat.RightAverageAngularVelocity;
            LeftWhiskerAvgProtractionVelocity  = stat.LeftAverageProtractionVelocity;
            RightWhiskerAvgProtractionVelocity = stat.RightAverageProtractionVelocity;
            LeftWhiskerAvgRetractionVelocity   = stat.LeftAverageRetractionVelocity;
            RightWhiskerAvgRetractionVelocity  = stat.RightAverageRetractionVelocity;
            LeftWhiskerFrequency               = stat.LeftWhiskerFrequency;
            RightWhiskerFrequency              = stat.RightWhiskerFrequnecy;
            LeftWhiskerMeanOffset              = stat.LeftMeanOffset;
            RightWhiskerMeanOffset             = stat.RightMeanOffset;

            UpdateSmoothing();
        }
Beispiel #7
0
 public StatsController()
 {
     statGenerator = new StatGenerator();
 }