diff --git a/Borepin/Borepin/App.xaml.cs b/Borepin/Borepin/App.xaml.cs index 13553bb..3eec22d 100644 --- a/Borepin/Borepin/App.xaml.cs +++ b/Borepin/Borepin/App.xaml.cs @@ -50,9 +50,9 @@ namespace Borepin // Register Navigation containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); - containerRegistry.RegisterForNavigation(); - containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); diff --git a/Borepin/Borepin/Borepin.csproj b/Borepin/Borepin/Borepin.csproj index e78156d..7ec38ab 100644 --- a/Borepin/Borepin/Borepin.csproj +++ b/Borepin/Borepin/Borepin.csproj @@ -28,8 +28,8 @@ - - MachinesPage.xaml + + MachineListPage.xaml SettingsPage.xaml @@ -47,6 +47,9 @@ LightTheme.xaml + + MachineListItemView.xaml + @@ -67,9 +70,6 @@ MSBuild:UpdateDesignTimeXaml - - MSBuild:UpdateDesignTimeXaml - MSBuild:UpdateDesignTimeXaml diff --git a/Borepin/Borepin/Converter/MachineStateColorConverter.cs b/Borepin/Borepin/Converter/MachineStateColorConverter.cs index 9ab249b..de7b2ca 100644 --- a/Borepin/Borepin/Converter/MachineStateColorConverter.cs +++ b/Borepin/Borepin/Converter/MachineStateColorConverter.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using System.Globalization; -using System.Text; -using Borepin.Model; using Xamarin.Forms; namespace Borepin.Converter @@ -11,9 +8,9 @@ namespace Borepin.Converter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - switch((MachineStates)value) + switch((FabAccessAPI.Schema.State)value) { - case (MachineStates.Free): + case (FabAccessAPI.Schema.State.free): return (Color)Application.Current.Resources["FirstColor"]; default: return (Color)Application.Current.Resources["SixthColor"]; diff --git a/Borepin/Borepin/Converter/MachineStateStringConverter.cs b/Borepin/Borepin/Converter/MachineStateStringConverter.cs new file mode 100644 index 0000000..21bd030 --- /dev/null +++ b/Borepin/Borepin/Converter/MachineStateStringConverter.cs @@ -0,0 +1,35 @@ +using System; +using System.Globalization; +using Xamarin.Forms; + +namespace Borepin.Converter +{ + public class MachineStateStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + switch((FabAccessAPI.Schema.State)value) + { + case (FabAccessAPI.Schema.State.free): + return "Free"; + case (FabAccessAPI.Schema.State.inUse): + return "In Use"; + case (FabAccessAPI.Schema.State.toCheck): + return "To Check"; + case (FabAccessAPI.Schema.State.reserved): + return "Reserved"; + case (FabAccessAPI.Schema.State.blocked): + return "Blocked"; + case (FabAccessAPI.Schema.State.disabled): + return "Disabled"; + default: + return "Unknown"; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Borepin/Borepin/Model/Machine.cs b/Borepin/Borepin/Model/Machine.cs index b4d048f..af21027 100644 --- a/Borepin/Borepin/Model/Machine.cs +++ b/Borepin/Borepin/Model/Machine.cs @@ -1,54 +1,8 @@ -using Prism.Mvvm; - -namespace Borepin.Model +namespace Borepin.Model { - public enum MachineStates + public class Machine { - Free, - InUse, - ToCheck, - Blocked, - Disabled, - Reserved - } - - public class Machine : BindableBase - { - private string _ID; - public string ID - { - get => _ID; - set => SetProperty(ref _ID, value); - } - - private MachineStates _State; - public MachineStates State - { - get => _State; - set => SetProperty(ref _State, value); - } - - private string _Description; - public string Description - { - get => _Description; - set => SetProperty(ref _Description, value); - } - - private User _User; - public User User - { - get => _User; - set => SetProperty(ref _User, value); - } - } - - public class User - { - public string ID { get; set; } - - public string Name { get; set; } - - public string OriginalWorkshop { get; set; } + public FabAccessAPI.Machine Instance { get; set; } + public FabAccessAPI.Schema.Machine.MInfo MInfo { get; set; } } } diff --git a/Borepin/Borepin/Page/MachineListPage.xaml b/Borepin/Borepin/Page/MachineListPage.xaml new file mode 100644 index 0000000..0f10107 --- /dev/null +++ b/Borepin/Borepin/Page/MachineListPage.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Borepin/Borepin/Page/MachinesPage.xaml.cs b/Borepin/Borepin/Page/MachineListPage.xaml.cs similarity index 77% rename from Borepin/Borepin/Page/MachinesPage.xaml.cs rename to Borepin/Borepin/Page/MachineListPage.xaml.cs index 83d1f70..65f3609 100644 --- a/Borepin/Borepin/Page/MachinesPage.xaml.cs +++ b/Borepin/Borepin/Page/MachineListPage.xaml.cs @@ -10,9 +10,9 @@ using Xamarin.Forms.Xaml; namespace Borepin.Page { [XamlCompilation(XamlCompilationOptions.Compile)] - public partial class MachinesPage : ContentPage + public partial class MachineListPage : ContentPage { - public MachinesPage() + public MachineListPage() { InitializeComponent(); } diff --git a/Borepin/Borepin/Page/MachinePage.xaml b/Borepin/Borepin/Page/MachinePage.xaml index a825df5..347475f 100644 --- a/Borepin/Borepin/Page/MachinePage.xaml +++ b/Borepin/Borepin/Page/MachinePage.xaml @@ -14,23 +14,10 @@ -