Exemplo n.º 1
0
 public ReadingPlanningViewModelFactory(IApprovalRepository repository, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory, IPlantManagementViewModelFactory plantManagementViewModelFactory, ITaskGenerator taskGenerator)
 {
     m_Repository = repository;
     m_ResponsibleSubjectViewModelFactory = responsibleSubjectViewModelFactory;
     m_PlantManagementViewModelFactory    = plantManagementViewModelFactory;
     m_TaskGenerator = taskGenerator;
     m_Random        = new Random();
 }
Exemplo n.º 2
0
 public SeriesViewModelFactory(IWasteRepository repository, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory, IContainerViewModelFactory containerViewModelFactory,
                               ITaskGenerator taskGenerator)
 {
     m_Repository = repository;
     m_ResponsibleSubjectViewModelFactory = responsibleSubjectViewModelFactory;
     m_ContainerViewModelFactory          = containerViewModelFactory;
     m_TaskGenerator = taskGenerator;
     m_Random        = new Random();
 }
 public SeriesViewModelFactory(IMeterRepository repository, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory, IMeterViewModelFactory meterViewModelFactory,
                               ITaskGenerator taskGenerator)
 {
     m_Repository = repository;
     m_ResponsibleSubjectViewModelFactory = responsibleSubjectViewModelFactory;
     m_MeterViewModelFactory = meterViewModelFactory;
     m_TaskGenerator         = taskGenerator;
     m_Random = new Random();
 }
Exemplo n.º 4
0
        public SeriesAddViewModel(Series model, IApprovalRepository repository, IPlantManagementViewModelFactory plantManagementViewModelFactory, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory, ITaskGenerator taskGenerator)
        {
            DisplayName  = TranslationProvider.Translate("InspectionAdd");
            m_Model      = model;
            m_Repository = repository;
            m_Repository.ContextChanged         += (s, e) => Application.Current.Dispatcher.Invoke(LoadData);
            m_ResponsibleSubjectViewModelFactory = responsibleSubjectViewModelFactory;
            m_TaskGenerator = taskGenerator;

            LoadData();
        }
Exemplo n.º 5
0
 public void AddTaskGenerator(ITaskGenerator taskGenerator)
 {
     AcceptedTypes |= taskGenerator.AcceptedTypes;
     for (int i = 0; i < 30; i++)
     {
         if ((1 << i & (int)taskGenerator.AcceptedTypes) != 0)
         {
             TaskGenerators[(TaskType)(1 << i)] = taskGenerator;
         }
     }
 }
Exemplo n.º 6
0
 public SeriesAddViewModel(Series model, IWasteRepository repository, IContainerViewModelFactory containerViewModelFactory, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory,
                           ITaskGenerator taskGenerator)
 {
     DisplayName  = TranslationProvider.Translate("TitleSeriesAddViewModel");
     Model        = model;
     m_Repository = repository;
     m_ContainerViewModelFactory          = containerViewModelFactory;
     m_ResponsibleSubjectViewModelFactory = responsibleSubjectViewModelFactory;
     m_TaskGenerator = taskGenerator;
     CreateSelectableContainerViewModels(repository.Container);
     CreateResponsibleSubjectViewModels(repository.ResponsibleSubjects);
 }
Exemplo n.º 7
0
 public SeriesAddViewModel(Series model, IMeterRepository repository, IMeterViewModelFactory meterViewModelFactory, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory,
                           ITaskGenerator taskGenerator)
 {
     DisplayName             = TranslationProvider.Translate("SeriesAdd");
     Model                   = model;
     m_Repository            = repository;
     m_MeterViewModelFactory = meterViewModelFactory;
     m_ResponsibleSubjectViewModelFactory = responsibleSubjectViewModelFactory;
     m_TaskGenerator = taskGenerator;
     CreateSelectableMeterViewModels(repository.Meter);
     CreateResponsibleSubjectViewModels(repository.ResponsibleSubjects);
 }
Exemplo n.º 8
0
        public SeriesEditViewModel(Series model, IMeterRepository repository, IMeterViewModelFactory meterViewModelFactory, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory,
                                   ITaskGenerator taskGenerator, MeterReading selectedReading, IEnumerable <MeterReading> allMeterReadings)
            : base(model, repository, meterViewModelFactory, responsibleSubjectViewModelFactory, taskGenerator)
        {
            m_Repository      = repository;
            m_SelectedReading = selectedReading;
            m_MeterReadings   = allMeterReadings;

            DisplayName = TranslationProvider.Translate("SeriesEdit");
            SelectContainer();
            SelectWeekDays();
            SelectResponsibleSubject();
        }
Exemplo n.º 9
0
        public SeriesEditViewModel(Series model, IWasteRepository repository, IContainerViewModelFactory containerViewModelFactory, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory,
                                   ITaskGenerator taskGenerator, FillLevelReading selectedReading, IEnumerable <FillLevelReading> allFillLevelReadings)
            : base(model, repository, containerViewModelFactory, responsibleSubjectViewModelFactory, taskGenerator)
        {
            m_Repository        = repository;
            m_SelectedReading   = selectedReading;
            m_FillLevelReadings = allFillLevelReadings;

            DisplayName = TranslationProvider.Translate("TitleSeriesEditViewModel");

            SelectContainer();
            SelectWeekDays();
            SelectResponsibleSubject();
        }
