public MeterReadingViewModel(MeterReading model, MeterViewModel meterViewModel, SeriesViewModel relatedSeriesViewModel)
        {
            m_Model                         = model;
            m_MeterViewModel                = meterViewModel;
            m_RelatedSeriesViewModel        = relatedSeriesViewModel;
            m_AppointmentResponsibleSubject = model.AppointmentResponsibleSubject;
            m_Model.PropertyChanged        += OnModelPropertyChanged;
            m_Model.RelatedSeries.SeriesColor.PropertyChanged += OnSeriesColorPropertyChanged;
            m_Model.RelatedSeries.PropertyChanged             += OnRelatedSeriesPropertyChanged;
            m_Model.DueDate.PropertyChanged += OnDueDatePropertyChanged;
            var color = Color.FromRgb(m_Model.RelatedSeries.SeriesColor.R, m_Model.RelatedSeries.SeriesColor.G, m_Model.RelatedSeries.SeriesColor.B);

            SeriesColor     = new SolidColorBrush(color);
            m_CalendarEntry = new CalendarEntry(m_Model.DueDate.Begin, m_Model.DueDate.End, m_Model.ReadingMeter.Number, color, m_Model.DueDate.IsAllDay, this);
        }
Exemplo n.º 2
0
        public InspectionViewModel(Approval_Inspection model, SeriesViewModel seriesViewModel, IEnumerable <Plant> plants)
        {
            m_Model = model;
            m_RelatedSeriesViewModel = seriesViewModel;
            m_ResponsibleSubject     = model.AppointmentResponsibleSubject;
            m_Model.PropertyChanged += OnModelPropertyChanged;
            m_Model.RelatedSeries.SeriesColor.PropertyChanged += OnSeriesColorPropertyChanged;
            m_Model.RelatedSeries.PropertyChanged             += OnRelatedSeriesPropertyChanged;
            m_Model.DueDate.PropertyChanged += OnDueDatePropertyChanged;
            var color = Color.FromRgb(m_Model.RelatedSeries.SeriesColor.R, m_Model.RelatedSeries.SeriesColor.G, m_Model.RelatedSeries.SeriesColor.B);

            SeriesColor     = new SolidColorBrush(color);
            m_CalendarEntry = new CalendarEntry(m_Model.DueDate.Begin, m_Model.DueDate.End, null, color, m_Model.DueDate.IsAllDay, this);
            m_Plants        = plants;
        }
Exemplo n.º 3
0
 private AirportBasedFlight CreateAirportBasedFlight(string name, string description, string tag, string iconId, DateTime start, DateTime finish, ICollection <AirportPosition> airports = null,
                                                     ResponsibleSubject responsibleSubject = null)
 {
     return(new AirportBasedFlight
     {
         Name = name,
         Description = description,
         Tag = tag,
         IconId = iconId,
         Start = start,
         Finish = finish,
         Airports = airports,
         ResponsibleSubject = responsibleSubject
     });
 }
Exemplo n.º 4
0
        public static MeterReading CreateMeterReading(DateTime dueDateBegin, DateTime dueDateEnd, DateTime entryDateBegin, DateTime entryDateEnd, double counterReading,
                                                      ResponsibleSubject appointmentResponsibleSubject, Meter readingMeter, Series series)
        {
            var dueDateAppointment   = AppointmentModelFactory.CreateAppointment(dueDateBegin, dueDateEnd, series.IsAllDay);
            var entryDateAppointment = AppointmentModelFactory.CreateAppointment(entryDateBegin, entryDateEnd, series.IsAllDay);

            return(new MeterReading
            {
                AppointmentResponsibleSubject = appointmentResponsibleSubject,
                DueDate = dueDateAppointment,
                EntryDate = entryDateAppointment,
                CounterReading = counterReading,
                ReadingMeter = readingMeter,
                RelatedSeries = series
            });
        }
Exemplo n.º 5
0
        public static FillLevelReading CreateFillLevelReading(DateTime dueDateBegin, DateTime dueDateEnd, DateTime entryDateBegin, DateTime entryDateEnd, float progress,
                                                              ResponsibleSubject appointmentResponsibleSubject, ResponsibleSubject entryResponsibleSubject, WasteContainer readingContainer, Series series)
        {
            var dueDateAppointment   = AppointmentModelFactory.CreateAppointment(dueDateBegin, dueDateEnd, series.IsAllDay);
            var entryDateAppointment = AppointmentModelFactory.CreateAppointment(entryDateBegin, entryDateEnd, series.IsAllDay);

            return(new FillLevelReading
            {
                AppointmentResponsibleSubject = appointmentResponsibleSubject,
                DueDate = dueDateAppointment,
                EntryResponsibleSubject = entryResponsibleSubject,
                EntryDate = entryDateAppointment,
                Progress = progress,
                ReadingContainer = readingContainer,
                RelatedSeries = series
            });
        }
