Beispiel #1
0
        private void Button_Start_Click(object sender, RoutedEventArgs e)
        {
            businessLogic = new BusinessLogic();
            List <double> quantity = new List <double>();

            ShowDate.DataFile     fileData     = GetShowDataFile();
            Settings.SettingsFile fileSettings = GetSettingsFile();

            for (int i = 0; i < fileData.Data.Count; i++)
            {
                quantity.Add(Convert.ToDouble(fileData.Data[i].Clients));
            }

            dataGrid.ItemsSource = businessLogic.GetTabulatedLines(quantity, Convert.ToDouble(fileData.Data.Last().Time), fileSettings.t, fileSettings.QueueLength, fileSettings.PeriodData, fileSettings.PredictSteps,
                                                                   fileSettings.MaxCashbox, fileSettings.ServiceTime, fileSettings.RadioButton_InfiniteQueue,
                                                                   fileSettings.RadioButton_LimitedQueue, fileSettings.RadioButton_LimitedTime);
            string[] names = new[] { "№", "Время", "Посетители", "Кассы" };
            for (int column = 0; column < names.Length; column++)
            {
                dataGrid.Columns[column].Header = names[column];
            }
            //MessageBox.Show(queuingSystem.MultiChannelInfiniteQueue(1.5, 2.5, 10).ToString());

            //MessageBox.Show(queuingSystem.MultiChannelLimitedQueue((double)1/5,(double)4/9, 4, 6).ToString());
        }
Beispiel #2
0
        private Settings.SettingsFile GetSettingsFile()
        {
            Settings.SettingsFile file      = new Settings.SettingsFile();
            BinaryFormatter       formatter = new BinaryFormatter();

            using (FileStream fs = new FileStream("settings.dat", FileMode.OpenOrCreate))
            {
                if (fs.Length == 0)
                {
                    return(null);
                }
                file = (Settings.SettingsFile)formatter.Deserialize(fs);
            }
            return(file);
        }