Beispiel #1
0
        public override int GetHashCode()
        {
            int hash = 2039;

            hash = hash * 1553 + State.GetHashCode();
            hash = hash * 1553 + RawCoordinates.GetHashCode();
            hash = hash * 1553 + SmoothedCoordinates.GetHashCode();
            hash = hash * 1553 + LeftEye.GetHashCode();
            hash = hash * 1553 + RightEye.GetHashCode();
            hash = hash * 1553 + TimeStamp.GetHashCode();
            hash = hash * 1553 + TimeStampString.GetHashCode();
            hash = hash * 1553 + IsFixated.GetHashCode();
            return(hash);
        }
Beispiel #2
0
        public override bool Equals(Object o)
        {
            if (ReferenceEquals(this, o))
            {
                return(true);
            }

            if (!(o is GazeData))
            {
                return(false);
            }

            var other = o as GazeData;

            return
                (State == other.State &&
                 RawCoordinates.Equals(other.RawCoordinates) &&
                 SmoothedCoordinates.Equals(other.SmoothedCoordinates) &&
                 LeftEye.Equals(other.LeftEye) &&
                 RightEye.Equals(other.RightEye) &&
                 TimeStamp == other.TimeStamp &&
                 TimeStampString.Equals(TimeStampString) &&
                 IsFixated == other.IsFixated);
        }
        public static void FindMinData(string[,] Fileholder, int Size)
        {
            Class1.ChangeMonthsToInt(ref Fileholder, Size, 1);
            string TempHolderString;            //used for temporary storage for strings
            string TimeStampString;             //used for temporary storage for strings
            double TempHolderDoub;              //used for temporary storage for double
            double TimeStampDoub;               //used for temporary storage for double

            int[] PositionHolder = new int[11]; //used to store the max values for all corrisponding values
            for (int y = 0; y < 10; y++)
            {
                //checks positions 1, 2, 6 and 7
                if (y == 1 || y == 2 || y == 6 || y == 7)
                {
                    TempHolderDoub    = Convert.ToDouble(Fileholder[y, 0]);  //stores the max vales for position choosen
                    TimeStampDoub     = Convert.ToDouble(Fileholder[10, 0]); //stores the max vales for TimeStamp choosen
                    PositionHolder[y] = 0;
                    //assigns correct values to tempholders
                    for (int i = 0; i < Size - 1; i++)
                    {
                        if (TempHolderDoub == Convert.ToDouble(Fileholder[y, 1 + i]))
                        {
                            if (TimeStampDoub > Convert.ToDouble(Fileholder[10, 1 + i]))
                            {
                                TempHolderDoub    = Convert.ToDouble(Fileholder[y, 1 + i]);  //stores the max vales for position choosen
                                TimeStampDoub     = Convert.ToDouble(Fileholder[10, 1 + i]); //stores the max vales for TimeStamp choosen
                                PositionHolder[y] = 1 + i;
                            }
                        }
                        else if (Convert.ToDouble(Fileholder[y, 1 + i]) < Convert.ToDouble(TempHolderDoub)) // checks to see if first element is bigger
                        {
                            TempHolderDoub    = Convert.ToDouble(Fileholder[y, 1 + i]);                     //stores the max vales for position choosen
                            TimeStampDoub     = Convert.ToDouble(Fileholder[10, 1 + i]);                    //stores the max vales for TimeStamp choosen
                            PositionHolder[y] = 1 + i;
                        }
                    }
                }
                else
                {
                    TempHolderString  = Fileholder[y, 0];  //stores the max vales for position choosen
                    TimeStampString   = Fileholder[10, 0]; //stores the max vales for TimeStamp choosen
                    PositionHolder[y] = 0;
                    //assigns correct values to tempholders
                    for (int i = 0; i < Size - 1; i++)
                    {
                        if (TempHolderString == Fileholder[y, 1 + i])
                        {
                            if (0 < (TimeStampString.CompareTo(Fileholder[10, 1 + i])))
                            {
                                TempHolderString  = Fileholder[y, 1 + i];  //stores the max vales for position choosen
                                TimeStampString   = Fileholder[10, 1 + i]; //stores the max vales for TimeStamp choosen
                                PositionHolder[y] = 1 + i;
                            }
                        }
                        else if (0 > (Fileholder[y, 1 + i].CompareTo(TempHolderString)))
                        {
                            TempHolderString  = Fileholder[y, 1 + i];  //stores the max vales for position choosen
                            TimeStampString   = Fileholder[10, 1 + i]; //stores the max vales for TimeStamp choosen
                            PositionHolder[y] = 1 + i;
                        }
                    }
                }
            }
            Class1.ChangeIntToMonth(ref Fileholder, Size); //chanage int to months
            string[,] Output = new string[11, 11];
            for (int i = 0; i < 11; i++)
            {
                Console.WriteLine(PositionHolder[i]);
                for (int y = 0; y < 11; y++)
                {
                    Output[y, i] = Fileholder[y, PositionHolder[i]];
                }
            }
            Class1.SendToHTML(Output, 11);
        }