Exemplo n.º 6
0
 private Flight CreateFlight(string name, string description, string tag, string iconId, DateTime start, DateTime finish, int kilometrage = 0, FlightRange flightRange = FlightRange.Kurzstrecke,
                             bool radiativeForcing = false, ResponsibleSubject responsibleSubject = null)
 {
     return(new Flight
     {
         Name = name,
         Description = description,
         Tag = tag,
         IconId = iconId,
         Start = start,
         Finish = finish,
         FlightType = flightRange,
         Kilometrage = kilometrage,
         RadiativeForcing = radiativeForcing,
         ResponsibleSubject = responsibleSubject
     });
 }
Exemplo n.º 7
0
        public FillLevelReadingViewModel(FillLevelReading model, ContainerViewModel containerViewModel, SeriesViewModel relatedSeriesViewModel)
        {
            m_Model = model;
            m_ContainerViewModel            = containerViewModel;
            m_RelatedSeriesViewModel        = relatedSeriesViewModel;
            m_AppointmentResponsibleSubject = model.AppointmentResponsibleSubject;
            m_Model.PropertyChanged        += OnModelPropertyChanged;
            m_Model.RelatedSeries.SeriesColor.PropertyChanged += OnSeriesColorPropertyChanged;
            m_Model.RelatedSeries.PropertyChanged             += OnRelatedSeriesPropertyChanged;
            m_Model.DueDate.PropertyChanged += OnDueDatePropertyChanged;
            DisplayName = TranslationProvider.Translate("TitleFillLevelReadingViewModel");

            var color = Color.FromRgb(m_Model.RelatedSeries.SeriesColor.R, m_Model.RelatedSeries.SeriesColor.G, m_Model.RelatedSeries.SeriesColor.B);

            SeriesColor     = new SolidColorBrush(color);
            m_CalendarEntry = new CalendarEntry(m_Model.DueDate.Begin, m_Model.DueDate.End, m_Model.ReadingContainer.Name, color, m_Model.DueDate.IsAllDay, this);
        }
Exemplo n.º 8
0
 private FullyQualifiedCar CreateFullyQualifiedCar(string name, string description, string tag, string iconId, DateTime start, DateTime finish, int kilometrage = 0, int carId = 1,
                                                   double consumption = 0, ResponsibleSubject responsibleSubject = null)
 {
     return(new FullyQualifiedCar
     {
         Name = name,
         Description = description,
         Tag = tag,
         IconId = iconId,
         Start = start,
         Finish = finish,
         Kilometrage = kilometrage,
         Consumption = consumption,
         CarId = carId,
         ResponsibleSubject = responsibleSubject
     });
 }
Exemplo n.º 9
0
 private Car CreateCar(string name, string description, string tag, string iconId, DateTime start, DateTime finish, int kilometrage = 0, double consumption = 0, double carbonProduction = 0,
                       Fuel fuelType = Fuel.Diesel, ResponsibleSubject responsibleSubject = null)
 {
     return(new Car
     {
         Name = name,
         Description = description,
         Tag = tag,
         IconId = iconId,
         Start = start,
         Finish = finish,
         Kilometrage = kilometrage,
         CarbonProduction = carbonProduction,
         Fuel = fuelType,
         Consumption = consumption,
         ResponsibleSubject = responsibleSubject
     });
 }
Exemplo n.º 10
0
 public static EnergyMeasure CreateMeasure(string name, string description, string evaluation, DateTime?entryDate,
                                           DateTime dueDate, ResponsibleSubject responsibleSubject, int status, int priority,
                                           DateTime creationDate, double rating, MeasureImageSource imageSource = null,
                                           ICollection <Document> attachedDocuments = null)
 {
     return(new EnergyMeasure
     {
         Name = name,
         Description = description,
         Evaluation = evaluation,
         EntryDate = entryDate,
         DueDate = dueDate,
         ResponsibleSubject = responsibleSubject,
         Status = status,
         Priority = priority,
         CreationDate = creationDate,
         MeasureImageSource = imageSource,
         AttachedDocuments = attachedDocuments,
         EvaluationRating = rating
     });
 }
