123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- using System;
- using System.Collections.Generic;
- using System.Linq.Expressions;
- using System.Windows.Controls;
- using System.Windows.Input;
- using Comal.Classes;
- using Comal.Stores;
- using InABox.Core;
- using InABox.Wpf;
- using Syncfusion.UI.Xaml.Maps;
- using System.ComponentModel;
- using System.Linq;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using Geocoding;
- using InABox.WPF;
- using Microsoft.Xaml.Behaviors.Core;
- using net.sf.mpxj;
- using Brush = System.Drawing.Brush;
- using Location = InABox.Core.Location;
- namespace PRSDesktop
- {
- public class EquipmentThumbnailConverter : AbstractConverter<Guid, BitmapImage?>
- {
-
- public static Dictionary<Guid, BitmapImage?> Cache { get; set; } = new ();
-
- public override BitmapImage? Convert(Guid value)
- {
- if (Cache?.TryGetValue(value, out var result) == true)
- return result;
- return null;
- }
- }
-
- public class EquipmentColorConverter : AbstractConverter<Equipment?, System.Windows.Media.Brush>
- {
-
- public static GPSTrackerLocation[] Pings { get; set; }
-
- public override System.Windows.Media.Brush Convert(Equipment? value)
- {
- if (value != null)
- {
- if (Pings?.Any(x=>x.Tracker.ID == value.TrackerLink.ID) == true)
- return new SolidColorBrush(Colors.LightYellow) { Opacity = 0.5};
- }
- return new SolidColorBrush(Colors.LightGray) { Opacity = 0.5};
- }
- }
- /// <summary>
- /// Interaction logic for MapsPanel.xaml
- /// </summary>
- public partial class LiveMapsPanel : UserControl, IPanel<GPSTracker>
- {
-
-
- public LiveMapsPanel()
- {
- InitializeComponent();
- }
- public bool IsReady { get; set; }
- public void CreateToolbarButtons(IPanelHost host)
- {
- }
- public string SectionName => "Maps";
- public DataModel DataModel(Selection selection)
- {
- return new MapsDataModel();
- }
- public void Heartbeat(TimeSpan time)
- {
- }
- public void Refresh()
- {
- ViewModel.Refresh();
- }
- public Dictionary<string, object[]> Selected()
- {
- return new Dictionary<string, object[]>();
- }
- public void Setup()
- {
-
- }
- public void Shutdown(CancelEventArgs? cancel)
- {
- }
- public event DataModelUpdateEvent? OnUpdateDataModel;
-
-
- }
- }
|