From d9b0b7617864600f690a8202d06b2fb2a64306db Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 19 Dec 2017 18:52:45 +0200 Subject: Started working on 'Synchronization' - Machine Studio module. --- .../src/main/java/com/twine/tango/dal/Entity.java | 9 + .../twine/tango/dal/enumerations/ActionTypes.java | 22 +++ .../com/twine/tango/dal/enumerations/Actions.java | 15 -- .../twine/tango/dal/enumerations/EventTypes.java | 22 +++ .../com/twine/tango/dal/enumerations/Events.java | 15 -- .../twine/tango/dal/enumerations/LiquidTypes.java | 22 +++ .../com/twine/tango/dal/enumerations/Liquids.java | 22 --- .../java/com/twine/tango/unittesting/DAL_TST.java | 21 +++ Software/DB/Tango.db | Bin 557056 -> 557056 bytes Software/DB/Tango.mdf | Bin 8388608 -> 8388608 bytes Software/DB/Tango_log.ldf | Bin 8388608 -> 8388608 bytes .../Machine Studio Modules/synchronization.jpg | Bin 0 -> 41826 bytes Software/Graphics/android-phone-color.png | Bin 0 -> 3254 bytes Software/Graphics/arrow_right.png | Bin 0 -> 1094 bytes Software/Graphics/remote-db.png | Bin 0 -> 159697 bytes Software/Graphics/sqlite.png | Bin 0 -> 123916 bytes Software/Graphics/synch_big.png | Bin 0 -> 83487 bytes .../ViewModels/ConfigurationsViewVM.cs | 2 +- .../ViewModels/DbTableViewModel.cs | 3 +- .../ViewModels/MachinesViewVM.cs | 2 +- .../Images/android-phone-color.png | Bin 0 -> 3254 bytes .../Images/arrow_right.png | Bin 0 -> 1094 bytes .../Images/remote-db.png | Bin 0 -> 159697 bytes .../Images/sqlite.png | Bin 0 -> 123916 bytes .../Images/synch_big.png | Bin 0 -> 83487 bytes .../Images/synchronization.jpg | Bin 0 -> 41826 bytes .../Navigation/NavigationView.cs | 15 ++ .../Navigation/SyncNavigationManager.cs | 17 ++ .../Properties/AssemblyInfo.cs | 18 ++ .../Properties/Resources.Designer.cs | 62 +++++++ .../Properties/Resources.resx | 117 +++++++++++++ .../Properties/Settings.Designer.cs | 30 ++++ .../Properties/Settings.settings | 7 + .../SynchronizationModule.cs | 46 ++++++ .../Tango.MachineStudio.Synchronization.csproj | 184 +++++++++++++++++++++ .../UserControl1.xaml | 12 ++ .../UserControl1.xaml.cs | 28 ++++ .../ViewModelLocator.cs | 45 +++++ .../ViewModels/MainViewVM.cs | 13 ++ .../ViewModels/MenuViewVM.cs | 28 ++++ .../Views/LocalSynchronizationView.xaml | 150 +++++++++++++++++ .../Views/LocalSynchronizationView.xaml.cs | 28 ++++ .../Views/MainView.xaml | 40 +++++ .../Views/MainView.xaml.cs | 31 ++++ .../Views/MenuView.xaml | 69 ++++++++ .../Views/MenuView.xaml.cs | 28 ++++ .../Views/RemoteSynchronizationView.xaml | 12 ++ .../Views/RemoteSynchronizationView.xaml.cs | 28 ++++ .../packages.config | 9 + .../Resources/MaterialDesign.xaml | 65 ++++++++ .../Tango.MachineStudio.Common.csproj | 10 +- .../Tango.MachineStudio.Common/packages.config | 1 + .../Tango.MachineStudio.UI.csproj | 4 + .../DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs | 2 + .../DB/APPLICATION_FIRMWARE_VERSIONS.cs | 2 + .../Tango.DAL.Local/DB/APPLICATION_OS_VERSIONS.cs | 2 + .../Tango.DAL.Local/DB/APPLICATION_VERSIONS.cs | 2 + .../Tango.DAL.Local/DB/CARTRIDGE_TYPES.cs | 2 + .../Tango.DAL.Local/DB/DISPENSER_TYPES.cs | 2 + .../DB/EMBEDDED_FIRMWARE_VERSIONS.cs | 2 + .../DB/EMBEDDED_SOFTWARE_VERSIONS.cs | 2 + .../Tango.DAL.Local/DB/EVENT_TYPES.cs | 1 + .../Tango.DAL.Local/DB/FIBER_SYNTHESISES.cs | 22 --- .../Tango.DAL.Local/DB/FIBER_SYNTHS.cs | 22 +++ .../Tango.DAL.Local/DB/HARDWARE_VERSIONS.cs | 2 + .../Tango.DAL.Local/DB/LIQUID_TYPES.cs | 1 + .../Tango.DAL.Local/DB/LocalADO.Context.cs | 2 +- .../Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx | 86 ++++++++-- .../Tango.DAL.Local/DB/LocalADO.edmx.diagram | 12 +- .../Tango.DAL.Local/DB/MACHINE_VERSIONS.cs | 2 + Software/Visual_Studio/Tango.DAL.Local/DB/RML.cs | 2 +- .../Tango.DAL.Local/Tango.DAL.Local.csproj | 2 +- .../Enumerations/ActionTypes.cs | 13 ++ .../Enumerations/EventTypes.cs | 13 ++ .../Enumerations/Permissions.cs | 6 + .../ExtensionMethods/ConfigurationExtensions.cs | 2 +- .../ExtensionMethods/ObservableEntityExtensions.cs | 2 +- .../Tango.DAL.Observables/IObservableEntity.cs | 5 + .../Tango.DAL.Observables/ObservableEntity.cs | 21 ++- .../Local/LocalDBSynchronizer.cs | 8 +- .../Tango.Synchronization/Local/SqliteDataBase.cs | 10 ++ .../Remote/RemoteDBSynchronizer.cs | 18 +- .../Visual_Studio/Tango.UnitTesting/DAL_TST.cs | 20 +-- .../Tango.UnitTesting/Synchronization_TST.cs | 18 +- Software/Visual_Studio/Tango.sln | 17 +- 85 files changed, 1454 insertions(+), 121 deletions(-) create mode 100644 Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/ActionTypes.java delete mode 100644 Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Actions.java create mode 100644 Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/EventTypes.java delete mode 100644 Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Events.java create mode 100644 Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/LiquidTypes.java delete mode 100644 Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Liquids.java create mode 100644 Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java create mode 100644 Software/Graphics/Machine Studio Modules/synchronization.jpg create mode 100644 Software/Graphics/android-phone-color.png create mode 100644 Software/Graphics/arrow_right.png create mode 100644 Software/Graphics/remote-db.png create mode 100644 Software/Graphics/sqlite.png create mode 100644 Software/Graphics/synch_big.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/android-phone-color.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/arrow_right.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/remote-db.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/sqlite.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/synch_big.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/synchronization.jpg create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/NavigationView.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/SyncNavigationManager.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/AssemblyInfo.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Resources.Designer.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Resources.resx create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Settings.Designer.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Settings.settings create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/UserControl1.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/UserControl1.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModelLocator.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MainViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MenuViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/LocalSynchronizationView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/LocalSynchronizationView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/RemoteSynchronizationView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/RemoteSynchronizationView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/packages.config create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml delete mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHESISES.cs create mode 100644 Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHS.cs (limited to 'Software') diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/Entity.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/Entity.java index fd41d9230..6cf88e85e 100644 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/Entity.java +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/Entity.java @@ -9,6 +9,8 @@ import org.joda.time.DateTimeZone; import java.util.UUID; +import io.reactivex.Single; + /** * Represents a DAL base entity. @@ -117,4 +119,11 @@ public class Entity extends BaseRXModel setGuid(UUID.randomUUID().toString()); setLast_updated(DateTime.now(DateTimeZone.UTC)); } + + @Override + public Single save() + { + setLast_updated(DateTime.now(DateTimeZone.UTC)); + return super.save(); + } } diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/ActionTypes.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/ActionTypes.java new file mode 100644 index 000000000..8233a0b88 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/ActionTypes.java @@ -0,0 +1,22 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum ActionTypes +{ + + @DescriptionAnnotation(description = "Some description") + Action1(1), + + @DescriptionAnnotation(description = "Some action 2 description") + Action2(2), + + ; + + private int value; + + ActionTypes(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Actions.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Actions.java deleted file mode 100644 index 55eebeb78..000000000 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Actions.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.twine.tango.dal.enumerations; - -import com.twine.tango.core.DescriptionAnnotation; - -public enum Actions -{ - ; - - private int value; - - Actions(int value) - { - this.value = value; - } -} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/EventTypes.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/EventTypes.java new file mode 100644 index 000000000..06ecf3f4f --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/EventTypes.java @@ -0,0 +1,22 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum EventTypes +{ + + @DescriptionAnnotation(description = "Some event description") + Event1(1), + + @DescriptionAnnotation(description = "Some event 2 description") + Event2(2), + + ; + + private int value; + + EventTypes(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Events.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Events.java deleted file mode 100644 index bfa2e1758..000000000 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Events.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.twine.tango.dal.enumerations; - -import com.twine.tango.core.DescriptionAnnotation; - -public enum Events -{ - ; - - private int value; - - Events(int value) - { - this.value = value; - } -} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/LiquidTypes.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/LiquidTypes.java new file mode 100644 index 000000000..d2d480167 --- /dev/null +++ b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/LiquidTypes.java @@ -0,0 +1,22 @@ +package com.twine.tango.dal.enumerations; + +import com.twine.tango.core.DescriptionAnnotation; + +public enum LiquidTypes +{ + + @DescriptionAnnotation(description = "Cyan") + Cyan(1), + + @DescriptionAnnotation(description = "Magenta") + Magenta(2), + + ; + + private int value; + + LiquidTypes(int value) + { + this.value = value; + } +} diff --git a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Liquids.java b/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Liquids.java deleted file mode 100644 index ca82d56ad..000000000 --- a/Software/Android_Studio/Tango.DAL/src/main/java/com/twine/tango/dal/enumerations/Liquids.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.twine.tango.dal.enumerations; - -import com.twine.tango.core.DescriptionAnnotation; - -public enum Liquids -{ - - @DescriptionAnnotation(description = "Cyan") - Cyan(1), - - @DescriptionAnnotation(description = "Magenta") - Magenta(2), - - ; - - private int value; - - Liquids(int value) - { - this.value = value; - } -} diff --git a/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java new file mode 100644 index 000000000..f04070d6a --- /dev/null +++ b/Software/Android_Studio/Tango.UnitTesting/src/androidTest/java/com/twine/tango/unittesting/DAL_TST.java @@ -0,0 +1,21 @@ +package com.twine.tango.unittesting; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.runner.RunWith; + +/** + * Created by Roy on 12/19/2017. + */ + +@RunWith(AndroidJUnit4.class) +public class DAL_TST +{ + public void perform_basic_dal_test() + { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + } +} diff --git a/Software/DB/Tango.db b/Software/DB/Tango.db index 2a238547c..a0d317b86 100644 Binary files a/Software/DB/Tango.db and b/Software/DB/Tango.db differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 6438c34ad..11a540748 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index a3a92fbf2..5687558f7 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/Machine Studio Modules/synchronization.jpg b/Software/Graphics/Machine Studio Modules/synchronization.jpg new file mode 100644 index 000000000..801bbce48 Binary files /dev/null and b/Software/Graphics/Machine Studio Modules/synchronization.jpg differ diff --git a/Software/Graphics/android-phone-color.png b/Software/Graphics/android-phone-color.png new file mode 100644 index 000000000..46453bf83 Binary files /dev/null and b/Software/Graphics/android-phone-color.png differ diff --git a/Software/Graphics/arrow_right.png b/Software/Graphics/arrow_right.png new file mode 100644 index 000000000..5b7f0736b Binary files /dev/null and b/Software/Graphics/arrow_right.png differ diff --git a/Software/Graphics/remote-db.png b/Software/Graphics/remote-db.png new file mode 100644 index 000000000..844695629 Binary files /dev/null and b/Software/Graphics/remote-db.png differ diff --git a/Software/Graphics/sqlite.png b/Software/Graphics/sqlite.png new file mode 100644 index 000000000..46cecd740 Binary files /dev/null and b/Software/Graphics/sqlite.png differ diff --git a/Software/Graphics/synch_big.png b/Software/Graphics/synch_big.png new file mode 100644 index 000000000..ff6476f44 Binary files /dev/null and b/Software/Graphics/synch_big.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs index 617faab31..bdec4f91b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/ConfigurationsViewVM.cs @@ -18,7 +18,7 @@ namespace Tango.MachineStudio.DB.ViewModels protected override void InitializeEntity(Configuration entity) { base.InitializeEntity(entity); - entity.CreationDate = DateTime.Now; + entity.CreationDate = DateTime.UtcNow; } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs index b6d77748e..89759309b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DbTableViewModel.cs @@ -167,8 +167,7 @@ namespace Tango.MachineStudio.DB.ViewModels try { - SelectedEntity.Deleted = true; - await SelectedEntity.SaveAsync(); + await SelectedEntity.SoftDeleteAsync(); } catch (Exception ex) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachinesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachinesViewVM.cs index fbec464bd..2349941fe 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachinesViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MachinesViewVM.cs @@ -20,7 +20,7 @@ namespace Tango.MachineStudio.DB.ViewModels protected override void InitializeEntity(Machine entity) { base.InitializeEntity(entity); - entity.ProductionDate = DateTime.Now; + entity.ProductionDate = DateTime.UtcNow; } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/android-phone-color.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/android-phone-color.png new file mode 100644 index 000000000..46453bf83 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/android-phone-color.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/arrow_right.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/arrow_right.png new file mode 100644 index 000000000..5b7f0736b Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/arrow_right.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/remote-db.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/remote-db.png new file mode 100644 index 000000000..844695629 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/remote-db.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/sqlite.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/sqlite.png new file mode 100644 index 000000000..46cecd740 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/sqlite.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/synch_big.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/synch_big.png new file mode 100644 index 000000000..ff6476f44 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/synch_big.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/synchronization.jpg b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/synchronization.jpg new file mode 100644 index 000000000..801bbce48 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Images/synchronization.jpg differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/NavigationView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/NavigationView.cs new file mode 100644 index 000000000..8d38acb7c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/NavigationView.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Synchronization.Navigation +{ + public enum NavigationView + { + MenuView, + LocalSynchronizationView, + RemoteSynchronizationView, + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/SyncNavigationManager.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/SyncNavigationManager.cs new file mode 100644 index 000000000..847fa2456 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Navigation/SyncNavigationManager.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.MachineStudio.Synchronization.Views; + +namespace Tango.MachineStudio.Synchronization.Navigation +{ + public class SyncNavigationManager + { + public void NavigateTo(NavigationView view) + { + MainView.Instance.TransitionControl.AutoNavigate(view.ToString()); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..d0a85a97c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +[assembly: AssemblyTitle("Tango - Machine Studio Synchronization Module")] + +[assembly: ComVisible(false)] + +[assembly:ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Resources.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Resources.Designer.cs new file mode 100644 index 000000000..81d350bfd --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.MachineStudio.Synchronization.Properties { + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.MachineStudio.Synchronization.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Resources.resx b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Settings.Designer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Settings.Designer.cs new file mode 100644 index 000000000..2c61b78ac --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.MachineStudio.Synchronization.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Settings.settings b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs new file mode 100644 index 000000000..039b9faf6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/SynchronizationModule.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Media.Imaging; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common; +using Tango.MachineStudio.Synchronization.Views; +using Tango.SharedUI.Helpers; + +namespace Tango.MachineStudio.Synchronization +{ + public class SynchronizationModule : IStudioModule + { + private bool _isInitialized; + + public string Name => "Synchronization"; + + public string Description => "Perform local to local or remote to local database synchronization."; + + public BitmapSource Image => ResourceHelper.GetImageFromResources("Images/synchronization.jpg"); + + public FrameworkElement MainView => new MainView(); + + public bool IsInitialized => _isInitialized; + + public Permissions Permission => Permissions.RunSynchronizationModule; + + public void Dispose() + { + //Dispose... + } + + public void Initialize() + { + if (!_isInitialized) + { + //Initialize.. + + _isInitialized = true; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj new file mode 100644 index 000000000..53a0476e5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Tango.MachineStudio.Synchronization.csproj @@ -0,0 +1,184 @@ + + + + + Debug + AnyCPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B} + library + Tango.MachineStudio.Synchronization + Tango.MachineStudio.Synchronization + v4.6 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + true + full + false + ..\..\..\Build\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll + + + ..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll + + + ..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll + + + ..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll + + + ..\..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll + + + ..\..\..\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll + + + ..\..\..\packages\MaterialDesignThemes.2.3.1.953\lib\net45\MaterialDesignThemes.Wpf.dll + + + ..\..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll + + + + + ..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll + + + + + + + + + 4.0 + + + + + + + + + + + + + RemoteSynchronizationView.xaml + + + LocalSynchronizationView.xaml + + + MainView.xaml + + + MenuView.xaml + + + MSBuild:Compile + Designer + + + GlobalVersionInfo.cs + + + + UserControl1.xaml + Code + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} + Tango.Core + + + {0ecd6da8-7aa6-48d9-8b65-279d176ad9af} + Tango.DAL.Observables + + + {8491d07b-c1f6-4b62-a412-41b9fd2d6538} + Tango.SharedUI + + + {7ada4e86-cad7-4968-a210-3a8a9e5153ab} + Tango.Synchronization + + + {cb0b0aa2-bb24-4bca-a720-45e397684e12} + Tango.MachineStudio.Common + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/UserControl1.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/UserControl1.xaml new file mode 100644 index 000000000..50afe7e4e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/UserControl1.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/UserControl1.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/UserControl1.xaml.cs new file mode 100644 index 000000000..16186b6bd --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/UserControl1.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Synchronization +{ + /// + /// Interaction logic for UserControl1.xaml + /// + public partial class UserControl1 : UserControl + { + public UserControl1() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModelLocator.cs new file mode 100644 index 000000000..30162e824 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModelLocator.cs @@ -0,0 +1,45 @@ +using GalaSoft.MvvmLight; +using GalaSoft.MvvmLight.Ioc; +using Microsoft.Practices.ServiceLocation; +using Tango.MachineStudio.Synchronization.Navigation; +using Tango.MachineStudio.Synchronization.ViewModels; + +namespace Tango.MachineStudio.Synchronization +{ + /// + /// This class contains static references to all the view models in the + /// application and provides an entry point for the bindings. + /// + public static class ViewModelLocator + { + /// + /// Initializes a new instance of the ViewModelLocator class. + /// + static ViewModelLocator() + { + ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); + SimpleIoc.Default.Register(); + SimpleIoc.Default.Register(); + + SimpleIoc.Default.Unregister(); + + SimpleIoc.Default.Register(); + } + + public static MainViewVM MainViewVM + { + get + { + return ServiceLocator.Current.GetInstance(); + } + } + + public static MenuViewVM MenuViewVM + { + get + { + return ServiceLocator.Current.GetInstance(); + } + } + } +} \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MainViewVM.cs new file mode 100644 index 000000000..61bf6e20c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MainViewVM.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.MachineStudio.Synchronization.ViewModels +{ + public class MainViewVM : ViewModel + { + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MenuViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MenuViewVM.cs new file mode 100644 index 000000000..8eb68a383 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/ViewModels/MenuViewVM.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.MachineStudio.Synchronization.Navigation; +using Tango.SharedUI; + +namespace Tango.MachineStudio.Synchronization.ViewModels +{ + public class MenuViewVM : ViewModel + { + private SyncNavigationManager _navigation; + + public MenuViewVM(SyncNavigationManager navigation) + { + _navigation = navigation; + + StartLocalSyncCommand = new RelayCommand(() => { _navigation.NavigateTo(NavigationView.LocalSynchronizationView); }); + StartRemoteSyncCommand = new RelayCommand(() => { _navigation.NavigateTo(NavigationView.RemoteSynchronizationView); }); + } + + public RelayCommand StartLocalSyncCommand { get; set; } + + public RelayCommand StartRemoteSyncCommand { get; set; } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/LocalSynchronizationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/LocalSynchronizationView.xaml new file mode 100644 index 000000000..ded60fbb7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/LocalSynchronizationView.xaml @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Master DataBase + + + + + + + + + Slave DataBase + + + + + + + + + + + + + + + Differences + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SQL Command + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/LocalSynchronizationView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/LocalSynchronizationView.xaml.cs new file mode 100644 index 000000000..f6c70143d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/LocalSynchronizationView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Synchronization.Views +{ + /// + /// Interaction logic for LocalSynchronizationView.xaml + /// + public partial class LocalSynchronizationView : UserControl + { + public LocalSynchronizationView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml new file mode 100644 index 000000000..53bcfdb1e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 11:35:10.34> Synchronization Engine Started... + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml.cs new file mode 100644 index 000000000..65e50905d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MainView.xaml.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Synchronization.Views +{ + /// + /// Interaction logic for MainView.xaml + /// + public partial class MainView : UserControl + { + public static MainView Instance; + + public MainView() + { + InitializeComponent(); + Instance = this; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml new file mode 100644 index 000000000..6210ca94c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + Remote Synchronization + Synchronize local SQLite database file with the remote Twine database. + + + + + + + + + + + + + + + + + + + + + Local Synchronization + Synchronize two SQLite local database files. + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml.cs new file mode 100644 index 000000000..eb4c17ca0 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/MenuView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Synchronization.Views +{ + /// + /// Interaction logic for MenuView.xaml + /// + public partial class MenuView : UserControl + { + public MenuView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/RemoteSynchronizationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/RemoteSynchronizationView.xaml new file mode 100644 index 000000000..92c8fa674 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/RemoteSynchronizationView.xaml @@ -0,0 +1,12 @@ + + + Remote Sync + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/RemoteSynchronizationView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/RemoteSynchronizationView.xaml.cs new file mode 100644 index 000000000..cee8e20d1 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/RemoteSynchronizationView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.Synchronization.Views +{ + /// + /// Interaction logic for LocalSynchronizationView.xaml + /// + public partial class RemoteSynchronizationView : UserControl + { + public RemoteSynchronizationView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/packages.config new file mode 100644 index 000000000..42945b407 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml new file mode 100644 index 000000000..482e852d6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 1aa5216b4..70962a2f7 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -40,6 +40,9 @@ ..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll + + ..\..\packages\MahApps.Metro.1.5.0\lib\net45\MahApps.Metro.dll + ..\..\packages\MaterialDesignColors.1.1.2\lib\net45\MaterialDesignColors.dll @@ -52,8 +55,7 @@ - ..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll - True + ..\..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll @@ -94,6 +96,10 @@ + + Designer + MSBuild:Compile + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config index f67c854e3..4fd672b32 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/packages.config @@ -1,6 +1,7 @@  + diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj index be0c1a829..4aa14b56a 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Tango.MachineStudio.UI.csproj @@ -232,6 +232,10 @@ {94f7acf8-55e1-4a02-b9bc-a818413fdbbf} Tango.MachineStudio.DB + + {12d0c43c-391f-4c74-92ab-82e9a9beeb9b} + Tango.MachineStudio.Synchronization + {cb0b0aa2-bb24-4bca-a720-45e397684e12} Tango.MachineStudio.Common diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs index df8ed6d2f..410d0309c 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_DISPLAY_PANEL_VERSIONS.cs @@ -18,5 +18,7 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_FIRMWARE_VERSIONS.cs index 3cf9cd3ce..dca8e82f1 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_FIRMWARE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_FIRMWARE_VERSIONS.cs @@ -18,5 +18,7 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_OS_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_OS_VERSIONS.cs index a3d4afab8..c05a2410c 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_OS_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_OS_VERSIONS.cs @@ -18,5 +18,7 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_VERSIONS.cs index 7ef6c94cb..c250201d0 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/APPLICATION_VERSIONS.cs @@ -18,5 +18,7 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/CARTRIDGE_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/CARTRIDGE_TYPES.cs index 87d05642b..6d8e2d441 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/CARTRIDGE_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/CARTRIDGE_TYPES.cs @@ -18,5 +18,7 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public long CODE { get; set; } + public string NAME { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER_TYPES.cs index f66752a5e..718ab5219 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/DISPENSER_TYPES.cs @@ -18,5 +18,7 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public long CODE { get; set; } + public string NAME { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_FIRMWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_FIRMWARE_VERSIONS.cs index d44343495..b4f3c3c85 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_FIRMWARE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_FIRMWARE_VERSIONS.cs @@ -18,5 +18,7 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_SOFTWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_SOFTWARE_VERSIONS.cs index a0b0a7b22..117295091 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_SOFTWARE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/EMBEDDED_SOFTWARE_VERSIONS.cs @@ -18,5 +18,7 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/EVENT_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/EVENT_TYPES.cs index 3ec964cb8..af7b10d05 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/EVENT_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/EVENT_TYPES.cs @@ -18,6 +18,7 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public long CODE { get; set; } public string NAME { get; set; } public string DESCRIPTION { get; set; } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHESISES.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHESISES.cs deleted file mode 100644 index f6667a7c1..000000000 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHESISES.cs +++ /dev/null @@ -1,22 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated from a template. -// -// Manual changes to this file may cause unexpected behavior in your application. -// Manual changes to this file will be overwritten if the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.DAL.Local.DB -{ - using System; - using System.Collections.Generic; - - public partial class FIBER_SYNTHESISES - { - public long ID { get; set; } - public string GUID { get; set; } - public System.DateTime LAST_UPDATED { get; set; } - public bool DELETED { get; set; } - } -} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHS.cs new file mode 100644 index 000000000..668872f68 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/FIBER_SYNTHS.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated from a template. +// +// Manual changes to this file may cause unexpected behavior in your application. +// Manual changes to this file will be overwritten if the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Tango.DAL.Local.DB +{ + using System; + using System.Collections.Generic; + + public partial class FIBER_SYNTHS + { + public long ID { get; set; } + public string GUID { get; set; } + public System.DateTime LAST_UPDATED { get; set; } + public bool DELETED { get; set; } + } +} diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/HARDWARE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/HARDWARE_VERSIONS.cs index 0ceb68f7c..62b93a878 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/HARDWARE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/HARDWARE_VERSIONS.cs @@ -18,5 +18,7 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public double VERSION { get; set; } + public string NAME { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES.cs index 652d219ba..16e069ef1 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LIQUID_TYPES.cs @@ -21,5 +21,6 @@ namespace Tango.DAL.Local.DB public long CODE { get; set; } public string NAME { get; set; } public double VERSION { get; set; } + public long COLOR { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs index 10f77068c..24df1c1ce 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.Context.cs @@ -42,7 +42,7 @@ namespace Tango.DAL.Local.DB public virtual DbSet EVENT_TYPES { get; set; } public virtual DbSet EVENT_TYPES_ACTIONS { get; set; } public virtual DbSet FIBER_SHAPES { get; set; } - public virtual DbSet FIBER_SYNTHESISES { get; set; } + public virtual DbSet FIBER_SYNTHS { get; set; } public virtual DbSet HARDWARE_VERSIONS { get; set; } public virtual DbSet IDS_PACKS { get; set; } public virtual DbSet LINEAR_MASS_DENSITY_UNITS { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx index 261cec120..aa2095368 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx @@ -41,6 +41,8 @@ + + @@ -50,6 +52,8 @@ + + @@ -59,6 +63,8 @@ + + @@ -68,6 +74,8 @@ + + @@ -77,6 +85,8 @@ + + @@ -129,6 +139,8 @@ + + @@ -148,6 +160,8 @@ + + @@ -157,6 +171,8 @@ + + @@ -166,6 +182,7 @@ + @@ -189,7 +206,7 @@ - + @@ -206,6 +223,8 @@ + + @@ -240,6 +259,7 @@ + @@ -260,7 +280,9 @@ + + @@ -378,7 +400,7 @@ - + @@ -464,7 +486,7 @@ - + @@ -509,7 +531,7 @@ - + @@ -568,6 +590,8 @@ + + @@ -577,6 +601,8 @@ + + @@ -586,6 +612,8 @@ + + @@ -595,6 +623,8 @@ + + @@ -604,6 +634,8 @@ + + @@ -656,6 +688,8 @@ + + @@ -675,6 +709,8 @@ + + @@ -684,6 +720,8 @@ + + @@ -693,6 +731,7 @@ + @@ -716,7 +755,7 @@ - + @@ -733,6 +772,8 @@ + + @@ -767,6 +808,7 @@ + @@ -787,7 +829,9 @@ + + @@ -905,7 +949,7 @@ - + @@ -1012,6 +1056,8 @@ + + @@ -1022,6 +1068,8 @@ + + @@ -1032,6 +1080,8 @@ + + @@ -1042,6 +1092,8 @@ + + @@ -1052,6 +1104,8 @@ + + @@ -1108,6 +1162,8 @@ + + @@ -1129,6 +1185,8 @@ + + @@ -1139,6 +1197,8 @@ + + @@ -1151,6 +1211,7 @@ + @@ -1180,9 +1241,9 @@ - - - + + + @@ -1193,6 +1254,8 @@ + + @@ -1227,6 +1290,7 @@ + @@ -1252,7 +1316,9 @@ + + @@ -1383,7 +1449,7 @@ - + diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram index 5bbf17d24..f36a25560 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/LocalADO.edmx.diagram @@ -22,16 +22,16 @@ - + - - - + + + @@ -42,8 +42,8 @@ - - + + diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS.cs index 987d5b501..482c5ff01 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/MACHINE_VERSIONS.cs @@ -18,6 +18,8 @@ namespace Tango.DAL.Local.DB public string GUID { get; set; } public System.DateTime LAST_UPDATED { get; set; } public bool DELETED { get; set; } + public string NAME { get; set; } public double VERSION { get; set; } + public string DEFAULT_CONFIGURATION_GUID { get; set; } } } diff --git a/Software/Visual_Studio/Tango.DAL.Local/DB/RML.cs b/Software/Visual_Studio/Tango.DAL.Local/DB/RML.cs index 6761a538f..8b7723d95 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/DB/RML.cs +++ b/Software/Visual_Studio/Tango.DAL.Local/DB/RML.cs @@ -25,7 +25,7 @@ namespace Tango.DAL.Local.DB public string CONDITION_GUID { get; set; } public string LINEAR_MASS_DENSITY_UNIT_GUID { get; set; } public string FIBER_SHAPE_GUID { get; set; } - public string FIBER_SYNTHESIS_GUID { get; set; } + public string FIBER_SYNTH_GUID { get; set; } public double FIBER_SIZE { get; set; } public long NUMBER_OF_FIBERS { get; set; } public long PLIES_PER_FIBER { get; set; } diff --git a/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj b/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj index 14625e59f..b37074e7f 100644 --- a/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj +++ b/Software/Visual_Studio/Tango.DAL.Local/Tango.DAL.Local.csproj @@ -116,7 +116,7 @@ LocalADO.tt - + LocalADO.tt diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs index 750b1b4ab..3473559e6 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/ActionTypes.cs @@ -8,5 +8,18 @@ namespace Tango.DAL.Observables { public enum ActionTypes { + + /// + /// (Some description) + /// + [Description("Some description")] + Action1 = 1, + + /// + /// (Some action 2 description) + /// + [Description("Some action 2 description")] + Action2 = 2, + } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/EventTypes.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/EventTypes.cs index 4321c9f9f..66df05539 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/EventTypes.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/EventTypes.cs @@ -8,5 +8,18 @@ namespace Tango.DAL.Observables { public enum EventTypes { + + /// + /// (Some event description) + /// + [Description("Some event description")] + Event1 = 1, + + /// + /// (Some event 2 description) + /// + [Description("Some event 2 description")] + Event2 = 2, + } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Permissions.cs b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Permissions.cs index 542555b51..8e90b2b87 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Permissions.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/Enumerations/Permissions.cs @@ -27,5 +27,11 @@ namespace Tango.DAL.Observables [Description("Allows loading the database module in Machine Studio")] RunDataBaseModule = 2, + /// + /// (Allows loading the synchronization module in machine studio) + /// + [Description("Allows loading the synchronization module in machine studio")] + RunSynchronizationModule = 3, + } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ExtensionMethods/ConfigurationExtensions.cs b/Software/Visual_Studio/Tango.DAL.Observables/ExtensionMethods/ConfigurationExtensions.cs index f80c45eae..6ab3b602f 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ExtensionMethods/ConfigurationExtensions.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ExtensionMethods/ConfigurationExtensions.cs @@ -10,7 +10,7 @@ public static class ConfigurationExtensions public static Configuration CloneConfiguration(this Configuration configuration) { Configuration cloned = configuration.CloneEntity(); - cloned.CreationDate = DateTime.Now; + cloned.CreationDate = DateTime.UtcNow; foreach (var idsPack in configuration.IdsPacks) { diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ExtensionMethods/ObservableEntityExtensions.cs b/Software/Visual_Studio/Tango.DAL.Observables/ExtensionMethods/ObservableEntityExtensions.cs index 8fad6e39c..eb7e6efb9 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ExtensionMethods/ObservableEntityExtensions.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ExtensionMethods/ObservableEntityExtensions.cs @@ -11,7 +11,7 @@ public static class ObservableEntityExtensions { T cloned = entity.ShallowClone(); cloned.Guid = Guid.NewGuid().ToString(); - cloned.LastUpdated = DateTime.Now; + cloned.LastUpdated = DateTime.UtcNow; return cloned; } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs b/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs index 397d7b820..10bb15f3f 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/IObservableEntity.cs @@ -25,8 +25,13 @@ namespace Tango.DAL.Observables Task SaveAsync(); + [Obsolete("The method delete is not for use as it prevents the synchronization of remote and local database.")] void Delete(); + void SoftDelete(); + + Task SoftDeleteAsync(); + List> GetDependentEntitiesNameAndGuid(); } } diff --git a/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs b/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs index e5e49ac38..74bcfbb83 100644 --- a/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs +++ b/Software/Visual_Studio/Tango.DAL.Observables/ObservableEntity.cs @@ -138,6 +138,8 @@ namespace Tango.DAL.Observables public abstract void Delete(); public abstract Task SaveAsync(); + public abstract void SoftDelete(); + public abstract Task SoftDeleteAsync(); } public abstract class ObservableEntity : ObservableEntity where T : class @@ -183,7 +185,7 @@ namespace Tango.DAL.Observables { Entity = Activator.CreateInstance(); Guid = System.Guid.NewGuid().ToString(); - LastUpdated = DateTime.Now; + LastUpdated = DateTime.UtcNow; _isNew = true; } @@ -219,10 +221,27 @@ namespace Tango.DAL.Observables ObservablesEntitiesAdapter.Instance.SaveChanges(); } + public override void SoftDelete() + { + this.Deleted = true; + Save(); + } + + public override Task SoftDeleteAsync() + { + return Task.Factory.StartNew(() => + { + SoftDelete(); + }); + } + internal override void Save(List savedEntities) { savedEntities.Add(this); + //Update last updated... + this.LastUpdated = DateTime.UtcNow; + //Match guids.. foreach (var prop in this.GetType().GetProperties().Where(x => !x.PropertyType.IsGenericType && x.PropertyType.IsClass && x.PropertyType != typeof(String) && x.PropertyType != typeof(DateTime))) diff --git a/Software/Visual_Studio/Tango.Synchronization/Local/LocalDBSynchronizer.cs b/Software/Visual_Studio/Tango.Synchronization/Local/LocalDBSynchronizer.cs index ca58686f3..c7b6900d6 100644 --- a/Software/Visual_Studio/Tango.Synchronization/Local/LocalDBSynchronizer.cs +++ b/Software/Visual_Studio/Tango.Synchronization/Local/LocalDBSynchronizer.cs @@ -8,7 +8,7 @@ namespace Tango.Synchronization.Local { public class LocalDBSynchronizer { - public static void Synchronize(String masterSQLiteFile, String slaveSQLiteFile) + public static List Synchronize(String masterSQLiteFile, String slaveSQLiteFile) { using (LocalDBComparer comparer = new LocalDBComparer(new SQLiteDataBase(masterSQLiteFile), new SQLiteDataBase(slaveSQLiteFile))) { @@ -17,12 +17,14 @@ namespace Tango.Synchronization.Local { diff.Commit(); } + + return diffs; } } - public static Task SynchronizeAsync(String masterSQLiteFile, String slaveSQLiteFile) + public static Task> SynchronizeAsync(String masterSQLiteFile, String slaveSQLiteFile) { - return Task.Factory.StartNew(() => Synchronize(masterSQLiteFile, slaveSQLiteFile)); + return Task.Factory.StartNew>(() => { return Synchronize(masterSQLiteFile, slaveSQLiteFile); }); } } } diff --git a/Software/Visual_Studio/Tango.Synchronization/Local/SqliteDataBase.cs b/Software/Visual_Studio/Tango.Synchronization/Local/SqliteDataBase.cs index b3d259e8c..add791b19 100644 --- a/Software/Visual_Studio/Tango.Synchronization/Local/SqliteDataBase.cs +++ b/Software/Visual_Studio/Tango.Synchronization/Local/SqliteDataBase.cs @@ -100,6 +100,16 @@ namespace Tango.Synchronization.Local return table; } + public void ClearDataBase() + { + foreach (var table in Tables) + { + var dropCommand = _connection.CreateCommand(); + dropCommand.CommandText = String.Format("DELETE FROM {0};", table.TableName); + dropCommand.ExecuteNonQuery(); + } + } + /// /// Clones a table from another database into this database. /// diff --git a/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBSynchronizer.cs b/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBSynchronizer.cs index ae39e118b..7abd8ad7e 100644 --- a/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBSynchronizer.cs +++ b/Software/Visual_Studio/Tango.Synchronization/Remote/RemoteDBSynchronizer.cs @@ -6,13 +6,21 @@ using System.Threading.Tasks; using remote = Tango.DAL.Remote.DB; using local = Tango.DAL.Local.DB; using Tango.Settings; +using Tango.Synchronization.Local; namespace Tango.Synchronization.Remote { public class RemoteDBSynchronizer { - public static void Synchronize(String sqliteDbFile, String serialNumber) + public static List Synchronize(String sqliteDbFile, String serialNumber, bool overrideLocal = false) { + if (overrideLocal) + { + SQLiteDataBase sqlite = new SQLiteDataBase(sqliteDbFile); + sqlite.LoadTables(); + sqlite.ClearDataBase(); + } + using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) { using (var localDB = new local.LocalDB(sqliteDbFile)) @@ -27,15 +35,17 @@ namespace Tango.Synchronization.Remote remoteDB.SaveChanges(); localDB.SaveChanges(); + + return diffs; } } } - public static Task SynchronizeAsync(String sqliteDBFile, String serialNumber) + public static Task> SynchronizeAsync(String sqliteDBFile, String serialNumber, bool overrideLocal = false) { - return Task.Factory.StartNew(() => + return Task.Factory.StartNew>(() => { - Synchronize(sqliteDBFile, serialNumber); + return Synchronize(sqliteDBFile, serialNumber, overrideLocal); }); } } diff --git a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs index e9fa5e6ba..88ea53900 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs @@ -17,21 +17,21 @@ namespace Tango.UnitTesting using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) { - var action = new DAL.Remote.DB.ACTION(); + var action = new DAL.Remote.DB.ACTION_TYPES(); action.CODE = 1; action.NAME = "Action 1"; action.DESCRIPTION = "Description 1"; action.GUID = guid; - action.LAST_UPDATED = DateTime.Now; + action.LAST_UPDATED = DateTime.UtcNow; - db.ACTIONS.Add(action); + db.ACTION_TYPES.Add(action); db.SaveChanges(); } using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) { - var action = db.ACTIONS.Single(x => x.GUID == guid); - db.ACTIONS.Remove(action); + var action = db.ACTION_TYPES.Single(x => x.GUID == guid); + db.ACTION_TYPES.Remove(action); db.SaveChanges(); } } @@ -43,21 +43,21 @@ namespace Tango.UnitTesting using (var db = new DAL.Local.DB.LocalDB(Helper.GetSQLiteFilePath())) { - var action = new DAL.Local.DB.ACTION(); + var action = new DAL.Local.DB.ACTION_TYPES(); action.CODE = 1; action.NAME = "Action 1"; action.DESCRIPTION = "Description 1"; action.GUID = guid; - db.ACTIONS.Add(action); + db.ACTION_TYPES.Add(action); db.SaveChanges(); } using (var db = new DAL.Local.DB.LocalDB(Helper.GetSQLiteFilePath())) { - var actions = db.ACTIONS.ToList(); - var action = db.ACTIONS.Single(x => x.GUID == guid); - db.ACTIONS.Remove(action); + var actions = db.ACTION_TYPES.ToList(); + var action = db.ACTION_TYPES.Single(x => x.GUID == guid); + db.ACTION_TYPES.Remove(action); db.SaveChanges(); } } diff --git a/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs index 765d93115..3b949cf90 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Synchronization_TST.cs @@ -20,7 +20,23 @@ namespace Tango.UnitTesting { var console = Helper.InitializeLogging(true); - RemoteDBSynchronizer.Synchronize(Helper.GetSQLiteFilePath(), "1234"); + using (var remoteDB = new remote.RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false)) + { + using (var localDB = new local.LocalDB(Helper.GetSQLiteFilePath())) + { + RemoteDBComparer comparer = new RemoteDBComparer(remoteDB, localDB, "1111"); + var diffs = comparer.Compare(); + } + } + + console.WaitForConsoleExit().Wait(); + } + + [TestMethod] + public void Synchronize_Remote_And_Local() + { + var console = Helper.InitializeLogging(true); + RemoteDBSynchronizer.Synchronize(Helper.GetSQLiteFilePath(), "1111", true); console.WaitForConsoleExit().Wait(); } diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 831c15e13..0a1922bd7 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.14 +VisualStudioVersion = 15.0.26430.16 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Protobuf", "Tango.Protobuf\Tango.Protobuf.csproj", "{40073806-914E-4E78-97AB-FA9639308EBE}" EndProject @@ -95,6 +95,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.Develop EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.ColorPicker", "Tango.ColorPicker\Tango.ColorPicker.csproj", "{A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.MachineStudio.Synchronization", "MachineStudio\Modules\Tango.MachineStudio.Synchronization\Tango.MachineStudio.Synchronization.csproj", "{12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -522,6 +524,18 @@ Global {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Release|x64.Build.0 = Release|Any CPU {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Release|x86.ActiveCfg = Release|Any CPU {A2F5AF44-29FF-45D6-9D25-ECDA5CCE88B5}.Release|x86.Build.0 = Release|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Debug|x64.ActiveCfg = Debug|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Debug|x64.Build.0 = Debug|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Debug|x86.ActiveCfg = Debug|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Debug|x86.Build.0 = Debug|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Release|Any CPU.Build.0 = Release|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Release|x64.ActiveCfg = Release|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Release|x64.Build.0 = Release|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Release|x86.ActiveCfg = Release|Any CPU + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -545,5 +559,6 @@ Global {94F7ACF8-55E1-4A02-B9BC-A818413FDBBF} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} {CB0B0AA2-BB24-4BCA-A720-45E397684E12} = {57DF2A95-5DDD-4830-A4AF-B484B59C7C2B} {CE4A0D11-08A2-4CD6-9908-D6C62E80D805} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} + {12D0C43C-391F-4C74-92AB-82E9A9BEEB9B} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} EndGlobalSection EndGlobal -- cgit v1.3.1