Exemplo n.º 11
0
 public CarbonFootprintPosition CreatePredefinedPosition(ResponsibleSubject responsibleSubject = null)
 {
     return(CreateAirportBasedFlight("Linienflug", "Stellt eine Flugkonfiguration basierend auf Linienflügen bereit.", "Flüge", "CfFlight.png", DateTime.Now, DateTime.Now.AddYears(1),
                                     new Collection <AirportPosition>
     {
         new AirportPosition
         {
             Order = 1,
             AirportID = 12243
         },
         new AirportPosition
         {
             Order = 2,
             AirportID = 57
         },
         new AirportPosition
         {
             Order = 3,
             AirportID = 124
         }
     }, responsibleSubject));
 }
 public ResponsibleSubjectViewModel(ResponsibleSubject model)
 {
     m_Model = model;
 }
Exemplo n.º 13
0
 private PublicTransport CreatePublicTransport(string name, string description, string tag, string iconId, DateTime start, DateTime finish, int kilometrage = 0,
                                               TransportType transportType = TransportType.Linienbus, ResponsibleSubject responsibleSubject = null)
 {
     return(new PublicTransport
     {
         Name = name,
         Description = description,
         Tag = tag,
         IconId = iconId,
         Start = start,
         Finish = finish,
         TransportType = transportType,
         Kilometrage = kilometrage,
         ResponsibleSubject = responsibleSubject
     });
 }
Exemplo n.º 14
0
        public IEnumerable <MeterReading> GenerateMeterReadings(DomainModelService.Meter meter, ResponsibleSubject responsibleSubject, Series series, DayOfWeek[] weekDays)
        {
            var taskGeneratorConfig = new TaskGeneratorConfig();

            taskGeneratorConfig.Meter              = meter;
            taskGeneratorConfig.Series             = series;
            taskGeneratorConfig.ResponsibleSubject = responsibleSubject;
            taskGeneratorConfig.WeekDays           = weekDays;

            taskGeneratorConfig.Begin               = series.Begin;
            taskGeneratorConfig.End                 = series.End;
            taskGeneratorConfig.Repeat              = series.Repeat;
            taskGeneratorConfig.RecurrenceInterval  = series.RecurrenceInterval;
            taskGeneratorConfig.EndsWithDate        = series.EndsWithDate;
            taskGeneratorConfig.RepeatUntilDate     = series.RepeatUntilDate;
            taskGeneratorConfig.NumberOfRecurrences = series.NumberOfRecurrences;
            taskGeneratorConfig.IsWeekdayRecurrence = series.IsWeekdayRecurrence;
            taskGeneratorConfig.IsAllDay            = series.IsAllDay;
            taskGeneratorConfig.Cycle               = series.Cycle;

            return(GenerateMeterReadings(taskGeneratorConfig));
        }
Exemplo n.º 15
0
 private MeterReading CreateFillLevelReading(DateTime begin, DateTime end, bool isAllDay, DomainModelService.Meter meter, ResponsibleSubject responsibleSubject, Series relatedSeries)
 {
     return(new MeterReading
     {
         DueDate = new Appointment
         {
             Begin = begin,
             End = end,
             IsAllDay = isAllDay
         },
         RelatedSeries = relatedSeries,
         AppointmentResponsibleSubject = responsibleSubject,
         ReadingMeter = meter
     });
 }
Exemplo n.º 16
0
 private FillLevelReading CreateFillLevelReading(DateTime begin, DateTime end, bool isAllDay, WasteContainer container, ResponsibleSubject responsibleSubject, Series relatedSeries)
 {
     return(new FillLevelReading
     {
         DueDate = new Appointment
         {
             Begin = begin,
             End = end,
             IsAllDay = isAllDay
         },
         RelatedSeries = relatedSeries,
         AppointmentResponsibleSubject = responsibleSubject,
         ReadingContainer = container
     });
 }
 ResponsibleSubjectViewModel IResponsibleSubjectViewModelFactory.CreateFromExisting(ResponsibleSubject model)
 {
     return(new ResponsibleSubjectViewModel(model));
 }
 public ResponsibleSubjectViewModel CreateFromExisting(ResponsibleSubject model)
 {
     return(new ResponsibleSubjectViewModel(model));
 }
