diff --git a/ExampleForDocs.cs b/ExampleForDocs.cs index 5117233d296add1939337f583f4d1a4062e7bd1c..ec99037754c017c731145590ea2ac1dd1177b13c 100644 --- a/ExampleForDocs.cs +++ b/ExampleForDocs.cs @@ -1,5 +1,5 @@ - +//This is a example from our report, it is not part of the codebase public void Notify(Device sender, string event) { if (sender == thermostat && event== "Temprature Changed") diff --git a/FinalClassDiagram.png b/FinalClassDiagram.png new file mode 100644 index 0000000000000000000000000000000000000000..e84f81ef1ee1c9e71147ea809dfce88f05199757 Binary files /dev/null and b/FinalClassDiagram.png differ diff --git a/SmartHome.App/Program.cs b/SmartHome.App/Program.cs index e1ad7a39e22f591a9a286b50a0e684e2a2e2e108..ba90a1368d2538d75a4443e56857a76469d88938 100644 --- a/SmartHome.App/Program.cs +++ b/SmartHome.App/Program.cs @@ -12,15 +12,17 @@ public class Program var livingRoomThermometer = new ElectroluxThermometer(mediator, "LivingRoom"); var bedroomThermometer = new ElectroluxThermometer(mediator, "Bedroom"); - var livingRoomLight = new IKE565Col(mediator, "Living Room"); + var livingRoomLight = new IKE565Col(mediator, "LivingRoom"); var bedroomLight = new PH500Amb(mediator, "Bedroom"); - var livingRoomThermostat = new PhilipsThermostat(mediator, "Living Room"); + var livingRoomThermostat = new PhilipsThermostat(mediator, "LivingRoom"); var bedroomThermostat = new PhilipsThermostat(mediator, "Bedroom"); var frontDoorLock = new SamsungLock(mediator, "FrontDoor"); var backDoorLock = new PhilipsLock(mediator, "Back Door"); + + // Register devices with the mediator mediator.AddThermometer(livingRoomThermometer); mediator.AddThermometer(bedroomThermometer); @@ -36,10 +38,15 @@ public class Program // Test temp change Console.WriteLine("Simulating temperature change in Living Room..."); - livingRoomThermometer.SimualteTemperatureChange(22.5); + Console.WriteLine("Expecting lights and thermometers in the living room to react"); + livingRoomThermometer.SimualteTemperatureChange(40); + + Console.WriteLine(); + Console.WriteLine(); - // Test what heppens when we lock the door + // // Test what heppens when we lock the door Console.WriteLine("Locking the front door..."); + Console.WriteLine("Expecting all doors to lock because we are looking front door"); frontDoorLock.Locks(); } diff --git a/SmartHome.App/obj/Debug/net9.0/SmartHome.App.AssemblyInfo.cs b/SmartHome.App/obj/Debug/net9.0/SmartHome.App.AssemblyInfo.cs index 27f160950be9fa315b60cc5a5701c6a3e8566a54..88b7d08178d9b3b696fad7b76de0590c405437b9 100644 --- a/SmartHome.App/obj/Debug/net9.0/SmartHome.App.AssemblyInfo.cs +++ b/SmartHome.App/obj/Debug/net9.0/SmartHome.App.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("SmartHome.App")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ec661a7041a47f852d27b8ec01f922fd5a942b9c")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1468f64e5fc1a79d0625f44aa17f6ab6734d8137")] [assembly: System.Reflection.AssemblyProductAttribute("SmartHome.App")] [assembly: System.Reflection.AssemblyTitleAttribute("SmartHome.App")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/SmartHome.App/obj/Debug/net9.0/SmartHome.App.AssemblyInfoInputs.cache b/SmartHome.App/obj/Debug/net9.0/SmartHome.App.AssemblyInfoInputs.cache index 6582a89180142df1a3ad4de2936330a476fbc256..58708963a69382e7683f1bc72b5dee9dfcae407b 100644 --- a/SmartHome.App/obj/Debug/net9.0/SmartHome.App.AssemblyInfoInputs.cache +++ b/SmartHome.App/obj/Debug/net9.0/SmartHome.App.AssemblyInfoInputs.cache @@ -1 +1 @@ -6dee3d4c944744a222ca58771e7b3c3dda395da25d98c781600bf95c0aed4e9c +bdea85756725658e5a129b3ff564a6cb67c37aeb03918225c466958c630f380f diff --git a/SmartHome.App/obj/Debug/net9.0/SmartHome.App.GeneratedMSBuildEditorConfig.editorconfig b/SmartHome.App/obj/Debug/net9.0/SmartHome.App.GeneratedMSBuildEditorConfig.editorconfig index 0251ba857c70986c1c01b734edda003ea7aebadd..a6aa0690dcee68335ed62ad14c0563af9a39722e 100644 --- a/SmartHome.App/obj/Debug/net9.0/SmartHome.App.GeneratedMSBuildEditorConfig.editorconfig +++ b/SmartHome.App/obj/Debug/net9.0/SmartHome.App.GeneratedMSBuildEditorConfig.editorconfig @@ -8,7 +8,7 @@ build_property.PlatformNeutralAssembly = build_property.EnforceExtendedAnalyzerRules = build_property._SupportedPlatformList = Linux,macOS,Windows build_property.RootNamespace = SmartHome.App -build_property.ProjectDir = C:\Users\nadda\source\repos\SWD\handinswd\SmartHome.App\ +build_property.ProjectDir = C:\Data\Itm8\Repositories\4semester\designSWD\handinswd\SmartHome.App\ build_property.EnableComHosting = build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EffectiveAnalysisLevelStyle = 9.0 diff --git a/SmartHome.App/obj/Debug/net9.0/SmartHome.App.assets.cache b/SmartHome.App/obj/Debug/net9.0/SmartHome.App.assets.cache index 7143cec4bd16b0069a30a5d807eaa490c610b17e..a4bb6a1e67e327ca2c0d454d9e39624feb6cc6f3 100644 Binary files a/SmartHome.App/obj/Debug/net9.0/SmartHome.App.assets.cache and b/SmartHome.App/obj/Debug/net9.0/SmartHome.App.assets.cache differ diff --git a/SmartHome.App/obj/SmartHome.App.csproj.nuget.dgspec.json b/SmartHome.App/obj/SmartHome.App.csproj.nuget.dgspec.json index b69132a1461b325c35998c65f4e306dddb012fd1..a81da9cdb372a9f004044a7006b647323e08a23f 100644 --- a/SmartHome.App/obj/SmartHome.App.csproj.nuget.dgspec.json +++ b/SmartHome.App/obj/SmartHome.App.csproj.nuget.dgspec.json @@ -1,23 +1,23 @@ { "format": 1, "restore": { - "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj": {} + "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj": {} }, "projects": { - "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj": { + "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj": { "version": "1.0.0", "restore": { - "projectUniqueName": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj", + "projectUniqueName": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj", "projectName": "SmartHome.App", - "projectPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj", - "packagesPath": "C:\\Users\\nadda\\.nuget\\packages\\", - "outputPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.App\\obj\\", + "projectPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj", + "packagesPath": "C:\\Users\\alnaj\\.nuget\\packages\\", + "outputPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.App\\obj\\", "projectStyle": "PackageReference", "fallbackFolders": [ "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" ], "configFilePaths": [ - "C:\\Users\\nadda\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Users\\alnaj\\AppData\\Roaming\\NuGet\\NuGet.Config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" ], @@ -33,8 +33,8 @@ "net9.0": { "targetAlias": "net9.0", "projectReferences": { - "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj": { - "projectPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj" + "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj": { + "projectPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj" } } } @@ -74,20 +74,20 @@ } } }, - "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj": { + "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj": { "version": "1.0.0", "restore": { - "projectUniqueName": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", + "projectUniqueName": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", "projectName": "SmartHome.Lib", - "projectPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", - "packagesPath": "C:\\Users\\nadda\\.nuget\\packages\\", - "outputPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\obj\\", + "projectPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", + "packagesPath": "C:\\Users\\alnaj\\.nuget\\packages\\", + "outputPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\obj\\", "projectStyle": "PackageReference", "fallbackFolders": [ "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" ], "configFilePaths": [ - "C:\\Users\\nadda\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Users\\alnaj\\AppData\\Roaming\\NuGet\\NuGet.Config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" ], diff --git a/SmartHome.App/obj/SmartHome.App.csproj.nuget.g.props b/SmartHome.App/obj/SmartHome.App.csproj.nuget.g.props index 26f8ea966e9fcdcf732dd3f078d98a8cd8adb69c..ed5ee59546530b80be029762c836dbacd6925947 100644 --- a/SmartHome.App/obj/SmartHome.App.csproj.nuget.g.props +++ b/SmartHome.App/obj/SmartHome.App.csproj.nuget.g.props @@ -5,12 +5,12 @@ <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool> <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile> <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot> - <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\nadda\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders> + <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\alnaj\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders> <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle> <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.0</NuGetToolVersion> </PropertyGroup> <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> - <SourceRoot Include="C:\Users\nadda\.nuget\packages\" /> + <SourceRoot Include="C:\Users\alnaj\.nuget\packages\" /> <SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" /> </ItemGroup> </Project> \ No newline at end of file diff --git a/SmartHome.App/obj/project.assets.json b/SmartHome.App/obj/project.assets.json index 1e6b3faa5b6919fff0ed2d8b889bd1fcef2c8963..6ca41f167f87152526a32f007d7bd0ae830d3e14 100644 --- a/SmartHome.App/obj/project.assets.json +++ b/SmartHome.App/obj/project.assets.json @@ -27,23 +27,23 @@ ] }, "packageFolders": { - "C:\\Users\\nadda\\.nuget\\packages\\": {}, + "C:\\Users\\alnaj\\.nuget\\packages\\": {}, "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} }, "project": { "version": "1.0.0", "restore": { - "projectUniqueName": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj", + "projectUniqueName": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj", "projectName": "SmartHome.App", - "projectPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj", - "packagesPath": "C:\\Users\\nadda\\.nuget\\packages\\", - "outputPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.App\\obj\\", + "projectPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj", + "packagesPath": "C:\\Users\\alnaj\\.nuget\\packages\\", + "outputPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.App\\obj\\", "projectStyle": "PackageReference", "fallbackFolders": [ "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" ], "configFilePaths": [ - "C:\\Users\\nadda\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Users\\alnaj\\AppData\\Roaming\\NuGet\\NuGet.Config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" ], @@ -59,8 +59,8 @@ "net9.0": { "targetAlias": "net9.0", "projectReferences": { - "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj": { - "projectPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj" + "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj": { + "projectPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj" } } } diff --git a/SmartHome.App/obj/project.nuget.cache b/SmartHome.App/obj/project.nuget.cache index 3b827824e7ed3f3f22fe8cbb22adb76908317ae6..be6270cc9c444e2ad6ffa97928f18037d894f6d9 100644 --- a/SmartHome.App/obj/project.nuget.cache +++ b/SmartHome.App/obj/project.nuget.cache @@ -1,8 +1,8 @@ { "version": 2, - "dgSpecHash": "R74As9VQkhM=", + "dgSpecHash": "3YVf7fiQTug=", "success": true, - "projectFilePath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj", + "projectFilePath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.App\\SmartHome.App.csproj", "expectedPackageFiles": [], "logs": [] } \ No newline at end of file diff --git a/SmartHome.Lib/Behaviours/LightColorBehaviours/ChangeAmbientColor.cs b/SmartHome.Lib/Behaviours/LightColorBehaviours/ChangeAmbientColor.cs index f6f293903a006b44835c358ca3ee2fb8b8891df0..48e5c86d5bbed84a34c44822c28dcf15a3e080ca 100644 --- a/SmartHome.Lib/Behaviours/LightColorBehaviours/ChangeAmbientColor.cs +++ b/SmartHome.Lib/Behaviours/LightColorBehaviours/ChangeAmbientColor.cs @@ -2,6 +2,7 @@ public class ChangeAmbientColor : IColorBehaviour { public void SetColor(string color) { + Console.WriteLine($"Ambient color changed to {color}."); } } diff --git a/SmartHome.Lib/Behaviours/ThermostatTempChangeBehaviours/RadiatorThermostat.cs b/SmartHome.Lib/Behaviours/ThermostatTempChangeBehaviours/RadiatorThermostat.cs index fb33def11126c5eb795b7d8abc71a25d4f77b218..fe50267a58c5be72267266a001a887b268d8acae 100644 --- a/SmartHome.Lib/Behaviours/ThermostatTempChangeBehaviours/RadiatorThermostat.cs +++ b/SmartHome.Lib/Behaviours/ThermostatTempChangeBehaviours/RadiatorThermostat.cs @@ -4,11 +4,11 @@ public class RadiatorThermostat : ITemperatureChangeBehavior { public void DecreaseTemperature(int temp) { - throw new NotImplementedException(); + Console.WriteLine("Decreasing Temprature"); } public void IncreaseTemperature(int temp) { - throw new NotImplementedException(); + Console.WriteLine("Increasing Temprature"); } } \ No newline at end of file diff --git a/SmartHome.Lib/DeviceBaseClasses/Light.cs b/SmartHome.Lib/DeviceBaseClasses/Light.cs index 975eafb0634b93ca8097b5bce4c9cef34846eb87..599c8cc4627c0c8a4d48317e4de792d874796126 100644 --- a/SmartHome.Lib/DeviceBaseClasses/Light.cs +++ b/SmartHome.Lib/DeviceBaseClasses/Light.cs @@ -1,5 +1,8 @@ public class Light : SmartDevice { + + //Base class for all light devices + // this implements strategy pattern because it has behaviours that are set in the sub classes. protected IBrightnessBehavior _brightnessBehavior; protected IColorBehaviour _colorBehavior; @@ -11,16 +14,17 @@ public class Light : SmartDevice public void TurnOn() { - // Implementation for turning on the light + Console.WriteLine("Turning in light"); } public void TurnOff() { - // Implementation for turning off the light + Console.WriteLine("Turning off light"); } public void ChangeColor(string color) { + //Delegate call to behaviour _colorBehavior.SetColor(color); } diff --git a/SmartHome.Lib/DeviceBaseClasses/Lock.cs b/SmartHome.Lib/DeviceBaseClasses/Lock.cs index 5f02ee9b0a15ee86c89a3af00888c6ffd6fc615d..663396372e1e6d0df132d20c94a1e591fe0cc8f4 100644 --- a/SmartHome.Lib/DeviceBaseClasses/Lock.cs +++ b/SmartHome.Lib/DeviceBaseClasses/Lock.cs @@ -1,5 +1,8 @@ public class Lock : SmartDevice { + //This is the lock class that will use the lock behaviour to lock and unlock the door. + //It will also notify the mediator when the lock is locked or unlocked. + //Strategy pattern is used here protected ILockBehaviour _lockBehaviour; public Lock(ISmartHomeMediator mediator) : base(mediator) @@ -17,7 +20,8 @@ public class Lock : SmartDevice public void Unlock() { - // Implementation for rotating lock + _lockBehaviour.Unlock(); + Mediator.Notify(this, "Unlocked"); } diff --git a/SmartHome.Lib/DeviceBaseClasses/Thermometer.cs b/SmartHome.Lib/DeviceBaseClasses/Thermometer.cs index 3974519c8b3596b3b28b3aa2172989e7a0e6628c..703081c5d2f4865825c473706b304e88c9c3512f 100644 --- a/SmartHome.Lib/DeviceBaseClasses/Thermometer.cs +++ b/SmartHome.Lib/DeviceBaseClasses/Thermometer.cs @@ -1,7 +1,8 @@ public class Thermometer : SmartDevice { - protected double _temperature = 0.0; + //Base class for all Thermometers + protected double _temperature = 20; public Thermometer(ISmartHomeMediator mediator) : base(mediator) { @@ -9,9 +10,11 @@ public class Thermometer : SmartDevice public void SimualteTemperatureChange(double temperature) { - _temperature = temperature; + if (temperature != _temperature) { + _temperature = temperature; + //Send event is a SmartDevice method that notifies the mediator about the event SendEvent("TemperatureChanged"); } diff --git a/SmartHome.Lib/HomeMediator.cs b/SmartHome.Lib/HomeMediator.cs index f95b86895d93d8e282efbe067c1357968baa3884..1833885b6483f3b99cbf67426b9223180b5280f4 100644 --- a/SmartHome.Lib/HomeMediator.cs +++ b/SmartHome.Lib/HomeMediator.cs @@ -4,9 +4,11 @@ public class HomeMediator : ISmartHomeMediator private List<Lock> _locks = new(); private List<Thermostat> _thermostats = new(); private List<Thermometer> _thermometers = new(); + //This mediator allows for adding Devices at runtime. + //This is the notify method the smart devices will use to notify the mediator about events public void Notify(SmartDevice sender, string eventMessage) { if (sender is Lock) @@ -39,6 +41,8 @@ public class HomeMediator : ISmartHomeMediator _thermometers.Add(thermometer); } + + ///This method will be called when the lock is locked or unlocked, this is the handler method for lock events. public void ReactOnLock(SmartDevice sender, string eventMessage) { @@ -46,17 +50,18 @@ public class HomeMediator : ISmartHomeMediator { foreach (var item in _locks) { - item.Locks(); + if (item.Location != "FrontDoor") item.Locks(); } } } + ///This method will be called when the thermometer is changed, this is the handler method for thermometer events. public void ReactOnThermometer(SmartDevice sender, string eventMessage) { if (eventMessage == "TemperatureChanged") { - var location = (sender as Thermometer).Location; + var location = sender.Location; var temperature = (sender as Thermometer).GetTemperature(); var kelvin = temperature + 273.15 * 200; @@ -84,6 +89,8 @@ public class HomeMediator : ISmartHomeMediator } } } + + //This is a method that is called on the mediator to turn off all lights in the house. public void TurnOffAllLights() { foreach (var light in _lights) @@ -92,6 +99,7 @@ public class HomeMediator : ISmartHomeMediator } } + //This is a method that is called on the mediator to turn on all lights in the house. public void TurnOnAllLights() { foreach (var light in _lights) diff --git a/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.AssemblyInfo.cs b/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.AssemblyInfo.cs index 35b3dbee3715acc4002ce70b8e132916a203f167..796137a8a224118ed05f746f9c157fefd602f212 100644 --- a/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.AssemblyInfo.cs +++ b/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("SmartHome.Lib")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ec661a7041a47f852d27b8ec01f922fd5a942b9c")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1468f64e5fc1a79d0625f44aa17f6ab6734d8137")] [assembly: System.Reflection.AssemblyProductAttribute("SmartHome.Lib")] [assembly: System.Reflection.AssemblyTitleAttribute("SmartHome.Lib")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.AssemblyInfoInputs.cache b/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.AssemblyInfoInputs.cache index f3be5e11982591348622afdf58a5bff435643ead..3f43e4fe576977c5c8159cb741405a97d3009fe9 100644 --- a/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.AssemblyInfoInputs.cache +++ b/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.AssemblyInfoInputs.cache @@ -1 +1 @@ -d7dee6328978ad7da1ae295f9180fe568c02e17152d61238508adb1c8e9aab5d +16caeba47c6be3e6e9a82dbad912bc106fa29efc531bb7d6751d27eb684ef347 diff --git a/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.GeneratedMSBuildEditorConfig.editorconfig b/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.GeneratedMSBuildEditorConfig.editorconfig index c7f31d527e0d06512c4da1a13b8de0228dd989af..9a4e4c01779dbec95ab86a0ca30cba5781a891da 100644 --- a/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.GeneratedMSBuildEditorConfig.editorconfig +++ b/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.GeneratedMSBuildEditorConfig.editorconfig @@ -8,7 +8,7 @@ build_property.PlatformNeutralAssembly = build_property.EnforceExtendedAnalyzerRules = build_property._SupportedPlatformList = Linux,macOS,Windows build_property.RootNamespace = SmartHome.Lib -build_property.ProjectDir = C:\Users\nadda\source\repos\SWD\handinswd\SmartHome.Lib\ +build_property.ProjectDir = C:\Data\Itm8\Repositories\4semester\designSWD\handinswd\SmartHome.Lib\ build_property.EnableComHosting = build_property.EnableGeneratedComInterfaceComImportInterop = build_property.EffectiveAnalysisLevelStyle = 9.0 diff --git a/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.assets.cache b/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.assets.cache index ed4691e5e923e2955650612073bfe8fdfa42cded..c6c0ccf93ea3cb615bde128e96932c384bf93850 100644 Binary files a/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.assets.cache and b/SmartHome.Lib/obj/Debug/net9.0/SmartHome.Lib.assets.cache differ diff --git a/SmartHome.Lib/obj/SmartHome.Lib.csproj.nuget.dgspec.json b/SmartHome.Lib/obj/SmartHome.Lib.csproj.nuget.dgspec.json index ef4c81df1e01e09a1f187c3d2e174897dc6465d5..6cbc392712f15b5d7ea88bfbdd6d4c220b7a9698 100644 --- a/SmartHome.Lib/obj/SmartHome.Lib.csproj.nuget.dgspec.json +++ b/SmartHome.Lib/obj/SmartHome.Lib.csproj.nuget.dgspec.json @@ -1,23 +1,23 @@ { "format": 1, "restore": { - "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj": {} + "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj": {} }, "projects": { - "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj": { + "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj": { "version": "1.0.0", "restore": { - "projectUniqueName": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", + "projectUniqueName": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", "projectName": "SmartHome.Lib", - "projectPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", - "packagesPath": "C:\\Users\\nadda\\.nuget\\packages\\", - "outputPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\obj\\", + "projectPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", + "packagesPath": "C:\\Users\\alnaj\\.nuget\\packages\\", + "outputPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\obj\\", "projectStyle": "PackageReference", "fallbackFolders": [ "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" ], "configFilePaths": [ - "C:\\Users\\nadda\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Users\\alnaj\\AppData\\Roaming\\NuGet\\NuGet.Config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" ], diff --git a/SmartHome.Lib/obj/SmartHome.Lib.csproj.nuget.g.props b/SmartHome.Lib/obj/SmartHome.Lib.csproj.nuget.g.props index 26f8ea966e9fcdcf732dd3f078d98a8cd8adb69c..ed5ee59546530b80be029762c836dbacd6925947 100644 --- a/SmartHome.Lib/obj/SmartHome.Lib.csproj.nuget.g.props +++ b/SmartHome.Lib/obj/SmartHome.Lib.csproj.nuget.g.props @@ -5,12 +5,12 @@ <RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool> <ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile> <NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot> - <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\nadda\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders> + <NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\alnaj\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders> <NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle> <NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.13.0</NuGetToolVersion> </PropertyGroup> <ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' "> - <SourceRoot Include="C:\Users\nadda\.nuget\packages\" /> + <SourceRoot Include="C:\Users\alnaj\.nuget\packages\" /> <SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" /> </ItemGroup> </Project> \ No newline at end of file diff --git a/SmartHome.Lib/obj/project.assets.json b/SmartHome.Lib/obj/project.assets.json index da9036542b5868fdda2d3249768f493939ab37ef..d19202f2417a493b654368b0946370730e5ffe17 100644 --- a/SmartHome.Lib/obj/project.assets.json +++ b/SmartHome.Lib/obj/project.assets.json @@ -8,23 +8,23 @@ "net9.0": [] }, "packageFolders": { - "C:\\Users\\nadda\\.nuget\\packages\\": {}, + "C:\\Users\\alnaj\\.nuget\\packages\\": {}, "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} }, "project": { "version": "1.0.0", "restore": { - "projectUniqueName": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", + "projectUniqueName": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", "projectName": "SmartHome.Lib", - "projectPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", - "packagesPath": "C:\\Users\\nadda\\.nuget\\packages\\", - "outputPath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\obj\\", + "projectPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", + "packagesPath": "C:\\Users\\alnaj\\.nuget\\packages\\", + "outputPath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\obj\\", "projectStyle": "PackageReference", "fallbackFolders": [ "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" ], "configFilePaths": [ - "C:\\Users\\nadda\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Users\\alnaj\\AppData\\Roaming\\NuGet\\NuGet.Config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" ], diff --git a/SmartHome.Lib/obj/project.nuget.cache b/SmartHome.Lib/obj/project.nuget.cache index b4cbd4ea05d60da9aded1d1db6ffa8eb1a84b4a7..d3927cdcd09962d21f044633256f5328949dc1af 100644 --- a/SmartHome.Lib/obj/project.nuget.cache +++ b/SmartHome.Lib/obj/project.nuget.cache @@ -1,8 +1,8 @@ { "version": 2, - "dgSpecHash": "Z8BYAI5QS48=", + "dgSpecHash": "XVUkJaqY93g=", "success": true, - "projectFilePath": "C:\\Users\\nadda\\source\\repos\\SWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", + "projectFilePath": "C:\\Data\\Itm8\\Repositories\\4semester\\designSWD\\handinswd\\SmartHome.Lib\\SmartHome.Lib.csproj", "expectedPackageFiles": [], "logs": [] } \ No newline at end of file diff --git a/plantuml/ExampleForDocs.puml b/plantuml/ExampleForDocs.puml new file mode 100644 index 0000000000000000000000000000000000000000..7a1a0090c38b6a1750ffbc7d97df7a4c34d96f05 --- /dev/null +++ b/plantuml/ExampleForDocs.puml @@ -0,0 +1,2 @@ +@startuml +@enduml diff --git a/plantuml/SeqeunceDiagram.puml b/plantuml/SeqeunceDiagram.puml new file mode 100644 index 0000000000000000000000000000000000000000..cadce0206bcd057e7bd38a26e623dc4b82bdfe17 --- /dev/null +++ b/plantuml/SeqeunceDiagram.puml @@ -0,0 +1,19 @@ +@startuml + +participant User +participant HomeMediator +participant ElectroluxThermometer as Thermometer +participant IKE565Col as Light +participant PhilipsThermostat as Thermostat +participant SamsungLock as Lock + + +User -> Thermometer: SimulateTemperatureChange(40) +Thermometer -> HomeMediator: Notify(TemperatureChanged) +HomeMediator -> Light: React to temperature change +HomeMediator -> Thermostat: React to temperature change + +User -> Lock: Locks() +Lock -> HomeMediator: Notify(Locked) +HomeMediator -> Lock: React to lock event (lock all doors) +@enduml \ No newline at end of file diff --git a/plantuml/SmartHome.Lib/Behaviours/LightBrightnessBehaviours/ChangeBrightness.puml b/plantuml/SmartHome.Lib/Behaviours/LightBrightnessBehaviours/ChangeBrightness.puml new file mode 100644 index 0000000000000000000000000000000000000000..5422cf9c3138a8927212dad6d0112b3316099e54 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/LightBrightnessBehaviours/ChangeBrightness.puml @@ -0,0 +1,6 @@ +@startuml +class ChangeBrightness { + + SetBrightness(level:int) : void +} +IBrightnessBehavior <|.. ChangeBrightness +@enduml diff --git a/plantuml/SmartHome.Lib/Behaviours/LightBrightnessBehaviours/ConstantBrightness.puml b/plantuml/SmartHome.Lib/Behaviours/LightBrightnessBehaviours/ConstantBrightness.puml new file mode 100644 index 0000000000000000000000000000000000000000..63052df75c3ec3b7293b02d6ae59b7b84a10dcf4 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/LightBrightnessBehaviours/ConstantBrightness.puml @@ -0,0 +1,6 @@ +@startuml +class ConstantBrightness { + + SetBrightness(level:int) : void +} +IBrightnessBehavior <|.. ConstantBrightness +@enduml diff --git a/plantuml/SmartHome.Lib/Behaviours/LightColorBehaviours/ChangeAmbientColor.puml b/plantuml/SmartHome.Lib/Behaviours/LightColorBehaviours/ChangeAmbientColor.puml new file mode 100644 index 0000000000000000000000000000000000000000..20a2b6e895eed7dd81ee00ebf82279e810a6eef8 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/LightColorBehaviours/ChangeAmbientColor.puml @@ -0,0 +1,6 @@ +@startuml +class ChangeAmbientColor { + + SetColor(color:string) : void +} +IColorBehaviour <|.. ChangeAmbientColor +@enduml diff --git a/plantuml/SmartHome.Lib/Behaviours/LightColorBehaviours/ChangeColor.puml b/plantuml/SmartHome.Lib/Behaviours/LightColorBehaviours/ChangeColor.puml new file mode 100644 index 0000000000000000000000000000000000000000..9bae47c9f6cf6d6442876853208c7cd7bd0cbb41 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/LightColorBehaviours/ChangeColor.puml @@ -0,0 +1,6 @@ +@startuml +class ChangeColor { + + SetColor(color:string) : void +} +IColorBehaviour <|-- ChangeColor +@enduml diff --git a/plantuml/SmartHome.Lib/Behaviours/LockBehaviours/RotatingLock.puml b/plantuml/SmartHome.Lib/Behaviours/LockBehaviours/RotatingLock.puml new file mode 100644 index 0000000000000000000000000000000000000000..4864d75d8631afcbab1087e0e859d64428feccc3 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/LockBehaviours/RotatingLock.puml @@ -0,0 +1,7 @@ +@startuml +class RotatingLock { + + Lock() : void + + Unlock() : void +} +ILockBehaviour <|.. RotatingLock +@enduml diff --git a/plantuml/SmartHome.Lib/Behaviours/LockBehaviours/SlidingLock.puml b/plantuml/SmartHome.Lib/Behaviours/LockBehaviours/SlidingLock.puml new file mode 100644 index 0000000000000000000000000000000000000000..43c8d24acfdb90f594c7ef3bf35ec65ecc6e9cf6 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/LockBehaviours/SlidingLock.puml @@ -0,0 +1,7 @@ +@startuml +class SlidingLock { + + Lock() : void + + Unlock() : void +} +ILockBehaviour <|.. SlidingLock +@enduml diff --git a/plantuml/SmartHome.Lib/Behaviours/ThermostatDisplayBehaviours/LCDDisplay.puml b/plantuml/SmartHome.Lib/Behaviours/ThermostatDisplayBehaviours/LCDDisplay.puml new file mode 100644 index 0000000000000000000000000000000000000000..6113f8d69d72f891e1e8d8fd125e8c883d090958 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/ThermostatDisplayBehaviours/LCDDisplay.puml @@ -0,0 +1,6 @@ +@startuml +class LCDDisplay { + + DisplayTemperature() : void +} +IDisplayTemperatureBehavior <|.. LCDDisplay +@enduml diff --git a/plantuml/SmartHome.Lib/Behaviours/ThermostatDisplayBehaviours/LEDDisplay.puml b/plantuml/SmartHome.Lib/Behaviours/ThermostatDisplayBehaviours/LEDDisplay.puml new file mode 100644 index 0000000000000000000000000000000000000000..ae58bc799b560dfd2254a7bb43cf5d4b86964759 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/ThermostatDisplayBehaviours/LEDDisplay.puml @@ -0,0 +1,6 @@ +@startuml +class LEDDisplay { + + DisplayTemperature() : void +} +IDisplayTemperatureBehavior <|.. LEDDisplay +@enduml diff --git a/plantuml/SmartHome.Lib/Behaviours/ThermostatDisplayBehaviours/NoDisplay.puml b/plantuml/SmartHome.Lib/Behaviours/ThermostatDisplayBehaviours/NoDisplay.puml new file mode 100644 index 0000000000000000000000000000000000000000..dc5bf4d882f1fe86314296bf1c54929e6635c6a8 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/ThermostatDisplayBehaviours/NoDisplay.puml @@ -0,0 +1,6 @@ +@startuml +class NoDisplay { + + DisplayTemperature() : void +} +IDisplayTemperatureBehavior <|.. NoDisplay +@enduml diff --git a/plantuml/SmartHome.Lib/Behaviours/ThermostatTempChangeBehaviours/HeatPumpThermostat.puml b/plantuml/SmartHome.Lib/Behaviours/ThermostatTempChangeBehaviours/HeatPumpThermostat.puml new file mode 100644 index 0000000000000000000000000000000000000000..88e6e7495ff7958b5b022670722af66700924298 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/ThermostatTempChangeBehaviours/HeatPumpThermostat.puml @@ -0,0 +1,7 @@ +@startuml +class HeatPumpThermostat { + + DecreaseTemperature(temp:int) : void + + IncreaseTemperature(temp:int) : void +} +ITemperatureChangeBehavior <|.. HeatPumpThermostat +@enduml diff --git a/plantuml/SmartHome.Lib/Behaviours/ThermostatTempChangeBehaviours/RadiatorThermostat.puml b/plantuml/SmartHome.Lib/Behaviours/ThermostatTempChangeBehaviours/RadiatorThermostat.puml new file mode 100644 index 0000000000000000000000000000000000000000..b56897beeb51f1a794b47b4a4f9dc6041a69f7a9 --- /dev/null +++ b/plantuml/SmartHome.Lib/Behaviours/ThermostatTempChangeBehaviours/RadiatorThermostat.puml @@ -0,0 +1,7 @@ +@startuml +class RadiatorThermostat { + + DecreaseTemperature(temp:int) : void + + IncreaseTemperature(temp:int) : void +} +ITemperatureChangeBehavior <|.. RadiatorThermostat +@enduml diff --git a/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLights/IKE565Col.puml b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLights/IKE565Col.puml new file mode 100644 index 0000000000000000000000000000000000000000..f708b7fd09903e5454f5aa5e5607d4080cb65a3a --- /dev/null +++ b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLights/IKE565Col.puml @@ -0,0 +1,6 @@ +@startuml +class IKE565Col { + + IKE565Col(mediator:ISmartHomeMediator, location:string) +} +Light <|-- IKE565Col +@enduml diff --git a/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLights/PH500Amb.puml b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLights/PH500Amb.puml new file mode 100644 index 0000000000000000000000000000000000000000..b205014f2c45e89f2052765b721662f7e77b7518 --- /dev/null +++ b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLights/PH500Amb.puml @@ -0,0 +1,6 @@ +@startuml +class PH500Amb { + + PH500Amb(mediator:ISmartHomeMediator, location:string) +} +Light <|-- PH500Amb +@enduml diff --git a/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLocks/PhilipsLock.puml b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLocks/PhilipsLock.puml new file mode 100644 index 0000000000000000000000000000000000000000..05623007da033536beb9b05de904bf3c31865a20 --- /dev/null +++ b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLocks/PhilipsLock.puml @@ -0,0 +1,6 @@ +@startuml +class PhilipsLock { + + PhilipsLock(mediator:ISmartHomeMediator, location:string) +} +Lock <|-- PhilipsLock +@enduml diff --git a/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLocks/SamsungLock.puml b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLocks/SamsungLock.puml new file mode 100644 index 0000000000000000000000000000000000000000..04088288a73d1fefd66321f95ff2d10120fae539 --- /dev/null +++ b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteLocks/SamsungLock.puml @@ -0,0 +1,6 @@ +@startuml +class SamsungLock { + + SamsungLock(mediator:ISmartHomeMediator, location:string) +} +Lock <|-- SamsungLock +@enduml diff --git a/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteThermometers/ElectroluxThermometer.puml b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteThermometers/ElectroluxThermometer.puml new file mode 100644 index 0000000000000000000000000000000000000000..e82ba3f1be32174944e66139d1a3cc12f60cc576 --- /dev/null +++ b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteThermometers/ElectroluxThermometer.puml @@ -0,0 +1,6 @@ +@startuml +class ElectroluxThermometer { + + ElectroluxThermometer(mediator:ISmartHomeMediator, location:string) +} +Thermometer <|-- ElectroluxThermometer +@enduml diff --git a/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteThermostats/PhilipsThermostat.puml b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteThermostats/PhilipsThermostat.puml new file mode 100644 index 0000000000000000000000000000000000000000..396cc5770481dd44e2fe941634777c5873ac107a --- /dev/null +++ b/plantuml/SmartHome.Lib/ConcreteDevices/ConcreteThermostats/PhilipsThermostat.puml @@ -0,0 +1,6 @@ +@startuml +class PhilipsThermostat { + + PhilipsThermostat(mediator:ISmartHomeMediator, location:string) +} +Thermostat <|-- PhilipsThermostat +@enduml diff --git a/plantuml/SmartHome.Lib/DeviceBaseClasses/Light.puml b/plantuml/SmartHome.Lib/DeviceBaseClasses/Light.puml new file mode 100644 index 0000000000000000000000000000000000000000..1f1c42c25f293852c547ee86ff0d60fb43891ade --- /dev/null +++ b/plantuml/SmartHome.Lib/DeviceBaseClasses/Light.puml @@ -0,0 +1,10 @@ +@startuml +class Light { + + Light(mediator:ISmartHomeMediator) + + TurnOn() : void + + TurnOff() : void + + ChangeColor(color:string) : void + + ChangeBrightness(level:int) : void +} +SmartDevice <|-- Light +@enduml diff --git a/plantuml/SmartHome.Lib/DeviceBaseClasses/Lock.puml b/plantuml/SmartHome.Lib/DeviceBaseClasses/Lock.puml new file mode 100644 index 0000000000000000000000000000000000000000..31815064798b8b8b220717ee2df23a6edf539b18 --- /dev/null +++ b/plantuml/SmartHome.Lib/DeviceBaseClasses/Lock.puml @@ -0,0 +1,8 @@ +@startuml +class Lock { + + Lock(mediator:ISmartHomeMediator) + + Locks() : void + + Unlock() : void +} +SmartDevice <|-- Lock +@enduml diff --git a/plantuml/SmartHome.Lib/DeviceBaseClasses/Thermometer.puml b/plantuml/SmartHome.Lib/DeviceBaseClasses/Thermometer.puml new file mode 100644 index 0000000000000000000000000000000000000000..4fd30f61b2e52c20e44899c0fbb1031a1ca8d0eb --- /dev/null +++ b/plantuml/SmartHome.Lib/DeviceBaseClasses/Thermometer.puml @@ -0,0 +1,8 @@ +@startuml +class Thermometer { + + Thermometer(mediator:ISmartHomeMediator) + + SimualteTemperatureChange(temperature:double) : void + + GetTemperature() : double +} +SmartDevice <|-- Thermometer +@enduml diff --git a/plantuml/SmartHome.Lib/DeviceBaseClasses/Thermostat.puml b/plantuml/SmartHome.Lib/DeviceBaseClasses/Thermostat.puml new file mode 100644 index 0000000000000000000000000000000000000000..a689ab531f479adf583693fb195fc07fadfd5a14 --- /dev/null +++ b/plantuml/SmartHome.Lib/DeviceBaseClasses/Thermostat.puml @@ -0,0 +1,10 @@ +@startuml +class Thermostat { + + Thermostat(mediator:ISmartHomeMediator) + + DisplayTemperature() : void + + SetTemperature(temp:int) : void + + IncreaseTemperature(temp:int) : void + + DecreaseTemperature(temp:int) : void +} +SmartDevice <|-- Thermostat +@enduml diff --git a/plantuml/SmartHome.Lib/HomeMediator.puml b/plantuml/SmartHome.Lib/HomeMediator.puml new file mode 100644 index 0000000000000000000000000000000000000000..5cb0648c1dcce70ad371f1671796794e7a454ca5 --- /dev/null +++ b/plantuml/SmartHome.Lib/HomeMediator.puml @@ -0,0 +1,15 @@ +@startuml +class HomeMediator { + + Notify(sender:SmartDevice, eventMessage:string) : void + + AddLight(light:Light) : void + + AddLock(lockDevice:Lock) : void + + AddThermostat(thermostat:Thermostat) : void + + AddThermometer(thermometer:Thermometer) : void + + ReactOnLock(sender:SmartDevice, eventMessage:string) : void + + ReactOnThermometer(sender:SmartDevice, eventMessage:string) : void + + TurnOffAllLights() : void + + TurnOnAllLights() : void +} +ISmartHomeMediator <|-- HomeMediator + +@enduml diff --git a/plantuml/SmartHome.Lib/Interfaces/IBrightnessBehaviour.puml b/plantuml/SmartHome.Lib/Interfaces/IBrightnessBehaviour.puml new file mode 100644 index 0000000000000000000000000000000000000000..e28e760a91c6a44ea2dac127d3d0ec84ea6587b3 --- /dev/null +++ b/plantuml/SmartHome.Lib/Interfaces/IBrightnessBehaviour.puml @@ -0,0 +1,4 @@ +@startuml +interface IBrightnessBehavior { +} +@enduml diff --git a/plantuml/SmartHome.Lib/Interfaces/IColorBehaviour.puml b/plantuml/SmartHome.Lib/Interfaces/IColorBehaviour.puml new file mode 100644 index 0000000000000000000000000000000000000000..8534f7fd118b8ec34582368bde473f95806b4d8e --- /dev/null +++ b/plantuml/SmartHome.Lib/Interfaces/IColorBehaviour.puml @@ -0,0 +1,5 @@ +@startuml +interface IColorBehaviour { + + SetColor(color:string) : void +} +@enduml diff --git a/plantuml/SmartHome.Lib/Interfaces/IDisplayTemperatureBehavior.puml b/plantuml/SmartHome.Lib/Interfaces/IDisplayTemperatureBehavior.puml new file mode 100644 index 0000000000000000000000000000000000000000..84b13412f6266a8cebaa732697bcc14f08c48d32 --- /dev/null +++ b/plantuml/SmartHome.Lib/Interfaces/IDisplayTemperatureBehavior.puml @@ -0,0 +1,4 @@ +@startuml +interface IDisplayTemperatureBehavior { +} +@enduml diff --git a/plantuml/SmartHome.Lib/Interfaces/ILockBehaviour.puml b/plantuml/SmartHome.Lib/Interfaces/ILockBehaviour.puml new file mode 100644 index 0000000000000000000000000000000000000000..dc8a854ebf713072f3032ad7cb08f0fee85cb7b4 --- /dev/null +++ b/plantuml/SmartHome.Lib/Interfaces/ILockBehaviour.puml @@ -0,0 +1,4 @@ +@startuml +interface ILockBehaviour { +} +@enduml diff --git a/plantuml/SmartHome.Lib/Interfaces/ISmartHomeMediator.puml b/plantuml/SmartHome.Lib/Interfaces/ISmartHomeMediator.puml new file mode 100644 index 0000000000000000000000000000000000000000..ae1f1eee740f5e9aff247d6f77d95eca4adf18e1 --- /dev/null +++ b/plantuml/SmartHome.Lib/Interfaces/ISmartHomeMediator.puml @@ -0,0 +1,5 @@ +@startuml +interface ISmartHomeMediator { + + Notify(sender:SmartDevice, eventMessage:string) : void +} +@enduml diff --git a/plantuml/SmartHome.Lib/Interfaces/ITemperatureChangeBehavior.puml b/plantuml/SmartHome.Lib/Interfaces/ITemperatureChangeBehavior.puml new file mode 100644 index 0000000000000000000000000000000000000000..103435d8aa2ef292d14ab645601f8ca553b52818 --- /dev/null +++ b/plantuml/SmartHome.Lib/Interfaces/ITemperatureChangeBehavior.puml @@ -0,0 +1,4 @@ +@startuml +interface ITemperatureChangeBehavior { +} +@enduml diff --git a/plantuml/SmartHome.Lib/SmartDevice.puml b/plantuml/SmartHome.Lib/SmartDevice.puml new file mode 100644 index 0000000000000000000000000000000000000000..d4e806cd88265c0721cb6aba3b6bc04a5cb5433f --- /dev/null +++ b/plantuml/SmartHome.Lib/SmartDevice.puml @@ -0,0 +1,6 @@ +@startuml +class SmartDevice { + + Location : string <<get>> <<set>> + + SendEvent(eventMessage:string) : void +} +@enduml diff --git a/plantuml/include.puml b/plantuml/include.puml new file mode 100644 index 0000000000000000000000000000000000000000..7e4d92eab358760ee42feb3e2b96308b82ad455e --- /dev/null +++ b/plantuml/include.puml @@ -0,0 +1,39 @@ +@startuml + +!include .\\SmartHome.Lib\HomeMediator.puml +!include .\\SmartHome.Lib\SmartDevice.puml +!include .\\SmartHome.Lib\DeviceBaseClasses\Light.puml +!include .\\SmartHome.Lib\DeviceBaseClasses\Lock.puml +!include .\\SmartHome.Lib\DeviceBaseClasses\Thermometer.puml +!include .\\SmartHome.Lib\DeviceBaseClasses\Thermostat.puml +!include .\\SmartHome.Lib\Interfaces\IBrightnessBehaviour.puml +!include .\\SmartHome.Lib\Interfaces\IColorBehaviour.puml +!include .\\SmartHome.Lib\Interfaces\IDisplayTemperatureBehavior.puml +!include .\\SmartHome.Lib\Interfaces\ILockBehaviour.puml +!include .\\SmartHome.Lib\Interfaces\ISmartHomeMediator.puml +!include .\\SmartHome.Lib\Interfaces\ITemperatureChangeBehavior.puml +!include .\\SmartHome.Lib\Behaviours\LightBrightnessBehaviours\ChangeBrightness.puml +!include .\\SmartHome.Lib\Behaviours\LightBrightnessBehaviours\ConstantBrightness.puml +!include .\\SmartHome.Lib\Behaviours\LightColorBehaviours\ChangeAmbientColor.puml +!include .\\SmartHome.Lib\Behaviours\LightColorBehaviours\ChangeColor.puml +!include .\\SmartHome.Lib\Behaviours\LockBehaviours\RotatingLock.puml +!include .\\SmartHome.Lib\Behaviours\LockBehaviours\SlidingLock.puml +!include .\\SmartHome.Lib\Behaviours\ThermostatDisplayBehaviours\LCDDisplay.puml +!include .\\SmartHome.Lib\Behaviours\ThermostatDisplayBehaviours\LEDDisplay.puml +!include .\\SmartHome.Lib\Behaviours\ThermostatDisplayBehaviours\NoDisplay.puml +!include .\\SmartHome.Lib\Behaviours\ThermostatTempChangeBehaviours\HeatPumpThermostat.puml +!include .\\SmartHome.Lib\Behaviours\ThermostatTempChangeBehaviours\RadiatorThermostat.puml +!include .\\SmartHome.Lib\ConcreteDevices\ConcreteLights\IKE565Col.puml +!include .\\SmartHome.Lib\ConcreteDevices\ConcreteLights\PH500Amb.puml +!include .\\SmartHome.Lib\ConcreteDevices\ConcreteLocks\PhilipsLock.puml +!include .\\SmartHome.Lib\ConcreteDevices\ConcreteLocks\SamsungLock.puml +!include .\\SmartHome.Lib\ConcreteDevices\ConcreteThermometers\ElectroluxThermometer.puml +!include .\\SmartHome.Lib\ConcreteDevices\ConcreteThermostats\PhilipsThermostat.puml +ISmartHomeMediator <-- SmartDevice +IBrightnessBehavior <-- Light +IColorBehaviour <-- Light +Lock --> ILockBehaviour +ITemperatureChangeBehavior <-- Thermostat +Thermostat --> IDisplayTemperatureBehavior + +@enduml