Exemplo n.º 10
0
        public void AddTaskGenerator(ITaskGenerator taskGenerator)
        {
            AvailableTasks |= taskGenerator.AcceptedTypes;
            for (int i = 0; i < 30; i++)
            {
                if ((1 << i & (int)taskGenerator.AcceptedTypes) != 0)
                {
                    TaskGenerators[(TaskType)(1 << i)] = taskGenerator;
                }
            }

            // JIT?
            taskGenerator.GenerateTask(TaskType.None, MyTuple.Create(IntelItemType.NONE, (long)0), new Dictionary <MyTuple <IntelItemType, long>, IFleetIntelligence>(), TimeSpan.Zero, 0);
        }
        public void add_tasks_to_week(string[] tasks)
        {
            // Arrange
            _taskGeneratorMock = Substitute.For<ITaskGenerator>();
            _taskGeneratorMock.GenerateWeekTasks().Returns(tasks);

            // Act
            var scheduling = GetInstance();
            scheduling.Schedule(1);

            // Assert
            using (var package = new ExcelPackage(new FileInfo(GetWeekPath(1))))
            {
                var worksheet = package.Workbook.Worksheets[1];
                for(var i = 0 ; i < tasks.Length; i++)
                {
                    Assert.Equal(tasks[i],worksheet.Cells[i+1,1].Value);
                }
                Assert.Equal("Zadania do wykonania",worksheet.Name);
                Assert.Null(worksheet.Cells[tasks.Length + 1, 1].Value);
            }
        }
Exemplo n.º 12
0
 /// <summary>
 ///     Constructor of the class
 /// </summary>
 /// <param name="serializer">Serializer</param>
 /// <param name="algorithmProvider">Algorithm Provider</param>
 /// <param name="taskGenerator">Task Generator</param>
 public MainWindowViewModel(ISerializer serializer, IAlgorithmProvider algorithmProvider, ITaskGenerator taskGenerator)
 {
     _serializer        = serializer;
     _algorithmProvider = algorithmProvider;
     _taskGenerator     = taskGenerator;
 }
Exemplo n.º 13
0
        public ReadingPlanningViewModel(ISeriesViewModelFactory seriesViewModelFactory, IMeterReadingViewModelFactory readingViewModelFactory, IMeterViewModelFactory meterViewModelFactory,
                                        IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory, IMeterRepository contextRepository, ITaskGenerator taskGenerator)
        {
            m_Repository                 = contextRepository;
            m_SeriesViewModelFactory     = seriesViewModelFactory;
            m_ReadingViewModelFactory    = readingViewModelFactory;
            m_Repository.ContextChanged += (s, e) => Application.Current.Dispatcher.Invoke(Reload);
            Reload();

            LocalizeDictionary.Instance.PropertyChanged += delegate(object sender, PropertyChangedEventArgs args)
            {
                if (args.PropertyName == "Culture")
                {
                    if (m_Calendar != null)
                    {
                        m_Calendar.Refresh();
                    }
                }
            };

            FlyoutActivated = true;
        }
 public PerformanceTests()
 {
     _serializer        = new Serializer();
     _algorithmProvider = new AlgorithmProvider();
     _taskGenerator     = new TaskGenerator(_serializer, _algorithmProvider);
 }
Exemplo n.º 15
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="taskGenerator">TaskGenerator</param>
 public GenerateAndComputeCommand(ITaskGenerator taskGenerator)
 {
     _taskGenerator = taskGenerator;
 }
Exemplo n.º 16
0
        public SeriesEditViewModel(Series model, IApprovalRepository repository, IPlantManagementViewModelFactory plantManagementViewModelFactory, IResponsibleSubjectViewModelFactory responsibleSubjectViewModelFactory, ITaskGenerator taskGenerator, Approval_Inspection selectedInspection, IEnumerable <Approval_Inspection> allInspections) : base(model, repository, plantManagementViewModelFactory, responsibleSubjectViewModelFactory, taskGenerator)
        {
            m_Repository         = repository;
            m_SelectedInspection = selectedInspection;
            m_AllInspections     = allInspections;

            DisplayName = TranslationProvider.Translate("InspectionEdit");

            SelectResponsibleSubject();
            SelectWeekDays();
            SelectAuxillaryConditions();
        }
Exemplo n.º 17
0
 public NewWeekSchedulingExcel(ITaskGenerator taskGenerator)
 {
     _taskGenerator = taskGenerator;
 }
        public NewWeekSchedulingExcel GetInstance()
        {
            if(_taskGeneratorMock == null)
                _taskGeneratorMock = new TaskGenerator();

            return new NewWeekSchedulingExcel(_taskGeneratorMock);
        }
Exemplo n.º 19
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="taskGenerator">TaskGenerator</param>
 public GenerateGraphCommand(ITaskGenerator taskGenerator)
 {
     _taskGenerator = taskGenerator;
 }