Exemplo n.º 19
0
 public CarbonFootprintPosition CreatePosition(string name, string description, string tag, string iconId, DateTime start, DateTime finish, ResponsibleSubject responsibleSubject = null)
 {
     return(CreateMachineEnergyConsumption(name, description, tag, iconId, start, finish));
 }
Exemplo n.º 20
0
 public CarbonFootprintPosition CreatePredefinedPosition(ResponsibleSubject responsibleSubject = null)
 {
     return(CreatePublicTransport("Öffentlicher Verkehr", "Stellt den öffentlichen Verkehr bereit.", "Öffentlicher Verkehr", "CfPublicTransport.png", DateTime.Now, DateTime.Now.AddYears(1), 300100,
                                  TransportType.Reisebus, responsibleSubject));
 }
Exemplo n.º 21
0
 public InvestmentPlan CreateInvestPlan(string investmentName, string description, ResponsibleSubject responsibleSubject, DateTime startYear, float imputedInterestRate, float otherCostsChangePA,
                                        float otherRevenueChangePA, ICollection <Comparison> comparisons, int lifetime, float investmentSum, float recoveryValueToday, float recoveryValueAfterLifetime, float energyCostsAnnual,
                                        float energyCostsChangePA, float otherCostsPA, float otherRevenuePA)
 {
     return(new InvestmentPlan()
     {
         InvestmentName = investmentName,
         Description = description,
         ResponsibleSubject = responsibleSubject,
         StartYear = startYear,
         ImputedInterestRate = imputedInterestRate,
         OtherCostsChangePA = otherCostsChangePA,
         OtherRevenueChangePA = otherRevenueChangePA,
         Comparisons = comparisons,
         Lifetime = lifetime,
         InvestmentSum = investmentSum,
         RecoveryValueToday = recoveryValueToday,
         RecoveryValueAfterLifetime = recoveryValueAfterLifetime,
         EnergyCostsAnnual = energyCostsAnnual,
         EnergyCostsChangePA = energyCostsChangePA,
         OtherCostsPA = otherCostsPA,
         OtherRevenuePA = otherRevenuePA
     });
 }
Exemplo n.º 22
0
 public Inspection CreateInspection(String name, DateTime productionDate, DateTime inspectionDate, int productionShift, int inspectionShift, int inspectionType, int inspectionFrequencyOrSampleSize,
                                    string inspectionFrequencyUnit, int totalAmount, string description, ResponsibleSubject responsibleSubject, ProductionItem productionItem, ICollection <DiscardItem> discardItems, bool finished)
 {
     return(new Inspection()
     {
         Name = name,
         ProductionDate = productionDate,
         InspectionDate = inspectionDate,
         ProductionShift = productionShift,
         InspectionShift = inspectionShift,
         InspectionType = inspectionType,
         SampleSize = inspectionFrequencyOrSampleSize,
         Unit = inspectionFrequencyUnit,
         TotalAmount = totalAmount,
         Description = description,
         ResponsibleSubject = responsibleSubject,
         ProductionItem = productionItem,
         DiscardItems = discardItems,
         Finished = finished
     });
 }
Exemplo n.º 23
0
 public CarbonFootprintPosition CreatePredefinedPosition(ResponsibleSubject responsibleSubject = null)
 {
     return(CreateMachineEnergyConsumption("Maschinenverbrauch", "Stellt den Energieverbrauch von Maschinen(-zuständen) dar.", "Energieverbrauch", "CfSite.png", DateTime.Now, DateTime.Now.AddYears(1),
                                           EnergySource.Ecostrom, 1000, 100, 2000, 250, 0, responsibleSubject));
 }
Exemplo n.º 24
0
 public CarbonFootprintPosition CreatePosition(string name, string description, string tag, string iconId, DateTime start, DateTime finish, ResponsibleSubject responsibleSubject = null)
 {
     return(CreateAirportBasedFlight(name, description, tag, iconId, start, finish));
 }
Exemplo n.º 25
0
 public CarbonFootprintPosition CreatePredefinedPosition(ResponsibleSubject responsibleSubject = null)
 {
     return(CreateFlight("Flug", "Stellt einen Flug mit manuellen Eingaben dar.", "Flüge", "CfFlight.png", DateTime.Now, DateTime.Now.AddYears(1), 3000, FlightRange.Mittelstrecke, false,
                         responsibleSubject));
 }
Exemplo n.º 26
0
 public CarbonFootprintPosition CreatePredefinedPosition(ResponsibleSubject responsibleSubject = null)
 {
     return(CreateCar("Fahrzeug", "Stellt ein Fahrzeug für die individuelle Personenbeförderung dar.", "Fahrzeuge", "CfCar.png", DateTime.Now, DateTime.Now.AddYears(1), 2000, 10.2, 120, Fuel.Benzin,
                      responsibleSubject));
 }
Exemplo n.º 27
0
 private EnergyConsumption CreateEnergyConsumption(string name, string description, string tag, string iconId, DateTime start, DateTime finish, double consumption = 0,
                                                   EnergySource energySource = EnergySource.Strommix, double carbonProduction = 0, ResponsibleSubject responsibleSubject = null)
 {
     return(new EnergyConsumption
     {
         Name = name,
         Description = description,
         Tag = tag,
         IconId = iconId,
         Start = start,
         Finish = finish,
         Consumption = consumption,
         EnergySource = energySource,
         CarbonProduction = carbonProduction,
         ResponsibleSubject = responsibleSubject
     });
 }
Exemplo n.º 28
0
        private Approval_Inspection CreateInspection(DateTime begin, DateTime end, bool isAllDay, ObservableCollection <ConditionInspection> conditionInspections, ResponsibleSubject responsibleSubject, Series relatedSeries)
        {
            Approval_Inspection result = new Approval_Inspection();

            foreach (var conditionInspection in conditionInspections)
            {
                var ci = new ConditionInspection();
                ci.EntryDate            = DateTime.Now;
                ci.AuxillaryConditionId = conditionInspection.AuxillaryConditionId;
                result.ConditionInspections.Add(ci);
            }

            result.DueDate = new Appointment
            {
                Begin    = begin,
                End      = end,
                IsAllDay = isAllDay
            };

            result.Progress      = 0.0f;
            result.RelatedSeries = relatedSeries;
            result.AppointmentResponsibleSubject = responsibleSubject;

            return(result);
        }
Exemplo n.º 29
0
        public IEnumerable <Approval_Inspection> GenerateInspections(ObservableCollection <ConditionInspection> conditionInspections, ResponsibleSubject responsibleSubject, Series series, DayOfWeek[] weekDays)
        {
            var taskGeneratorConfig = new TaskGeneratorConfig();

            taskGeneratorConfig.ConditionInspections = conditionInspections;

            taskGeneratorConfig.Series             = series;
            taskGeneratorConfig.ResponsibleSubject = responsibleSubject;
            taskGeneratorConfig.WeekDays           = weekDays;

            taskGeneratorConfig.Begin               = series.Begin;
            taskGeneratorConfig.End                 = series.End;
            taskGeneratorConfig.Repeat              = series.Repeat;
            taskGeneratorConfig.RecurrenceInterval  = series.RecurrenceInterval;
            taskGeneratorConfig.EndsWithDate        = series.EndsWithDate;
            taskGeneratorConfig.RepeatUntilDate     = series.RepeatUntilDate;
            taskGeneratorConfig.NumberOfRecurrences = series.NumberOfRecurrences;
            taskGeneratorConfig.IsWeekdayRecurrence = series.IsWeekdayRecurrence;
            taskGeneratorConfig.IsAllDay            = series.IsAllDay;
            taskGeneratorConfig.Cycle               = series.Cycle;

            return(GenerateInspections(taskGeneratorConfig));
        }
Exemplo n.º 30
0
 private MachineEnergyConsumption CreateMachineEnergyConsumption(string name, string description, string tag, string iconId, DateTime start, DateTime finish,
                                                                 EnergySource energySource = EnergySource.Strommix, double hoursInStandbyState = 0, double consumptionPerHourForStandby   = 0, double hoursInProcessingState = 0,
                                                                 double consumptionPerHourForProcessing = 0, double carbonProduction           = 0, ResponsibleSubject responsibleSubject = null)
 {
     return(new MachineEnergyConsumption
     {
         Name = name,
         Description = description,
         Tag = tag,
         IconId = iconId,
         Start = start,
         Finish = finish,
         EnergySource = energySource,
         HoursInStandbyState = hoursInStandbyState,
         HoursInProcessingState = hoursInProcessingState,
         ConsumptionPerHourForProcessing = consumptionPerHourForProcessing,
         ConsumptionPerHourForStandby = consumptionPerHourForStandby,
         CarbonProduction = carbonProduction,
         ResponsibleSubject = responsibleSubject
     });
 }