You can subscribe to this list here.
2007 |
Jan
(36) |
Feb
(79) |
Mar
(123) |
Apr
(95) |
May
(119) |
Jun
(172) |
Jul
(124) |
Aug
(100) |
Sep
(83) |
Oct
(52) |
Nov
(97) |
Dec
(87) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(131) |
Feb
(80) |
Mar
(163) |
Apr
(178) |
May
(73) |
Jun
(54) |
Jul
(106) |
Aug
(118) |
Sep
(50) |
Oct
(125) |
Nov
(100) |
Dec
(99) |
2009 |
Jan
(104) |
Feb
(99) |
Mar
(68) |
Apr
(81) |
May
(52) |
Jun
(87) |
Jul
(67) |
Aug
(33) |
Sep
(27) |
Oct
(37) |
Nov
(60) |
Dec
(116) |
2010 |
Jan
(82) |
Feb
(79) |
Mar
(38) |
Apr
(50) |
May
(45) |
Jun
(53) |
Jul
(23) |
Aug
(86) |
Sep
(22) |
Oct
(96) |
Nov
(97) |
Dec
(73) |
2011 |
Jan
(24) |
Feb
(45) |
Mar
(28) |
Apr
(31) |
May
(42) |
Jun
(25) |
Jul
|
Aug
(12) |
Sep
(28) |
Oct
(13) |
Nov
(43) |
Dec
(13) |
2012 |
Jan
(62) |
Feb
(28) |
Mar
(6) |
Apr
(16) |
May
(7) |
Jun
|
Jul
(16) |
Aug
(2) |
Sep
(1) |
Oct
(4) |
Nov
(1) |
Dec
(3) |
2013 |
Jan
(5) |
Feb
|
Mar
(34) |
Apr
(9) |
May
(6) |
Jun
(10) |
Jul
(32) |
Aug
(8) |
Sep
(11) |
Oct
(35) |
Nov
(24) |
Dec
(22) |
2014 |
Jan
(44) |
Feb
(9) |
Mar
(9) |
Apr
(15) |
May
(25) |
Jun
(34) |
Jul
(16) |
Aug
(11) |
Sep
(7) |
Oct
(6) |
Nov
(1) |
Dec
(12) |
2015 |
Jan
(33) |
Feb
(19) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
From: <hor...@us...> - 2012-01-18 09:01:05
|
Revision: 4414 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4414&view=rev Author: horned-reaper Date: 2012-01-18 09:00:52 +0000 (Wed, 18 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/Docs/Ausstehend.txt trunk/plugins/FritzBox/Docs/Changes.txt trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/Settings.cs trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/GenerateResource-ResGen.read.1.tlog trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/releases/update.xml Added Paths: ----------- trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4413.mpe1 Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2012-01-17 23:36:10 UTC (rev 4413) +++ trunk/plugins/FritzBox/Build/Build.log 2012-01-18 09:00:52 UTC (rev 4414) @@ -1,6 +1,6 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -SVN Version: 4403 +SVN Version: 4413 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs @@ -10,7 +10,7 @@ [Microsoft .NET Framework, Version 4.0.30319.239] Copyright (C) Microsoft Corporation 2007. All rights reserved. -Build started 14.01.2012 18:41:28. +Build started 18.01.2012 09:46:45. Project "D:\FritzBox\FritzBox.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Mixed Platforms". @@ -154,8 +154,8 @@ Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.DebugForm.resources". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.exe". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.pdb". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog". + Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog". + Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog". CoreResGen: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" /r:D:\FritzBox\FritzBox\bin\Release\FritzBox.dll /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Drawing.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /compile DebugForm.resx,obj\Release\FritzBoxDebugger.DebugForm.resources Processing resource file "DebugForm.resx" into "obj\Release\FritzBoxDebugger.DebugForm.resources". @@ -195,7 +195,7 @@ 0 Warning(s) 0 Error(s) -Time Elapsed 00:00:02.20 +Time Elapsed 00:00:02.46 Reverting to build 0 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs @@ -280,7 +280,7 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 18:41:32 +Build started at 09:46:50 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Writing UpdateXML to "update.xml" Modified: trunk/plugins/FritzBox/Docs/Ausstehend.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-01-17 23:36:10 UTC (rev 4413) +++ trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-01-18 09:00:52 UTC (rev 4414) @@ -3,8 +3,6 @@ Fehler beheben: - auch bei einem "Unbekannten Anrufer" (unterdr\xFCckte bzw. nicht \xFCbertragene Rufnummer) \xF6ffnet sich \xFCber das Kontextrufen "zur\xFCckrufen". Sollte man deaktivieren -- bei Auswahl einer MSN im Konfigurationsdialog werden die MSN-Eintr\xE4ge verdoppelt -- Configuration: erste MSN wird nicht im Dropdown-Men\xFC angezeigt - btnModus umbenennen? - ObjectDisposed-Exception bei Client-Stop - ein kleiner schwarzer Balken \xFCberdeckt das erste Zeichen oder die erste Ziffer zur H\xE4lfte @@ -18,7 +16,7 @@ - Rufnummer-Typ hinzuf\xFCgen - GUI-Adressbuch - Anruf-Benachrichtigungen -- Telefonbuch editierbar machen (f\xFCr FRITZ!Box-Versionen ohne Telefonbuch), ImageURL-Feld editierbar machen +- Telefonbuch editierbar machen (f\xFCr FRITZ!Box-Versionen ohne Telefonbuch), ImageURL-Feld hinzuf\xFCgen und nur synchronisieren, wenn im FRITZ!Box-Telefonbuch vorhanden - R\xFCckw\xE4rtssuche wieder integrieren - Kontextmen\xFC f\xFCr Telefonbuch - Wiki-Eintrag @@ -31,6 +29,9 @@ Anwenderw\xFCnsche: +IchBinsShort, 05.01.2012, 18:02: +Noch eine andere Frage ist es auch m\xF6glich das bei ausgehenden Anrufen nur bei bestimmten Handger\xE4ten der Pause Befehl gesendet wird. Ich benutze drei Funktelefone \xFCber die Dect Funktion der Fritzbox 7020, Garten, Eltern und bei mir. W\xE4re also sch\xF6n wenn nur auf Pause gestellt wird wenn von meinem Telefon eine Anruf get\xE4tigt wird. + Scrounger, 05.12.2011: Was ich wirklich verdammt gerne noch h\xE4tte, w\xE4re die M\xF6glichkeit, sich auf dem Basic Home Screen die verpassten anrufe anzeigen zu lassen oder die letzten 3 Anrufe. K\xF6nntet ihr das evtl. in eine kommende Version integrieren? Was ich damit meine ist, dass du evtl. 3 globale Variablen (AnruferName bzw. Nr. und Bild) zur Verf\xFCgung stellen k\xF6nntest, die dann jeder Skindesigner in seinem BasicHome integrieren k\xF6nnte. Z.B. wie das beim DriveFreeSpace Plugin geht oder bei den Plugins von Micropolis. @@ -46,7 +47,7 @@ Die Notifications bei eingehenden/ausgehenden Rufen funktionieren mit dem Skin problemlos. Wenn man allerdings in den Plugins-Bereichs geht, um z.B. die Anrufliste anzuzeigen, passiert erst mal gar nichts und dann kommt so ein ewig durchlaufender Fortschrittsbalken ohne da\xDF etwas passiert. -Stefan: +Stefan Rinke: - Abspielen von Sprachnachrichten nach dem Anklicken im Home-Screen: add onAction handler to catch custom action from home screen button damit k\xF6nnten man ein Control auf dem HomeScreen erscheinen lassen @@ -57,17 +58,14 @@ mu\xDF warum gibt es kein Buttons wo ich die Listen direKt anw\xE4hlen kann oder \xFCbersehe ich da was. Gru\xDF Burkh2407 -IchBinsShort, 05.01.2012, 18:02: -Noch eine andere Frage ist es auch m\xF6glich das bei ausgehenden Anrufen nur bei bestimmten Handger\xE4ten der Pause Befehl gesendet wird. Ich benutze drei Funktelefone \xFCber die Dect Funktion der Fritzbox 7020, Garten, Eltern und bei mir. W\xE4re also sch\xF6n wenn nur auf Pause gestellt wird wenn von meinem Telefon eine Anruf get\xE4tigt wird. - creativ, 10.01.2012, 19:53: -Was nur noch eingebaut werden sollte, das dort Kontakte abgew\xE4hlt werden k\xF6nnen die im MP dann nicht angezeigt werden! Ich habe n\xE4mlich das Fritz!Fon MT-F und dort sind Kontakte im internen Speicher die nicht gel\xF6scht werden k\xF6nnen, z.b. (wie klingt HD-Telefonie und daf\xFCr gibt es eine Telefonnumer die hinterlegt ist). +Was nur noch eingebaut werden sollte, das im Telefonbuch Kontakte abgew\xE4hlt werden k\xF6nnen die im MP dann nicht angezeigt werden! Ich habe n\xE4mlich das Fritz!Fon MT-F und dort sind Kontakte im internen Speicher die nicht gel\xF6scht werden k\xF6nnen, z.b. (wie klingt HD-Telefonie und daf\xFCr gibt es eine Telefonnumer die hinterlegt ist). IchBinsShort, 11.01.2012, 00:28: L\xF6schen von Anruflisten \xFCber die GUI -creativ, 20.01.2012, 19:53: -Ausblenden bestimmter Kontakte in der GUI +IchBinsShort, 17.01.2012, 15:05: +Ich h\xE4tte noch Idee, wei\xDF nicht ob dies M\xF6glich ist. Aber sch\xF6n w\xE4re es wenn Mediaportal aus dem Standby oder Hibernate erwacht anzeigen w\xFCrde wenn es verpasste Anrufe gibt. Also das vlt. ein Popup Fenster sich \xF6ffnet und anzeigt das es verpasste Anrufe gibt... Ist dies wohl M\xF6glich ? -AlfredENeuma, 13.01.2012, 12:10: -Vielleicht w\xE4re das eine M\xF6glichkeit f\xFCr die Zukunft: Im Telefonbuch des Plugins eine zus\xE4tzliche Spalte f\xFCr Bilder (lokal oder auf FB USB Stick). Diese Eintr\xE4ge k\xF6nnten dann verwendet werden, wenn die FB keine Eintr\xE4ge f\xFCr Bilder hat \ No newline at end of file +IchBinsShort, 17.01.2012, 15:23: +Eventuell w\xE4re es dann auch noch gut wenn neue Anrufe in der Anrufliste als Neu markiert werden k\xF6nnen. Also so was wie ein "gelesen Status" woraus ersichtlich welche der Anrufe seit dem letztem Aufruf der Anrufliste neu hinzugekommen sind :-) \ No newline at end of file Modified: trunk/plugins/FritzBox/Docs/Changes.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Changes.txt 2012-01-17 23:36:10 UTC (rev 4413) +++ trunk/plugins/FritzBox/Docs/Changes.txt 2012-01-18 09:00:52 UTC (rev 4414) @@ -0,0 +1,12 @@ +Fixed bugs: +- on multiple contact deletions multiple synchronisations are necessary +- multiple contacts with the same name cause update actions on every synchronization +- multiple MSN filter entries when FRITZ!Box Manager configuration window is closed and re-opened without closing the MediaPortal Configuration window +- MediaPortal crashes on calls with phone numbers not contained in the phone book + +Optimizations: +- phone book is now saved on every change instead of MediaPortal exit +- entry checks for the following settings: + - update interval + - dial port +- first MSN filter entry is automatically displayed when Configuration window is opened \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-01-17 23:36:10 UTC (rev 4413) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-01-18 09:00:52 UTC (rev 4414) @@ -210,6 +210,8 @@ { if (phoneBookItem != null) // phone book entry exists { + if (Settings.ExtensiveLogging) Log.Info("Caller is identified by phone book as {0}", phoneBookItem.Name); + if (phoneBookItem.ShowCallNotification) showNotification = true; } else if (Settings.ShowUnknownCaller) showNotification = true; // unknown caller @@ -239,15 +241,14 @@ // ...message text strText = Environment.NewLine; - if (callAction.Caller.PhoneNumber == "") strText += GUILocalizeStrings.Get(3); // 3 = Unknown - else if (callAction.Caller.PhoneBookItem.Name == "") strText += callAction.Caller.PhoneNumber; - else + if (callAction.Caller.PhoneNumber != "") { - strText += callAction.Caller.PhoneBookItem.Name; + if (phoneBookItem != null) strText += phoneBookItem.Name; - if (Settings.ShowMSNOnNotify) strText += Environment.NewLine + callAction.Caller.PhoneNumber; + if (Settings.ShowPhoneNumberOnNotify) strText += Environment.NewLine + callAction.Caller.PhoneNumber; } - + else strText += GUILocalizeStrings.Get(3); // 3 = Unknown + // show call notification ShowNotify(callAction.Type, strHeading, strImage, strText); } @@ -272,7 +273,7 @@ if (Settings.MSNList.Contains(mSN)) { - Log.Info("MSN is on the list"); + Log.Info("MSN is on the filter list"); return true; } else @@ -428,9 +429,6 @@ Utils.OnStopExternal -= OnStopExternal; SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); // power changes - - // save phone book - phoneBook.SavePhoneBookToXMLFile(); } #endregion Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2012-01-17 23:36:10 UTC (rev 4413) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2012-01-18 09:00:52 UTC (rev 4414) @@ -46,7 +46,7 @@ this.checkBoxCloseOnConnectionClosed = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.lblMaxNotifies = new MediaPortal.UserInterface.Controls.MPLabel(); this.numericUpDownMaxNotifies = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); - this.checkBoxShowMSNOnNotify = new MediaPortal.UserInterface.Controls.MPCheckBox(); + this.checkBoxShowPhoneNumberOnNotify = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.buttonMSNsRemove = new MediaPortal.UserInterface.Controls.MPButton(); this.checkBoxFilterMSNs = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.buttonMSNsAdd = new MediaPortal.UserInterface.Controls.MPButton(); @@ -62,7 +62,6 @@ this.checkBoxPauseMediaOnIncomingCall = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.tabPageConnection = new System.Windows.Forms.TabPage(); this.label2 = new System.Windows.Forms.Label(); - this.dialPort = new System.Windows.Forms.TextBox(); this.vBPath = new System.Windows.Forms.TextBox(); this.passwd = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); @@ -76,7 +75,8 @@ this.tabPageMiscellaneous = new System.Windows.Forms.TabPage(); this.checkBoxExtensiveLogging = new MediaPortal.UserInterface.Controls.MPCheckBox(); this.label4 = new System.Windows.Forms.Label(); - this.updateInterval = new MediaPortal.UserInterface.Controls.MPTextBox(); + this.dialPortNumericUpDown = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); + this.updateInterval = new MediaPortal.UserInterface.Controls.MPNumericUpDown(); this.tabPageDiagnostics.SuspendLayout(); this.tabPagePhoneBook.SuspendLayout(); this.tabPageCallNotification.SuspendLayout(); @@ -90,6 +90,8 @@ ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.tabControlConfiguration.SuspendLayout(); this.tabPageMiscellaneous.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dialPortNumericUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.updateInterval)).BeginInit(); this.SuspendLayout(); // // labelVersion @@ -212,7 +214,7 @@ this.groupBoxPhonebook.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.groupBoxPhonebook.Location = new System.Drawing.Point(7, 229); this.groupBoxPhonebook.Name = "groupBoxPhonebook"; - this.groupBoxPhonebook.Size = new System.Drawing.Size(177, 71); + this.groupBoxPhonebook.Size = new System.Drawing.Size(177, 67); this.groupBoxPhonebook.TabIndex = 2; this.groupBoxPhonebook.TabStop = false; this.groupBoxPhonebook.Text = "Phone book settings"; @@ -221,7 +223,7 @@ // this.checkBoxShowUnknownCaller.AutoSize = true; this.checkBoxShowUnknownCaller.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.checkBoxShowUnknownCaller.Location = new System.Drawing.Point(24, 45); + this.checkBoxShowUnknownCaller.Location = new System.Drawing.Point(23, 41); this.checkBoxShowUnknownCaller.Name = "checkBoxShowUnknownCaller"; this.checkBoxShowUnknownCaller.Size = new System.Drawing.Size(126, 17); this.checkBoxShowUnknownCaller.TabIndex = 1; @@ -247,7 +249,7 @@ this.groupBoxNotify.Controls.Add(this.checkBoxCloseOnConnectionClosed); this.groupBoxNotify.Controls.Add(this.lblMaxNotifies); this.groupBoxNotify.Controls.Add(this.numericUpDownMaxNotifies); - this.groupBoxNotify.Controls.Add(this.checkBoxShowMSNOnNotify); + this.groupBoxNotify.Controls.Add(this.checkBoxShowPhoneNumberOnNotify); this.groupBoxNotify.Controls.Add(this.buttonMSNsRemove); this.groupBoxNotify.Controls.Add(this.checkBoxFilterMSNs); this.groupBoxNotify.Controls.Add(this.buttonMSNsAdd); @@ -306,16 +308,16 @@ 0, 0}); // - // checkBoxShowMSNOnNotify + // checkBoxShowPhoneNumberOnNotify // - this.checkBoxShowMSNOnNotify.AutoSize = true; - this.checkBoxShowMSNOnNotify.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.checkBoxShowMSNOnNotify.Location = new System.Drawing.Point(6, 88); - this.checkBoxShowMSNOnNotify.Name = "checkBoxShowMSNOnNotify"; - this.checkBoxShowMSNOnNotify.Size = new System.Drawing.Size(121, 17); - this.checkBoxShowMSNOnNotify.TabIndex = 6; - this.checkBoxShowMSNOnNotify.Text = "Show MSN on notify"; - this.checkBoxShowMSNOnNotify.UseVisualStyleBackColor = true; + this.checkBoxShowPhoneNumberOnNotify.AutoSize = true; + this.checkBoxShowPhoneNumberOnNotify.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.checkBoxShowPhoneNumberOnNotify.Location = new System.Drawing.Point(6, 88); + this.checkBoxShowPhoneNumberOnNotify.Name = "checkBoxShowPhoneNumberOnNotify"; + this.checkBoxShowPhoneNumberOnNotify.Size = new System.Drawing.Size(122, 17); + this.checkBoxShowPhoneNumberOnNotify.TabIndex = 6; + this.checkBoxShowPhoneNumberOnNotify.Text = "Show phone number"; + this.checkBoxShowPhoneNumberOnNotify.UseVisualStyleBackColor = true; // // buttonMSNsRemove // @@ -480,8 +482,8 @@ // // tabPageConnection // + this.tabPageConnection.Controls.Add(this.dialPortNumericUpDown); this.tabPageConnection.Controls.Add(this.label2); - this.tabPageConnection.Controls.Add(this.dialPort); this.tabPageConnection.Controls.Add(this.vBPath); this.tabPageConnection.Controls.Add(this.passwd); this.tabPageConnection.Controls.Add(this.label3); @@ -508,13 +510,6 @@ this.label2.TabIndex = 32; this.label2.Text = "Voice box path (e. g. \\\\fritz.box\\FRITZ.NAS\\USBStore\\FRITZ\\voicebox)"; // - // dialPort - // - this.dialPort.Location = new System.Drawing.Point(125, 151); - this.dialPort.Name = "dialPort"; - this.dialPort.Size = new System.Drawing.Size(30, 20); - this.dialPort.TabIndex = 30; - // // vBPath // this.vBPath.Location = new System.Drawing.Point(17, 216); @@ -623,9 +618,9 @@ // // tabPageMiscellaneous // + this.tabPageMiscellaneous.Controls.Add(this.updateInterval); this.tabPageMiscellaneous.Controls.Add(this.checkBoxExtensiveLogging); this.tabPageMiscellaneous.Controls.Add(this.label4); - this.tabPageMiscellaneous.Controls.Add(this.updateInterval); this.tabPageMiscellaneous.Location = new System.Drawing.Point(4, 22); this.tabPageMiscellaneous.Name = "tabPageMiscellaneous"; this.tabPageMiscellaneous.Padding = new System.Windows.Forms.Padding(3); @@ -654,13 +649,46 @@ this.label4.TabIndex = 20; this.label4.Text = "Auto update frequency (seconds)"; // + // dialPortNumericUpDown + // + this.dialPortNumericUpDown.Location = new System.Drawing.Point(129, 149); + this.dialPortNumericUpDown.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.dialPortNumericUpDown.Name = "dialPortNumericUpDown"; + this.dialPortNumericUpDown.Size = new System.Drawing.Size(53, 20); + this.dialPortNumericUpDown.TabIndex = 33; + this.dialPortNumericUpDown.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.dialPortNumericUpDown.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // // updateInterval // - this.updateInterval.BorderColor = System.Drawing.Color.Empty; - this.updateInterval.Location = new System.Drawing.Point(32, 47); + this.updateInterval.Location = new System.Drawing.Point(33, 45); + this.updateInterval.Maximum = new decimal(new int[] { + 999, + 0, + 0, + 0}); + this.updateInterval.Minimum = new decimal(new int[] { + 30, + 0, + 0, + 0}); this.updateInterval.Name = "updateInterval"; - this.updateInterval.Size = new System.Drawing.Size(159, 20); - this.updateInterval.TabIndex = 19; + this.updateInterval.Size = new System.Drawing.Size(47, 20); + this.updateInterval.TabIndex = 22; + this.updateInterval.TextAlign = System.Windows.Forms.HorizontalAlignment.Right; + this.updateInterval.Value = new decimal(new int[] { + 300, + 0, + 0, + 0}); // // FritzBoxConfig // @@ -700,6 +728,8 @@ this.tabControlConfiguration.ResumeLayout(false); this.tabPageMiscellaneous.ResumeLayout(false); this.tabPageMiscellaneous.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dialPortNumericUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.updateInterval)).EndInit(); this.ResumeLayout(false); } @@ -719,7 +749,7 @@ private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxCloseOnConnectionClosed; private MediaPortal.UserInterface.Controls.MPLabel lblMaxNotifies; private MediaPortal.UserInterface.Controls.MPNumericUpDown numericUpDownMaxNotifies; - private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxShowMSNOnNotify; + private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxShowPhoneNumberOnNotify; private MediaPortal.UserInterface.Controls.MPButton buttonMSNsRemove; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxFilterMSNs; private MediaPortal.UserInterface.Controls.MPButton buttonMSNsAdd; @@ -740,10 +770,8 @@ private System.Windows.Forms.Button buttonEditPhoneBook; private System.Windows.Forms.TabPage tabPageMiscellaneous; private System.Windows.Forms.Label label4; - private MediaPortal.UserInterface.Controls.MPTextBox updateInterval; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label2; - private System.Windows.Forms.TextBox dialPort; private System.Windows.Forms.TextBox vBPath; private System.Windows.Forms.TextBox passwd; private System.Windows.Forms.Label label3; @@ -754,5 +782,7 @@ private MediaPortal.UserInterface.Controls.MPLabel labelPort; private MediaPortal.UserInterface.Controls.MPLabel labelAddress; private MediaPortal.UserInterface.Controls.MPCheckBox checkBoxExtensiveLogging; + private MediaPortal.UserInterface.Controls.MPNumericUpDown dialPortNumericUpDown; + private MediaPortal.UserInterface.Controls.MPNumericUpDown updateInterval; } } \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs 2012-01-17 23:36:10 UTC (rev 4413) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs 2012-01-18 09:00:52 UTC (rev 4414) @@ -57,7 +57,7 @@ numericUpDownPort.Value = FritzBoxClient.Port; passwd.Text = Settings.Password; - dialPort.Text = Settings.DialPort; + dialPortNumericUpDown.Text = Settings.DialPort; vBPath.Text = Settings.VBPath; @@ -76,8 +76,9 @@ comboBoxMSNs.Items.Clear(); comboBoxMSNs.Items.AddRange(Settings.MSNList.ToArray()); + comboBoxMSNs.Text = Settings.MSNList[0]; - checkBoxShowMSNOnNotify.Checked = Settings.ShowMSNOnNotify; + checkBoxShowPhoneNumberOnNotify.Checked = Settings.ShowPhoneNumberOnNotify; checkBoxPauseMediaOnIncomingCall.Checked = Settings.PauseMediaOnIncomingCall; checkBoxResumeMediaOnIncomingCall.Checked = Settings.ResumeMediaOnIncomingCall; @@ -91,7 +92,7 @@ mpIncomingSoundTextBox.Text = Settings.IncomingSoundPath; // miscellaneous settings - updateInterval.Text = Convert.ToString(Settings.UpdateInterval); + updateInterval.Text = Settings.UpdateInterval.ToString(); } private void SaveSettings() @@ -103,7 +104,7 @@ FritzBoxClient.Port = (int)numericUpDownPort.Value; Settings.Password = passwd.Text; - Settings.DialPort = dialPort.Text; + Settings.DialPort = dialPortNumericUpDown.Text; Settings.VBPath = vBPath.Text; @@ -114,14 +115,15 @@ Settings.CloseOnConnectionClosed = checkBoxCloseOnConnectionClosed.Checked; Settings.FilterMSN = checkBoxFilterMSNs.Checked; + Settings.MSNList.Clear(); - foreach (object obj in comboBoxMSNs.Items) + foreach (string item in comboBoxMSNs.Items) { - Settings.MSNList.Add((string)obj); + Settings.MSNList.Add(item); } - Settings.ShowMSNOnNotify = checkBoxShowMSNOnNotify.Checked; + Settings.ShowPhoneNumberOnNotify = checkBoxShowPhoneNumberOnNotify.Checked; Settings.PauseMediaOnIncomingCall = checkBoxPauseMediaOnIncomingCall.Checked; Settings.ResumeMediaOnIncomingCall = checkBoxResumeMediaOnIncomingCall.Checked; Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs 2012-01-17 23:36:10 UTC (rev 4413) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs 2012-01-18 09:00:52 UTC (rev 4414) @@ -85,8 +85,6 @@ { if (normalizePhoneNumber(phoneNumber.Value) == normalizePhoneNumber(caller.PhoneNumber)) { - if (Settings.ExtensiveLogging) Log.Info("Caller is identified by phone book as {0}", phoneBookItem.Name); - caller.PhoneBookItem = phoneBookItem; return caller; } @@ -115,32 +113,6 @@ if (phoneBook.Count != 0) Log.Info("Loaded " + phoneBook.Count + " contacts from " + Settings.PhoneBookFilePath); } - public void SavePhoneBookToXMLFile() - { - if (phoneBookSaveIsRequired) - { - InternalPhoneBook internalPhoneBook = new InternalPhoneBook(); - - foreach (PhoneBookItem phoneBookItem in phoneBook.Values) - { - internalPhoneBook.items.Add(phoneBookItem); - } - - if (internalPhoneBook.items.Count > 0) - { - XmlSerializer xmlSerializer = new XmlSerializer(typeof(InternalPhoneBook)); - TextWriter textWriter = new StreamWriter(Settings.PhoneBookFilePath); - xmlSerializer.Serialize(textWriter, internalPhoneBook); - textWriter.Close(); - - Log.Info("Saved " + internalPhoneBook.items.Count + " contacts to {0}", Settings.PhoneBookFilePath); - } - else Log.Info("No changes, no contacts saved"); - } - - phoneBookSaveIsRequired = false; - } - public bool SynchronizePhoneBook() { bool phoneBookChanges = false; // second field is required to determine if GUI phone book update is required @@ -164,48 +136,50 @@ FritzManager.PhoneBook fritzPhoneBook = fritzPhoneBooks.Items[0]; // always choose first phone book PhoneBookItem newPhoneBookItem; bool updateRequired, contactFound; - string name, uniqueID = null, imageURL; + string name, uniqueID = null, imageURL, lastContactName = ""; // check if FRITZ!Box phone book has unique ID field. Older FRITZ!Box models e. g. 7170 and 7320 doesn't have an unique ID field in it's address book - if (fritzPhoneBook.contact[0].uniqueid == null) Log.Debug("FRITZ!Box phone book doesn't have an unique ID field. Synchronizing contacts in compatibility mode. Multiple contacts with the same name won't be shown and cause update actions on every synchronization!"); + if (fritzPhoneBook.contact[0].uniqueid == null) Log.Debug("FRITZ!Box phone book doesn't have an unique ID field. Synchronizing contacts in compatibility mode. Multiple contacts with the same name won't be synchronized!"); lock (sync) { - // update/add entries from FRITZ!Box phone book to local phone book - foreach (Contact contact in fritzPhoneBook.contact) - { - name = contact.person[0].realName; - imageURL = contact.person[0].imageURL; + // update/add entries from FRITZ!Box phone book to local phone book + foreach (Contact contact in fritzPhoneBook.contact) + { + name = contact.person[0].realName; + imageURL = contact.person[0].imageURL; - if (fritzPhoneBook.contact[0].uniqueid != null) uniqueID = contact.uniqueid; - else uniqueID = name; // in compatibility mode the name is used as unique ID + if (fritzPhoneBook.contact[0].uniqueid != null) uniqueID = contact.uniqueid; + else uniqueID = name; // in compatibility mode the name is used as unique ID - updateRequired = false; + updateRequired = false; - // search if FRITZ!Box contact already exists in phone book - if (phoneBook.ContainsKey(uniqueID)) + // search if FRITZ!Box contact already exists in phone book + if (phoneBook.ContainsKey(uniqueID)) + { + // check for differences + // ...on name and image URL fields + if (phoneBook[uniqueID].Name != name || imageURL != phoneBook[uniqueID].ImageURL) updateRequired = true; + + // ...on phone numbers + for (int i = 0; i < contact.telephony.Length; i++) { - // check for differences - // ...on name and image URL fields - if (phoneBook[uniqueID].Name != name || imageURL != phoneBook[uniqueID].ImageURL) updateRequired = true; - - // ...on phone numbers - for (int i = 0; i < contact.telephony.Length; i++) + try { - try - { - if (!contact.telephony[i].Equals(phoneBook[uniqueID].PhoneNumbers[i])) updateRequired = true; - } - catch - { - // on property changes the differences check may fail - Log.Debug("Phone book difference check failed. Forcing contact update"); - updateRequired = true; - break; - } + if (!contact.telephony[i].Equals(phoneBook[uniqueID].PhoneNumbers[i])) updateRequired = true; } + catch + { + // on property changes the differences check may fail + Log.Debug("Phone book difference check failed. Forcing contact update"); + updateRequired = true; + break; + } + } - if (updateRequired) + if (updateRequired) + { + if (uniqueID != lastContactName) { if (Settings.ExtensiveLogging) Log.Info("Updating contact " + phoneBook[uniqueID].Name); else Log.Info("Updating contact"); @@ -216,74 +190,87 @@ phoneBookChanges = true; } + else + { + // avoid double synchronization on multiple contacts with the same name in compatibility mode + if (Settings.ExtensiveLogging) Log.Info("Contact " + phoneBook[uniqueID].Name + " is skipped because there are multiple contacts with the same name"); + else Log.Info("One contact is skipped because there are multiple contacts with the same name"); + } } - else - { - if (Settings.ExtensiveLogging) Log.Info("Adding contact " + name); - else Log.Info("Adding contact"); + } + else + { + if (Settings.ExtensiveLogging) Log.Info("Adding contact " + name); + else Log.Info("Adding contact"); - newPhoneBookItem = new PhoneBookItem(); - newPhoneBookItem.UniqueID = uniqueID; - newPhoneBookItem.Name = name; - newPhoneBookItem.PhoneNumbers = contact.telephony; - newPhoneBookItem.ImageURL = imageURL; + newPhoneBookItem = new PhoneBookItem(); + newPhoneBookItem.UniqueID = uniqueID; + newPhoneBookItem.Name = name; + newPhoneBookItem.PhoneNumbers = contact.telephony; + newPhoneBookItem.ImageURL = imageURL; - phoneBook.Add(uniqueID, newPhoneBookItem); + phoneBook.Add(uniqueID, newPhoneBookItem); - phoneBookSortIsRequired = true; - phoneBookChanges = true; - } + phoneBookSortIsRequired = true; + phoneBookChanges = true; } - // check for obsolete entries in local phone book (not existing in FRITZ!Box phone book anymore) - string[] contactsToDelete = new string[phoneBook.Count]; - int k = 0; - string uniqueIDOnFritzBox; + lastContactName = name; // remember last contact name to avoid double synchronization on multiple contacts with the same name in compatibility mode + } - foreach (PhoneBookItem phoneBookItem in phoneBook.Values) + // check for obsolete entries in local phone book (not existing in FRITZ!Box phone book anymore) + string[] contactsToDelete = new string[phoneBook.Count]; + int k = 0; + string uniqueIDOnFritzBox; + + foreach (PhoneBookItem phoneBookItem in phoneBook.Values) + { + contactFound = false; + + foreach (Contact contact in fritzPhoneBook.contact) { - contactFound = false; + name = contact.person[0].realName; - foreach (Contact contact in fritzPhoneBook.contact) + if (contact.uniqueid != null) { - name = contact.person[0].realName; - - if (contact.uniqueid != null) uniqueID = phoneBookItem.UniqueID; - else uniqueID = phoneBookItem.Name; // in compatibility mode the name is used as unique ID - - if (fritzPhoneBook.contact[0].uniqueid != null) uniqueIDOnFritzBox = contact.uniqueid; - else uniqueIDOnFritzBox = name; // in compatibility mode the name is used as unique ID - - if (uniqueID == uniqueIDOnFritzBox) - { - contactFound = true; - break; - } + uniqueID = phoneBookItem.UniqueID; + uniqueIDOnFritzBox = contact.uniqueid; } + else + { + // in compatibility mode the name is used as unique ID + uniqueID = phoneBookItem.Name; + uniqueIDOnFritzBox = name; + } - if (!contactFound) + if (uniqueID == uniqueIDOnFritzBox) { - contactsToDelete[k] = uniqueID; - k++; + contactFound = true; break; } } - foreach (string _uniqueID in contactsToDelete) // contacts cannot be deleted in above foreach loop, a second loop is required - { - if (_uniqueID != null) - { - if (Settings.ExtensiveLogging) Log.Info("Removing contact " + phoneBook[_uniqueID].Name); - else Log.Info("Removing contact"); + if (!contactFound) + { + contactsToDelete[k] = uniqueID; + k++; + } + } - phoneBook.Remove(_uniqueID); + foreach (string _uniqueID in contactsToDelete) // contacts cannot be deleted in above foreach loop, a second loop is required + { + if (_uniqueID != null) + { + if (Settings.ExtensiveLogging) Log.Info("Removing contact " + phoneBook[_uniqueID].Name); + else Log.Info("Removing contact"); - phoneBookChanges = true; - } - else break; - } + phoneBook.Remove(_uniqueID); + + phoneBookChanges = true; + } + else break; + } } - Log.Info("Synchronized " + phoneBook.Count + " contacts with FRITZ!Box"); } } @@ -312,6 +299,10 @@ if (phoneBookChanges) { phoneBookSaveIsRequired = true; + + // save phone book + SavePhoneBookToXMLFile(); + return true; } else return false; @@ -454,7 +445,33 @@ } } } + + public void SavePhoneBookToXMLFile() + { + if (phoneBookSaveIsRequired) + { + InternalPhoneBook internalPhoneBook = new InternalPhoneBook(); + foreach (PhoneBookItem phoneBookItem in phoneBook.Values) + { + internalPhoneBook.items.Add(phoneBookItem); + } + + if (internalPhoneBook.items.Count > 0) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(InternalPhoneBook)); + TextWriter textWriter = new StreamWriter(Settings.PhoneBookFilePath); + xmlSerializer.Serialize(textWriter, internalPhoneBook); + textWriter.Close(); + + Log.Info("Saved " + internalPhoneBook.items.Count + " contacts to {0}", Settings.PhoneBookFilePath); + } + else Log.Info("No changes, no contacts saved"); + } + + phoneBookSaveIsRequired = false; + } + #endregion public methods #region private methods Modified: trunk/plugins/FritzBox/FritzBox/Settings.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/Settings.cs 2012-01-17 23:36:10 UTC (rev 4413) +++ trunk/plugins/FritzBox/FritzBox/Settings.cs 2012-01-18 09:00:52 UTC (rev 4414) @@ -82,7 +82,7 @@ public static bool CloseOnConnectionClosed { get; set; } - public static bool ShowMSNOnNotify { get; set; } + public static bool ShowPhoneNumberOnNotify { get; set; } public static bool ShowUnknownCaller { get; set; } @@ -154,7 +154,7 @@ if (decryptedPassword != null) Password = decryptedPassword; else Password = xmlreader.GetValue("FritzManager", "passwd"); // if the password was not encrypted read it in clear text (for older FritzBox Manager versions) - DialPort = xmlreader.GetValue("FritzManager", "dialport"); + DialPort = xmlreader.GetValueAsString("FritzManager", "dialport", "1"); VBPath = xmlreader.GetValue("FritzManager", "vBPath"); // phone book settings @@ -167,11 +167,13 @@ CloseOnConnectionClosed = xmlreader.GetValueAsBool("fritzbox", "closeOnConnectionClosed", true); FilterMSN = xmlreader.GetValueAsBool("fritzbox", "filterMSNs", false); + string strMSN = xmlreader.GetValueAsString("fritzbox", "MSN", ""); char[] charSeparators = new[] { ';' }; + MSNList.Clear(); // necessary to avoid multiple entries when FRITZ!Box Manager configuration window is closed and re-opened without closing the MediaPortal Configuration window MSNList.AddRange(strMSN.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries)); - ShowMSNOnNotify = xmlreader.GetValueAsBool("fritzbox", "showMSNOnNotify", true); + ShowPhoneNumberOnNotify = xmlreader.GetValueAsBool("fritzbox", "showPhoneNumberOnNotify", true); ShowUnknownCaller = xmlreader.GetValueAsBool("fritzbox", "showUnknownCaller", true); @@ -186,6 +188,8 @@ // miscellaneous settings UpdateInterval = xmlreader.GetValueAsInt("FritzManager", "updateInterval", 300); + if (UpdateInterval < 30) UpdateInterval = 30; // ensure that update timer interval is not smaller than 30 seconds + ExtensiveLogging = xmlreader.GetValueAsBool("fritzbox", "extensiveLogging", false); // GUI settings @@ -225,6 +229,8 @@ xmlreader.RemoveEntry("FritzManager", "defaultAreacode"); xmlreader.RemoveEntry("fritzbox", "saveUnknownCaller"); + + xmlreader.RemoveEntry("fritzbox", "showMSNOnNotify"); } } @@ -249,14 +255,17 @@ xmlwriter.SetValueAsBool("fritzbox", "closeOnConnectionClosed", CloseOnConnectionClosed); xmlwriter.SetValueAsBool("fritzbox", "filterMSNs", FilterMSN); + string strMSN = ""; + foreach (string mSN in MSNList) { strMSN += mSN + ";"; } + xmlwriter.SetValue("fritzbox", "MSN", strMSN); - xmlwriter.SetValueAsBool("fritzbox", "showMSNOnNotify", ShowMSNOnNotify); + xmlwriter.SetValueAsBool("fritzbox", "showPhoneNumberOnNotify", ShowPhoneNumberOnNotify); xmlwriter.SetValueAsBool("fritzbox", "usePhonebook", PhoneBookEnabled); @@ -269,7 +278,6 @@ xmlwriter.SetValueAsBool("fritzbox", "resumeMediaOnOutgoingCall", ResumeMediaOnOutgoingCall); // miscellaneous settings - if (UpdateInterval < 30) UpdateInterval = 30; // ensure that update timer interval is not smaller than 30 seconds xmlwriter.SetValue("FritzManager", "updateInterval", UpdateInterval); xmlwriter.SetValueAsBool("fritzbox", "extensiveLogging", ExtensiveLogging); Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/GenerateResource-ResGen.read.1.tlog =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 =================================================================== --- trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-17 23:36:10 UTC (rev 4413) +++ trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-18 09:00:52 UTC (rev 4414) @@ -559,7 +559,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.4403</DesignedForVersion> + <DesignedForVersion>1.1.7.4413</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -582,7 +582,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>4403</Revision> + <Revision>4413</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -596,7 +596,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-14T18:41:32.7676728+01:00</ReleaseDate> + <ReleaseDate>2012-01-18T09:46:50.1990036+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Added: trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4413.mpe1 =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4413.mpe1 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/FritzBox/releases/update.xml =================================================================== --- trunk/plugins/FritzBox/releases/update.xml 2012-01-17 23:36:10 UTC (rev 4413) +++ trunk/plugins/FritzBox/releases/update.xml 2012-01-18 09:00:52 UTC (rev 4414) @@ -88,7 +88,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.4403</DesignedForVersion> + <DesignedForVersion>1.1.7.4413</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -111,7 +111,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>4403</Revision> + <Revision>4413</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -125,7 +125,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-14T18:41:32.7676728+01:00</ReleaseDate> + <ReleaseDate>2012-01-18T09:46:50.1990036+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Param... [truncated message content] |
From: <Ba...@us...> - 2012-01-17 23:36:17
|
Revision: 4413 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4413&view=rev Author: BartEv Date: 2012-01-17 23:36:10 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/VeraControl.xmp2 trunk/plugins/VeraControl/releases/VeraControl_v0.6.1.0.mpe1 trunk/plugins/VeraControl/releases/update.xml Modified: trunk/plugins/VeraControl/releases/VeraControl.xmp2 =================================================================== --- trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-17 23:34:36 UTC (rev 4412) +++ trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-17 23:36:10 UTC (rev 4413) @@ -833,7 +833,7 @@ - Improved error handling </VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> - <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.6.0.1.mpe1</OnlineLocation> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v[version].mpe1</OnlineLocation> <ReleaseDate>2012-01-18T22:51:05</ReleaseDate> <Tags>home automation, z-wave, Modified: trunk/plugins/VeraControl/releases/VeraControl_v0.6.1.0.mpe1 =================================================================== (Binary files differ) Modified: trunk/plugins/VeraControl/releases/update.xml =================================================================== --- trunk/plugins/VeraControl/releases/update.xml 2012-01-17 23:34:36 UTC (rev 4412) +++ trunk/plugins/VeraControl/releases/update.xml 2012-01-17 23:36:10 UTC (rev 4413) @@ -674,29 +674,29 @@ <Build>1</Build> <Revision>0</Revision> </Version> - <ExtensionDescription>Control your Vera controller from MediaPortal. - -Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... - -Vera is a Z-wave home automation controller from MicasaVerde. - -This version is tested with: - - Vera 1 v1.1.1338 - - Vera 2 v1.1.1267 - - Vera 2 v1.5.255 - - - - - + <ExtensionDescription>Control your Vera controller from MediaPortal. + +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... + +Vera is a Z-wave home automation controller from MicasaVerde. + +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.5.255 + + + + + </ExtensionDescription> - <VersionDescription>- Real time Vera status update --Threated communication (no-screen-lockups) -- IP Cam support -- Improved error handling + <VersionDescription>- Real time Vera status update +-Threated communication (no-screen-lockups) +- IP Cam support +- Improved error handling </VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> - <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.6.1.0.mpe1</OnlineLocation> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v[version].mpe1</OnlineLocation> <ReleaseDate>2012-01-18T22:51:05</ReleaseDate> <Tags>home automation, z-wave, @@ -739,4 +739,4 @@ <IsSkin>false</IsSkin> </PackageClass> </Items> -</ExtensionCollection> +</ExtensionCollection> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-17 23:34:42
|
Revision: 4412 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4412&view=rev Author: BartEv Date: 2012-01-17 23:34:36 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/update.xml Modified: trunk/plugins/VeraControl/releases/update.xml =================================================================== --- trunk/plugins/VeraControl/releases/update.xml 2012-01-17 23:33:29 UTC (rev 4411) +++ trunk/plugins/VeraControl/releases/update.xml 2012-01-17 23:34:36 UTC (rev 4412) @@ -696,7 +696,7 @@ - Improved error handling </VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> - <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.6.0.1.mpe1</OnlineLocation> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.6.1.0.mpe1</OnlineLocation> <ReleaseDate>2012-01-18T22:51:05</ReleaseDate> <Tags>home automation, z-wave, @@ -739,4 +739,4 @@ <IsSkin>false</IsSkin> </PackageClass> </Items> -</ExtensionCollection> \ No newline at end of file +</ExtensionCollection> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-17 23:33:35
|
Revision: 4411 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4411&view=rev Author: BartEv Date: 2012-01-17 23:33:29 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/update.xml Modified: trunk/plugins/VeraControl/releases/update.xml =================================================================== --- trunk/plugins/VeraControl/releases/update.xml 2012-01-17 23:11:40 UTC (rev 4410) +++ trunk/plugins/VeraControl/releases/update.xml 2012-01-17 23:33:29 UTC (rev 4411) @@ -674,26 +674,26 @@ <Build>1</Build> <Revision>0</Revision> </Version> - <ExtensionDescription>Control your Vera controller from MediaPortal. - -Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... - -Vera is a Z-wave home automation controller from MicasaVerde. - -This version is tested with: - - Vera 1 v1.1.1338 - - Vera 2 v1.1.1267 - - Vera 2 v1.5.255 - - - - - + <ExtensionDescription>Control your Vera controller from MediaPortal. + +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... + +Vera is a Z-wave home automation controller from MicasaVerde. + +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.5.255 + + + + + </ExtensionDescription> - <VersionDescription>- Real time Vera status update --Threated communication (no-screen-lockups) -- IP Cam support -- Improved error handling + <VersionDescription>- Real time Vera status update +-Threated communication (no-screen-lockups) +- IP Cam support +- Improved error handling </VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.6.0.1.mpe1</OnlineLocation> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-17 23:11:46
|
Revision: 4410 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4410&view=rev Author: BartEv Date: 2012-01-17 23:11:40 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/Scene.cs trunk/plugins/VeraControl/VeraCommunication.cs Modified: trunk/plugins/VeraControl/Scene.cs =================================================================== --- trunk/plugins/VeraControl/Scene.cs 2012-01-17 23:11:15 UTC (rev 4409) +++ trunk/plugins/VeraControl/Scene.cs 2012-01-17 23:11:40 UTC (rev 4410) @@ -57,6 +57,7 @@ { vera.status.system.reportCommandError("Unknown scene"); m_bScreenUpdateRequired = true; + return; } reportPendingRequest(); string cmd = "?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum="+id; Modified: trunk/plugins/VeraControl/VeraCommunication.cs =================================================================== --- trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-17 23:11:15 UTC (rev 4409) +++ trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-17 23:11:40 UTC (rev 4410) @@ -565,14 +565,7 @@ get { return (helper.getSecondsSince1970() - m_lLastUpdate); } set { } } - - /* - public bool metric - { - get { return m_bMetric; } - set { } - } - */ + public List<Scene> scenes { get { return m_status.scenes; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-17 23:11:21
|
Revision: 4409 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4409&view=rev Author: BartEv Date: 2012-01-17 23:11:15 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/VeraControl.xmp2 trunk/plugins/VeraControl/releases/VeraControl_v0.6.1.0.mpe1 trunk/plugins/VeraControl/releases/update.xml Modified: trunk/plugins/VeraControl/releases/VeraControl.xmp2 =================================================================== --- trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-17 23:06:18 UTC (rev 4408) +++ trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-17 23:11:15 UTC (rev 4409) @@ -808,40 +808,33 @@ <Version> <Major>0</Major> <Minor>6</Minor> - <Build>0</Build> - <Revision>1</Revision> + <Build>1</Build> + <Revision>0</Revision> </Version> - <ExtensionDescription>Control your Vera controller from MediaPortal. + <ExtensionDescription>Control your Vera controller from MediaPortal. -Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... - +Vera is a Z-wave home automation controller from MicasaVerde. -Vera is a Z-wave home automation controller from MicasaVerde. +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.5.255 -This version is tested with: - - Vera 1 v1.1.1338 - - Vera 2 v1.1.1267 - - Vera 2 v1.5.255 - - - - </ExtensionDescription> - <VersionDescription>- Real time Vera status update - --Threated communication (no-screen-lockups) - -- IP Cam support - + <VersionDescription>- Real time Vera status update +-Threated communication (no-screen-lockups) +- IP Cam support +- Improved error handling </VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.6.0.1.mpe1</OnlineLocation> - <ReleaseDate>2012-01-16T22:51:05</ReleaseDate> + <ReleaseDate>2012-01-18T22:51:05</ReleaseDate> <Tags>home automation, z-wave, micasaverde, Modified: trunk/plugins/VeraControl/releases/VeraControl_v0.6.1.0.mpe1 =================================================================== (Binary files differ) Modified: trunk/plugins/VeraControl/releases/update.xml =================================================================== --- trunk/plugins/VeraControl/releases/update.xml 2012-01-17 23:06:18 UTC (rev 4408) +++ trunk/plugins/VeraControl/releases/update.xml 2012-01-17 23:11:15 UTC (rev 4409) @@ -688,6 +688,7 @@ + </ExtensionDescription> <VersionDescription>- Real time Vera status update -Threated communication (no-screen-lockups) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-17 23:06:28
|
Revision: 4408 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4408&view=rev Author: BartEv Date: 2012-01-17 23:06:18 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Improved error handling Modified Paths: -------------- trunk/plugins/VeraControl/DeviceCam.cs trunk/plugins/VeraControl/DeviceDimmer.cs trunk/plugins/VeraControl/DeviceDoorlock.cs trunk/plugins/VeraControl/DeviceGeneric.cs trunk/plugins/VeraControl/DeviceSecurity.cs trunk/plugins/VeraControl/DeviceSprinkler.cs trunk/plugins/VeraControl/DeviceSwitch.cs trunk/plugins/VeraControl/DeviceSystem.cs trunk/plugins/VeraControl/DeviceThermostat.cs trunk/plugins/VeraControl/DialogDeviceControl.cs trunk/plugins/VeraControl/DialogSceneControl.cs trunk/plugins/VeraControl/Scene.cs trunk/plugins/VeraControl/VeraCommunication.cs trunk/plugins/VeraControl/VeraControl.cs trunk/plugins/VeraControl/VeraControl.csproj trunk/plugins/VeraControl/VeraHelper.cs trunk/plugins/VeraControl/skin/Default/VeraDialogDeviceControl.xml Added Paths: ----------- trunk/plugins/VeraControl/BaseDevice.cs Added: trunk/plugins/VeraControl/BaseDevice.cs =================================================================== --- trunk/plugins/VeraControl/BaseDevice.cs (rev 0) +++ trunk/plugins/VeraControl/BaseDevice.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -0,0 +1,175 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 17-1-2012 + * Time: 19:12 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of BaseDevice. + /// </summary> + public class BaseDevice + { + public long m_lLastUpdate = 0; + public long m_lLastPendingUpdate = 0; + public bool m_bScreenUpdateRequired = false; + private string m_sName = "unknown device"; + private int m_iId = 0; + private int m_iRoom = 0; + + // not connected (-2), none (-1), pending (0,1,5,6), success(4), error (2,3) + private DevState m_dsState = DevState.NONE; + private string m_sComment = ""; // red(error), green(success) or blue(pending) - icon/text + + public VeraHelper helper = VeraHelper.Instance; + public VeraCommunication vera = VeraCommunication.Instance; + + public BaseDevice(XmlNode xn) + { + if (xn != null) + { + update(xn); + } + } + + /// <summary> + /// Process Vera update information + /// </summary> + public virtual bool update(XmlNode xn) + { + m_sName = helper.getAttrAsString(xn, "name", m_sName); + m_iId = helper.getAttrAsInt (xn, "id", m_iId); + m_iRoom = helper.getAttrAsInt (xn, "room", m_iRoom); + + string temp_sComment = helper.getAttrAsString(xn, "comment", m_sComment ); + DevState temp_dsState = helper.toDevState(helper.getAttrAsInt(xn, "state", -1)); + if (m_dsState != DevState.PENDING || temp_dsState != DevState.NONE || (temp_dsState == DevState.NONE && ((m_lLastPendingUpdate / TimeSpan.TicksPerSecond ) < (DateTime.Now.Ticks / TimeSpan.TicksPerSecond)))) + { // If state was set to pending next update should contain a new state or still pending - so do not clear pending flag for at least 10 seconds + m_sComment = temp_sComment; + m_dsState = temp_dsState; + } + if (m_iId == 0) + { + // void device no further processing needed + return false; + } + + // Set update flag + m_bScreenUpdateRequired = true; + m_lLastUpdate = DateTime.Now.Ticks; + return true; + } + + /// <summary> + /// Returns the id of this device + /// </summary> + public int id + { + get { return m_iId; } + set { } + } + + /// <summary> + /// Returns the name of this device + /// </summary> + public string name + { + get { return m_sName; } + set { } + } + + /// <summary> + /// Returns true when this device is associated with the given room + /// </summary> + public bool inRoom(int id) + { + return (m_iRoom == id); + } + + /// <summary> + /// Return the room is this device is associated with + /// </summary> + public int room + { + get { return m_iRoom; } + set { m_iRoom = value; } + } + + /// <summary> + /// Return the communications state for this device + /// </summary> + public DevState commstate + { + get { return m_dsState; } + set { } + } + + /// <summary> + /// Return the comment as reported by Vera for this device + /// </summary> + public string comment + { + get { return (commstate != DevState.NONE ? m_sComment : ""); } + set { } + } + + /// <summary> + /// Set virtual device state to pending request + /// </summary> + public void reportPendingRequest() + { + m_dsState = DevState.PENDING; + m_sComment = "Sending command..."; + m_bScreenUpdateRequired = true; + m_lLastUpdate = DateTime.Now.Ticks; + m_lLastPendingUpdate = m_lLastUpdate; + } + + /// <summary> + /// Callback function for Ansync Web Client call on to report errors... + /// </summary> + public void reportRequestError(string message) + { + m_dsState = DevState.COMMAND_ERROR; + m_sComment = message; + m_bScreenUpdateRequired = true; + m_lLastUpdate = DateTime.Now.Ticks; + } + + public void clearCommState() + { + m_dsState = DevState.NONE; + } + /// <summary> + /// True when an update was processed after the give time stamp + /// </summary> + public virtual bool newUpdateSince(long lTimePreviousCheck) + { + return (lTimePreviousCheck <= m_lLastUpdate); + } + + /// <summary> + /// Invoking this method will clear the update ready flag -> so caller need to handle the screen update + /// </summary> + public virtual bool newScreenUpdateWaitingAndClearFlag( ) + { + bool b = m_bScreenUpdateRequired; + m_bScreenUpdateRequired = false; + return b; + } + + public override string ToString() + { + return name; + } + + } +} Modified: trunk/plugins/VeraControl/DeviceCam.cs =================================================================== --- trunk/plugins/VeraControl/DeviceCam.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DeviceCam.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -15,7 +15,7 @@ /// Description of DeviceCam. /// </summary> public class DeviceCam : DeviceGeneric - { + { // TODO: add IP-cam control buttons private string m_sIp = "127.0.0.1"; private string m_sUrl = "/"; private string m_sStream = ""; @@ -54,7 +54,7 @@ private bool refreshDelayPassed(long lastcheck) { - return ((helper.getSecondsSince1970() - refreshRate) > (lastcheck / 10000000)); + return ((helper.getSecondsSince1970() - refreshRate) > (lastcheck / TimeSpan.TicksPerSecond)); } public override string getIconName() Modified: trunk/plugins/VeraControl/DeviceDimmer.cs =================================================================== --- trunk/plugins/VeraControl/DeviceDimmer.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DeviceDimmer.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -64,13 +64,14 @@ } else { if (newValue < 0) { newValue = 0; } } - if ((id > 0) && (newValue != m_iLevel)) // Only send when a valid ID is found - { + if (id > 0) // Only send when a valid ID is found + { + reportPendingRequest(); // Do something with vera string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ "&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget" + "&newLoadlevelTarget="+value; - vera.doVeraRequest(cmd); + vera.doVeraCommandRequest(cmd, reportRequestError); } m_iLevel = newValue; } Modified: trunk/plugins/VeraControl/DeviceDoorlock.cs =================================================================== --- trunk/plugins/VeraControl/DeviceDoorlock.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DeviceDoorlock.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -41,13 +41,13 @@ set { if (id > 0) // Only send when a valid ID is found { + reportPendingRequest(); // Do something with vera string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ "&serviceId=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget" + "&newTargetValue="+(value ? "1" : "0"); - vera.doVeraRequest(cmd); + vera.doVeraCommandRequest(cmd, reportRequestError); } - m_bStatus = value; } } Modified: trunk/plugins/VeraControl/DeviceGeneric.cs =================================================================== --- trunk/plugins/VeraControl/DeviceGeneric.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DeviceGeneric.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -14,29 +14,15 @@ namespace VeraControl.Properties { - - /// <summary> /// Description of DeviceGeneric. /// </summary> - public class DeviceGeneric + public class DeviceGeneric : BaseDevice { - public long m_lLastUpdate = 0; - public bool m_bScreenUpdateRequired = false; - private string m_sName = "unknown device"; - private int m_iId = 0; private string m_sAltId = ""; private int m_iCategory = 0; - private int m_iRoom = 0; - // not connected (-2), none (-1), pending (0,1,5,6), success(4), error (2,3) - private DevState m_dsState = DevState.NONE; - private string m_sComment = ""; // red(error), green(success) or blue(pending) - icon/text - - public VeraHelper helper = VeraHelper.Instance; - public VeraCommunication vera = VeraCommunication.Instance; - - public DeviceGeneric(XmlNode xn) + public DeviceGeneric(XmlNode xn): base (xn) { if (xn != null) { @@ -44,97 +30,43 @@ } } - public virtual bool update(XmlNode xn) + public override bool update(XmlNode xn) { - m_sName = helper.getAttrAsString(xn, "name", m_sName); - m_iId = helper.getAttrAsInt (xn, "id", m_iId); m_sAltId = helper.getAttrAsString(xn, "altid", m_sAltId); m_iCategory = helper.getAttrAsInt (xn, "category", m_iCategory); - m_iRoom = helper.getAttrAsInt (xn, "room", m_iRoom); - m_sComment = helper.getAttrAsString(xn, "comment", m_sComment ); - m_dsState = helper.toDevState(helper.getAttrAsInt(xn, "state", -1)); - - if (m_iId == 0) + bool b = base.update(xn); + // Make sure the room exists + if (room == 0 || !vera.status.isRoomFound(room)) { - // void device no further processing needed - return false; - } - // Make sure room exists - if (m_iRoom == 0 || !vera.status.isRoomFound(m_iRoom)) - { if (!vera.status.isRoomFound(0)) { // create dummy room to attach to vera.rooms.Add(new Room(null)); } - m_iRoom = 0; + room = 0; } - - // Set update flag - m_bScreenUpdateRequired = true; - m_lLastUpdate = DateTime.Now.Ticks; - - return true; + + return b; } - - public int id - { - get { return m_iId; } - set { } - } - + public string altid { get { return m_sAltId; } set { } } - - public string name - { - get { return m_sName; } - set { } - } - + public int category { get { return m_iCategory; } set { } } - - public bool inRoom(int id) - { - return (m_iRoom == id); - } - public int room - { - get { return m_iRoom; } - set { } - } - - public override string ToString() - { - return name; - } - public virtual bool isControllable { get { return false; } set { } } - public virtual DevState commstate - { - get { return m_dsState; } - set { } - } - - public virtual string comment - { - get { return (commstate != DevState.NONE ? m_sComment : ""); } - set { } - } - public virtual bool status { get { return false; } @@ -183,18 +115,5 @@ { return new string [] {"Off", "On"}; } - - public virtual bool newScreenUpdateWaitingAndClearFlag( ) - { - // Invoking this method will clear the update ready flag -> so caller need to handle the update - bool b = m_bScreenUpdateRequired; - m_bScreenUpdateRequired = false; - return b; - } - - public virtual bool newUpdateSince(long lTimePreviousCheck) - { - return (lTimePreviousCheck <= m_lLastUpdate); - } } } Modified: trunk/plugins/VeraControl/DeviceSecurity.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSecurity.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DeviceSecurity.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -43,13 +43,13 @@ set { if (id > 0) // Only send when a valid ID is found { + reportPendingRequest(); // Do something with vera string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ "&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&action=SetArmed" + "&newArmedValue=" + (value ? "1" : "0"); - vera.doVeraRequest(cmd); + vera.doVeraCommandRequest(cmd, reportRequestError); } - m_bArmed = value; } } Modified: trunk/plugins/VeraControl/DeviceSprinkler.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSprinkler.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DeviceSprinkler.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -49,13 +49,13 @@ set { if (id > 0) // Only send when a valid ID is found { + reportPendingRequest(); // Do something with vera string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + "&newTargetValue="+(value ? "1" : "0"); - vera.doVeraRequest(cmd); + vera.doVeraCommandRequest(cmd, reportRequestError); } - m_bStatus = value; } } @@ -71,13 +71,13 @@ set { if (id > 0) // Only send when a valid ID is found { + reportPendingRequest(); // Do something with vera string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ "&serviceId=urn:upnp-micasaverde-com:serviceId:Sprinkler1&action=" + (value == "Auto" ? "SetModeAuto" : (value == "Block" ? "SetModeBlock" : "SetModeManual")); - vera.doVeraRequest(cmd); + vera.doVeraCommandRequest(cmd, reportRequestError); } - m_sMode = value; } } Modified: trunk/plugins/VeraControl/DeviceSwitch.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSwitch.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DeviceSwitch.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -4,8 +4,8 @@ * Date: 22-12-2011 * Time: 14:25 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; @@ -22,7 +22,7 @@ private string m_sWatt = "-"; private string m_sKwh = "-"; - public DeviceSwitch( XmlNode xn ): base (xn) + public DeviceSwitch( XmlNode xn ): base (xn) { if (xn != null) { @@ -30,13 +30,13 @@ } } - public override bool update(XmlNode xn) + public override bool update(XmlNode xn) { m_bStatus = helper.getAttrAsBool (xn, "status", m_bStatus); m_sWatt = helper.getAttrAsString(xn, "watts", m_sWatt); m_sKwh = helper.getAttrAsString(xn, "kwh", m_sKwh); - return base.update(xn); + return base.update(xn); } public string watts @@ -48,16 +48,16 @@ public override bool status { get { return m_bStatus; } - set { - if (id > 0) // Only send when a valid ID is found - { - // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ - "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + - "&newTargetValue="+(value ? "1" : "0"); - vera.doVeraRequest(cmd); - } - m_bStatus = value; + set { + if (id > 0) // Only send when a valid ID is found + { + reportPendingRequest(); + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + + "&newTargetValue="+(value ? "1" : "0"); + vera.doVeraCommandRequest(cmd, reportRequestError); + } } } Modified: trunk/plugins/VeraControl/DeviceSystem.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSystem.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DeviceSystem.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -148,6 +148,14 @@ m_lLastUpdate = DateTime.Now.Ticks; } + public void reportCommandError( string errmsg ) + { + m_dsVeraState = DevState.COMMAND_ERROR; + m_sComment = errmsg; + m_bScreenUpdateRequired = true; + m_lLastUpdate = DateTime.Now.Ticks; + } + public void clearConnectionError( ) { m_dsVeraState = DevState.NONE; Modified: trunk/plugins/VeraControl/DeviceThermostat.cs =================================================================== --- trunk/plugins/VeraControl/DeviceThermostat.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DeviceThermostat.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -60,14 +60,14 @@ set { if (id > 0) // Only send when a valid ID is found { + reportPendingRequest(); // Do something with vera string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ "&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget" + "&NewModeTarget="+(value == "Off" ? "Off" : (value == "Cool" ? "CoolOn" : (value == "Heat" ? "HeatOn" : "AutoChangeOver")) ); - vera.doVeraRequest(cmd); + vera.doVeraCommandRequest(cmd, reportRequestError); } - m_sMode = value; } } Modified: trunk/plugins/VeraControl/DialogDeviceControl.cs =================================================================== --- trunk/plugins/VeraControl/DialogDeviceControl.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DialogDeviceControl.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -46,9 +46,12 @@ [SkinControl(30)] protected GUIImage cmtImage = null; [SkinControlAttribute(31)] protected GUILabelControl comment=null; - VeraHelper helper = new VeraHelper(); - private DeviceGeneric myDev = null; - private long m_iLastUpdate = 0; + private VeraHelper helper = new VeraHelper(); + private DeviceGeneric myDev = null; + private long m_iLastUpdate = 0; + private bool m_bLevelUpdatePending = false; + private long m_lLastLevelUpdate = 0; + private int m_iDesiredLevel = 0; public DialogDeviceControl() { @@ -60,7 +63,6 @@ bool bResult = Load(GUIGraphicsContext.Skin + @"\VeraDialogDeviceControl.xml"); return bResult; } - public void InitDialog(string strLine, DeviceGeneric dev) { @@ -75,7 +77,7 @@ { btnClose.SetNavigation(2,2,2,2); } - + updateStatus(); } @@ -96,8 +98,8 @@ { SetText(myDev.name, myDev.getStatusText(), myDev.getExtraText() ); SetActiveBut((myDev.status ? 1 : 0), (myDev.mode == "Auto" ? 0 : - (myDev.mode == "CoolOn" || myDev.mode == "Cool" ? 1 : - (myDev.mode == "HeatOn" || myDev.mode == "Heat" ? 2 : 3) ))); + (myDev.mode == "CoolOn" || myDev.mode == "Cool" ? 1 : + (myDev.mode == "HeatOn" || myDev.mode == "Heat" ? 2 : 3) ))); } else { @@ -105,7 +107,10 @@ SetActiveBut(myDev.status ? 1 : 0, -1); } SetButtons(myDev.getCommands()); - SetSlider(myDev.level, myDev.maxLevel); + if (!m_bLevelUpdatePending) + { + SetSlider(myDev.level, myDev.maxLevel); + } } else { @@ -120,52 +125,32 @@ m_iLastUpdate = DateTime.Now.Ticks; } - protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { - if (control == btnLeft) - { - myDev.level = myDev.minLevel; - SetSlider( myDev.level, myDev.maxLevel ); - } - - if (control == btnRight) - { - myDev.level = myDev.maxLevel; - SetSlider( myDev.level, myDev.maxLevel ); - } - - if (control == btnMode1) - { - myDev.mode = btnMode1.Label; - SetActiveBut(-1, 0); - } - if (control == btnMode2) - { - myDev.mode = btnMode2.Label; - SetActiveBut(-1, 1); - } - if (control == btnMode3) - { - myDev.mode = btnMode3.Label; - SetActiveBut(-1, 2); - } - - if (control == slider) - { - myDev.level = slider.IntValue; - } - - // update button high lighting - SetActiveBut( (slider.IntValue > 0 ? 1 : 0), -1); - - // update icon - SetImage("Vera\\" + myDev.getIconName() + ".png"); - - // Back to the text button to switch from image view - if (control == btnClose) - { + if (control == btnClose) { PageDestroy(); + } else { + if (control == btnLeft) { + myDev.level = myDev.minLevel; + } + if (control == btnRight) { + myDev.level = myDev.maxLevel; + } + if (control == btnMode1) { + myDev.mode = btnMode1.Label; + } + if (control == btnMode2) { + myDev.mode = btnMode2.Label; + } + if (control == btnMode3) { + myDev.mode = btnMode3.Label; + } + if (control == slider) { + // Do something with fast repeating level changes.... slow down communications + m_bLevelUpdatePending = true; + m_iDesiredLevel = slider.IntValue; + SliderDebouncer(); + } } base.OnClicked(controlId, control, actionType); } @@ -197,9 +182,23 @@ } } + public void SliderDebouncer() + { + if (m_lLastLevelUpdate < DateTime.Now.Ticks) + { // If minimum update delay (2 sec) has been passed + if (m_bLevelUpdatePending && myDev.level != m_iDesiredLevel) + { + myDev.level = m_iDesiredLevel; + slider.IntValue = m_iDesiredLevel; + m_lLastLevelUpdate = DateTime.Now.Ticks + (TimeSpan.TicksPerSecond * 2); + } + m_bLevelUpdatePending = false; + } + } + public void SetSlider(int iVal, int iMaxval) { - if (iVal >= 0) + if ((iVal >= 0) && !m_bLevelUpdatePending) { slider.SetRange(0, iMaxval); slider.IntValue = iVal; @@ -276,8 +275,8 @@ if (myDev.newUpdateSince(m_iLastUpdate)) { updateStatus(); + SliderDebouncer(); } - base.Render(timePassed); } } Modified: trunk/plugins/VeraControl/DialogSceneControl.cs =================================================================== --- trunk/plugins/VeraControl/DialogSceneControl.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/DialogSceneControl.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -80,9 +80,7 @@ if (control == btnRight) { if (myScene.id != 0) { - comment.Label = "Running..."; myScene.run(); - } } Modified: trunk/plugins/VeraControl/Scene.cs =================================================================== --- trunk/plugins/VeraControl/Scene.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/Scene.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -17,116 +17,62 @@ /// <summary> /// Description of Scene. /// </summary> - public class Scene + public class Scene : BaseDevice { - public Scene(XmlNode xn) + public Scene(XmlNode xn): base (xn) { if (xn != null) { update(xn); } } - public VeraHelper helper = VeraHelper.Instance; - private bool m_bScreenUpdateRequired = false; - private string m_sName = "unknown scene"; - private int m_iId = 0; private bool m_bActive = false; - private int m_iRoom = 0; - private long m_lLastUpdate = 0; - - // not connected (-2), none (-1), pending (0,1,5,6), success(4), error (2,3) - private string m_sComment = ""; // red(error), green(success) or blue(pending) - icon/text - private DevState m_dsState = DevState.NONE; - - public bool update(XmlNode xn) + public override bool update(XmlNode xn) { - m_sName = helper.getAttrAsString(xn, "name", m_sName); - m_iId = helper.getAttrAsInt (xn, "id", m_iId); - m_iRoom = helper.getAttrAsInt (xn, "room", m_iRoom); - m_bActive = helper.getAttrAsBool (xn, "active", m_bActive); + m_bActive = helper.getAttrAsBool(xn, "active", m_bActive); + bool b = base.update(xn); - m_sComment = helper.getAttrAsString(xn, "comment", m_sComment ); - m_dsState = helper.toDevState(helper.getAttrAsInt(xn, "state", -1)); - - // Set update reqired flag - m_lLastUpdate = DateTime.Now.Ticks; - m_bScreenUpdateRequired = true; - return true; + // Make sure the room exists or is 0 + if (room != 0 && !vera.status.isRoomFound(room)) + { + if (!vera.status.isRoomFound(0)) + { // create dummy room to attach to + vera.rooms.Add(new Room(null)); + } + room = 0; + } + return b; } - public int id - { - get { return m_iId; } - set { } - } - - public string name - { - get { return m_sName; } - set { } - } - - public virtual DevState commstate - { - get { return m_dsState; } - set { } - } - public virtual string comment - { - get { return (commstate != DevState.NONE ? m_sComment : ""); } - set { } - } - public bool isActive() { return m_bActive; } - public bool inRoom(int id) + public void run() { - return (m_iRoom == id); - } - - public int room - { - get { return m_iRoom; } - set { } - } - - public override string ToString() - { - return name; - } - - public string run() - { if (id == 0) { - return "Unknown scene"; + vera.status.system.reportCommandError("Unknown scene"); + m_bScreenUpdateRequired = true; } - VeraCommunication vera = VeraCommunication.Instance; + reportPendingRequest(); string cmd = "?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum="+id; - return vera.doVeraRequest(cmd); + vera.doVeraCommandRequest(cmd, reportRequestError); } - public bool newScreenUpdateWaitingAndClearFlag( ) + public override bool newScreenUpdateWaitingAndClearFlag( ) { - // Invoking this method will clear the update ready flag -> so caller need to handle the update - bool b = m_bScreenUpdateRequired; - m_bScreenUpdateRequired = false; - if (m_dsState != DevState.NONE && (m_lLastUpdate < (DateTime.Now.Ticks - (10 * 10000000)))) + // Scenes are not reported Done by Vera so the will time out... + bool b = base.newScreenUpdateWaitingAndClearFlag(); + if (commstate != DevState.NONE && (m_lLastUpdate < (DateTime.Now.Ticks - (10 * 10000000)))) { - m_dsState = DevState.NONE; + clearCommState(); return true; } return b; } - - public virtual bool newUpdateSince(long lTimePreviousCheck) - { - return (lTimePreviousCheck <= m_lLastUpdate); - } } } Modified: trunk/plugins/VeraControl/VeraCommunication.cs =================================================================== --- trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -172,19 +172,20 @@ // Config data private string m_sVeraIPAddress; private string m_sVeraTCPIPPort; - private int m_iMaxRefreshDelay; + private int m_iMaxRefreshDelay; // Maximun delay between 2 status updates in seconds + private int m_iMinRefreshDelay = 1000; // Minimun delay between 2 status updates in miliseconds - // Actual device information private VeraStatus m_status = new VeraStatus(); // Communication status/control private long m_lLastUpdate = 0; - private bool m_bUpdatePending = false; private bool m_bScreenUpdateRequired = false; // Only true when a new update was received AND at least one device(staus) or scene was changed private bool m_bLastUpdateFailed = false; private string m_strLastUpdateError = ""; - private WebClient m_webClient = new WebClient(); + private WebClient m_webUpdateClient = new WebClient(); + private WebClient m_webCommandClient = new WebClient(); + private Action<string> m_webCommandClientReportError = null; // Action control table public int[] actionTriggerTable = new int[(int)Actiontrigger.LAST_ACTIONTRIGGER]; @@ -226,71 +227,113 @@ m_iMaxRefreshDelay = int.Parse(xmlreader.GetValueAsString("veracontroller", "maxrefreshdelay", "60")); // Set DownloadStringCompleted handler - m_webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(OnAsyncCompletedEventArgs); + m_webUpdateClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(OnCompletedUpdateStatusRequest); + m_webCommandClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(OnCompletedCommandRequest); } } - public void updateCurrentStatus(long lNow) - { - /* when to update in case connection gets lost --> keep updating with webClient timeout 180 sec....*/ - /* TODO: watch-dog !!! last time > 4 * maxDelay force an update - to recover from hibernate */ - if (m_bUpdatePending /* && m_lLastUpdate < ((lNow / 10000000) - (4 * m_iMaxRefreshDelay)) */) - { - return; - } - - m_bUpdatePending = true; - string url = "?id=lu_sdata&loadtime=" + m_status.system.loadtime + "&dataversion=" + m_status.system.dataversion + "&minimumdelay=2000&timeout=" + m_iMaxRefreshDelay + "&output_format=xml"; - doVeraRequest(url, OnAsyncCompletedEventArgs); - m_lLastUpdate = helper.getSecondsSince1970(); - } - public bool isVeraAlive(string ip, string port) { string response = retrieveURL("http://" + ip + ":" + port + "/data_request?id=lu_alive&time="+DateTime.Now.Ticks); - return (response == "OK"); } - public string doVeraRequest(string param) + private string retrieveURL(string url) { - return retrieveURL("http://" + vera_Address + "/data_request" + param + "&time="+DateTime.Now.Ticks); + // No callback thus Synchronised call (wait for response) + try { + WebClient wc = new WebClient(); + wc.CancelAsync(); // Cancel any current pending Async calls... + return wc.DownloadString(url); + } catch( Exception ) + { + return "ERROR"; + } } - public void doVeraRequest(string param, Action<object, DownloadStringCompletedEventArgs> onCallBack) + public void doVeraCommandRequest(string param, Action<string> errorReporter) { - retrieveURLAsync("http://" + vera_Address + "/data_request" + param + "&time="+DateTime.Now.Ticks); - } - - private string retrieveURL(string url) - { - // No callback thus Synchronised call (wait for response) + if (m_webCommandClient.IsBusy) + { + // TODO: What to do ? cancel pending request or queue new request? + } + string url = "http://" + vera_Address + "/data_request" + param + "&time="+DateTime.Now.Ticks; + + // Callback thus ASynchronised call (do NOT wait for response) try { - m_webClient.CancelAsync(); // Cancel any current pending Async calls... - return m_webClient.DownloadString(url); + m_webCommandClientReportError = errorReporter; + m_webCommandClient.CancelAsync(); // Cancel any current pending Async calls... + m_webCommandClient.DownloadStringAsync(new Uri(url)); + } catch( Exception e ) { - m_bLastUpdateFailed = true; - m_strLastUpdateError = e.Message; - return "ERROR"; + m_webCommandClientReportError = null; + status.system.reportCommandError(e.Message); + m_bScreenUpdateRequired = true; } - } - private void retrieveURLAsync(string url) + public void OnCompletedCommandRequest(object sender, DownloadStringCompletedEventArgs e) { - // Callback thus ASynchronised call (do NOT wait for response) + if (e.Cancelled) { + // Communication cancel for some reason, no valid data to be expected + if (m_webCommandClientReportError != null) { + m_webCommandClientReportError("Request was canceled"); + } else { + status.system.reportCommandError("Request was canceled"); + } + m_bScreenUpdateRequired = true; + } else if (e.Error != null) { + // Handle error here + if (m_webCommandClientReportError != null) { + m_webCommandClientReportError(e.Error.Message); + } else { + status.system.reportCommandError(e.Error.Message); + } + m_bScreenUpdateRequired = true; + } else { + // Communication succes full -> no parse Vera response... + if (!e.Result.ToUpper().Contains("<OK>OK</OK>") && !e.Result.ToUpper().Contains("<JOBID>")) + { + if (m_webCommandClientReportError != null) { + m_webCommandClientReportError(e.Result); + } else { + status.system.reportCommandError(e.Result); + } + m_bScreenUpdateRequired = true; + } + } + m_webCommandClientReportError = null; + } + + + public void updateCurrentStatus() + { + /* Keep updating with webClient timeout 180 sec, even when last time did fail or connection was lost....*/ + if (!m_webUpdateClient.IsBusy) + { + string url = "http://" + vera_Address + "/data_request" + + "?id=lu_sdata&loadtime=" + m_status.system.loadtime + + "&dataversion=" + m_status.system.dataversion + + "&minimumdelay=" + m_iMinRefreshDelay + + "&timeout=" + m_iMaxRefreshDelay + + "&output_format=xml" + + "&time="+DateTime.Now.Ticks; + + // Callback thus ASynchronised call (do NOT wait for response) try { - m_webClient.CancelAsync(); // Cancel any current pending Async calls... - m_webClient.DownloadStringAsync(new Uri(url)); + m_webUpdateClient.CancelAsync(); // Cancel any current pending Async calls... + m_webUpdateClient.DownloadStringAsync(new Uri(url)); } catch( Exception e ) { m_bLastUpdateFailed = true; m_strLastUpdateError = e.Message; } + m_lLastUpdate = helper.getSecondsSince1970(); + } } - - public void OnAsyncCompletedEventArgs(object sender, DownloadStringCompletedEventArgs e) + + public void OnCompletedUpdateStatusRequest(object sender, DownloadStringCompletedEventArgs e) { if (!e.Cancelled) { @@ -311,14 +354,18 @@ // update timer again (took some time to get the data) m_lLastUpdate = helper.getSecondsSince1970(); - m_bUpdatePending = false; } public void ParseUpdateInfo(string veraresponse) { var xmlDoc = new XmlDocument(); - xmlDoc.LoadXml(veraresponse); - + try { + xmlDoc.LoadXml(veraresponse); + } catch (Exception) + { + // Parser failed so in correct data received (could be an interrupted data transfer) + return; + } // Parse header XmlNode rootnode = xmlDoc.SelectSingleNode("/root"); if (rootnode == null) @@ -342,7 +389,7 @@ m_status.system.update(rootnode); if (m_status.system.fullReload) { - // We have a full refresh -> Clear all lists (to get clear of removed devices) TODO: check/handle selected index when an item was deleted... + // We have a full refresh -> Clear all lists (to get clear of removed devices) m_status.clearAllLists(); } @@ -578,7 +625,7 @@ public bool updatePending { - get { return m_bUpdatePending; } + get { return m_webUpdateClient.IsBusy; } set { } } Modified: trunk/plugins/VeraControl/VeraControl.cs =================================================================== --- trunk/plugins/VeraControl/VeraControl.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/VeraControl.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -207,7 +207,7 @@ // Handle MP start-up trigger - do this is a different Thread to not block MP-start up new Thread( () => { - vera.updateCurrentStatus(DateTime.Now.Ticks); + vera.updateCurrentStatus(); // Run startup trigger after first update if (enableSceneTrigger) { @@ -481,9 +481,10 @@ if (!bLastUpdateFailed) { if (vera.status.system.dataversion == "0") - { // Give message on never connected... + { // Give message dialog on never connected... new Thread (() => { NoConnection(vera.lastUpdateError);}).Start(); } else { + // Give an error message on screen vera.status.system.reportConnectionError(vera.lastUpdateError); } } @@ -495,7 +496,7 @@ } // vera will only update when realy required - vera.updateCurrentStatus((long)timePassed); + vera.updateCurrentStatus(); refreshNow(); base.Render(timePassed); @@ -511,39 +512,51 @@ setSystemStatus(); } - // update device status - if (m_iSelectedRoom != Int16.MaxValue) + // if full reload has been found rebuild lists + if (vera.status.system.fullReload ) { + listRooms(m_iSelectedCategory, m_iSelectedRoom); + if (m_iSelectedRoom == Int16.MaxValue) { + listScenes(); + } else { + listDevices(m_iSelectedRoom); + } + } + else { - foreach (GUIListItem item in RightList.ListItems) + // update device status + if (m_iSelectedRoom != Int16.MaxValue) { - DeviceGeneric dev = vera.status.getDeviceById( item.ItemId ); - if (dev.newScreenUpdateWaitingAndClearFlag()) + foreach (GUIListItem item in RightList.ListItems) { - item.Label2 = dev.getStatusText(); - item.PinImage = helper.getStateImage(dev.commstate); - - //Adjust color of item when option is turned off - item.IsPlayed = !dev.isControllable; - - item.IconImage = "Vera\\"+dev.getIconName()+".png"; - item.IconImageBig = "Vera\\"+dev.getIconName()+".png"; - item.ThumbnailImage = "Vera\\"+dev.getIconName()+".png"; - - Utils.SetDefaultIcons(item); + DeviceGeneric dev = vera.status.getDeviceById( item.ItemId ); + if (dev.newScreenUpdateWaitingAndClearFlag()) + { + item.Label2 = dev.getStatusText(); + item.PinImage = helper.getStateImage(dev.commstate); + + //Adjust color of item when option is turned off + item.IsPlayed = !dev.isControllable; + + item.IconImage = "Vera\\"+dev.getIconName()+".png"; + item.IconImageBig = "Vera\\"+dev.getIconName()+".png"; + item.ThumbnailImage = "Vera\\"+dev.getIconName()+".png"; + + Utils.SetDefaultIcons(item); + } } } - } - else - { - foreach(GUIListItem item in RightList.ListItems) + else { - Scene scene = vera.status.getSceneById( item.ItemId ); - if (scene.newScreenUpdateWaitingAndClearFlag()) + foreach(GUIListItem item in RightList.ListItems) { - item.Label2 = (scene.room == 0 ? "" : vera.status.getRoomById(scene.room).name); - item.PinImage = helper.getStateImage(scene.commstate); - item.IsPlayed = scene.isActive(); - Utils.SetDefaultIcons(item); + Scene scene = vera.status.getSceneById( item.ItemId ); + if (scene.newScreenUpdateWaitingAndClearFlag()) + { + item.Label2 = (scene.room == 0 ? "" : vera.status.getRoomById(scene.room).name); + item.PinImage = helper.getStateImage(scene.commstate); + item.IsPlayed = scene.isActive(); + Utils.SetDefaultIcons(item); + } } } } @@ -571,8 +584,7 @@ base.OnPageLoad(); } - - + private void setSystemStatus() { if (vera.status.system.state != DevState.NONE) { @@ -587,6 +599,7 @@ comment.Label = vera.status.system.comment; } + private void listCategories() { int iCnt = 1; Modified: trunk/plugins/VeraControl/VeraControl.csproj =================================================================== --- trunk/plugins/VeraControl/VeraControl.csproj 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/VeraControl.csproj 2012-01-17 23:06:18 UTC (rev 4408) @@ -83,6 +83,7 @@ </Reference> </ItemGroup> <ItemGroup> + <Compile Include="BaseDevice.cs" /> <Compile Include="DevCategories.cs" /> <Compile Include="DeviceCam.cs" /> <Compile Include="DeviceDimmer.cs" /> Modified: trunk/plugins/VeraControl/VeraHelper.cs =================================================================== --- trunk/plugins/VeraControl/VeraHelper.cs 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/VeraHelper.cs 2012-01-17 23:06:18 UTC (rev 4408) @@ -13,7 +13,6 @@ namespace VeraControl.Properties { - public enum DevState { NONE = 0, @@ -21,7 +20,8 @@ SUCCESS, ERROR, - CONNECTION_ERROR // not a Vera state + CONNECTION_ERROR, // not a Vera state: update request failed + COMMAND_ERROR // not a Vera state: command request failed } /// <summary> @@ -79,6 +79,9 @@ { switch(state) { + case DevState.NONE: + return ""; + case DevState.PENDING: return "remote_blue.png"; @@ -87,14 +90,14 @@ case DevState.ERROR: return "tvguide_recordconflict_button.png"; - + + case DevState.COMMAND_ERROR: + return "tvguide_record_button.png"; + case DevState.CONNECTION_ERROR: + default: return "warning-icon.png"; - - default: - case DevState.NONE: - return ""; - + } } @@ -128,7 +131,7 @@ public long getSecondsSince1970() { - return (DateTime.Now.Ticks / 10000000); + return (DateTime.Now.Ticks / TimeSpan.TicksPerSecond); } } } Modified: trunk/plugins/VeraControl/skin/Default/VeraDialogDeviceControl.xml =================================================================== --- trunk/plugins/VeraControl/skin/Default/VeraDialogDeviceControl.xml 2012-01-17 23:05:16 UTC (rev 4407) +++ trunk/plugins/VeraControl/skin/Default/VeraDialogDeviceControl.xml 2012-01-17 23:06:18 UTC (rev 4408) @@ -222,7 +222,6 @@ <id>15</id> <description>Dimmable Light</description> <type>slider</type> - <id>15</id> <posX>330</posX> <posY>345</posY> <spintype>Int</spintype> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-17 23:05:22
|
Revision: 4407 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4407&view=rev Author: BartEv Date: 2012-01-17 23:05:16 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/VeraControl/releases/VeraControl_v0.6.1.0.mpe1 Added: trunk/plugins/VeraControl/releases/VeraControl_v0.6.1.0.mpe1 =================================================================== (Binary files differ) Property changes on: trunk/plugins/VeraControl/releases/VeraControl_v0.6.1.0.mpe1 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-17 23:04:57
|
Revision: 4406 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4406&view=rev Author: BartEv Date: 2012-01-17 23:04:50 +0000 (Tue, 17 Jan 2012) Log Message: ----------- Version 6.1.0 Modified Paths: -------------- trunk/plugins/VeraControl/releases/update.xml Modified: trunk/plugins/VeraControl/releases/update.xml =================================================================== --- trunk/plugins/VeraControl/releases/update.xml 2012-01-15 23:50:18 UTC (rev 4405) +++ trunk/plugins/VeraControl/releases/update.xml 2012-01-17 23:04:50 UTC (rev 4406) @@ -514,37 +514,189 @@ <Build>0</Build> <Revision>1</Revision> </Version> - <ExtensionDescription>Control your Vera controller from MediaPortal. + <ExtensionDescription>Control your Vera controller from MediaPortal. + +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... + + + +Vera is a Z-wave home automation controller from MicasaVerde. + +This version is tested with: + + - Vera 1 v1.1.1338 + + - Vera 2 v1.1.1267 + + - Vera 2 v1.5.255 + + + + + +</ExtensionDescription> + <VersionDescription>- Real time Vera status update + +-Threated communication (no-screen-lockups) + +- IP Cam support + +</VersionDescription> + <DevelopmentStatus>Beta</DevelopmentStatus> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.6.0.1.mpe1</OnlineLocation> + <ReleaseDate>2012-01-16T22:51:05</ReleaseDate> + <Tags>home automation, +z-wave, +micasaverde, +vera</Tags> + <Location>C:\Users\Bart\Documents\SharpDevelop Projects\VeraControl\releases\VeraControl_v[Version].mpe1</Location> + <Params> + <Items> + <SectionParam Name="Online Icon"> + <Value /> + <ValueType>String</ValueType> + <Description>The icon file of the package stored online (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Configuration file"> + <Value /> + <ValueType>Template</ValueType> + <Description>The file used to configure the extension. + If have .exe extension the will be executed + If have .dll extension used like MP plugin configuration</Description> + </SectionParam> + <SectionParam Name="Online Screenshots"> + <Value /> + <ValueType>String</ValueType> + <Description>Online stored screenshot urls separated by ; </Description> + </SectionParam> + <SectionParam Name="Force to uninstall on update"> + <Value>yes</Value> + <ValueType>Bool</ValueType> + <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description> + </SectionParam> + </Items> + </Params> + </GeneralInfo> + <UniqueFileList> + <Items /> + </UniqueFileList> + <ProjectSettings> + <FolderGroups /> + </ProjectSettings> + <IsSkin>false</IsSkin> + </PackageClass> + <PackageClass> + <Version>2.0</Version> + <Groups> + <Items> + <GroupItem Name="Default"> + <DisplayName>Default</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Default</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="IconsDefault"> + <DisplayName>IconsDefault</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>IconsDefault</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="IconsDefaultWide"> + <DisplayName>IconsDefaultWide</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>IconsDefaultWide</Description> + <Files> + <Items /> + </Files> + </GroupItem> + </Items> + </Groups> + <Sections> + <Items /> + </Sections> + <Dependencies> + <Items> + <DependencyItem> + <Type>MediaPortal</Type> + <Id /> + <MinVersion> + <Major>1</Major> + <Minor>1</Minor> + <Build>6</Build> + <Revision>27644</Revision> + </MinVersion> + <MaxVersion> + <Major>1</Major> + <Minor>1</Minor> + <Build>6</Build> + <Revision>27644</Revision> + </MaxVersion> + <WarnOnly>false</WarnOnly> + <Message>requires MediaPortal version 1.1.6.27644 to 1.1.6.27644</Message> + <Name>MediaPortal</Name> + </DependencyItem> + </Items> + </Dependencies> + <PluginDependencies> + <Items> + <PluginDependencyItem AssemblyName="VeraControl.dll"> + <CompatibleVersion> + <Items> + <CompatibleVersionItem> + <MinRequiredVersion>1.1.6.27644</MinRequiredVersion> + <DesignedForVersion>1.1.6.27644</DesignedForVersion> + </CompatibleVersionItem> + </Items> + </CompatibleVersion> + <SubSystemsUsed> + <Items> + <SubSystemItem Name="MP.SkinEngine" /> + <SubSystemItem Name="MP.Config" /> + </Items> + </SubSystemsUsed> + </PluginDependencyItem> + </Items> + </PluginDependencies> + <GeneralInfo> + <Name>Vera Controller</Name> + <Id>ebb6b1af-6fb9-44e5-a859-9d32ffe20a9e</Id> + <Author>Bart Eversdijk</Author> + <HomePage>http://www.team-mediaportal.com/extensions/micasaverde-vera-controller</HomePage> + <ForumPage>http://forum.team-mediaportal.com/mediaportal-plugins-47/plugin-micasaverde-vera-controller-104337/</ForumPage> + <UpdateUrl>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/update.xml</UpdateUrl> + <Version> + <Major>0</Major> + <Minor>6</Minor> + <Build>1</Build> + <Revision>0</Revision> + </Version> + <ExtensionDescription>Control your Vera controller from MediaPortal. -Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtains automatically when MediaPortal starts a movie... - +Vera is a Z-wave home automation controller from MicasaVerde. -Vera is a Z-wave home automation controller from MicasaVerde. +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.5.255 -This version is tested with: - - Vera 1 v1.1.1338 - - Vera 2 v1.1.1267 - - Vera 2 v1.5.255 - - - - - </ExtensionDescription> - <VersionDescription>- Real time Vera status update - --Threated communication (no-screen-lockups) - -- IP Cam support - + <VersionDescription>- Real time Vera status update +-Threated communication (no-screen-lockups) +- IP Cam support +- Improved error handling </VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.6.0.1.mpe1</OnlineLocation> - <ReleaseDate>2012-01-16T22:51:05</ReleaseDate> + <ReleaseDate>2012-01-18T22:51:05</ReleaseDate> <Tags>home automation, z-wave, micasaverde, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-15 23:50:27
|
Revision: 4405 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4405&view=rev Author: BartEv Date: 2012-01-15 23:50:18 +0000 (Sun, 15 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/DeviceDimmer.cs trunk/plugins/VeraControl/DeviceGeneric.cs trunk/plugins/VeraControl/DialogDeviceControl.cs trunk/plugins/VeraControl/Properties/AssemblyInfo.cs trunk/plugins/VeraControl/Scene.cs trunk/plugins/VeraControl/VeraCommunication.cs trunk/plugins/VeraControl/VeraControl.cs trunk/plugins/VeraControl/VeraControl.csproj trunk/plugins/VeraControl/VeraHelper.cs trunk/plugins/VeraControl/VeraSetupForm.Designer.cs trunk/plugins/VeraControl/VeraSetupForm.cs trunk/plugins/VeraControl/releases/VeraControl.xmp2 trunk/plugins/VeraControl/releases/update.xml trunk/plugins/VeraControl/skin/Default/VeraControl.xml trunk/plugins/VeraControl/skin/Default/VeraDialogDeviceControl.xml trunk/plugins/VeraControl/skin/DefaultWide/VeraControl.xml trunk/plugins/VeraControl/skin/DefaultWide/VeraDialogDeviceControl.xml Added Paths: ----------- trunk/plugins/VeraControl/DeviceCam.cs trunk/plugins/VeraControl/DeviceSceneController.cs trunk/plugins/VeraControl/DeviceSystem.cs trunk/plugins/VeraControl/DialogSceneControl.cs trunk/plugins/VeraControl/releases/VeraControl_v0.6.0.1.mpe1 trunk/plugins/VeraControl/skin/Default/VeraDialogSceneControl.xml trunk/plugins/VeraControl/skin/DefaultWide/VeraDialogSceneControl.xml trunk/plugins/VeraControl/skin/Media/Vera/IR_Transmitter.png trunk/plugins/VeraControl/skin/Media/Vera/USB_UIRT.png trunk/plugins/VeraControl/skin/Media/Vera/Zwave.png trunk/plugins/VeraControl/skin/Media/Vera/music_audio.png trunk/plugins/VeraControl/skin/Media/Vera/plugins.png trunk/plugins/VeraControl/skin/Media/Vera/users.png Added: trunk/plugins/VeraControl/DeviceCam.cs =================================================================== --- trunk/plugins/VeraControl/DeviceCam.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceCam.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -0,0 +1,88 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 7-1-2012 + * Time: 21:42 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceCam. + /// </summary> + public class DeviceCam : DeviceGeneric + { + private string m_sIp = "127.0.0.1"; + private string m_sUrl = "/"; + private string m_sStream = ""; + private string m_sVideoUrl = ""; + private int m_refresh = 10; + + public DeviceCam( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_sIp = helper.getAttrAsString(xn, "ip", m_sIp); + m_sUrl = helper.getAttrAsString(xn, "url", m_sUrl); + m_sStream = helper.getAttrAsString(xn, "streaming", m_sStream); + m_sVideoUrl = helper.getAttrAsString(xn, "videourls", m_sVideoUrl); + + return base.update(xn); + } + + public string imgUrl + { + get { return "http://" + m_sIp + "/" + m_sUrl.Replace("%2F", "/"); } + set { } + } + + public int refreshRate + { + get { return m_refresh; } + set { m_refresh = value; } + } + + private bool refreshDelayPassed(long lastcheck) + { + return ((helper.getSecondsSince1970() - refreshRate) > (lastcheck / 10000000)); + } + + public override string getIconName() + { + return "Ip_Camera"; + } + + public override bool newScreenUpdateWaitingAndClearFlag( ) + { + // Invoking this method will clear the update ready flag -> so caller need to handle the update + // A cam device requires an update every refreshRate seconds + bool b = m_bScreenUpdateRequired || refreshDelayPassed(DateTime.Now.Ticks); + m_bScreenUpdateRequired = false; + if (b) + { + m_lLastUpdate = DateTime.Now.Ticks; + } + return b; + } + + public override bool newUpdateSince(long lTimePreviousCheck) + { + bool b = (lTimePreviousCheck <= m_lLastUpdate) || refreshDelayPassed(m_lLastUpdate); + if (b) + { + m_lLastUpdate = DateTime.Now.Ticks; + } + return b; + } + } +} Modified: trunk/plugins/VeraControl/DeviceDimmer.cs =================================================================== --- trunk/plugins/VeraControl/DeviceDimmer.cs 2012-01-14 17:51:27 UTC (rev 4404) +++ trunk/plugins/VeraControl/DeviceDimmer.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -57,14 +57,14 @@ { get { return m_iLevel; } set - { + { int newValue = value; if (newValue > 100) { newValue = 100; } else { if (newValue < 0) { newValue = 0; } } - if (id > 0) // Only send when a valid ID is found + if ((id > 0) && (newValue != m_iLevel)) // Only send when a valid ID is found { // Do something with vera string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ @@ -97,9 +97,9 @@ { string leveltxt = "0"; if (level > 0) { leveltxt = "25"; } - if (level > 35) { leveltxt = "50"; } - if (level > 65) { leveltxt = "75"; } - if (level > 85) { leveltxt = "100"; } + if (level > 25) { leveltxt = "50"; } + if (level > 50) { leveltxt = "75"; } + if (level > 75) { leveltxt = "100"; } return "Dimmable_Light_"+leveltxt; } Modified: trunk/plugins/VeraControl/DeviceGeneric.cs =================================================================== --- trunk/plugins/VeraControl/DeviceGeneric.cs 2012-01-14 17:51:27 UTC (rev 4404) +++ trunk/plugins/VeraControl/DeviceGeneric.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -21,11 +21,13 @@ /// </summary> public class DeviceGeneric { - private string m_sName = "unknown device"; - private int m_iId = 0; - private string m_sAltId = ""; - private int m_iCategory = 0; - private int m_iRoom = 0; + public long m_lLastUpdate = 0; + public bool m_bScreenUpdateRequired = false; + private string m_sName = "unknown device"; + private int m_iId = 0; + private string m_sAltId = ""; + private int m_iCategory = 0; + private int m_iRoom = 0; // not connected (-2), none (-1), pending (0,1,5,6), success(4), error (2,3) private DevState m_dsState = DevState.NONE; @@ -56,7 +58,7 @@ if (m_iId == 0) { // void device no further processing needed - return true; + return false; } // Make sure room exists if (m_iRoom == 0 || !vera.status.isRoomFound(m_iRoom)) @@ -67,6 +69,11 @@ } m_iRoom = 0; } + + // Set update flag + m_bScreenUpdateRequired = true; + m_lLastUpdate = DateTime.Now.Ticks; + return true; } @@ -176,5 +183,18 @@ { return new string [] {"Off", "On"}; } + + public virtual bool newScreenUpdateWaitingAndClearFlag( ) + { + // Invoking this method will clear the update ready flag -> so caller need to handle the update + bool b = m_bScreenUpdateRequired; + m_bScreenUpdateRequired = false; + return b; + } + + public virtual bool newUpdateSince(long lTimePreviousCheck) + { + return (lTimePreviousCheck <= m_lLastUpdate); + } } } Added: trunk/plugins/VeraControl/DeviceSceneController.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSceneController.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceSceneController.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -0,0 +1,70 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 8-1-2012 + * Time: 0:15 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceSceneController. + /// </summary> + public class DeviceSceneController: DeviceGeneric + { + private bool m_bTripped = false; + + public DeviceSceneController( XmlNode xn ): base (xn) + { + if (xn != null) + { + update(xn); + } + } + + public override bool update(XmlNode xn) + { + m_bTripped = helper.getAttrAsBool(xn, "status", m_bTripped); + m_bTripped = helper.getAttrAsBool(xn, "tripped", m_bTripped); + return base.update(xn); + } + + public override bool status + { + get { return m_bTripped; } + set { } + } + + public bool tripped + { + get { return m_bTripped; } + set { } + } + + public override int level + { + get { return (m_bTripped ? 1 : 0); } + set { } + } + + public override string ToString() + { + return name + " [" + getStatusText() + "]"; + } + + public override string getIconName() + { + return "Motion_Sensor_" + (m_bTripped ? "100" : "0"); + } + + public override string getStatusText() + { + return (status ? "ACTIVE" : "standby"); + } + + } +} Added: trunk/plugins/VeraControl/DeviceSystem.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSystem.cs (rev 0) +++ trunk/plugins/VeraControl/DeviceSystem.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -0,0 +1,177 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 12-1-2012 + * Time: 10:32 + * + * To change this template use Tools | Options | Coding | Edit Standard Headers. + */ +using System; +using System.Xml; +// using VeraControl.Properties.Devstate; + +namespace VeraControl.Properties +{ + /// <summary> + /// Description of DeviceSystem. + /// </summary> + public class DeviceSystem + { + public DeviceSystem() + { + } + + public VeraHelper helper = VeraHelper.Instance; + + public long m_lLastUpdate = 0; + public bool m_bScreenUpdateRequired = false; + private bool m_bFullReload = true; + private string m_sVersion = ""; + private string m_sModel = ""; + private bool m_zWaveHeal = false; + private bool m_bMetric = true; + private string m_sSerial = ""; + private string m_sFwd1Server = ""; + private string m_sFwd2Server = ""; + private string m_sLoadTime = "0"; + private string m_sDataVersion = "0"; + private string m_sComment = ""; + private DevState m_dsVeraState = DevState.NONE; + + + public bool update(XmlNode xn) + { + m_bFullReload = helper.getAttrAsBool (xn, "full", m_bFullReload); + m_sVersion = helper.getAttrAsString (xn, "version", m_sVersion); + m_sModel = helper.getAttrAsString (xn, "model", m_sModel); + m_zWaveHeal = helper.getAttrAsBool (xn, "zwave_heal", m_zWaveHeal); + m_sSerial = helper.getAttrAsString (xn, "serial_number", m_sSerial); + m_sFwd1Server = helper.getAttrAsString (xn, "fwd1", m_sFwd1Server); + m_sFwd2Server = helper.getAttrAsString (xn, "fwd2", m_sFwd2Server); + m_sLoadTime = helper.getAttrAsString (xn, "loadtime", m_sLoadTime); + + // Set update flag + string tempDataversion = helper.getAttrAsString (xn, "dataversion", m_sDataVersion); + DevState tempVeraState = helper.toDevState(helper.getAttrAsInt(xn, "state", -1)); + string tempComment = helper.getAttrAsString (xn, "comment", ""); + + if ((m_sDataVersion != tempDataversion) || m_sComment != tempComment || m_dsVeraState != tempVeraState) + { + m_bScreenUpdateRequired = true; + m_lLastUpdate = DateTime.Now.Ticks; + } + m_sDataVersion = tempDataversion; + m_dsVeraState = tempVeraState; + m_sComment = tempComment; + + m_dsVeraState = helper.toDevState(helper.getAttrAsInt(xn, "state", -1)); + m_sComment = helper.getAttrAsString (xn, "comment", ""); + m_bMetric = (helper.getAttrAsString(xn, "temperature", "C") == "C"); + + return true; + } + + public void clearFullReloadFlag() + { + m_bFullReload = false; + } + + public void setFullReloadFlag() + { + m_bFullReload = true; + } + public bool fullReload + { + get { return m_bFullReload; } + set { } + } + + public string versionInfo + { + get { return m_sModel + " " + m_sVersion; } + set { } + } + + public bool bZWaveHeal + { + get { return m_zWaveHeal; } + set { } + } + + public string serialno + { + get { return m_sSerial; } + set { } + } + + public string fwd + { + get { return m_sFwd1Server; } + set { } + } + + public string fwdBackup + { + get { return m_sFwd2Server; } + set { } + } + + public string loadtime + { + get { return m_sLoadTime; } + set { } + } + + public string dataversion + { + get { return m_sDataVersion; } + set { } + } + + public DevState state + { + get { return m_dsVeraState; } + set { } + } + + public string comment + { + get { return m_sComment; } + set { } + } + + public void reportConnectionError( string errmsg ) + { + m_dsVeraState = DevState.CONNECTION_ERROR; + m_sComment = errmsg; + m_bScreenUpdateRequired = true; + m_lLastUpdate = DateTime.Now.Ticks; + } + + public void clearConnectionError( ) + { + m_dsVeraState = DevState.NONE; + m_sComment = ""; + m_bScreenUpdateRequired = true; + m_lLastUpdate = DateTime.Now.Ticks; + } + + public bool isMetric() + { + return m_bMetric; + } + + public bool newScreenUpdateWaitingAndClearFlag( ) + { + // Invoking this method will clear the update ready flag -> so caller need to handle the update + bool b = m_bScreenUpdateRequired; + m_bScreenUpdateRequired = false; + return b; + } + + public bool newUpdateSince(float fTimePreviousCheck) + { + return (fTimePreviousCheck <= m_lLastUpdate); + } + } +} Modified: trunk/plugins/VeraControl/DialogDeviceControl.cs =================================================================== --- trunk/plugins/VeraControl/DialogDeviceControl.cs 2012-01-14 17:51:27 UTC (rev 4404) +++ trunk/plugins/VeraControl/DialogDeviceControl.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -4,8 +4,8 @@ * Date: 24-12-2011 * Time: 14:17 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; @@ -27,47 +27,100 @@ /// </summar`y> public class DialogDeviceControl : GUIDialogWindow { - [SkinControl(2)] protected GUIButtonControl btnClose = null; - [SkinControl(4)] protected GUILabelControl lblHeading = null; - [SkinControl(5)] protected GUIImage imgLogo = null; + [SkinControl(2)] protected GUIButtonControl btnClose = null; + [SkinControl(4)] protected GUILabelControl lblHeading = null; + [SkinControl(5)] protected GUIImage imgLogo = null; - [SkinControlAttribute(6)] protected GUILabelControl label1=null; + [SkinControlAttribute(6)] protected GUILabelControl label1=null; [SkinControlAttribute(7)] protected GUILabelControl label2=null; [SkinControlAttribute(8)] protected GUILabelControl label3=null; [SkinControl(10)] protected GUIButtonControl btnLeft = null; - [SkinControl(11)] protected GUIButtonControl btnRight = null; - [SkinControl(12)] protected GUIButtonControl btnMode1 = null; + [SkinControl(11)] protected GUIButtonControl btnRight = null; + [SkinControl(12)] protected GUIButtonControl btnMode1 = null; [SkinControl(13)] protected GUIButtonControl btnMode2 = null; [SkinControl(14)] protected GUIButtonControl btnMode3 = null; - [SkinControl(15)] protected GUISliderControl slider = null; - [SkinControl(20)] protected GUIImage camImage = null; - - - DeviceGeneric myDev = null; - + [SkinControl(15)] protected GUISliderControl slider = null; + [SkinControl(20)] protected GUIImage camImage = null; + + [SkinControl(30)] protected GUIImage cmtImage = null; + [SkinControlAttribute(31)] protected GUILabelControl comment=null; + + VeraHelper helper = new VeraHelper(); + private DeviceGeneric myDev = null; + private long m_iLastUpdate = 0; + public DialogDeviceControl() { GetID = (int)1973; } - public void InitDialog(string strLine, DeviceGeneric dev) - { - //LoadSkin(); - AllocResources(); - InitControls(); + public override bool Init() + { + bool bResult = Load(GUIGraphicsContext.Skin + @"\VeraDialogDeviceControl.xml"); + return bResult; + } - lblHeading.Label = strLine; - + + public void InitDialog(string strLine, DeviceGeneric dev) + { + //LoadSkin(); + AllocResources(); + InitControls(); + + lblHeading.Label = strLine; myDev = dev; + + if (!myDev.isControllable) + { + btnClose.SetNavigation(2,2,2,2); + } + + updateStatus(); } - - public override bool Init() - { - bool bResult = Load(GUIGraphicsContext.Skin + @"\VeraDialogDeviceControl.xml"); - return bResult; - } + public void updateStatus() + { + SetImage("Vera\\"+myDev.getIconName()+".png"); + + setComment(helper.getStateImage(myDev.commstate), myDev.comment); + + if (myDev.isControllable) + { + if (myDev.GetType() == typeof(DeviceSprinkler)) + { + SetText(myDev.name, myDev.getStatusText() + " - " + myDev.mode, myDev.getExtraText() ); + SetActiveBut((myDev.status ? 1 : 0), (myDev.mode == "Auto" ? 0 : (myDev.mode == "Block" ? 2 : 1) )); + } + else if (myDev.GetType() == typeof(DeviceThermostat)) + { + SetText(myDev.name, myDev.getStatusText(), myDev.getExtraText() ); + SetActiveBut((myDev.status ? 1 : 0), (myDev.mode == "Auto" ? 0 : + (myDev.mode == "CoolOn" || myDev.mode == "Cool" ? 1 : + (myDev.mode == "HeatOn" || myDev.mode == "Heat" ? 2 : 3) ))); + } + else + { + SetText(myDev.name, "", ""); + SetActiveBut(myDev.status ? 1 : 0, -1); + } + SetButtons(myDev.getCommands()); + SetSlider(myDev.level, myDev.maxLevel); + } + else + { + if (myDev.GetType() == typeof(DeviceCam)) + { + DeviceCam cam = (DeviceCam) myDev; + SetCamImage(cam.imgUrl); + } + SetText(myDev.name, myDev.getStatusText(), myDev.getExtraText()); + } + // save last update ticks + m_iLastUpdate = DateTime.Now.Ticks; + } + + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { if (control == btnLeft) @@ -134,7 +187,7 @@ { btnLeft.NavigateUp = 12; btnRight.NavigateUp = 14; - + if (butTxt.Length < 5) { // if only 2 buttons required, use right iso middle button @@ -176,10 +229,10 @@ { btnMode1.TextColor = (iModeNr == 0 ? 0xFFFFFF00 : 0xFFFFFFFF ); btnMode1.TextColorNoFocus = (iModeNr == 0 ? 0x60FFFF00 : 0x60ffffff); - + btnMode2.TextColor = (iModeNr == 1 ? 0xFFFFFF00 : 0xFFFFFFFF ); btnMode2.TextColorNoFocus = (iModeNr == 1 ? 0x60FFFF00 : 0x60ffffff); - + btnMode3.TextColor = (iModeNr == 2 ? 0xFFFFFF00 : 0xFFFFFFFF ); btnMode3.TextColorNoFocus = (iModeNr == 2 ? 0x60FFFF00 : 0x60ffffff); } @@ -203,5 +256,29 @@ imgLogo.AllocResources(); imgLogo.KeepAspectRatio = true; } + + public void setComment(string img, string txt) + { + if (img != "") { + cmtImage.Dispose(); + cmtImage.SetFileName(img); + cmtImage.KeepAspectRatio = true; + cmtImage.Visibility = System.Windows.Visibility.Visible; + cmtImage.AllocResources(); + } else{ + cmtImage.Visibility = System.Windows.Visibility.Hidden; + } + comment.Label = txt; + } + + public override void Render(float timePassed) + { + if (myDev.newUpdateSince(m_iLastUpdate)) + { + updateStatus(); + } + + base.Render(timePassed); + } } } Added: trunk/plugins/VeraControl/DialogSceneControl.cs =================================================================== --- trunk/plugins/VeraControl/DialogSceneControl.cs (rev 0) +++ trunk/plugins/VeraControl/DialogSceneControl.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -0,0 +1,120 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 24-12-2011 + * Time: 14:17 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Collections; +using MediaPortal; +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using Alignment = MediaPortal.GUI.Library.GUIControl.Alignment; +using VAlignment = MediaPortal.GUI.Library.GUIControl.VAlignment; +using Action = MediaPortal.GUI.Library.Action; +using VeraControl.Properties; + +namespace VeraControl +{ + /// <summary> + /// Description of DialogDeviceControl. + /// </summar`y> + public class DialogSceneControl : GUIDialogWindow + { + [SkinControl(2)] protected GUIButtonControl btnClose = null; + [SkinControl(4)] protected GUILabelControl lblHeading = null; + [SkinControl(5)] protected GUIImage imgLogo = null; + + [SkinControlAttribute(6)] protected GUILabelControl label1=null; + + [SkinControl(11)] protected GUIButtonControl btnRight = null; + + [SkinControl(30)] protected GUIImage cmtImage = null; + [SkinControlAttribute(31)] protected GUILabelControl comment=null; + + VeraHelper helper = new VeraHelper(); + private Scene myScene = null; + private long m_iLastUpdate = 0; + + public DialogSceneControl() + { + GetID = (int)1975; + } + + public override bool Init() + { + bool bResult = Load(GUIGraphicsContext.Skin + @"\VeraDialogSceneControl.xml"); + return bResult; + } + + + public void InitDialog(string strLine, Scene scene) + { + //LoadSkin(); + AllocResources(); + InitControls(); + + lblHeading.Label = strLine; + myScene = scene; + + updateStatus(); + } + + public void updateStatus() + { + setComment(helper.getStateImage(myScene.commstate), myScene.comment); + + label1.Label = myScene.name; + + // save last update ticks + m_iLastUpdate = DateTime.Now.Ticks; + } + + protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) + { + if (control == btnRight) + { + if (myScene.id != 0) { + comment.Label = "Running..."; + myScene.run(); + + } + } + + // Back to the text button to switch from image view + if (control == btnClose) + { + PageDestroy(); + } + base.OnClicked(controlId, control, actionType); + } + + public void setComment(string img, string txt) + { + if (img != "") { + cmtImage.Dispose(); + cmtImage.SetFileName(img); + cmtImage.KeepAspectRatio = true; + cmtImage.Visibility = System.Windows.Visibility.Visible; + cmtImage.AllocResources(); + } else{ + cmtImage.Visibility = System.Windows.Visibility.Hidden; + } + comment.Label = txt; + } + + public override void Render(float timePassed) + { + if (myScene.newUpdateSince(m_iLastUpdate)) + { + updateStatus(); + } + base.Render(timePassed); + } + } +} Modified: trunk/plugins/VeraControl/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/VeraControl/Properties/AssemblyInfo.cs 2012-01-14 17:51:27 UTC (rev 4404) +++ trunk/plugins/VeraControl/Properties/AssemblyInfo.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -28,4 +28,4 @@ // // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: -[assembly: AssemblyVersion("0.5.0.1")] +[assembly: AssemblyVersion("0.5.1.0")] Modified: trunk/plugins/VeraControl/Scene.cs =================================================================== --- trunk/plugins/VeraControl/Scene.cs 2012-01-14 17:51:27 UTC (rev 4404) +++ trunk/plugins/VeraControl/Scene.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -4,8 +4,8 @@ * Date: 22-12-2011 * Time: 13:50 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; @@ -28,11 +28,14 @@ } public VeraHelper helper = VeraHelper.Instance; + private bool m_bScreenUpdateRequired = false; private string m_sName = "unknown scene"; private int m_iId = 0; private bool m_bActive = false; private int m_iRoom = 0; + private long m_lLastUpdate = 0; + // not connected (-2), none (-1), pending (0,1,5,6), success(4), error (2,3) private string m_sComment = ""; // red(error), green(success) or blue(pending) - icon/text private DevState m_dsState = DevState.NONE; @@ -47,6 +50,9 @@ m_sComment = helper.getAttrAsString(xn, "comment", m_sComment ); m_dsState = helper.toDevState(helper.getAttrAsInt(xn, "state", -1)); + // Set update reqired flag + m_lLastUpdate = DateTime.Now.Ticks; + m_bScreenUpdateRequired = true; return true; } @@ -55,7 +61,7 @@ get { return m_iId; } set { } } - + public string name { get { return m_sName; } @@ -72,7 +78,7 @@ get { return (commstate != DevState.NONE ? m_sComment : ""); } set { } } - + public bool isActive() { return m_bActive; @@ -102,7 +108,25 @@ } VeraCommunication vera = VeraCommunication.Instance; string cmd = "?id=lu_action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum="+id; - return vera.doVeraRequest(cmd, true); + return vera.doVeraRequest(cmd); } + + public bool newScreenUpdateWaitingAndClearFlag( ) + { + // Invoking this method will clear the update ready flag -> so caller need to handle the update + bool b = m_bScreenUpdateRequired; + m_bScreenUpdateRequired = false; + if (m_dsState != DevState.NONE && (m_lLastUpdate < (DateTime.Now.Ticks - (10 * 10000000)))) + { + m_dsState = DevState.NONE; + return true; + } + return b; + } + + public virtual bool newUpdateSince(long lTimePreviousCheck) + { + return (lTimePreviousCheck <= m_lLastUpdate); + } } } Modified: trunk/plugins/VeraControl/VeraCommunication.cs =================================================================== --- trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-14 17:51:27 UTC (rev 4404) +++ trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -4,13 +4,14 @@ * Date: 21-12-2011 * Time: 22:26 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; using System.Net; using System.IO; +using System.Threading; using System.Collections.Generic; using System.Xml; @@ -22,6 +23,7 @@ public class VeraStatus { + public DeviceSystem system = new DeviceSystem(); public List<DeviceGeneric> devices = new List<DeviceGeneric>(); public List<Scene> scenes = new List<Scene>(); public List<Room> rooms = new List<Room>(); @@ -164,22 +166,29 @@ public sealed class VeraCommunication { private static volatile VeraCommunication instance; - private static object syncRoot = new Object(); + private static object syncRoot = new Object(); + private VeraHelper helper = VeraHelper.Instance; - private string m_sVeraIPAddress; - private string m_sVeraTCPIPPort; - private string m_sDataVersion = ""; - private bool m_bMetric = true; - private DevState m_dsVeraState = DevState.NONE; - private string m_sComment = ""; + // Config data + private string m_sVeraIPAddress; + private string m_sVeraTCPIPPort; + private int m_iMaxRefreshDelay; + + // Actual device information private VeraStatus m_status = new VeraStatus(); - private long m_lLastUpdate = 0; - private bool m_bUpdatePending = false; + // Communication status/control + private long m_lLastUpdate = 0; + private bool m_bUpdatePending = false; + private bool m_bScreenUpdateRequired = false; // Only true when a new update was received AND at least one device(staus) or scene was changed + private bool m_bLastUpdateFailed = false; + private string m_strLastUpdateError = ""; + private WebClient m_webClient = new WebClient(); + + // Action control table public int[] actionTriggerTable = new int[(int)Actiontrigger.LAST_ACTIONTRIGGER]; - private VeraHelper helper = VeraHelper.Instance; - + public static VeraCommunication Instance { get @@ -208,39 +217,132 @@ //m_sVeraIPAddress = "192.10.1.240"; // m_sVeraIPAddress = "demo.mios.com"; // m_sVeraTCPIPPort = "3480"; - + // Fill action table (config settings) for (Actiontrigger i = 0; i < Actiontrigger.LAST_ACTIONTRIGGER; i++) { actionTriggerTable[(int)i] = xmlreader.GetValueAsInt("veracontroller", i.ToString(), 0); } + m_iMaxRefreshDelay = int.Parse(xmlreader.GetValueAsString("veracontroller", "maxrefreshdelay", "60")); + + // Set DownloadStringCompleted handler + m_webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(OnAsyncCompletedEventArgs); } } - public bool updateCurrentStatus() + public void updateCurrentStatus(long lNow) { - if (m_bUpdatePending) + /* when to update in case connection gets lost --> keep updating with webClient timeout 180 sec....*/ + /* TODO: watch-dog !!! last time > 4 * maxDelay force an update - to recover from hibernate */ + if (m_bUpdatePending /* && m_lLastUpdate < ((lNow / 10000000) - (4 * m_iMaxRefreshDelay)) */) { - return false; + return; } + m_bUpdatePending = true; - string verastatus = doVeraRequest("?id=lu_sdata&output_format=xml"); - m_lLastUpdate = getSecondsSince1970(); + string url = "?id=lu_sdata&loadtime=" + m_status.system.loadtime + "&dataversion=" + m_status.system.dataversion + "&minimumdelay=2000&timeout=" + m_iMaxRefreshDelay + "&output_format=xml"; + doVeraRequest(url, OnAsyncCompletedEventArgs); + m_lLastUpdate = helper.getSecondsSince1970(); + } + + public bool isVeraAlive(string ip, string port) + { + string response = retrieveURL("http://" + ip + ":" + port + "/data_request?id=lu_alive&time="+DateTime.Now.Ticks); + return (response == "OK"); + } + + public string doVeraRequest(string param) + { + return retrieveURL("http://" + vera_Address + "/data_request" + param + "&time="+DateTime.Now.Ticks); + } + + public void doVeraRequest(string param, Action<object, DownloadStringCompletedEventArgs> onCallBack) + { + retrieveURLAsync("http://" + vera_Address + "/data_request" + param + "&time="+DateTime.Now.Ticks); + } + + private string retrieveURL(string url) + { + // No callback thus Synchronised call (wait for response) + try { + m_webClient.CancelAsync(); // Cancel any current pending Async calls... + return m_webClient.DownloadString(url); + } catch( Exception e ) + { + m_bLastUpdateFailed = true; + m_strLastUpdateError = e.Message; + return "ERROR"; + } + + } + + private void retrieveURLAsync(string url) + { + // Callback thus ASynchronised call (do NOT wait for response) + try { + m_webClient.CancelAsync(); // Cancel any current pending Async calls... + m_webClient.DownloadStringAsync(new Uri(url)); + } catch( Exception e ) + { + m_bLastUpdateFailed = true; + m_strLastUpdateError = e.Message; + } + } + + public void OnAsyncCompletedEventArgs(object sender, DownloadStringCompletedEventArgs e) + { + if (!e.Cancelled) + { + // Communication cancel for some reason, no valid data to be expected + if (e.Error != null) + { + // Handle error here + m_bLastUpdateFailed = true; + m_strLastUpdateError = e.Error.Message; + m_bScreenUpdateRequired = true; + } + else + { + ParseUpdateInfo(e.Result); + // ParseUpdateInfo(m_webClient.DownloadString(@"C:\Users\Bart\Documents\SharpDevelop Projects\VeraControl\testdata\text.xml")); + } + } + + // update timer again (took some time to get the data) + m_lLastUpdate = helper.getSecondsSince1970(); + m_bUpdatePending = false; + } + + public void ParseUpdateInfo(string veraresponse) + { var xmlDoc = new XmlDocument(); - xmlDoc.LoadXml(verastatus); - + xmlDoc.LoadXml(veraresponse); + // Parse header XmlNode rootnode = xmlDoc.SelectSingleNode("/root"); - m_bMetric = (helper.getAttrAsString(rootnode, "temperature", "C") == "C"); - bool bFullRefresh = helper.getAttrAsBool (rootnode, "full", true); - m_sDataVersion = helper.getAttrAsString (rootnode, "dataversion", "0"); - m_sComment = helper.getAttrAsString (rootnode, "comment", ""); - m_dsVeraState = helper.toDevState(helper.getAttrAsInt(rootnode, "state", -1)); + if (rootnode == null) + { + // not a status update, just return (might have been an Asynchrone sent command or start scene request) + return; + } - if (bFullRefresh) + if (!m_bScreenUpdateRequired) { - // We have a full refresh -> Clear all lists + // Clear flag, only when previous update was already handled + m_status.system.clearFullReloadFlag(); + } + if (m_bLastUpdateFailed) + { + m_bLastUpdateFailed = false; + m_bScreenUpdateRequired = true; + m_status.system.clearConnectionError(); + } + // Process system status first + m_status.system.update(rootnode); + if (m_status.system.fullReload) + { + // We have a full refresh -> Clear all lists (to get clear of removed devices) TODO: check/handle selected index when an item was deleted... m_status.clearAllLists(); } @@ -278,6 +380,9 @@ } else { m_status.scenes.Add(new Scene(xn)); } + + // At least one scene was found and thus changed + m_bScreenUpdateRequired = true; } @@ -292,20 +397,24 @@ m_status.categories.Add(new DevCategories(xn)); } } - + // Process Devices xnList = xmlDoc.SelectNodes("/root/devices/device"); foreach (XmlNode xn in xnList) { DeviceGeneric dev = m_status.getDeviceById( int.Parse(xn.Attributes["id"].Value) ); if (dev.id != 0) { + // update existing device dev.update(xn); } else { + m_status.system.setFullReloadFlag(); + + // catids: http://wiki.micasaverde.com/index.php/Luup_UPNP_Files switch (xn.Attributes["category"].Value) { - //case "1": - // m_status.devices.Add(new DeviceInterface(xn)); - // break; + //case "1": // TODO: Implement interface device ? + // m_status.devices.Add(new DeviceInterface(xn)); + // break; case "2": m_status.devices.Add(new DeviceDimmer(xn)); @@ -321,13 +430,13 @@ m_status.devices.Add(new DeviceSecurity(xn)); break; - case "5": - m_status.devices.Add(new DeviceThermostat(xn, m_bMetric)); - break; + case "5": + m_status.devices.Add(new DeviceThermostat(xn, m_status.system.isMetric())); + break; case "6": m_status.devices.Add(new DeviceCam(xn)); - break; + break; case "7": m_status.devices.Add(new DeviceDoorlock(xn)); @@ -336,31 +445,50 @@ case "8": m_status.devices.Add(new DeviceWindowCovering(xn)); break; - - case "14": + + //case "9": + // m_status.devices.Add(new DeviceRemoteControl(xn)); + // break; + + //case "10": + // m_status.devices.Add(new DeviceIrTx(xn)); + // break; + + //case "13": + // m_status.devices.Add(new DeviceSerialPort(xn)); + // break + + case "14": m_status.devices.Add(new DeviceSceneController(xn)); - break; - - // case "15": // TODO: Implement AV device ? - // m_status.devices.Add(new DeviceSensor(xn)); - // break; - + break; + + // case "15": + // m_status.devices.Add(new DeviceAV(xn)); + // break; + case "16": m_status.devices.Add(new DeviceHumidity(xn)); break; case "17": - m_status.devices.Add(new DeviceTemperature(xn, m_bMetric)); + m_status.devices.Add(new DeviceTemperature(xn, m_status.system.isMetric())); break; - - case "18": + + case "18": m_status.devices.Add(new DeviceLightSensor(xn)); - break; - - case "21": + break; + + //case "19": + // m_status.devices.Add(new DeviceZwaveInt(xn)); + // break + //case "20": + // m_status.devices.Add(new DeviceInsteonInt(xn)); + // break + + case "21": m_status.devices.Add(new DevicePowerMeter(xn)); - break; - + break; + case "0": default: // Check for Google Weather Device @@ -380,80 +508,30 @@ break; } } + // At least one device was found and thus changes + m_bScreenUpdateRequired = true; } - // update timer again (took some time to get the data) - m_lLastUpdate = getSecondsSince1970(); - m_bUpdatePending = false; - return bFullRefresh; } - public string doVeraRequest( string param, bool pParseResult ) - { - string response = doVeraRequest( param ); - if (pParseResult) - { - response = parseVeraRespones(response); - } - return response; - } - - public bool isVeraAlive(string ip, string port) - { - string response = retrieveURL("http://" + ip + ":" + port + "/data_request?id=lu_alive&time="+DateTime.Now.Ticks); - - return (response == "OK"); - } - - public string doVeraRequest( string param ) - { - return retrieveURL("http://" + vera_Address + "/data_request" + param + "&time="+DateTime.Now.Ticks); - } - - private string retrieveURL( string url ) - { - using (var webClient = new System.Net.WebClient()) { - return webClient.DownloadString(url); - } - } - - - private string parseVeraRespones(string response) - { - if (response.StartsWith("ERROR:")) - { - return response; - } - if (response.Contains("<OK>OK</OK>")) - { - return "Ok"; - } - - return response; - } - - public long getSecondsSince1970() - { - return (DateTime.Now.Ticks / 10000000); - } - public long secondsSinceLastUpdate { - get { return (getSecondsSince1970() - m_lLastUpdate); } + get { return (helper.getSecondsSince1970() - m_lLastUpdate); } set { } } + /* public bool metric { get { return m_bMetric; } set { } } - + */ public List<Scene> scenes { get { return m_status.scenes; } set { } } - + public List<DeviceGeneric> devices { get { return m_status.devices; } @@ -478,6 +556,32 @@ set { } } + public bool lastUpdateFailed + { + get { return m_bLastUpdateFailed; } + set { m_bLastUpdateFailed = value; } + } + + public string lastUpdateError + { + get { return m_strLastUpdateError; } + set { } + } + + public bool newScreenUpdateWaitingAndClearFlag() + { + // Invoking this method will clear the update ready flag -> so caller need to handle the update + bool b = m_bScreenUpdateRequired; + m_bScreenUpdateRequired = false; + return b; + } + + public bool updatePending + { + get { return m_bUpdatePending; } + set { } + } + public VeraStatus status { get { return m_status; } @@ -490,6 +594,6 @@ set { } } } - - + + } Modified: trunk/plugins/VeraControl/VeraControl.cs =================================================================== --- trunk/plugins/VeraControl/VeraControl.cs 2012-01-14 17:51:27 UTC (rev 4404) +++ trunk/plugins/VeraControl/VeraControl.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -4,8 +4,8 @@ * Date: 21-12-2011 * Time: 21:20 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; @@ -31,9 +31,7 @@ [assembly: UsesSubsystem("MP.SkinEngine")] [assembly: UsesSubsystem("MP.Config")] -// TODO: support multiple Vera Box -// TODO: get all boxes for a specific user (http://sta1.mios.com/locator_json.php?username=<user>) -// TODO: support remote vera Boxes (http://fwd1.mios.com/<name>/<pass>/<serial>/data_request?...) +// TODO: support multiple Vera Box AND get all boxes for a specific user (http://sta1.mios.com/locator_json.php?username=<user>) AND support remote vera Boxes (http://fwd1.mios.com/<name>/<pass>/<serial>/data_request?...) namespace VeraControl { @@ -88,17 +86,19 @@ [SkinControl(60)] protected GUIButtonControl ActionButton = null; [SkinControl(70)] protected GUIToggleButtonControl ActionTriggerButton = null; - int PluginID = 1972; - VeraCommunication vera = VeraCommunication.Instance; - int iSelectedRoom = Int16.MaxValue; - int iSelectedCategory = Int16.MaxValue; - int iRefreshDelay = 5; - public Actiontrigger iLastAction = Actiontrigger.LAST_ACTIONTRIGGER; + [SkinControl(30)] protected GUIImage cmtImage = null; + [SkinControlAttribute(31)] protected GUILabelControl comment=null; - public bool enableSceneTrigger = false; - bool bLastUpdateFailed = false; + private int PluginID = 1972; + private VeraCommunication vera = VeraCommunication.Instance; + private int m_iSelectedRoom = Int16.MaxValue; + private int m_iSelectedCategory = Int16.MaxValue; + public Actiontrigger iLastAction = Actiontrigger.LAST_ACTIONTRIGGER; + private VeraHelper helper = new VeraHelper(); - private string titleTxt = "Micasa Verde - Vera control"; + public bool enableSceneTrigger = false; + private bool bLastUpdateFailed = false; + private string titleTxt = "Micasa Verde - Vera control"; public VeraControl() { @@ -191,26 +191,33 @@ public override bool Init() { - iSelectedRoom = Int16.MaxValue; - iSelectedCategory = Int16.MaxValue; + m_iSelectedRoom = Int16.MaxValue; + m_iSelectedCategory = Int16.MaxValue; using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) { - iRefreshDelay = int.Parse(xmlreader.GetValueAsString("veracontroller", "refreshdelay", "5")); enableSceneTrigger = xmlreader.GetValueAsBool("veracontroller", "enableSceneTrigger", false); } GUIWindowManager.OnNewAction += new OnActionHandler(OnNewAction); - + Player.PlayBackEnded += new Player.EndedHandler(g_Player_PlayBackEnded); Player.PlayBackStarted += new Player.StartedHandler(g_Player_PlayBackStarted); Player.PlayBackStopped += new Player.StoppedHandler(g_Player_PlayBackStopped); - // Handle MP start-up trigger - InitClass initClass = new InitClass(this); - Thread oThread = new Thread(new ThreadStart(initClass.runFirstUpdate)); - oThread.Start(); - + // Handle MP start-up trigger - do this is a different Thread to not block MP-start up + new Thread( () => { + vera.updateCurrentStatus(DateTime.Now.Ticks); + // Run startup trigger after first update + if (enableSceneTrigger) + { + while (vera.updatePending) + { + Thread.Sleep(1000); + } + handleActionTriggers(Actiontrigger.MP_START_UP); + } + }).Start(); return Load(GUIGraphicsContext.Skin+@"\VeraControl.xml"); } @@ -269,6 +276,13 @@ } break; + case Action.ActionType.ACTION_CONTEXT_MENU: + if (GUIWindowManager.ActiveWindow == GetWindowId()) + { + showInfoDialog(); + } + break; + case Action.ActionType.ACTION_EXIT: handleActionTriggers(Actiontrigger.MP_EXIT); break; @@ -458,84 +472,150 @@ } } - public override void Render(float timePassed) { - if (vera.secondsSinceLastUpdate > iRefreshDelay) + // Give a message to the user a update failed + if (vera.lastUpdateFailed) { - refreshNow(); + // Show message only once! + if (!bLastUpdateFailed) + { + if (vera.status.system.dataversion == "0") + { // Give message on never connected... + new Thread (() => { NoConnection(vera.lastUpdateError);}).Start(); + } else { + vera.status.system.reportConnectionError(vera.lastUpdateError); + } + } + bLastUpdateFailed = true; } + else + { // Reset failed flag again + bLastUpdateFailed = false; + } + + // vera will only update when realy required + vera.updateCurrentStatus((long)timePassed); + refreshNow(); + base.Render(timePassed); - } public void refreshNow() { - if (updateNow()) + if (vera.newScreenUpdateWaitingAndClearFlag()) { + // update system status + if (vera.status.system.newScreenUpdateWaitingAndClearFlag()) + { + setSystemStatus(); + } + // update device status - if (iSelectedRoom != Int16.MaxValue) + if (m_iSelectedRoom != Int16.MaxValue) { foreach (GUIListItem item in RightList.ListItems) { DeviceGeneric dev = vera.status.getDeviceById( item.ItemId ); - item.Label2 = dev.getStatusText(); - - //Adjust color of item when option is turned off - item.IsPlayed = !dev.isControllable; - - item.IconImage = "Vera\\"+dev.getIconName()+".png"; - item.IconImageBig = "Vera\\"+dev.getIconName()+".png"; - item.ThumbnailImage = "Vera\\"+dev.getIconName()+".png"; - - Utils.SetDefaultIcons(item); + if (dev.newScreenUpdateWaitingAndClearFlag()) + { + item.Label2 = dev.getStatusText(); + item.PinImage = helper.getStateImage(dev.commstate); + + //Adjust color of item when option is turned off + item.IsPlayed = !dev.isControllable; + + item.IconImage = "Vera\\"+dev.getIconName()+".png"; + item.IconImageBig = "Vera\\"+dev.getIconName()+".png"; + item.ThumbnailImage = "Vera\\"+dev.getIconName()+".png"; + + Utils.SetDefaultIcons(item); + } } } + else + { + foreach(GUIListItem item in RightList.ListItems) + { + Scene scene = vera.status.getSceneById( item.ItemId ); + if (scene.newScreenUpdateWaitingAndClearFlag()) + { + item.Label2 = (scene.room == 0 ? "" : vera.status.getRoomById(scene.room).name); + item.PinImage = helper.getStateImage(scene.commstate); + item.IsPlayed = scene.isActive(); + Utils.SetDefaultIcons(item); + } + } + } } } protected override void OnPageLoad() { - updateNow(); + if (m_iSelectedCategory == 0) { m_iSelectedCategory = Int16.MaxValue; } - if (iSelectedCategory == 0) { iSelectedCategory = Int16.MaxValue; } - listCategories(); - listRooms(iSelectedCategory); - listScenes(); - - // Set Current Selected Item - LeftList.SelectedListItemIndex = 0; + listRooms(m_iSelectedCategory, m_iSelectedRoom); + if (m_iSelectedRoom == Int16.MaxValue) { + listScenes(); + } else { + listDevices(m_iSelectedRoom); + } + // Disable Page control (for left list) + LeftList.SetPageControlVisible( false ); + + setSystemStatus(); + refreshNow(); updateSceneTrigger(); base.OnPageLoad(); } + + private void setSystemStatus() + { + if (vera.status.system.state != DevState.NONE) { + cmtImage.Dispose(); + cmtImage.SetFileName(helper.getStateImage(vera.status.system.state)); + cmtImage.KeepAspectRatio = true; + cmtImage.Visibility = System.Windows.Visibility.Visible; + cmtImage.AllocResources(); + } else{ + cmtImage.Visibility = System.Windows.Visibility.Hidden; + } + comment.Label = vera.status.system.comment; + + } private void listCategories() { + int iCnt = 1; + int iSelected = 0; GUIControl.ClearControl(GetID, catList.GetID); catList.AddSpinLabel("All", Int16.MaxValue); - // Fill in scene for default foreach( Section sec in vera.sections ) { catList.AddSpinLabel(sec.name, sec.id); - + iCnt++; + if (m_iSelectedCategory == sec.id) + { + iSelected = iCnt; + } } - catList.SelectedItem = iSelectedCategory; + catList.SelectedItem = iSelected; } private void listScenes() { GUIControl.ClearControl(GetID, RightList.GetID); - // Fill in scene for default foreach( Scene scene in vera.scenes ) { GUIListItem item = new GUIListItem(scene.name); - item.Label2 = vera.status.getRoomById(scene.room).name; + item.Label2 = (scene.room == 0 ? "" : vera.status.getRoomById(scene.room).name); + item.PinImage = helper.getStateImage(scene.commstate); item.IsPlayed = scene.isActive(); item.ItemId = scene.id; @@ -545,7 +625,6 @@ Utils.SetDefaultIcons(item); RightList.Add(item); - } GUIControl.FocusControl(GetID, LeftList.GetID); @@ -555,8 +634,10 @@ title.Label = titleTxt + " - Scenes"; } - private void listRooms(int iShowSection) + private void listRooms(int iShowSection, int iSelectedRoom) { + int iCnt = 0; + int iSelected = 0; // --- fill in left lisft with rooms and scene item GUIControl.ClearControl(GetID, LeftList.GetID); GUIListItem sceneitem = new GUIListItem("Scenes"); @@ -583,9 +664,16 @@ Utils.SetDefaultIcons(item); LeftList.Add(item); + + iCnt++; + if (iSelectedRoom == room.id) + { + iSelected = iCnt; + } } } - + // Set Current Selected Item + LeftList.SelectedListItemIndex = iSelected; } private void listDevices(int iShowRoom) @@ -599,6 +687,7 @@ { GUIListItem item = new GUIListItem(dev.name); item.Label2 = dev.getStatusText(); + item.PinImage = helper.getStateImage(dev.commstate); //Adjust color of item when option is turned off item.IsPlayed = !dev.isControllable; @@ -624,11 +713,11 @@ private void OnLeftlistCrtl(GUIListControl control) { - iSelectedRoom = control.SelectedListItem.ItemId; + m_iSelectedRoom = control.SelectedListItem.ItemId; GUIAnimation.HideControl(GetID, RightList.GetID); - if (iSelectedRoom == Int16.MaxValue) + if (m_iSelectedRoom == Int16.MaxValue) { // Selected room is Int16.MaxValue which mean we need to have scenes in our list listScenes(); @@ -636,7 +725,7 @@ else { // Selected room != Int16.MaxValue which mean we need to have devices of a certain room in our list - listDevices(iSelectedRoom); + listDevices(m_iSelectedRoom); } GUIAnimation.ShowControl(GetID, RightList.GetID); @@ -645,33 +734,24 @@ private void OnCategoryList(GUISpinButton control) { if (control.SpinValue > 0) { - iSelectedCategory = vera.sections[control.SpinValue-1].id; + m_iSelectedCategory = vera.sections[control.SpinValue-1].id; } else { - iSelectedCategory = Int16.MaxValue; + m_iSelectedCategory = Int16.MaxValue; } - if (iSelectedCategory == 0 ) { iSelectedCategory = Int16.MaxValue; } - listRooms( iSelectedCategory ); - iSelectedRoom = Int16.MaxValue; + if (m_iSelectedCategory == 0 ) { m_iSelectedCategory = Int16.MaxValue; } + m_iSelectedRoom = Int16.MaxValue; + listRooms( m_iSelectedCategory, m_iSelectedRoom ); listScenes(); } private void OnRightlistCrtl(GUIListControl control) { - if (iSelectedRoom == Int16.MaxValue) + if (m_iSelectedRoom == Int16.MaxValue) { // Selected room is 0 which mean we have scenes in our list Scene scene = vera.status.getSceneById(control.SelectedListItem.ItemId); - - GUIDialogOK dlg = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - dlg.SetHeading("Scene has been pressed"); - - if (scene.id != 0) { - scene.run(); - dlg.SetLine(1, "Scene '" + scene.name + "' executed"); - } else { - dlg.SetLine(1, "Scene id not found: " + control.SelectedListItem.ItemId.ToString()); - } - dlg.SetLine(2, String.Empty); - dlg.SetLine(3, String.Empty); + + DialogSceneControl dlg = (DialogSceneControl)GUIWindowManager.GetWindow((int)1975); + dlg.InitDialog("Scene control", scene); dlg.DoModal(GUIWindowManager.ActiveWindow); } else @@ -680,39 +760,6 @@ DeviceGeneric dev = vera.status.getDeviceById(control.SelectedListItem.ItemId); DialogDeviceControl dlg = (DialogDeviceControl)GUIWindowManager.GetWindow((int)1973); dlg.InitDialog(vera.status.getRoomById(dev.room).name, dev); - dlg.SetImage("Vera\\"+dev.getIconName()+".png"); - - if (dev.isControllable) - { - if (dev.GetType() == typeof(DeviceSprinkler)) - { - dlg.SetText(dev.name, dev.getStatusText() + " - " + dev.mode, dev.getExtraText() ); - dlg.SetActiveBut((dev.status ? 1 : 0), (dev.mode == "Auto" ? 0 : (dev.mode == "Block" ? 2 : 1) )); - } - else if (dev.GetType() == typeof(DeviceThermostat)) - { - dlg.SetText(dev.name, dev.getStatusText(), dev.getExtraText() ); - dlg.SetActiveBut((dev.status ? 1 : 0), (dev.mode == "Auto" ? 0 : - (dev.mode == "CoolOn" || dev.mode == "Cool" ? 1 : - (dev.mode == "HeatOn" || dev.mode == "Heat" ? 2 : 3) ))); - } - else - { - dlg.SetText(dev.name, "", ""); - dlg.SetActiveBut(dev.status ? 1 : 0, -1); - } - dlg.SetButtons(dev.getCommands()); - dlg.SetSlider(dev.level, dev.maxLevel); - } - else - { - if (dev.GetType() == typeof(DeviceCam)) - { - DeviceCam cam = (DeviceCam) dev; - dlg.SetCamImage(cam.imgUrl); - } - dlg.SetText(dev.name, dev.getStatusText(), dev.getExtraText()); - } dlg.DoModal(GUIWindowManager.ActiveWindow); // Update list after closure @@ -744,34 +791,37 @@ { ActionButton.IsVisible = enableSceneTrigger; ActionTriggerButton.Selected = enableSceneTrigger; - if (enableSceneTrigger) + if (enableSceneTrigger) { - LeftList.NavigateLeft = 60; - RightList.NavigateRight = 60; + LeftList.NavigateLeft = 60; + RightList.NavigateRight = 60; } else { - LeftList.NavigateLeft = 50; - RightList.NavigateRight = 40; + LeftList.NavigateLeft = 50; + RightList.NavigateRight = 40; } } - public bool updateNow() + private void showInfoDialog() { - try { - bool result = vera.updateCurrentStatus(); - bLastUpdateFailed = false; - return result; - } catch(Exception e) + GUIDialogText dlg = (GUIDialogText)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_TEXT); + if (dlg != null) { - if (!bLastUpdateFailed) - { - NoConnection(e.ToString()); - } - bLastUpdateFailed = false; - return false; + dlg.Reset(); + dlg.SetHeading("VeraBox - " + vera.status.system.serialno); + dlg.SetText ("version : " + vera.status.system.versionInfo +"\n" + + "addres : " + vera.vera_Address +"\n" + + "healed : " + (vera.status.system.bZWaveHeal ? "yes" : "no") +"\n" + + "units : " + (vera.status.system.isMetric() ? "metric" : "imperial") +"\n" + + "fwd1 : " + vera.status.system.fwd +"\n" + + "fwd2 : " + vera.status.system.fwdBackup + "\n" + "\n" + + "comment : " + (vera.status.system.comment == "" ? "-": vera.status.system.comment)); + + dlg.DoModal(GUIWindowManager.ActiveWindow); } } + private void NoConnection(string err) { GUIDialogText dlg = (GUIDialogText)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_TEXT); @@ -779,28 +829,11 @@ { dlg.Reset(); dlg.SetHeading("Error !!!"); - dlg.SetText ("Micasa Verde Vera 2 Box not found @ " + vera.vera_Address +"\n" + - "Check the plug-in cofiguration. \n\n Error message: \n" + err); + dlg.SetText ("MicasaVerde Vera 2 Box not found @ " + vera.vera_Address +"\n" + + "Check the plug-in configuration.\n\nError message: \n" + err); dlg.DoModal(GUIWindowManager.ActiveWindow); } } } - - public class InitClass - { - VeraControl _vc = null; - public InitClass(VeraControl vc) - { - _vc = vc; - } - public void runFirstUpdate() - { - _vc.updateNow(); - // Handle MP start-up trigger - _vc.handleActionTriggers(Actiontrigger.MP_START_UP); - } - } - - } \ No newline at end of file Modified: trunk/plugins/VeraControl/VeraControl.csproj =================================================================== --- trunk/plugins/VeraControl/VeraControl.csproj 2012-01-14 17:51:27 UTC (rev 4404) +++ trunk/plugins/VeraControl/VeraControl.csproj 2012-01-15 23:50:18 UTC (rev 4405) @@ -96,11 +96,13 @@ <Compile Include="DeviceSecurity.cs" /> <Compile Include="DeviceSprinkler.cs" /> <Compile Include="DeviceSwitch.cs" /> + <Compile Include="DeviceSystem.cs" /> <Compile Include="DeviceTemperature.cs" /> <Compile Include="DeviceThermostat.cs" /> <Compile Include="DeviceWindowCovering.cs" /> <Compile Include="DialogActionTrigger.cs" /> <Compile Include="DialogDeviceControl.cs" /> + <Compile Include="DialogSceneControl.cs" /> <Compile Include="VeraControl.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Room.cs" /> Modified: trunk/plugins/VeraControl/VeraHelper.cs =================================================================== --- trunk/plugins/VeraControl/VeraHelper.cs 2012-01-14 17:51:27 UTC (rev 4404) +++ trunk/plugins/VeraControl/VeraHelper.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -19,7 +19,9 @@ NONE = 0, PENDING, SUCCESS, - ERROR + ERROR, + + CONNECTION_ERROR // not a Vera state } /// <summary> @@ -73,6 +75,29 @@ } } + public string getStateImage( DevState state ) + { + switch(state) + { + case DevState.PENDING: + return "remote_blue.png"; + + case DevState.SUCCESS: + return "remote_green.png"; + + case DevState.ERROR: + return "tvguide_recordconflict_button.png"; + + case DevState.CONNECTION_ERROR: + return "warning-icon.png"; + + default: + case DevState.NONE: + return ""; + + } + } + public int getAttrAsInt(XmlNode xn, string key, int iDefault) { if (xn == null || xn.Attributes[key] == null) @@ -100,5 +125,10 @@ } return xn.Attributes[key].Value; } + + public long getSecondsSince1970() + { + return (DateTime.Now.Ticks / 10000000); + } } } Modified: trunk/plugins/VeraControl/VeraSetupForm.Designer.cs =================================================================== --- trunk/plugins/VeraControl/VeraSetupForm.Designer.cs 2012-01-14 17:51:27 UTC (rev 4404) +++ trunk/plugins/VeraControl/VeraSetupForm.Designer.cs 2012-01-15 23:50:18 UTC (rev 4405) @@ -37,10 +37,10 @@ this.CheckConnection = new System.Windows.Forms.Button(); this.labelPortNumber = new System.Windows.Forms.Label(); this.portnumber = new System.Windows.Forms.TextBox(); - this.label1 = new System.Windows.Forms.Label(); this.refreshdelay = new System.Windows.Forms.TextBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.enableSceneTrigger = new System.Windows.Forms.CheckBox(); + this.label1 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.SuspendLayout(); @@ -141,26 +141,17 @@ this.portnumber.TabIndex = 2; this.portnumber.Text = "3480"; // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(17, 24); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(117, 13); - this.label1.TabIndex = 7; - this.label1.Text = "Refresh status delay (s)"; - // // refreshdelay // this.refreshdelay.AcceptsTab = true; this.refreshdelay.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Win... [truncated message content] |
From: <hor...@us...> - 2012-01-14 17:51:35
|
Revision: 4404 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4404&view=rev Author: horned-reaper Date: 2012-01-14 17:51:27 +0000 (Sat, 14 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/Docs/Ausstehend.txt trunk/plugins/FritzBox/Docs/Documentation/Data/FRITZ!Box Manager Phone Book.xml trunk/plugins/FritzBox/FritzBox/EditPhoneBook.Designer.cs trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/GenerateResource-ResGen.read.1.tlog trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/releases/update.xml Added Paths: ----------- trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4403.mpe1 Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2012-01-12 23:52:12 UTC (rev 4403) +++ trunk/plugins/FritzBox/Build/Build.log 2012-01-14 17:51:27 UTC (rev 4404) @@ -1,6 +1,6 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -SVN Version: 4402 +SVN Version: 4403 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs @@ -10,7 +10,7 @@ [Microsoft .NET Framework, Version 4.0.30319.239] Copyright (C) Microsoft Corporation 2007. All rights reserved. -Build started 13.01.2012 00:47:42. +Build started 14.01.2012 18:41:28. Project "D:\FritzBox\FritzBox.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Mixed Platforms". @@ -154,8 +154,8 @@ Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.DebugForm.resources". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.exe". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.pdb". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog". + Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog". + Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog". CoreResGen: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" /r:D:\FritzBox\FritzBox\bin\Release\FritzBox.dll /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Drawing.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /compile DebugForm.resx,obj\Release\FritzBoxDebugger.DebugForm.resources Processing resource file "DebugForm.resx" into "obj\Release\FritzBoxDebugger.DebugForm.resources". @@ -195,7 +195,7 @@ 0 Warning(s) 0 Error(s) -Time Elapsed 00:00:02.11 +Time Elapsed 00:00:02.20 Reverting to build 0 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs @@ -280,7 +280,7 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 00:47:46 +Build started at 18:41:32 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Writing UpdateXML to "update.xml" Modified: trunk/plugins/FritzBox/Docs/Ausstehend.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-01-12 23:52:12 UTC (rev 4403) +++ trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-01-14 17:51:27 UTC (rev 4404) @@ -2,6 +2,7 @@ Einen kleinen Bug habe ich auch gefunden: Ich wollte gerade unter MyTVSeries die Sendung einer Serie weiterschauen - es wurde der Dialog angezeigt ob man die Folge bei Stelle X fortsetzen m\xF6chte - in diesem Moment kam ein Anruf - nach Beendigung des Anrufs wurde die Sendung dann automatisch gestartet/fortgesetzt Fehler beheben: +- auch bei einem "Unbekannten Anrufer" (unterdr\xFCckte bzw. nicht \xFCbertragene Rufnummer) \xF6ffnet sich \xFCber das Kontextrufen "zur\xFCckrufen". Sollte man deaktivieren - bei Auswahl einer MSN im Konfigurationsdialog werden die MSN-Eintr\xE4ge verdoppelt - Configuration: erste MSN wird nicht im Dropdown-Men\xFC angezeigt - btnModus umbenennen? @@ -10,12 +11,15 @@ - Problem beim Laden gro\xDFer meta0-Dateien, siehe "Problembeschreibung 1.txt" - blauer Hintergrund f\xFCr Default und DefaultWide Skins - GUI-Properties \xFCberpr\xFCfen und Dokumentation vervollst\xE4ndigen +- vertrauliche Daten im Log trotz "Extensive Logging"-Einstellung -Neue Funktionen: +Neue Funktionen/Erweiterungen: - Schalter zum Deaktivieren von Benachrichtigungen bei ausgehenden Anrufen - Rufnummer-Typ hinzuf\xFCgen - GUI-Adressbuch - Anruf-Benachrichtigungen +- Telefonbuch editierbar machen (f\xFCr FRITZ!Box-Versionen ohne Telefonbuch), ImageURL-Feld editierbar machen +- R\xFCckw\xE4rtssuche wieder integrieren - Kontextmen\xFC f\xFCr Telefonbuch - Wiki-Eintrag - Skin-Erweiterungen @@ -23,6 +27,7 @@ - geplante \xC4nderungen ver\xF6ffentlichen - wenn m\xF6glich GUI-Telefonbuch (und edit Phonebook) nach Kontakt gruppieren - Bei Anrufbenachrichtigungen: Auflistung von Kontaktnamen wenn eine Rufnummer mehrmals im Telefonbuch vorkommt +- Verbindungstest um Login, Anruflisten- und Telefonbuch-Download erweitern Anwenderw\xFCnsche: @@ -62,4 +67,7 @@ L\xF6schen von Anruflisten \xFCber die GUI creativ, 20.01.2012, 19:53: -Ausblenden bestimmter Kontakte in der GUI \ No newline at end of file +Ausblenden bestimmter Kontakte in der GUI + +AlfredENeuma, 13.01.2012, 12:10: +Vielleicht w\xE4re das eine M\xF6glichkeit f\xFCr die Zukunft: Im Telefonbuch des Plugins eine zus\xE4tzliche Spalte f\xFCr Bilder (lokal oder auf FB USB Stick). Diese Eintr\xE4ge k\xF6nnten dann verwendet werden, wenn die FB keine Eintr\xE4ge f\xFCr Bilder hat \ No newline at end of file Modified: trunk/plugins/FritzBox/Docs/Documentation/Data/FRITZ!Box Manager Phone Book.xml =================================================================== --- trunk/plugins/FritzBox/Docs/Documentation/Data/FRITZ!Box Manager Phone Book.xml 2012-01-12 23:52:12 UTC (rev 4403) +++ trunk/plugins/FritzBox/Docs/Documentation/Data/FRITZ!Box Manager Phone Book.xml 2012-01-14 17:51:27 UTC (rev 4404) @@ -14,7 +14,7 @@ <Name>Tom Hanks</Name> <UniqueID>1256</UniqueID> <PhoneNumbers> - <PhoneNumber prio="1" type="home">+00 (456) 78901</PhoneNumber> + <PhoneNumber prio="1" type="mobile">+00 (456) 78901</PhoneNumber> </PhoneNumbers> </PhoneBookItem> <PhoneBookItem> @@ -22,7 +22,7 @@ <Name>Bruce Willis</Name> <UniqueID>1224</UniqueID> <PhoneNumbers> - <PhoneNumber prio="1" type="home">+00 (789) 98745</PhoneNumber> + <PhoneNumber prio="1" type="work">+00 (789) 98745</PhoneNumber> </PhoneNumbers> </PhoneBookItem> </items> Modified: trunk/plugins/FritzBox/FritzBox/EditPhoneBook.Designer.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/EditPhoneBook.Designer.cs 2012-01-12 23:52:12 UTC (rev 4403) +++ trunk/plugins/FritzBox/FritzBox/EditPhoneBook.Designer.cs 2012-01-14 17:51:27 UTC (rev 4404) @@ -28,19 +28,20 @@ /// </summary> private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); this.dataGridView = new System.Windows.Forms.DataGridView(); - this.pictureBoxCaller = new System.Windows.Forms.PictureBox(); this.columnContactID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnPhoneType = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnPhoneNumber = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnShowCallNotification = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.columnRingTonePath = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.pictureBoxCaller = new System.Windows.Forms.PictureBox(); + this.label1 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).BeginInit(); this.SuspendLayout(); @@ -54,14 +55,14 @@ this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle16.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle16.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle16.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle16.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle16; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.columnContactID, @@ -70,46 +71,36 @@ this.columnPhoneNumber, this.columnShowCallNotification, this.columnRingTonePath}); - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle19.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dataGridView.DefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dataGridView.DefaultCellStyle = dataGridViewCellStyle4; this.dataGridView.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter; this.dataGridView.Location = new System.Drawing.Point(31, 29); this.dataGridView.MultiSelect = false; this.dataGridView.Name = "dataGridView"; - dataGridViewCellStyle20.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle20.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle20.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle20.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle20.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle20.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle20.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle5; this.dataGridView.RowHeadersVisible = false; this.dataGridView.RowTemplate.Height = 23; this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; this.dataGridView.Size = new System.Drawing.Size(729, 582); this.dataGridView.TabIndex = 19; // - // pictureBoxCaller - // - this.pictureBoxCaller.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.pictureBoxCaller.Location = new System.Drawing.Point(785, 29); - this.pictureBoxCaller.Name = "pictureBoxCaller"; - this.pictureBoxCaller.Size = new System.Drawing.Size(122, 122); - this.pictureBoxCaller.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBoxCaller.TabIndex = 23; - this.pictureBoxCaller.TabStop = false; - // // columnContactID // - dataGridViewCellStyle17.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.columnContactID.DefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.columnContactID.DefaultCellStyle = dataGridViewCellStyle2; this.columnContactID.HeaderText = "Contact ID"; this.columnContactID.Name = "columnContactID"; this.columnContactID.ReadOnly = true; @@ -117,8 +108,8 @@ // // columnName // - dataGridViewCellStyle18.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.columnName.DefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.columnName.DefaultCellStyle = dataGridViewCellStyle3; this.columnName.FillWeight = 3.825149F; this.columnName.HeaderText = "Name"; this.columnName.MinimumWidth = 150; @@ -160,11 +151,31 @@ this.columnRingTonePath.Name = "columnRingTonePath"; this.columnRingTonePath.Width = 225; // + // pictureBoxCaller + // + this.pictureBoxCaller.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.pictureBoxCaller.Location = new System.Drawing.Point(785, 29); + this.pictureBoxCaller.Name = "pictureBoxCaller"; + this.pictureBoxCaller.Size = new System.Drawing.Size(122, 122); + this.pictureBoxCaller.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pictureBoxCaller.TabIndex = 23; + this.pictureBoxCaller.TabStop = false; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(782, 598); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(89, 13); + this.label1.TabIndex = 24; + this.label1.Text = "0 phone numbers"; + // // EditPhoneBook // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(933, 639); + this.Controls.Add(this.label1); this.Controls.Add(this.pictureBoxCaller); this.Controls.Add(this.dataGridView); this.Name = "EditPhoneBook"; @@ -174,6 +185,7 @@ ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCaller)).EndInit(); this.ResumeLayout(false); + this.PerformLayout(); } @@ -187,5 +199,6 @@ private System.Windows.Forms.DataGridViewTextBoxColumn columnPhoneNumber; private System.Windows.Forms.DataGridViewCheckBoxColumn columnShowCallNotification; private System.Windows.Forms.DataGridViewTextBoxColumn columnRingTonePath; + private System.Windows.Forms.Label label1; } } \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs 2012-01-12 23:52:12 UTC (rev 4403) +++ trunk/plugins/FritzBox/FritzBox/EditPhoneBook.cs 2012-01-14 17:51:27 UTC (rev 4404) @@ -30,18 +30,22 @@ { uniqueID = phoneBookItem.UniqueID; name = phoneBookItem.Name; + showCallNotification = phoneBookItem.ShowCallNotification; + ringTonePath = phoneBookItem.RingTonePath; foreach (PhoneNumber phoneNumber in phoneBookItem.PhoneNumbers) { - type = phoneNumber.type; - number = phoneNumber.Value; + if (!String.IsNullOrEmpty(phoneNumber.Value)) + { + type = phoneNumber.type; + number = phoneNumber.Value; + + dataGridView.Rows.Add(uniqueID, name, type, number, showCallNotification, ringTonePath); + } } + } - showCallNotification = phoneBookItem.ShowCallNotification; - ringTonePath = phoneBookItem.RingTonePath; - - dataGridView.Rows.Add(uniqueID, name, type, number, showCallNotification, ringTonePath); - } + label1.Text = dataGridView.Rows.Count + " phone numbers"; } private void EditPhoneBook_Load(object sender, EventArgs e) @@ -86,12 +90,27 @@ { case 4: contact.ShowCallNotification = (bool)newValue; + + // update "Show call notification" field in all rows + for (int i = 0; i < dataGridView.Rows.Count; i++) + { + dataGridView.Rows[i].Cells[4].Value = phoneBook.Items[dataGridView.Rows[i].Cells[0].Value.ToString()].ShowCallNotification; + } + break; case 5: contact.RingTonePath = (string)newValue; + + // update "Ring tone path" field in all rows + for (int i = 0; i < dataGridView.Rows.Count; i++) + { + dataGridView.Rows[i].Cells[5].Value = phoneBook.Items[dataGridView.Rows[i].Cells[0].Value.ToString()].RingTonePath; + } + break; } + // transfer changed contact to phone book phoneBook.EditItem(contact); } @@ -100,6 +119,10 @@ dataGridView.EndEdit(); // confirm open table changes phoneBook.SavePhoneBookToXMLFile(); + + // unregister event monitors + this.dataGridView.SelectionChanged -= new System.EventHandler(this.dataGridView_SelectionChanged); + dataGridView.CellValueChanged -= new DataGridViewCellEventHandler(dataGridView_CellValueChanged); } } } Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-01-12 23:52:12 UTC (rev 4403) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-01-14 17:51:27 UTC (rev 4404) @@ -967,7 +967,7 @@ if (voiceBoxItem.isNew > 0) { - if (lastNewCallerName == "") lastNewCallerName = caller.PhoneBookItem.Name; + if (lastNewCallerName == "" && caller.PhoneBookItem != null) lastNewCallerName = caller.PhoneBookItem.Name; newVoiceBoxItemsCount++; } Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs 2012-01-12 23:52:12 UTC (rev 4403) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs 2012-01-14 17:51:27 UTC (rev 4404) @@ -86,6 +86,7 @@ if (normalizePhoneNumber(phoneNumber.Value) == normalizePhoneNumber(caller.PhoneNumber)) { if (Settings.ExtensiveLogging) Log.Info("Caller is identified by phone book as {0}", phoneBookItem.Name); + caller.PhoneBookItem = phoneBookItem; return caller; } @@ -160,9 +161,8 @@ { XmlSerializer xmlSerializer = new XmlSerializer(typeof(FritzPhoneBooks)); fritzPhoneBooks = (FritzPhoneBooks)xmlSerializer.Deserialize(new StringReader(fritzPhoneBooksSerialized)); - FritzManager.PhoneBook fritzPhoneBook = fritzPhoneBooks.Items[0]; // always choose first phone book - PhoneBookItem tempPhoneBookItem; + PhoneBookItem newPhoneBookItem; bool updateRequired, contactFound; string name, uniqueID = null, imageURL; @@ -186,11 +186,15 @@ if (phoneBook.ContainsKey(uniqueID)) { // check for differences + // ...on name and image URL fields + if (phoneBook[uniqueID].Name != name || imageURL != phoneBook[uniqueID].ImageURL) updateRequired = true; + + // ...on phone numbers for (int i = 0; i < contact.telephony.Length; i++) { try { - if (phoneBook[uniqueID].Name != name || !contact.telephony[i].Equals(phoneBook[uniqueID].PhoneNumbers[i]) || imageURL != phoneBook[uniqueID].ImageURL) updateRequired = true; + if (!contact.telephony[i].Equals(phoneBook[uniqueID].PhoneNumbers[i])) updateRequired = true; } catch { @@ -204,6 +208,7 @@ if (updateRequired) { if (Settings.ExtensiveLogging) Log.Info("Updating contact " + phoneBook[uniqueID].Name); + else Log.Info("Updating contact"); phoneBook[uniqueID].Name = name; phoneBook[uniqueID].PhoneNumbers = contact.telephony; @@ -215,14 +220,15 @@ else { if (Settings.ExtensiveLogging) Log.Info("Adding contact " + name); + else Log.Info("Adding contact"); - tempPhoneBookItem = new PhoneBookItem(); - tempPhoneBookItem.UniqueID = uniqueID; - tempPhoneBookItem.Name = name; - tempPhoneBookItem.PhoneNumbers = contact.telephony; - tempPhoneBookItem.ImageURL = imageURL; + newPhoneBookItem = new PhoneBookItem(); + newPhoneBookItem.UniqueID = uniqueID; + newPhoneBookItem.Name = name; + newPhoneBookItem.PhoneNumbers = contact.telephony; + newPhoneBookItem.ImageURL = imageURL; - phoneBook.Add(uniqueID, tempPhoneBookItem); + phoneBook.Add(uniqueID, newPhoneBookItem); phoneBookSortIsRequired = true; phoneBookChanges = true; @@ -232,6 +238,7 @@ // check for obsolete entries in local phone book (not existing in FRITZ!Box phone book anymore) string[] contactsToDelete = new string[phoneBook.Count]; int k = 0; + string uniqueIDOnFritzBox; foreach (PhoneBookItem phoneBookItem in phoneBook.Values) { @@ -239,9 +246,15 @@ foreach (Contact contact in fritzPhoneBook.contact) { - uniqueID = phoneBookItem.UniqueID; + name = contact.person[0].realName; - if (uniqueID == phoneBookItem.UniqueID) + if (contact.uniqueid != null) uniqueID = phoneBookItem.UniqueID; + else uniqueID = phoneBookItem.Name; // in compatibility mode the name is used as unique ID + + if (fritzPhoneBook.contact[0].uniqueid != null) uniqueIDOnFritzBox = contact.uniqueid; + else uniqueIDOnFritzBox = name; // in compatibility mode the name is used as unique ID + + if (uniqueID == uniqueIDOnFritzBox) { contactFound = true; break; @@ -261,9 +274,13 @@ if (_uniqueID != null) { if (Settings.ExtensiveLogging) Log.Info("Removing contact " + phoneBook[_uniqueID].Name); + else Log.Info("Removing contact"); + phoneBook.Remove(_uniqueID); + phoneBookChanges = true; } + else break; } } @@ -317,10 +334,7 @@ return picturePath; } } - else - { - picturePath = Settings.SkinMediaFolderPath + @"\FritzBox\CallMonitor.Missing.png"; - } + else picturePath = Settings.SkinMediaFolderPath + @"\FritzBox\CallMonitor.Missing.png"; } return picturePath; Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/GenerateResource-ResGen.read.1.tlog =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 =================================================================== --- trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-12 23:52:12 UTC (rev 4403) +++ trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-14 17:51:27 UTC (rev 4404) @@ -559,7 +559,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.4402</DesignedForVersion> + <DesignedForVersion>1.1.7.4403</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -582,7 +582,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>4402</Revision> + <Revision>4403</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -596,7 +596,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-13T00:47:46.7613728+01:00</ReleaseDate> + <ReleaseDate>2012-01-14T18:41:32.7676728+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Added: trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4403.mpe1 =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4403.mpe1 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/FritzBox/releases/update.xml =================================================================== --- trunk/plugins/FritzBox/releases/update.xml 2012-01-12 23:52:12 UTC (rev 4403) +++ trunk/plugins/FritzBox/releases/update.xml 2012-01-14 17:51:27 UTC (rev 4404) @@ -88,7 +88,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.4402</DesignedForVersion> + <DesignedForVersion>1.1.7.4403</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -111,7 +111,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>4402</Revision> + <Revision>4403</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -125,7 +125,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-13T00:47:46.7613728+01:00</ReleaseDate> + <ReleaseDate>2012-01-14T18:41:32.7676728+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hor...@us...> - 2012-01-12 23:52:20
|
Revision: 4403 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4403&view=rev Author: horned-reaper Date: 2012-01-12 23:52:12 +0000 (Thu, 12 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/Docs/Ausstehend.txt trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/releases/update.xml Added Paths: ----------- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.6.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.6.tlog trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4402.mpe1 Removed Paths: ------------- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.7.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.7.tlog Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2012-01-11 20:30:59 UTC (rev 4402) +++ trunk/plugins/FritzBox/Build/Build.log 2012-01-12 23:52:12 UTC (rev 4403) @@ -1,6 +1,6 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -SVN Version: 4400 +SVN Version: 4402 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs @@ -10,7 +10,7 @@ [Microsoft .NET Framework, Version 4.0.30319.239] Copyright (C) Microsoft Corporation 2007. All rights reserved. -Build started 10.01.2012 23:18:05. +Build started 13.01.2012 00:47:42. Project "D:\FritzBox\FritzBox.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Mixed Platforms". @@ -154,8 +154,6 @@ Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.DebugForm.resources". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.exe". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.pdb". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog". CoreResGen: @@ -197,7 +195,7 @@ 0 Warning(s) 0 Error(s) -Time Elapsed 00:00:01.90 +Time Elapsed 00:00:02.11 Reverting to build 0 Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs @@ -282,7 +280,7 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 23:18:09 +Build started at 00:47:46 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Writing UpdateXML to "update.xml" Modified: trunk/plugins/FritzBox/Docs/Ausstehend.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-01-11 20:30:59 UTC (rev 4402) +++ trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-01-12 23:52:12 UTC (rev 4403) @@ -1,3 +1,6 @@ +Testen: +Einen kleinen Bug habe ich auch gefunden: Ich wollte gerade unter MyTVSeries die Sendung einer Serie weiterschauen - es wurde der Dialog angezeigt ob man die Folge bei Stelle X fortsetzen m\xF6chte - in diesem Moment kam ein Anruf - nach Beendigung des Anrufs wurde die Sendung dann automatisch gestartet/fortgesetzt + Fehler beheben: - bei Auswahl einer MSN im Konfigurationsdialog werden die MSN-Eintr\xE4ge verdoppelt - Configuration: erste MSN wird nicht im Dropdown-Men\xFC angezeigt @@ -49,5 +52,14 @@ mu\xDF warum gibt es kein Buttons wo ich die Listen direKt anw\xE4hlen kann oder \xFCbersehe ich da was. Gru\xDF Burkh2407 -IchBinsShort, 05.01.2012, 18:02:. -Noch eine andere Frage ist es auch m\xF6glich das bei ausgehenden Anrufen nur bei bestimmten Handger\xE4ten der Pause Befehl gesendet wird. Ich benutze drei Funktelefone \xFCber die Dect Funktion der Fritzbox 7020, Garten, Eltern und bei mir. W\xE4re also sch\xF6n wenn nur auf Pause gestellt wird wenn von meinem Telefon eine Anruf get\xE4tigt wird. \ No newline at end of file +IchBinsShort, 05.01.2012, 18:02: +Noch eine andere Frage ist es auch m\xF6glich das bei ausgehenden Anrufen nur bei bestimmten Handger\xE4ten der Pause Befehl gesendet wird. Ich benutze drei Funktelefone \xFCber die Dect Funktion der Fritzbox 7020, Garten, Eltern und bei mir. W\xE4re also sch\xF6n wenn nur auf Pause gestellt wird wenn von meinem Telefon eine Anruf get\xE4tigt wird. + +creativ, 10.01.2012, 19:53: +Was nur noch eingebaut werden sollte, das dort Kontakte abgew\xE4hlt werden k\xF6nnen die im MP dann nicht angezeigt werden! Ich habe n\xE4mlich das Fritz!Fon MT-F und dort sind Kontakte im internen Speicher die nicht gel\xF6scht werden k\xF6nnen, z.b. (wie klingt HD-Telefonie und daf\xFCr gibt es eine Telefonnumer die hinterlegt ist). + +IchBinsShort, 11.01.2012, 00:28: +L\xF6schen von Anruflisten \xFCber die GUI + +creativ, 20.01.2012, 19:53: +Ausblenden bestimmter Kontakte in der GUI \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-01-11 20:30:59 UTC (rev 4402) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-01-12 23:52:12 UTC (rev 4403) @@ -107,10 +107,12 @@ { case CallAction.CallType.Incoming: if (Settings.PhoneBookEnabled) callAction.Caller = phoneBook.FindContactEntry(callAction.Caller); + OnCall(callAction); break; case CallAction.CallType.Outgoing: if (Settings.PhoneBookEnabled) callAction.Caller = phoneBook.FindContactEntry(callAction.Caller); + OnCall(callAction); break; case CallAction.CallType.ConnectionStarted: @@ -118,7 +120,8 @@ case CallAction.CallType.ConnectionClosed: if (Settings.CloseOnConnectionClosed) { - Log.Info("_closeOnConnectionClosed is enabled. Try to close active notification"); + Log.Info("\"Close On Connection Close\" setting is enabled. Try to close active notification"); + if (_tempNotify != null) { MediaPortal.GUI.Library.Action act = new MediaPortal.GUI.Library.Action(); @@ -128,7 +131,7 @@ } break; default: - Log.Error("Incorrect callAction.Type"); + Log.Error("Incorrect CallAction.CallType"); break; } } @@ -329,10 +332,10 @@ switch (callType) { case CallAction.CallType.Incoming: - if (Settings.PauseMediaOnIncomingCall && Settings.ResumeMediaOnIncomingCall) g_Player.Pause(); + if (Settings.ResumeMediaOnIncomingCall) g_Player.Pause(); break; case CallAction.CallType.Outgoing: - if (Settings.PauseMediaOnOutgoingCall && Settings.ResumeMediaOnOutgoingCall) g_Player.Pause(); + if (Settings.ResumeMediaOnOutgoingCall) g_Player.Pause(); break; } } @@ -419,6 +422,8 @@ FritzBoxClient.CallEvent -= OnCallAction; FritzBoxClient.LogEvent -= OnLogAction; + FritzBoxClient.ConnectedEvent += OnConnectedAction; + Utils.OnStartExternal -= OnStartExternal; Utils.OnStopExternal -= OnStopExternal; @@ -948,59 +953,66 @@ Log.Debug("Updating GUI properties"); - if (voiceBoxItemList != null) + try { - voiceBoxItemsCount = voiceBoxItemList.Count; + if (voiceBoxItemList != null) + { + voiceBoxItemsCount = voiceBoxItemList.Count; - foreach (VoiceBoxItem voiceBoxItem in voiceBoxItemList) - { - if (voiceBoxItem.type == 3) + foreach (VoiceBoxItem voiceBoxItem in voiceBoxItemList) { - caller = phoneBook.FindContactEntry(voiceBoxItem.callerId); - - if (voiceBoxItem.isNew > 0) + if (voiceBoxItem.type == 3) { - if (lastNewCallerName == "") lastNewCallerName = caller.PhoneBookItem.Name; + caller = phoneBook.FindContactEntry(voiceBoxItem.callerId); - newVoiceBoxItemsCount++; + if (voiceBoxItem.isNew > 0) + { + if (lastNewCallerName == "") lastNewCallerName = caller.PhoneBookItem.Name; + + newVoiceBoxItemsCount++; + } } } } - } - if (newVoiceBoxItemsCount == 0) - { - GUIPropertyManager.SetProperty("#FritzManager.NewMessages", " "); - GUIPropertyManager.SetProperty("#FritzManager.Caller", " "); - GUIPropertyManager.SetProperty("#FritzManager.NewMessageCount", string.Empty); - GUIPropertyManager.SetProperty("#FritzManager.NewMessagesAvail", "false"); - } - else - { - if (newVoiceBoxItemsCount > 1) GUIPropertyManager.SetProperty("#FritzManager.NewMessages", newVoiceBoxItemsCount + " " + GUILocalizeStrings.Get(7)); // 7 = Messages - else GUIPropertyManager.SetProperty("#FritzManager.NewMessages", newVoiceBoxItemsCount + " " + GUILocalizeStrings.Get(27)); // 27 = Message + if (newVoiceBoxItemsCount == 0) + { + GUIPropertyManager.SetProperty("#FritzManager.NewMessages", " "); + GUIPropertyManager.SetProperty("#FritzManager.Caller", " "); + GUIPropertyManager.SetProperty("#FritzManager.NewMessageCount", string.Empty); + GUIPropertyManager.SetProperty("#FritzManager.NewMessagesAvail", "false"); + } + else + { + if (newVoiceBoxItemsCount > 1) GUIPropertyManager.SetProperty("#FritzManager.NewMessages", newVoiceBoxItemsCount + " " + GUILocalizeStrings.Get(7)); // 7 = Messages + else GUIPropertyManager.SetProperty("#FritzManager.NewMessages", newVoiceBoxItemsCount + " " + GUILocalizeStrings.Get(27)); // 27 = Message - GUIPropertyManager.SetProperty("#FritzManager.Caller", lastNewCallerName); - GUIPropertyManager.SetProperty("#FritzManager.NewMessageCount", newVoiceBoxItemsCount.ToString()); - GUIPropertyManager.SetProperty("#FritzManager.NewMessagesAvail", "true"); - } + GUIPropertyManager.SetProperty("#FritzManager.Caller", lastNewCallerName); + GUIPropertyManager.SetProperty("#FritzManager.NewMessageCount", newVoiceBoxItemsCount.ToString()); + GUIPropertyManager.SetProperty("#FritzManager.NewMessagesAvail", "true"); + } - if (voiceBoxItemsCount == 0) - { - GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", " "); - GUIPropertyManager.SetProperty("#FritzManager.TotalMessageCount", string.Empty); + if (voiceBoxItemsCount == 0) + { + GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", " "); + GUIPropertyManager.SetProperty("#FritzManager.TotalMessageCount", string.Empty); + } + else + { + if (voiceBoxItemsCount > 1) GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", voiceBoxItemsCount + " " + GUILocalizeStrings.Get(7)); // 7 = Messages + else GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", voiceBoxItemsCount + " " + GUILocalizeStrings.Get(27)); // 27 = Message + + GUIPropertyManager.SetProperty("#FritzManager.TotalMessageCount", voiceBoxItemsCount.ToString()); + } + + // set properties for skin file labels + GUIPropertyManager.SetProperty("#FritzManager.LabelCallList", GUILocalizeStrings.Get(18)); // 18 = Call list + GUIPropertyManager.SetProperty("#FritzManager.LabelUpdate", GUILocalizeStrings.Get(25)); // 25 = Update } - else + catch (Exception e) { - if (voiceBoxItemsCount > 1) GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", voiceBoxItemsCount + " " + GUILocalizeStrings.Get(7)); // 7 = Messages - else GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", voiceBoxItemsCount + " " + GUILocalizeStrings.Get(27)); // 27 = Message - - GUIPropertyManager.SetProperty("#FritzManager.TotalMessageCount", voiceBoxItemsCount.ToString()); + Log.Error("An error occured during GUI properties update: {0}", e.Message); } - - // set properties for skin file labels - GUIPropertyManager.SetProperty("#FritzManager.LabelCallList", GUILocalizeStrings.Get(18)); // 18 = Call list - GUIPropertyManager.SetProperty("#FritzManager.LabelUpdate", GUILocalizeStrings.Get(25)); // 25 = Update } /// <summary> Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2012-01-11 20:30:59 UTC (rev 4402) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2012-01-12 23:52:12 UTC (rev 4403) @@ -418,9 +418,9 @@ this.checkBoxResumeMediaOnOutgoingCall.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxResumeMediaOnOutgoingCall.Location = new System.Drawing.Point(220, 40); this.checkBoxResumeMediaOnOutgoingCall.Name = "checkBoxResumeMediaOnOutgoingCall"; - this.checkBoxResumeMediaOnOutgoingCall.Size = new System.Drawing.Size(162, 17); + this.checkBoxResumeMediaOnOutgoingCall.Size = new System.Drawing.Size(118, 17); this.checkBoxResumeMediaOnOutgoingCall.TabIndex = 11; - this.checkBoxResumeMediaOnOutgoingCall.Text = "Auto-resume on closing notify"; + this.checkBoxResumeMediaOnOutgoingCall.Text = "Resume on call end"; this.checkBoxResumeMediaOnOutgoingCall.UseVisualStyleBackColor = true; // // checkBoxPauseMediaOnOutgoingCall @@ -433,6 +433,7 @@ this.checkBoxPauseMediaOnOutgoingCall.TabIndex = 10; this.checkBoxPauseMediaOnOutgoingCall.Text = "Pause on outgoing call"; this.checkBoxPauseMediaOnOutgoingCall.UseVisualStyleBackColor = true; + this.checkBoxPauseMediaOnOutgoingCall.CheckedChanged += new System.EventHandler(this.checkBoxPauseMediaOnOutgoingCall_CheckedChanged); // // mpLabel5 // @@ -460,9 +461,9 @@ this.checkBoxResumeMediaOnIncomingCall.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxResumeMediaOnIncomingCall.Location = new System.Drawing.Point(24, 40); this.checkBoxResumeMediaOnIncomingCall.Name = "checkBoxResumeMediaOnIncomingCall"; - this.checkBoxResumeMediaOnIncomingCall.Size = new System.Drawing.Size(162, 17); + this.checkBoxResumeMediaOnIncomingCall.Size = new System.Drawing.Size(118, 17); this.checkBoxResumeMediaOnIncomingCall.TabIndex = 1; - this.checkBoxResumeMediaOnIncomingCall.Text = "Auto-resume on closing notify"; + this.checkBoxResumeMediaOnIncomingCall.Text = "Resume on call end"; this.checkBoxResumeMediaOnIncomingCall.UseVisualStyleBackColor = true; // // checkBoxPauseMediaOnIncomingCall @@ -639,9 +640,9 @@ this.checkBoxExtensiveLogging.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.checkBoxExtensiveLogging.Location = new System.Drawing.Point(33, 94); this.checkBoxExtensiveLogging.Name = "checkBoxExtensiveLogging"; - this.checkBoxExtensiveLogging.Size = new System.Drawing.Size(328, 17); + this.checkBoxExtensiveLogging.Size = new System.Drawing.Size(399, 17); this.checkBoxExtensiveLogging.TabIndex = 21; - this.checkBoxExtensiveLogging.Text = "Extensive logging (!!! phone numbers are written to the log file !!!)"; + this.checkBoxExtensiveLogging.Text = "Extensive logging: Phone numbers and contact names are written to the log file!"; this.checkBoxExtensiveLogging.UseVisualStyleBackColor = true; // // label4 Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs 2012-01-11 20:30:59 UTC (rev 4402) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs 2012-01-12 23:52:12 UTC (rev 4403) @@ -167,8 +167,23 @@ private void checkBoxStopMedia_CheckedChanged(object sender, EventArgs e) { - checkBoxResumeMediaOnIncomingCall.Enabled = checkBoxPauseMediaOnIncomingCall.Checked; + if (!checkBoxPauseMediaOnIncomingCall.Checked) + { + checkBoxResumeMediaOnIncomingCall.Checked = false; + checkBoxResumeMediaOnIncomingCall.Enabled = false; + } + else checkBoxResumeMediaOnIncomingCall.Enabled = true; } + + private void checkBoxPauseMediaOnOutgoingCall_CheckedChanged(object sender, EventArgs e) + { + if (!checkBoxPauseMediaOnOutgoingCall.Checked) + { + checkBoxResumeMediaOnOutgoingCall.Checked = false; + checkBoxResumeMediaOnOutgoingCall.Enabled = false; + } + else checkBoxResumeMediaOnOutgoingCall.Enabled = true; + } private void checkBoxUsePhonebook_CheckedChanged(object sender, EventArgs e) { Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs 2012-01-11 20:30:59 UTC (rev 4402) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs 2012-01-12 23:52:12 UTC (rev 4403) @@ -149,121 +149,131 @@ { Log.Debug("Synchronizing phone book with FRITZ!Box"); - // load FRITZ!Box phone book - FritzPhoneBooks fritzPhoneBooks = new FritzPhoneBooks(); + try + { + // load FRITZ!Box phone book + FritzPhoneBooks fritzPhoneBooks = new FritzPhoneBooks(); - string fritzPhoneBooksSerialized = fritz.loadPhoneBookFromFritzBox(); + string fritzPhoneBooksSerialized = fritz.loadPhoneBookFromFritzBox(); - if (fritzPhoneBooksSerialized != null) - { - XmlSerializer xmlSerializer = new XmlSerializer(typeof(FritzPhoneBooks)); - fritzPhoneBooks = (FritzPhoneBooks)xmlSerializer.Deserialize(new StringReader(fritzPhoneBooksSerialized)); + if (fritzPhoneBooksSerialized != null) + { + XmlSerializer xmlSerializer = new XmlSerializer(typeof(FritzPhoneBooks)); + fritzPhoneBooks = (FritzPhoneBooks)xmlSerializer.Deserialize(new StringReader(fritzPhoneBooksSerialized)); - FritzManager.PhoneBook fritzPhoneBook = fritzPhoneBooks.Items[0]; // always choose first phone book - PhoneBookItem tempPhoneBookItem; - bool updateRequired, contactFound; - string name, uniqueID, imageURL; + FritzManager.PhoneBook fritzPhoneBook = fritzPhoneBooks.Items[0]; // always choose first phone book + PhoneBookItem tempPhoneBookItem; + bool updateRequired, contactFound; + string name, uniqueID = null, imageURL; - lock (sync) - { - // update/add entries from FRITZ!Box phone book to local phone book - foreach (Contact contact in fritzPhoneBook.contact) + // check if FRITZ!Box phone book has unique ID field. Older FRITZ!Box models e. g. 7170 and 7320 doesn't have an unique ID field in it's address book + if (fritzPhoneBook.contact[0].uniqueid == null) Log.Debug("FRITZ!Box phone book doesn't have an unique ID field. Synchronizing contacts in compatibility mode. Multiple contacts with the same name won't be shown and cause update actions on every synchronization!"); + + lock (sync) { - name = contact.person[0].realName; - imageURL = contact.person[0].imageURL; - uniqueID = contact.uniqueid; + // update/add entries from FRITZ!Box phone book to local phone book + foreach (Contact contact in fritzPhoneBook.contact) + { + name = contact.person[0].realName; + imageURL = contact.person[0].imageURL; - updateRequired = false; + if (fritzPhoneBook.contact[0].uniqueid != null) uniqueID = contact.uniqueid; + else uniqueID = name; // in compatibility mode the name is used as unique ID - // search if FRITZ!Box contact already exists in phone book - if (phoneBook.ContainsKey(uniqueID)) - { - // check for differences - for (int i = 0; i < contact.telephony.Length; i++) - { - try + updateRequired = false; + + // search if FRITZ!Box contact already exists in phone book + if (phoneBook.ContainsKey(uniqueID)) { - if (phoneBook[uniqueID].Name != name || !contact.telephony[i].Equals(phoneBook[uniqueID].PhoneNumbers[i]) || imageURL != phoneBook[uniqueID].ImageURL) updateRequired = true; + // check for differences + for (int i = 0; i < contact.telephony.Length; i++) + { + try + { + if (phoneBook[uniqueID].Name != name || !contact.telephony[i].Equals(phoneBook[uniqueID].PhoneNumbers[i]) || imageURL != phoneBook[uniqueID].ImageURL) updateRequired = true; + } + catch + { + // on property changes the differences check may fail + Log.Debug("Phone book difference check failed. Forcing contact update"); + updateRequired = true; + break; + } + } + + if (updateRequired) + { + if (Settings.ExtensiveLogging) Log.Info("Updating contact " + phoneBook[uniqueID].Name); + + phoneBook[uniqueID].Name = name; + phoneBook[uniqueID].PhoneNumbers = contact.telephony; + phoneBook[uniqueID].ImageURL = imageURL; + + phoneBookChanges = true; + } } - catch + else { - // on property changes the differences check may fail - Log.Debug("Phone book difference check failed. Forcing contact update"); - updateRequired = true; - break; - } - } + if (Settings.ExtensiveLogging) Log.Info("Adding contact " + name); - if (updateRequired) - { - Log.Info("Updating contact " + phoneBook[uniqueID].Name); + tempPhoneBookItem = new PhoneBookItem(); + tempPhoneBookItem.UniqueID = uniqueID; + tempPhoneBookItem.Name = name; + tempPhoneBookItem.PhoneNumbers = contact.telephony; + tempPhoneBookItem.ImageURL = imageURL; - phoneBook[uniqueID].Name = name; - phoneBook[uniqueID].PhoneNumbers = contact.telephony; - phoneBook[uniqueID].ImageURL = imageURL; + phoneBook.Add(uniqueID, tempPhoneBookItem); - phoneBookChanges = true; + phoneBookSortIsRequired = true; + phoneBookChanges = true; + } } - } - else - { - Log.Info("Adding contact " + name); - tempPhoneBookItem = new PhoneBookItem(); - tempPhoneBookItem.UniqueID = uniqueID; - tempPhoneBookItem.Name = name; - tempPhoneBookItem.PhoneNumbers = contact.telephony; - tempPhoneBookItem.ImageURL = imageURL; + // check for obsolete entries in local phone book (not existing in FRITZ!Box phone book anymore) + string[] contactsToDelete = new string[phoneBook.Count]; + int k = 0; - phoneBook.Add(uniqueID, tempPhoneBookItem); + foreach (PhoneBookItem phoneBookItem in phoneBook.Values) + { + contactFound = false; - phoneBookSortIsRequired = true; - phoneBookChanges = true; - } - } + foreach (Contact contact in fritzPhoneBook.contact) + { + uniqueID = phoneBookItem.UniqueID; - // check for obsolete entries in local phone book (not existing in FRITZ!Box phone book anymore) - string[] contactsToDelete = new string[phoneBook.Count]; - int k = 0; + if (uniqueID == phoneBookItem.UniqueID) + { + contactFound = true; + break; + } + } - foreach (PhoneBookItem phoneBookItem in phoneBook.Values) - { - uniqueID = phoneBookItem.UniqueID; - contactFound = false; - - foreach (Contact contact in fritzPhoneBook.contact) - { - if (contact.uniqueid == uniqueID) - { - contactFound = true; - break; + if (!contactFound) + { + contactsToDelete[k] = uniqueID; + k++; + break; + } } - } - if (!contactFound) - { - contactsToDelete[k] = uniqueID; - k++; - } + foreach (string _uniqueID in contactsToDelete) // contacts cannot be deleted in above foreach loop, a second loop is required + { + if (_uniqueID != null) + { + if (Settings.ExtensiveLogging) Log.Info("Removing contact " + phoneBook[_uniqueID].Name); + phoneBook.Remove(_uniqueID); + phoneBookChanges = true; + } + } } - lock (sync) - { - foreach (string _uniqueID in contactsToDelete) // contacts cannot be deleted in above foreach loop, a second loop is required - { - if (_uniqueID != null) - { - Log.Info("Removing contact " + phoneBook[_uniqueID].Name); - phoneBook.Remove(_uniqueID); - phoneBookChanges = true; - } - } - } + Log.Info("Synchronized " + phoneBook.Count + " contacts with FRITZ!Box"); } - - Log.Debug("Synchronized " + phoneBook.Count + " contacts with FRITZ!Box"); } - else Log.Error("Phone book synchronisation with the FRITZ!Box failed"); + catch (Exception e) + { + Log.Error("An error occured during phone book synchronisation with the FRITZ!Box: {0}", e.Message); + } } else Log.Debug("No connection to FRITZ!Box. Phone book synchronization not started"); @@ -278,6 +288,8 @@ { phoneBook = sortedPhoneBook.ToDictionary(k => k.Key, v => v.Value); } + + phoneBookSaveIsRequired = true; } if (phoneBookChanges) @@ -302,13 +314,11 @@ if (File.Exists(picturePath)) { - if (Settings.ExtensiveLogging) Log.Debug("Found image for contact " + contact.Name + ": " + picturePath); return picturePath; } } else { - if (Settings.ExtensiveLogging) Log.Debug("No image has been assigned for the contact " + contact.Name); picturePath = Settings.SkinMediaFolderPath + @"\FritzBox\CallMonitor.Missing.png"; } } @@ -324,8 +334,6 @@ } // unknown caller - if (Settings.ExtensiveLogging) Log.Debug("Assigning unknown caller image for phone number {0}", caller.PhoneNumber); - return Settings.SkinMediaFolderPath + @"\FritzBox\CallMonitor.Unknown.png"; } @@ -478,8 +486,6 @@ } } - if (Settings.ExtensiveLogging) Log.Debug("Normalized phone number \"{0}\" to \"{1}\"", inputPhoneNumber, outputPhoneNumber); - return outputPhoneNumber; } Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 =================================================================== --- trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-11 20:30:59 UTC (rev 4402) +++ trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-12 23:52:12 UTC (rev 4403) @@ -559,7 +559,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.4400</DesignedForVersion> + <DesignedForVersion>1.1.7.4402</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -582,7 +582,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>4400</Revision> + <Revision>4402</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -596,7 +596,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-10T23:18:09.5983408+01:00</ReleaseDate> + <ReleaseDate>2012-01-13T00:47:46.7613728+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt 2012-01-11 20:30:59 UTC (rev 4402) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt 2012-01-12 23:52:12 UTC (rev 4403) @@ -23,5 +23,5 @@ D:\FritzBox\Tools\FritzBoxDebugger\bin\Release\log4net.dll D:\FritzBox\Tools\FritzBoxDebugger\bin\Release\Ionic.Zip.dll D:\FritzBox\Tools\FritzBoxDebugger\bin\Release\FritzBox.pdb -D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog -D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog +D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog +D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Added: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.6.tlog =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.6.tlog ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.7.tlog =================================================================== (Binary files differ) Added: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.6.tlog =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.6.tlog ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.7.tlog =================================================================== (Binary files differ) Added: trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4402.mpe1 =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4402.mpe1 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/FritzBox/releases/update.xml =================================================================== --- trunk/plugins/FritzBox/releases/update.xml 2012-01-11 20:30:59 UTC (rev 4402) +++ trunk/plugins/FritzBox/releases/update.xml 2012-01-12 23:52:12 UTC (rev 4403) @@ -88,7 +88,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.4400</DesignedForVersion> + <DesignedForVersion>1.1.7.4402</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -111,7 +111,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>4400</Revision> + <Revision>4402</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -125,7 +125,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-10T23:18:09.5983408+01:00</ReleaseDate> + <ReleaseDate>2012-01-13T00:47:46.7613728+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dou...@us...> - 2012-01-11 20:31:07
|
Revision: 4402 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4402&view=rev Author: dougmckeen Date: 2012-01-11 20:30:59 +0000 (Wed, 11 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/CanadianWeather/ConfigurationForm.Designer.cs trunk/plugins/CanadianWeather/ConfigurationForm.cs trunk/plugins/CanadianWeather/GUICanadianWeather.cs Modified: trunk/plugins/CanadianWeather/ConfigurationForm.Designer.cs =================================================================== --- trunk/plugins/CanadianWeather/ConfigurationForm.Designer.cs 2012-01-10 22:45:33 UTC (rev 4401) +++ trunk/plugins/CanadianWeather/ConfigurationForm.Designer.cs 2012-01-11 20:30:59 UTC (rev 4402) @@ -29,9 +29,6 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - this.RadioButtonEnglish = new System.Windows.Forms.RadioButton(); - this.RadioButtonFrench = new System.Windows.Forms.RadioButton(); - this.LanguageChoice = new System.Windows.Forms.GroupBox(); this.label1 = new System.Windows.Forms.Label(); this.RefreshIntervalTxtBx = new System.Windows.Forms.TextBox(); this.PluginNameTextBox = new System.Windows.Forms.Label(); @@ -62,47 +59,10 @@ this.ImageURL4 = new System.Windows.Forms.TextBox(); this.label12 = new System.Windows.Forms.Label(); this.configurationFormBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.LanguageChoice.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.configurationFormBindingSource)).BeginInit(); this.SuspendLayout(); // - // RadioButtonEnglish - // - this.RadioButtonEnglish.AutoSize = true; - this.RadioButtonEnglish.Checked = true; - this.RadioButtonEnglish.Enabled = false; - this.RadioButtonEnglish.Location = new System.Drawing.Point(6, 19); - this.RadioButtonEnglish.Name = "RadioButtonEnglish"; - this.RadioButtonEnglish.Size = new System.Drawing.Size(59, 17); - this.RadioButtonEnglish.TabIndex = 5; - this.RadioButtonEnglish.TabStop = true; - this.RadioButtonEnglish.Text = "English"; - this.RadioButtonEnglish.UseVisualStyleBackColor = true; - // - // RadioButtonFrench - // - this.RadioButtonFrench.AutoSize = true; - this.RadioButtonFrench.Enabled = false; - this.RadioButtonFrench.Location = new System.Drawing.Point(6, 40); - this.RadioButtonFrench.Name = "RadioButtonFrench"; - this.RadioButtonFrench.Size = new System.Drawing.Size(58, 17); - this.RadioButtonFrench.TabIndex = 6; - this.RadioButtonFrench.Text = "French"; - this.RadioButtonFrench.UseVisualStyleBackColor = true; - // - // LanguageChoice - // - this.LanguageChoice.Controls.Add(this.RadioButtonEnglish); - this.LanguageChoice.Controls.Add(this.RadioButtonFrench); - this.LanguageChoice.Enabled = false; - this.LanguageChoice.Location = new System.Drawing.Point(341, 1); - this.LanguageChoice.Name = "LanguageChoice"; - this.LanguageChoice.Size = new System.Drawing.Size(79, 66); - this.LanguageChoice.TabIndex = 8; - this.LanguageChoice.TabStop = false; - this.LanguageChoice.Text = "Language"; - // // label1 // this.label1.AutoSize = true; @@ -398,12 +358,9 @@ this.Controls.Add(this.RefreshIntervalTxtBx); this.Controls.Add(this.PluginNameTextBox); this.Controls.Add(this.label1); - this.Controls.Add(this.LanguageChoice); this.Name = "ConfigurationForm"; this.Text = "Canadian Weather Configuration"; this.Load += new System.EventHandler(this.ConfigurationForm_Load); - this.LanguageChoice.ResumeLayout(false); - this.LanguageChoice.PerformLayout(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.configurationFormBindingSource)).EndInit(); @@ -414,9 +371,6 @@ #endregion - private System.Windows.Forms.RadioButton RadioButtonEnglish; - private System.Windows.Forms.RadioButton RadioButtonFrench; - private System.Windows.Forms.GroupBox LanguageChoice; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox RefreshIntervalTxtBx; private System.Windows.Forms.Label PluginNameTextBox; Modified: trunk/plugins/CanadianWeather/ConfigurationForm.cs =================================================================== --- trunk/plugins/CanadianWeather/ConfigurationForm.cs 2012-01-10 22:45:33 UTC (rev 4401) +++ trunk/plugins/CanadianWeather/ConfigurationForm.cs 2012-01-11 20:30:59 UTC (rev 4402) @@ -18,7 +18,6 @@ List<string> _items = new List<string>(); string PluginName; int RefreshTime; - string Language; string[,] Sites; bool SiteLookupFailed; int NumberofSites; @@ -42,7 +41,6 @@ { PluginName = reader.GetValueAsString("BasicSettings", "PluginName", "Canadian Weather"); RefreshTime = reader.GetValueAsInt("BasicSettings", "RefreshTime", 60); - Language = reader.GetValueAsString("BasicSettings", "Language", "English"); //create 2D array of sites (20 sites, 4 attributes) Sites = new string[20, 4]; @@ -57,12 +55,6 @@ //Fill in Refresh Interval RefreshIntervalTxtBx.Text = RefreshTime.ToString(); - //Activate Language Radio Button - if (String.Equals(Language, "French")) - { RadioButtonFrench.Checked = true; } - else - { RadioButtonEnglish.Checked = true; } - //Determine how many sites exist NumberofSites = 0; for (int i = 0; i < 20; i++) @@ -84,6 +76,13 @@ //Fill in the Plugin Name PluginNameTxtBx.Text = PluginName; + + //load the images + ImageURL0.Text = reader.GetValueAsString("Images", "Image0", ""); + ImageURL1.Text = reader.GetValueAsString("Images", "Image1", ""); + ImageURL2.Text = reader.GetValueAsString("Images", "Image2", ""); + ImageURL3.Text = reader.GetValueAsString("Images", "Image3", ""); + ImageURL4.Text = reader.GetValueAsString("Images", "Image4", ""); } //Get Site List from Environment Canada @@ -141,10 +140,6 @@ private void OK_Click(object sender, EventArgs e) { - if (RadioButtonEnglish.Checked == true) - { Language = "English"; } - else - { Language = "French"; } //validate Refresh Interval int tempInteger; @@ -156,7 +151,6 @@ { writer.SetValue("BasicSettings", "PluginName", PluginNameTxtBx.Text); writer.SetValue("BasicSettings", "RefreshTime", RefreshIntervalTxtBx.Text); - writer.SetValue("BasicSettings", "Language", Language); for (int i = 0; i < 19; i++) { Modified: trunk/plugins/CanadianWeather/GUICanadianWeather.cs =================================================================== --- trunk/plugins/CanadianWeather/GUICanadianWeather.cs 2012-01-10 22:45:33 UTC (rev 4401) +++ trunk/plugins/CanadianWeather/GUICanadianWeather.cs 2012-01-11 20:30:59 UTC (rev 4402) @@ -13,6 +13,7 @@ using System.IO; using System.Xml; using System.Net; +using System.Reflection; using MediaPortal.Configuration; using MediaPortal.Dialogs; using MediaPortal.GUI.Library; @@ -21,6 +22,7 @@ using System.Globalization; #endregion + namespace MediaPortal.GUI.CanadianWeather { [PluginIcons("CanadianWeather.Resources.lf.png", "CanadianWeather.Resources.lf_disabled.png")] @@ -114,21 +116,9 @@ int intSunsetHour; int intSunsetMinute; + string strLogo; string strIcon = GUIGraphicsContext.Skin + @"\Media\CanadianWeather\na.png"; string strBaseURL = "http://dd.weatheroffice.ec.gc.ca/citypage_weather/xml/"; - string strPressure = "Pressure"; - string strVisibility = "Visibility"; - string strSunrise = "Sunrise"; - string strSunset = "Sunset"; - string strForecastIssued = "Forecast Issued: "; - string strSevenDayForecast = "Text Forecast"; - string strCurrentConditions = "Current Conditions"; - string strNotObserved = "not observed"; - string strGust = " gust "; - string strWarning = "Warning - "; - string strHigh = "High"; - string strMed = "Med."; - string strLow = "Low"; public string[] Day = new string[NUM_DAYS]; public string[] High = new string[NUM_DAYS]; @@ -150,9 +140,44 @@ List<string> ShortListOfProvs; List<string> CityNames; String strURL = "http://dd.weatheroffice.ec.gc.ca/citypage_weather/xml/siteList.xml"; - String strChooseProv = "Select a Province"; - String strChooseCity = "Select a City"; + + public static class Translation + { + ///// These will be loaded with the language files content + ///// if the selected lang file is not found, it will first try to load en(us).xml as a backup + ///// if that also fails it will use the hardcoded strings as a last resort. + + #region Translatable Fields + + public static string Pressure = "Pressure"; + public static string Visibility = "Visibility"; + public static string Sunrise = "Sunrise"; + public static string Sunset = "Sunset"; + public static string ForecastIssued = "Forecast Issued: "; + public static string SevenDayForecast = "Text Forecast"; + public static string CurrentConditions = "Current Conditions"; + public static string NotObserved = "not observed"; + public static string Gust = " gust "; + public static string Warning = "Warning - "; + public static string High = "High"; + public static string Med = "Med."; + public static string Low = "Low"; + public static string ChooseProv = "Select a Province"; + public static string ChooseCity = "Select a City"; + public static string FeelsLike = "Feels Like"; + public static string Wind = "Wind"; + public static string Humidity = "Humidity"; + public static string Dewpoint = "Dewpoint"; + public static string Satellite = "Satellite"; + public static string SelectLocation = "Select Location"; + public static string Refresh = "Refresh"; + public static string City = "City"; + public static string Weather = "Weather"; + + #endregion + } + #endregion #region enums @@ -220,6 +245,77 @@ //{ //} + public void localize() + { + //GUIDialogMenu debug = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); + //debug.SetHeading("debug"); + //debug.Add(temp.ToString()); + //debug.DoModal(GetID); + //debug.Reset(); + + string lang; + string path = ""; + + try + { + lang = GUILocalizeStrings.GetCultureName(GUILocalizeStrings.CurrentLanguage()); + } + catch (Exception) + { + lang = "en-US"; + } + + if (lang.Substring(0,2) == "fr") + { + LanguageChoice = "f"; + } + else + { + LanguageChoice = "e"; + } + + path = Config.GetSubFolder(Config.Dir.Language, "CanadianWeather"); + + if (!System.IO.Directory.Exists(path)) + System.IO.Directory.CreateDirectory(path); + + XmlDocument doc = new XmlDocument(); + Dictionary<string, string> TranslatedStrings = new Dictionary<string, string>(); + string langPath = ""; + try + { + langPath = Path.Combine(path, lang + ".xml"); + doc.Load(langPath); + } + catch (Exception) + { + return; //use the hardcoded strings + } + foreach (XmlNode stringEntry in doc.DocumentElement.ChildNodes) + { + if (stringEntry.NodeType == XmlNodeType.Element) + try + { + TranslatedStrings.Add(stringEntry.Attributes.GetNamedItem("Field").Value, stringEntry.InnerText); + } + catch (Exception) + { + + } + + } + + Type TransType = typeof(Translation); + FieldInfo[] fieldInfos = TransType.GetFields(BindingFlags.Public | BindingFlags.Static); + foreach (FieldInfo fi in fieldInfos) + { + if (TranslatedStrings != null && TranslatedStrings.ContainsKey(fi.Name)) + { + TransType.InvokeMember(fi.Name, BindingFlags.SetField, null, TransType, new object[] { TranslatedStrings[fi.Name] }); + } + } + } + public bool IsRefreshing { get { return _workerActive; } @@ -252,9 +348,15 @@ lastmode = "ShowCurrent"; LoadSettings(); //get the weather settings from the user SelectedCity = Sites[0, 3] + "/" + Sites[0, 0] + "_"; // e.g., "AB/s0000047_" - LanguageChoice = "e"; //language choice defaulting to English for now. later check Language and set as appropriate + //LanguageChoice = "e"; //language choice defaulting to English for now. later check Language and set as appropriate URL = strBaseURL + SelectedCity + LanguageChoice + ".xml"; //form URL - + + //show the default controls so they are visible during page load + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNSWITCH, Translation.Satellite); + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNVIEW, Translation.SevenDayForecast); + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNREFRESH, Translation.Refresh); + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNLOCATIONSELECT, Translation.City); + OnRefresh(); } @@ -349,7 +451,7 @@ } //display the provinces for selection GUIDialogMenu dialogTempProvSelect = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); - dialogTempProvSelect.SetHeading(strChooseProv); + dialogTempProvSelect.SetHeading(Translation.ChooseProv); foreach (string Provinceelement in ProvinceArray) { dialogTempProvSelect.Add(Provinceelement); @@ -371,7 +473,7 @@ dialogTempProvSelect.Reset(); //display the cities for selection GUIDialogMenu dialogTempCitySelect = (GUIDialogMenu)GUIWindowManager.GetWindow((int)Window.WINDOW_DIALOG_MENU); - dialogTempCitySelect.SetHeading(strChooseCity); + dialogTempCitySelect.SetHeading(Translation.ChooseCity); foreach (string Cityelement in CityArray) { dialogTempCitySelect.Add(Cityelement); @@ -380,8 +482,9 @@ if (dialogTempCitySelect.SelectedLabel >= 0) { + + string SelectedCity = dialogTempCitySelect.SelectedLabelText; dialogTempCitySelect.Reset(); - string SelectedCity = dialogTempCitySelect.SelectedLabelText; string TempSite = loaded.Descendants("site") .Where(x => x.Element("provinceCode").Value == SelectedTempProvince) @@ -390,15 +493,16 @@ .SingleOrDefault() .ToString(); - CityNames.Sort(); - SelectedCity = SelectedTempProvince + "/" + TempSite + "_"; // e.g., "AB/s0000047_" URL = strBaseURL + SelectedCity + LanguageChoice + ".xml"; + mode = "ShowCurrent"; lastmode = "ShowCurrent"; OnRefresh(); } + dialogTempCitySelect.Reset(); } + dialogTempProvSelect.Reset(); } public void OnCityButton() @@ -407,15 +511,15 @@ if (dialogCitySelect != null) { dialogCitySelect.Reset(); - dialogCitySelect.SetHeading(8); //my weather + dialogCitySelect.SetHeading(Translation.Weather); //my weather for (int i = 0; i < NumberofSites; i++) { dialogCitySelect.Add(Sites[i, 1] + ", " + Sites[i, 3]); } - dialogCitySelect.Add(GUILocalizeStrings.Get(396)); + dialogCitySelect.Add(Translation.SelectLocation); dialogCitySelect.DoModal(GetID); - if (dialogCitySelect.SelectedLabelText == GUILocalizeStrings.Get(396)) + if (dialogCitySelect.SelectedLabelText == Translation.SelectLocation) { dialogCitySelect.Reset(); OnTempCity(); @@ -424,7 +528,7 @@ { //create the string for the selected location SelectedCity = Sites[dialogCitySelect.SelectedLabel, 3] + "/" + Sites[dialogCitySelect.SelectedLabel, 0] + "_"; // e.g., "AB/s0000047_" - LanguageChoice = "e"; //language choice defaulting to English for now. later check Language and set as appropriate + //LanguageChoice = "e"; //language choice defaulting to English for now. later check Language and set as appropriate URL = strBaseURL + SelectedCity + LanguageChoice + ".xml"; } } @@ -601,6 +705,8 @@ { _urlImage0 = @"http://www.weatheroffice.gc.ca/data/satellite/goes_nam_1070x_100.jpg"; } + + localize(); } //Determine how many sites there are @@ -631,6 +737,7 @@ ForecastXML = htmlStream.ReadToEnd(); response.Close(); + } catch (Exception) { @@ -648,7 +755,7 @@ request.Timeout = 20000; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); using (Stream responseStream = response.GetResponseStream()) - using (StreamReader htmlStream = new StreamReader(responseStream)) + using (StreamReader htmlStream = new StreamReader(responseStream, Encoding.Default)) WarningHTML = htmlStream.ReadToEnd(); response.Close(); @@ -760,10 +867,10 @@ case "ShowCurrent": //show buttons - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNVIEW, strSevenDayForecast); + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNVIEW, Translation.SevenDayForecast); GUIControl.ShowControl(GetID, (int)Controls.CONTROL_BTNVIEW); GUIControl.ShowControl(GetID, (int)Controls.CONTROL_BTNLOCATIONSELECT); - GUIControl.ShowControl(GetID, (int)Controls.CONTROL_BTNREFRESH); //, GUILocalizeStrings.Get(184)); //Refresh button + GUIControl.ShowControl(GetID, (int)Controls.CONTROL_BTNREFRESH); if (WeatherWarningType != "") { @@ -771,13 +878,13 @@ switch (WeatherWarningPriority) { case "high": - ShowWeatherWarningButton(strWarning + strHigh); + ShowWeatherWarningButton(Translation.Warning + Translation.High); break; case "medium": - ShowWeatherWarningButton(strWarning + strMed); + ShowWeatherWarningButton(Translation.Warning + Translation.Med); break; case "low": - ShowWeatherWarningButton(strWarning + strLow); + ShowWeatherWarningButton(Translation.Warning + Translation.Low); break; default: //nothing @@ -800,11 +907,13 @@ case "ShowTextForecast": //toggle the button label - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNVIEW, strCurrentConditions); + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNVIEW, Translation.CurrentConditions); GUIControl.ShowControl(GetID, (int)Controls.CONTROL_BTNVIEW); GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELLOCATION, currentLocation); //display current location - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_IMAGELOGO, currentLocation); //display logo - + GUIControl.ShowControl(GetID, (int)Controls.CONTROL_IMAGELOGO); + + + HideCurrentConditions(); HideWeatherWarning(); HideImages(); @@ -870,8 +979,6 @@ private void ShowImages() { - //GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNSWITCH, GUILocalizeStrings.Get(19100)); - //GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_BTNVIEW, GUILocalizeStrings.Get(737)); for (int i = (int)Controls.CONTROL_IMAGE_SAT; i < (int)Controls.CONTROL_IMAGE_SAT + 5; ++i) { GUIControl.ShowControl(GetID, i); @@ -917,10 +1024,23 @@ GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELLOCATION, currentLocation); //display current location GUIControl.ShowControl(GetID, (int)Controls.CONTROL_LABELLOCATION); //display current location (required if coming from satellite images) GUIControl.ShowControl(GetID, (int)Controls.CONTROL_FORECASTUPDATED); //display time of forecast + + if (LanguageChoice == "f") + { + strLogo = GUIGraphicsContext.Skin + String.Format(@"\Media\CanadianWeather\EC logo-Fr.png"); //display logo if french + } + else + { + strLogo = GUIGraphicsContext.Skin + String.Format(@"\Media\CanadianWeather\EC logo.png"); //display logo if english + } + GUIImage logo = (GUIImage)GetControl((int)Controls.CONTROL_IMAGELOGO); + logo.ColourDiffuse = 0xffffffff; + logo.SetFileName(strLogo); + GUIControl.ShowControl(GetID, (int)Controls.CONTROL_IMAGELOGO); //display logo //display time of forecast - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_FORECASTUPDATED, strForecastIssued + LocalizedTimeStamp); + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_FORECASTUPDATED, Translation.ForecastIssued + LocalizedTimeStamp); //display current temp, current condition icon, and current conditions text GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELNOWTEMP, currentTemperature); @@ -940,14 +1060,14 @@ GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_LABELSUNSET, SunsetTime); //sunset //display static labels - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICFEEL, GUILocalizeStrings.Get(402)); // - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICWIND, GUILocalizeStrings.Get(404)); // - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICRELHUMIDITY, GUILocalizeStrings.Get(406)); // - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICDEWPOINT, GUILocalizeStrings.Get(405)); // - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICPRESSURE, strPressure); // - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICVISIBILIY, strVisibility); // - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICSUNRISE, strSunrise); // - GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICSUNSET, strSunset); // + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICFEEL, Translation.FeelsLike); // + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICWIND, Translation.Wind); // + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICRELHUMIDITY, Translation.Humidity); // + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICDEWPOINT, Translation.Dewpoint); // + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICPRESSURE, Translation.Pressure); // + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICVISIBILIY, Translation.Visibility); // + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICSUNRISE, Translation.Sunrise); // + GUIControl.SetControlLabel(GetID, (int)Controls.CONTROL_STATICSUNSET, Translation.Sunset); // } private void HideImages() @@ -1092,7 +1212,7 @@ } catch { - ObservedtextSummary = strNotObserved; + ObservedtextSummary = Translation.NotObserved; } //current condition text @@ -1105,11 +1225,11 @@ } catch { - currentCondition = strNotObserved; + currentCondition = Translation.NotObserved; } if (currentCondition == "" || currentCondition == null) { - currentCondition = strNotObserved; + currentCondition = Translation.NotObserved; } //icon @@ -1142,7 +1262,7 @@ } catch { - currentTemperature = strNotObserved; + currentTemperature = Translation.NotObserved; } @@ -1199,16 +1319,21 @@ .ToString(); if (currentDewpoint == "" || currentDewpoint == null) { - currentDewpoint = strNotObserved; + currentDewpoint = Translation.NotObserved; } else { currentDewpoint += DEGREE_CHARACTER + "C"; + if (LanguageChoice == "f") + { + currentDewpoint = currentDewpoint.Replace(".", ",");//replace the period with a comma for french + } } + } catch { - currentDewpoint = strNotObserved; + currentDewpoint = Translation.NotObserved; } //pressure @@ -1236,17 +1361,21 @@ } if (currentPressure == "" || currentPressure == null && currentPressuretendency == "" || currentPressuretendency == null ) { - currentPressureAndTendency = strNotObserved; + currentPressureAndTendency = Translation.NotObserved; } else { if (currentPressure == "" || currentPressure == null) { - currentPressureAndTendency = strNotObserved; + currentPressureAndTendency = Translation.NotObserved; } else { currentPressureAndTendency = currentPressure + " kPa, " + currentPressuretendency; + if (LanguageChoice == "f") + { + currentPressureAndTendency = currentPressureAndTendency.Replace(".", ",");//replace the period with a comma for french + } } } @@ -1260,16 +1389,20 @@ .ToString(); if (currentVisibility == "" || currentVisibility == null) { - currentVisibility = strNotObserved; + currentVisibility = Translation.NotObserved; } else { currentVisibility += " km"; + if (LanguageChoice == "f") + { + currentVisibility = currentVisibility.Replace(".", ",");//replace the period with a comma for french + } } } catch { - currentVisibility = strNotObserved; + currentVisibility = Translation.NotObserved; } //humidity @@ -1281,7 +1414,7 @@ .ToString(); if (currentRelativeHumidity == "" || currentRelativeHumidity == null) { - currentRelativeHumidity = strNotObserved; + currentRelativeHumidity = Translation.NotObserved; } else { @@ -1290,7 +1423,7 @@ } catch { - currentRelativeHumidity = strNotObserved; + currentRelativeHumidity = Translation.NotObserved; } //wind @@ -1330,12 +1463,12 @@ //append the word "gust" and the gust speed if it exists if (currentWindgust.Length > 1) { - currentWindspeed += strGust + currentWindgust; + currentWindspeed += Translation.Gust + currentWindgust; } if (currentWindspeed == "") { - currentWindCombinedString = strNotObserved; + currentWindCombinedString = Translation.NotObserved; } else { @@ -1430,8 +1563,13 @@ foreach (var forecast in loaded.Descendants("forecastGroup").Elements("forecast")) { string tempday = forecast.Element("period").Attribute("textForecastName").Value; - if (tempint > 0 && tempday.Contains("night")) + if (tempint == 0 && tempday.Contains("soir")) { + tempday = "ce soir"; //shortens "ce soir et cette nuit" + } + + if (tempint > 0 && (tempday.Contains("night") || tempday.Contains("soir"))) + { //this filters out the possibility of 8 forecasts occurring and the 2nd or 3rd one is a "night"time forecast which we won't display //it also grabs the "low" in that night forecast and moves it to the next day var templow = (string)forecast.Element("temperatures") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hor...@us...> - 2012-01-10 23:26:54
|
Revision: 4401 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4401&view=rev Author: horned-reaper Date: 2012-01-10 22:45:33 +0000 (Tue, 10 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/Docs/Changes.txt trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/Languages/strings_en-US.xml trunk/plugins/FritzBox/FritzBox/Languages/strings_en.xml trunk/plugins/FritzBox/FritzBox/Settings.cs trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/releases/update.xml Added Paths: ----------- trunk/plugins/FritzBox/Docs/Documentation/ trunk/plugins/FritzBox/Docs/Documentation/Data/ trunk/plugins/FritzBox/Docs/Documentation/Data/FRITZ!Box Manager Phone Book.xml trunk/plugins/FritzBox/Docs/Documentation/Data/FritzBox-CallList.csv trunk/plugins/FritzBox/Docs/Documentation/Screenshots/ trunk/plugins/FritzBox/Docs/Documentation/Screenshots/1.JPG trunk/plugins/FritzBox/Docs/Documentation/Screenshots/2.JPG trunk/plugins/FritzBox/Docs/Documentation/Screenshots/3.JPG trunk/plugins/FritzBox/Docs/Documentation/Screenshots/4.JPG trunk/plugins/FritzBox/Docs/Documentation/Screenshots/5.JPG trunk/plugins/FritzBox/Docs/Documentation/Screenshots/6.JPG trunk/plugins/FritzBox/Docs/Documentation/Screenshots/7.JPG trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4400.mpe1 Removed Paths: ------------- trunk/plugins/FritzBox/Docs/Install-de.txt trunk/plugins/FritzBox/Docs/Install.txt trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.6.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.6.tlog Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/Build/Build.log 2012-01-10 22:45:33 UTC (rev 4401) @@ -1,12 +1,16 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -Unable to determine SVN version. Try with a SVN cleanup! -Local SVN not up to date +SVN Version: 4400 +Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\Tools\FritzBoxConfigTester\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\Tools\FritzBoxDebugger\Properties\AssemblyInfo.cs Microsoft (R) Build Engine Version 4.0.30319.1 [Microsoft .NET Framework, Version 4.0.30319.239] Copyright (C) Microsoft Corporation 2007. All rights reserved. -Build started 09.01.2012 18:24:45. +Build started 10.01.2012 23:18:05. Project "D:\FritzBox\FritzBox.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Mixed Platforms". @@ -150,10 +154,10 @@ Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.DebugForm.resources". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.exe". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.pdb". + Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog". + Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog". CoreResGen: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" /r:D:\FritzBox\FritzBox\bin\Release\FritzBox.dll /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Drawing.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /compile DebugForm.resx,obj\Release\FritzBoxDebugger.DebugForm.resources Processing resource file "DebugForm.resx" into "obj\Release\FritzBoxDebugger.DebugForm.resources". @@ -193,8 +197,13 @@ 0 Warning(s) 0 Error(s) -Time Elapsed 00:00:05.87 +Time Elapsed 00:00:01.90 Reverting to build 0 +Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\Tools\FritzBoxConfigTester\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\Tools\FritzBoxDebugger\Properties\AssemblyInfo.cs ..\FritzBox\bin\Release\FritzBox.dll 1 File(s) copied ..\FritzBox\Resources\speexdec.exe @@ -273,7 +282,7 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 18:24:56 +Build started at 23:18:09 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Writing UpdateXML to "update.xml" Modified: trunk/plugins/FritzBox/Docs/Changes.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Changes.txt 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/Docs/Changes.txt 2012-01-10 22:45:33 UTC (rev 4401) @@ -1,21 +0,0 @@ -New features: -- FRITZ!Box phone book is now used only. The local FRITZ!Manager phone book (fritzbox.xml) has been replaced -- automatic list update on changes -- offline function for phone book -- contact-specific sounds for incoming calls -- reworked Configuration menu - -Optimizations: -- improved performance: all data load is done in the background -- main menu icon with transparent background (thanks to Peter2!) -- improved handling with network connection interrupts - -Removed features (make no sense anymore if phone book is stored in FRITZ!Box): -- inverse search -- save unknown callers - -Fixed bugs: -- MediaPortal crashes when network connection to FRITZ!Box is interrupted -- voice box items are not displayed on the first menu call -- the picture of the first contact is not automatically shown on menu openning -- call list menu title is not shown when another menu (e. g. phone book) is active and you click on the filter button \ No newline at end of file Added: trunk/plugins/FritzBox/Docs/Documentation/Data/FRITZ!Box Manager Phone Book.xml =================================================================== --- trunk/plugins/FritzBox/Docs/Documentation/Data/FRITZ!Box Manager Phone Book.xml (rev 0) +++ trunk/plugins/FritzBox/Docs/Documentation/Data/FRITZ!Box Manager Phone Book.xml 2012-01-10 22:45:33 UTC (rev 4401) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<InternalPhoneBook xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <items> + <PhoneBookItem> + <ShowCallNotification>true</ShowCallNotification> + <Name>Angelina Jolie</Name> + <UniqueID>1321</UniqueID> + <PhoneNumbers> + <PhoneNumber prio="1" type="home">+00 (123) 45678</PhoneNumber> + </PhoneNumbers> + </PhoneBookItem> + <PhoneBookItem> + <ShowCallNotification>true</ShowCallNotification> + <Name>Tom Hanks</Name> + <UniqueID>1256</UniqueID> + <PhoneNumbers> + <PhoneNumber prio="1" type="home">+00 (456) 78901</PhoneNumber> + </PhoneNumbers> + </PhoneBookItem> + <PhoneBookItem> + <ShowCallNotification>true</ShowCallNotification> + <Name>Bruce Willis</Name> + <UniqueID>1224</UniqueID> + <PhoneNumbers> + <PhoneNumber prio="1" type="home">+00 (789) 98745</PhoneNumber> + </PhoneNumbers> + </PhoneBookItem> + </items> +</InternalPhoneBook> \ No newline at end of file Added: trunk/plugins/FritzBox/Docs/Documentation/Data/FritzBox-CallList.csv =================================================================== --- trunk/plugins/FritzBox/Docs/Documentation/Data/FritzBox-CallList.csv (rev 0) +++ trunk/plugins/FritzBox/Docs/Documentation/Data/FritzBox-CallList.csv 2012-01-10 22:45:33 UTC (rev 4401) @@ -0,0 +1,5 @@ +sep=; +Typ;Datum;Name;Rufnummer;Nebenstelle;Eigene Rufnummer;Dauer + +2;08.01.12 08:41;Angelina Jolie;+00 (123) 45678;;123;0:06 +1;08.01.12 10:40;Tom Hanks;+00 (456) 78901;;123;0:16 Added: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/1.JPG =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/1.JPG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/2.JPG =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/2.JPG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/3.JPG =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/3.JPG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/4.JPG =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/4.JPG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/5.JPG =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/5.JPG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/6.JPG =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/6.JPG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/7.JPG =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/Docs/Documentation/Screenshots/7.JPG ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Deleted: trunk/plugins/FritzBox/Docs/Install-de.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Install-de.txt 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/Docs/Install-de.txt 2012-01-10 22:45:33 UTC (rev 4401) @@ -1,144 +0,0 @@ -Dieses Plugin ist eine Kombination aus dem fr\xFChreren Callmonitor und dem neuen FritzManager. - -Dieses Howto beschreibt die Installation und die Features des FritzManager Teils. - -Der FritzManager l\xE4dt und zeigt verschiedene Informationen der FritzBox an. - -Hinweis zur Installation: -Bitte deinstalliere das alte Fritz Callmonitor Plugin zuerst. Wenn beide Plugins zusammen -installiert sind, f\xFChrt das zu Problemen, wie z.B. das Plugin kann nicht entladen werden -und MediaPortal bleibt h\xE4ngen. - -Die verschiedenen Sichten - -1. Die Anruferliste. ------------------------ - -Wird \xFCber den CSV-Export aus dem Web-Gui der FritzBox heruntergeladen. - -2. Das Telefonbuch. ------------------------- - -Wird ebenfalls \xFCber das Web-Gui herunter geladen (Telefonbuch Export \xFCber XML). -Zur Zeit wird nur ein Telefonbuch unterst\xFCtzt. Falls Du mehr als eins hast, wird -wahrscheinlich nur das erste angezeigt (ungetestet). - -3. Die Nachrichten des Anrufbeantworters. --------------------------------------------- - -Wird \xFCber das Auslesen der meta0...4 Dateien auf dem USB-Speicher der FritzBox -erledigt. Damit das funktioniert, muss die FB so konfiguriert sein, dass Anrufbeantworter- -nachrichten auf dem USB-Speicher abgelegt werden. Ausserdem muss der NAS Zugriff -auf den USB-Speicher eingeschaltet sein. - -Als n\xE4chstes verbindet man dieses Netzlaufwerk (irgendwas wie \\fritz.box\your-usb-store) -als lokales Laufwerk auf dem PC auf dem Mediaportal l\xE4uft. Es ist besser ein richtige Laufwerkverbindung zu nutzen, da UNC Pfade wie \\fritz.box\usb... manchmal nicht -funktionieren. - -Der Pfad zu der meta0 Datei (das ist das Inhaltsverzeichnis des ersten Anrufbeantworters) -muss dann in der Konfiguration bei 'path to voicebox' eingegeben werden. - -Falls keine Nachrichten angezeigt werden, wenn man auf die Nachrichten\xFCbersicht -umschaltet, dann \xFCberpr\xFCfe bitte das Logfile (mediaportal.log muss auf debug level gesetzt -sein), um zu sehen, ob das Plugin die metaX Dateien \xFCberhaupt findet. - -Bilder der Kontakte / Telefonbucheintr\xE4ge ----------------------- - -Alle Ansichten unterst\xFCtzen das Anzeigen von Bildern der jeweiligen Person. Wenn Du ein -Bild gleichen Namens wie die Person in den Ordner -<mediaportal-shared-base>\thumbs\yac legst, wird das Bild automatisch angezeigt. - -Weitere Features: - -Abspielen der Nachrichten: -------------------------- - -Wird eine Nachricht angeklickt, wird sie direkt im MP abgespielt. Damit das funktioniert, -muss die der speexdec.exe decoder ins Windows-verzeichnis kopiert werden. - -R\xFCckruf oder Anrufen eines Kontakts oder Anrufers: ------------------------------------------------------------------- - -\xD6ffne das Kontextmen\xFC eines Eintrags und w\xE4hle "Callback" dann l\xF6st das Plugin -einen Rufruf mit Hilfe der FritzBox Funktion "Anrufassistent" aus. - -Versichere dich dass Du den richtigen "Dial-Port" gew\xE4hlt hast, damit die Verbindung -auch auf dem gew\xFCnschten Telefon hergestellt wird. Falls Du nicht wei\xDFt, welcher -Dial-Port der richtige ist, probier einfach 1,2,3 ... aus, bis Du das richtige -Telefon gefunden hast. - -R\xFCckw\xE4rts-Aufl\xF6sung von Rufnummern: ------------------------------------ - -Alle bekannten Nummers in der Anruferliste und in der Nachrichten\xFCbersicht werden -mit ihren Namen aus dem Telefonbuch dargestellt. - -F\xFCr alle anderen Nummern wird im Hintergrund eine R\xFCckw\xE4rtssuche bei "Das \xF6rtliche" -durchgef\xFChrt. Falls ein Name gefunden wird, wird der Listeneintrag ersetzt und f\xFCr -das n\xE4chste mal gespeichert. - -Diese Funktion muss explizit in der Konfiguration eingeschaltet werden. F\xFCr Nummern, -die ohne Vorwahl gew\xE4hlt wurden, muss deine Ortwahl eingegeben werden, sonst klappt -die R\xFCckw\xE4rtssuche nicht. - -\xDCberwachen des Anrufbeantwortes mit Benachrichtigung ----------------------------------------------------- - -Das Plugin \xFCberwacht das Verzeichnis des Anrufbeantworters und aktualisiert die -Ansicht, wenn eine neue Nachricht eintrifft. -Ausserdem setzt das Plugin einige Skin-Properties, die es erlauben ein Custom- -Control oder ein Label im Skin einzubauen, welches z.B. im Home-Screen von MP -neue Nachrichten anzeigt. - -Du kannst den Home-Screen so \xE4ndern, dass ein Marker angezeigt. (sogar ein anklickbarer -Marker ist m\xF6glich). - -Es gibt einige gui properties: -#FritzManager.NewMessages -#FritzManager.TotalMessages - -Werden auf ' ' (ein Leerzeichen) gesetzt, wenn keine nachricht vorhanden ist. -Wenn eine Nachricht oder mehr vorhanden sind, dann wird '1 Nachtricht' oder '2 Nachrichten' -gesetzt. - -#FritzManager.NewMessageCount: Leerstring oder Anzahl neuer Nachrichten -#FritzManager.TotalMessageCount: Leerstring oder Anzahl aller Nachrichten -#FritzManager.NewMessagesAvail: "true" oder "false" -> kann zum Umschalten der Sichtbarkeit -genutzt werden - -Du kannst das direkt nutzen, um eine Anzeige f\xFCr den Anrufbeantworter in dein Skin zu -integrieren. Eine Text hinzuf\xFCgen geht so: - -<control> - <type>fadelabel</type> - <label>#FritzManager.NewMessages</label> - <posX>100</posX> - <posY>120</posY> -</control> - -In mediaportal 1.1.0 B1 and neuer, kann man sogar ein Control anzeigen oder verbergen: - -<control> - <type>button</type> - <visible>string.equals(#FritzManager.NewMessagesAvail,true)</visible> - ... -</control> - - -Bemerkungen: - -Die Kommunikation mit der FritzBox findet \xFCber das normale WebGui statt. Aus diesem -Grund muss das Plugin das Password kennen, um sich einloggen zu k\xF6nnen. Aktuell wird -nur die SID basierte Authetication unterst\xFCtzt (getestet auf 7270 und 7170). -Falls ben\xF6tigt, kann auch die alte Methode noch integriert werden. - -Die URLs, die das Plugin nutzt, um das Telefonbuch und die Anruferliste herunterzuladen sind -fest kodiert und passen zur fritz 7270 mit firmware 54.04.76. - -F\xFCr andere Firmware versionen und andere Fritzboxen ist nicht sichergestellt, dass alle URLs -so funktionieren wir erwartet. Falls etwas nicht klappt schau bitte zuerst ins Logfile mediaportal.log. - - - - \ No newline at end of file Deleted: trunk/plugins/FritzBox/Docs/Install.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Install.txt 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/Docs/Install.txt 2012-01-10 22:45:33 UTC (rev 4401) @@ -1,139 +0,0 @@ -This plugin is a combination of the former fritz call monitor and the new fritz manager. - -This howto describes the installation and features of the fritz manager part. - -The fritz manager can load and display several informations from the fritz!box. - -Note on Installation: -Please uninstall the old fritz call monitor first. It is completely included in this -plugin. Installing both will lead to problems like media portal cannot unload the -plugin and hangs. - - -Views - -1. The list of callers. ------------------------ - -This is done via the web admin gui (csv export). - -2. The fritz phone book. ------------------------- - -This is also done via the web admin gui (phone book export xml). -Only one phone book is supported at this time. If you have more than one, I think -the first one will be shown (not tested). - -3. The messages on the fritz voice mail box. --------------------------------------------- - -This done by reading the meta0 ... 4 files on the fritz voicebox usb store. -In order to make this work, you have configure you fritz box to use usb store -for voicebox recordings and allows a NAS export of your usb store. - -Next map this export (something like \\fritz.box\your-usb-store) to a local drive -on the pc mediaportal is running on. I prever to use a fix drive mapping, because -in my environment unc pathes \\fritz.box\usb... sometimes don't work. - -Insert the path to the meta0 file (directory for the first voicebox) into -'path to voicebox' setting of the fritz manager plugin. - -If no voice box items listed, when switching to voicebox view please check the -logfile (mediaportal.log must be set to debug level) to see if the plugin finds -the metaX files. - -Thumbsnail of contacts: ----------------------- - -All views support a thumbnail view of the selected contact. If you put an jpg -image of the same name as show in the view in the -<mediaportal-shared-base>\thumbs\yac folder, it will be displayed on your screen. - -Further feaures: - -Play voicebox recordings: -------------------------- - -When you click a recording, it is played directly on the mediaportal pc. To -get this running you must install the decoder speexdec.exe (comes with this -plugin) somewhere 'on the search path' e.g. to c:\windows. - -Callback or Call someone from phoneBook / voicebox / callers list: ------------------------------------------------------------------- - -On the list view open the context menu and choose 'call back' and the plugin -calls the selected subscriber via the fritz "call assistant" function. - -Be sure to configure the right dial port in the fritz manager settings to choose -the right telephone which is connected by fritz. If you dont own which dial port -to choose simply try 1,2,3 ... - -Revers lookup numbers: ----------------------- - -All known numbers in callers list and voicebox recordings are replaced by the -matching name from phoneBook. For all other numbers the plugin will submit an -invers search request to "das Oertliche" in background. If it finds a name the -number will replaced and the name will remembered next time. - -You must activate this explicitly in fritz manager settings. For numbers without -areacode, you must provide a default areacode to make the lookup for this numbers -possible. - -Monitor the voicebox with notification --------------------------------------- - -The plugin monitors the voicebox directory files and update the view, if a new -message arrives. Further the plugin sets two skin properties, which allow to -include a custom control or info label on any screen of media portal. - -you can modify our home screen that it shows a marker (or even a clickable marker) -if there are new messages. - -There are some gui properties: -#FritzManager.NewMessages -#FritzManager.TotalMessages - -These are set to ' ' (one space) if message count is 0. If count is greather than -0 a displayable string like '1 message' or '2 messages' is set. - -#FritzManager.NewMessageCount: empty string or number of new messages -#FritzManager.TotalMessageCount: empty string or number of total messages -#FritzManager.NewMessagesAvail: "true" or "false" -> use this to switch visibility - -You can use this directly in your skin file to include a voicebox display. Add a -label control like this: - -<control> - <type>fadelabel</type> - <label>#FritzManager.NewMessages</label> - <posX>100</posX> - <posY>120</posY> -</control> - -In mediaportal 1.1.0 B1 and newer you can even switch a control on and off: - -<control> - <type>button</type> - <visible>string.equals(#FritzManager.NewMessagesAvail,true)</visible> - ... -</control> - - -Notes: - -The communication to the fritz box is done via the normal web admin gui. For this -reason the plugin has to know the password. Actually only the newer sid based -authentication is supported (tested with 7270). If someone requests I will integrate -the older auth methos as well. - -The URLs the plugin uses to download the phoneBook / callers list are fixed and tested -with fritz 7270 firmware 54.04.76. - -For other firmware versions or other fritz box types there is no garantee, that all URLs -or POST request will work as expected. If something unexpected happens please check -the mediaportal.log logfile first. - - - - \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-01-10 22:45:33 UTC (rev 4401) @@ -154,6 +154,15 @@ } } + private void OnConnectedAction() + { + fritz.Login(); + + loadDataInBackground(); + + worker.queue.Enqueue(new Task(Task.TaskAction.RefreshView, null)); // schedule refresh view task + } + private void OnCall(CallAction callAction) { PhoneBookItem phoneBookItem = callAction.Caller.PhoneBookItem; @@ -352,17 +361,49 @@ public void Start() { Log.Info("FRITZ!Box Manager {0} plugin is starting", Assembly.GetExecutingAssembly().GetName().Version); + Settings.Load(); + // register events Utils.OnStartExternal += OnStartExternal; Utils.OnStopExternal += OnStopExternal; FritzBoxClient.LogEvent += OnLogAction; FritzBoxClient.CallEvent += OnCallAction; + + FritzBoxClient.ConnectedEvent += OnConnectedAction; + + SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); // power mode changes (Standby & Hibernate) + FritzBoxClient.StartClient(); + + thePlugin = this; - // start monitoring Windows power mode changes (Standby & Hibernate) - SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + // open FRITZ!Box connection and login + fritz = new Fritz(Settings.Password, Config.GetFolder(Config.Dir.Config), FritzBoxClient.Address, Settings.DialPort); + + // set session timer interval and start the timer + sessionTimer.Interval = 30000; + sessionTimer.Elapsed += OnSessionTimerEvent; + sessionTimer.Start(); + + // set update timer interval and start the timer + int updateInterval = Settings.UpdateInterval; + + if (updateInterval != 0) + { + updateTimer.Interval = updateInterval * 1000; // interval is in sec + updateTimer.Elapsed += OnUpdateTimerEvent; + updateTimer.Start(); + } + + // load phone book from XML file + phoneBook = new PhoneBook(fritz); + phoneBook.LoadPhoneBookFromXMLFile(); + + startBackGroundWorker(); + + loadDataInBackground(); } /// <summary> @@ -373,15 +414,17 @@ Log.Info("FRITZ!Box Manager {0} plugin is stopping", Assembly.GetExecutingAssembly().GetName().Version); FritzBoxClient.StopClient(); + + // unregister events FritzBoxClient.CallEvent -= OnCallAction; FritzBoxClient.LogEvent -= OnLogAction; Utils.OnStartExternal -= OnStartExternal; Utils.OnStopExternal -= OnStopExternal; - // stop monitoring power changes - SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); // power changes + // save phone book phoneBook.SavePhoneBookToXMLFile(); } @@ -525,9 +568,6 @@ private Thread workerThread; // sync the access to call list private System.Object sync = new System.Object(); - //private bool gUICallItemListUpdateIsRequired = true; - //private bool gUIPhoneBookUpdateIsRequired = true; - //private bool gUIVoiceBoxItemListUpdateIsRequired = true; #endregion fields @@ -539,7 +579,7 @@ Log.Debug("Init called"); Start(); - loadConfig(); + //loadConfig(); return Load(GUIGraphicsContext.Skin + @"\FritzManager.xml"); } @@ -592,38 +632,6 @@ filesToDelete.Clear(); } - protected void loadConfig() - { - thePlugin = this; - - // open FRITZ!Box connection and login - fritz = new Fritz(Settings.Password, Config.GetFolder(Config.Dir.Config), FritzBoxClient.Address, Settings.DialPort); - fritz.Login(); - - // set session timer interval and start the timer - sessionTimer.Interval = 30000; - sessionTimer.Elapsed += OnSessionTimerEvent; - sessionTimer.Start(); - - // set update timer interval and start the timer - int updateInterval = Settings.UpdateInterval; - - if (updateInterval != 0) - { - updateTimer.Interval = updateInterval * 1000; // interval is in sec - updateTimer.Elapsed += OnUpdateTimerEvent; - updateTimer.Start(); - } - - // load phone book from XML file - phoneBook = new PhoneBook(fritz); - phoneBook.LoadPhoneBookFromXMLFile(); - - startBackGroundWorker(); - - loadDataInBackground(); - } - protected override void OnPageLoad() { windowIsDisplayed = true; @@ -654,8 +662,7 @@ { Log.Debug("Processing session timer event"); - if (!fritz.LoggedIn) fritz.Login(); - else + if (fritz.LoggedIn) { fritz.KeepAlive(); @@ -892,6 +899,7 @@ voiceBoxItemList.Sort(VoiceBoxItem.CompareByDate); int i = 0; Caller caller; + string callerName; foreach (VoiceBoxItem voiceBoxItem in voiceBoxItemList) { @@ -905,8 +913,19 @@ if (mSNs.ContainsValue(voiceBoxItem.mynumber)) mSNName = mSNs[voiceBoxItem.mynumber]; elem.Label = (voiceBoxItem.isNew == 1 ? "* " : " ") + voiceBoxItem.time.ToString(format, ci); - elem.Label2 = caller.PhoneBookItem.Name + " " + GUILocalizeStrings.Get(26) + " " + mSNName; // 26 = to + + // add caller name/phone number and MSN + if (caller.PhoneBookItem != null) callerName = caller.PhoneBookItem.Name; + else + { + if (caller.PhoneNumber != "") callerName = caller.PhoneNumber; + else callerName = GUILocalizeStrings.Get(3); // 3 = Unknown + } + + elem.Label2 = callerName + " " + GUILocalizeStrings.Get(26) + " " + mSNName; // 26 = to + elem.Path = Convert.ToString(i); + elem.IconImageBig = "defaultAudioBig.png"; elem.IconImage = "defaultAudio.png"; @@ -1009,10 +1028,14 @@ elem.Label = item.timestamp.ToString(format, ci) + " - " + item.duration.ToString("HH:mm", ci); - // add caller name - elem.Label2 = caller.PhoneBookItem.Name; + // add caller name/phone number + if (caller.PhoneBookItem != null) elem.Label2 = caller.PhoneBookItem.Name; + else + { + if (caller.PhoneNumber != "") elem.Label2 = caller.PhoneNumber; + else elem.Label2 = GUILocalizeStrings.Get(3); // 3 = Unknown + } - // add phone number elem.DVDLabel = item.mynumber + item.extension; elem.Path = Convert.ToString(i); @@ -1034,7 +1057,7 @@ facadeView.Add(elem); } } - else Log.Debug("callItemList is not initialized"); + else Log.Debug("call item list is not initialized"); } private void showThumbPanel() Modified: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs 2012-01-10 22:45:33 UTC (rev 4401) @@ -173,6 +173,8 @@ private void checkBoxUsePhonebook_CheckedChanged(object sender, EventArgs e) { checkBoxShowUnknownCaller.Enabled = checkBoxUsePhonebook.Checked; + + if (!checkBoxUsePhonebook.Checked) checkBoxShowUnknownCaller.Checked = true; } private void buttonMSNsAdd_Click(object sender, EventArgs e) Modified: trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs 2012-01-10 22:45:33 UTC (rev 4401) @@ -76,6 +76,8 @@ public delegate void LogEventHandler(LogLevel logLevel, string logMessage); + public delegate void ConnectedEventHandler(); + #endregion private static readonly TimeSpan minConnectWaitTime = new TimeSpan(0, 0, 30); @@ -101,6 +103,8 @@ public static event LogEventHandler LogEvent; + public static event ConnectedEventHandler ConnectedEvent; + #region Public methods public static void StartClient() @@ -223,6 +227,9 @@ _client.BeginConnect(Address, Port, ConnectCallback, _client); Connected = true; + + // Raise event + ConnectedEvent(); } catch (SocketException) { @@ -256,7 +263,7 @@ } catch (SocketException) { - Log(LogLevel.Error, "Connection faild: SocketException"); + Log(LogLevel.Error, "Connection failed: SocketException"); ReConnect(); } catch (Exception ex) Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs 2012-01-10 22:45:33 UTC (rev 4401) @@ -146,48 +146,44 @@ public string loadPhoneBookFromFritzBox() { - if (LoggedIn) + string returnData; + + try { - string returnData; + string postdata = + "-----------------------------88612920297\r\n" + + "Content-Disposition: form-data; name=\"sid\"\r\n" + + "\r\n" + + sid + "\r\n" + + "-----------------------------88612920297\r\n" + + "Content-Disposition: form-data; name=\"PhonebookId\"\r\n" + + "\r\n" + + "0\r\n" + + "-----------------------------88612920297\r\n" + + "Content-Disposition: form-data; name=\"PhonebookExportName\"\r\n" + + "\r\n" + + "Telefonbuch\r\n" + + "-----------------------------88612920297\r\n" + + "Content-Disposition: form-data; name=\"PhonebookExport\"\r\n" + + "\r\n" + + "\r\n" + + "-----------------------------88612920297--\r\n" + + "\r\n"; - try - { - string postdata = - "-----------------------------88612920297\r\n" + - "Content-Disposition: form-data; name=\"sid\"\r\n" + - "\r\n" + - sid + "\r\n" + - "-----------------------------88612920297\r\n" + - "Content-Disposition: form-data; name=\"PhonebookId\"\r\n" + - "\r\n" + - "0\r\n" + - "-----------------------------88612920297\r\n" + - "Content-Disposition: form-data; name=\"PhonebookExportName\"\r\n" + - "\r\n" + - "Telefonbuch\r\n" + - "-----------------------------88612920297\r\n" + - "Content-Disposition: form-data; name=\"PhonebookExport\"\r\n" + - "\r\n" + - "\r\n" + - "-----------------------------88612920297--\r\n" + - "\r\n"; + returnData = PostRequest("http://" + hostname + "/cgi-bin/firmwarecfg", postdata, "multipart/form-data; boundary=---------------------------88612920297", "ISO-8859-15"); - returnData = PostRequest("http://" + hostname + "/cgi-bin/firmwarecfg", postdata, "multipart/form-data; boundary=---------------------------88612920297", "ISO-8859-15"); - - if (!returnData.StartsWith("<!DOCTYPE html")) return returnData; // check if return data is FRITZ!Box logon page - else - { - loggedIn = false; - Log.Debug("Not logged in to FRITZ!Box. Phone book cannot be loaded"); - } - } - catch + if (!returnData.StartsWith("<!DOCTYPE html")) return returnData; // check if return data is FRITZ!Box logon page + else { - Log.Debug("Error on loading phone book from FRITZ!Box"); loggedIn = false; + Log.Debug("Not logged in to FRITZ!Box. Phone book cannot be loaded"); } } - else Log.Debug("Not logged in to FRITZ!Box. Phone book cannot be loaded"); + catch + { + Log.Debug("Error on loading phone book from FRITZ!Box"); + loggedIn = false; + } return null; } Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs 2012-01-10 22:45:33 UTC (rev 4401) @@ -92,10 +92,8 @@ } } } - - // if no contact item was found return "Unknown" as name - if (caller.PhoneBookItem == null) caller.PhoneBookItem = new PhoneBookItem(GUILocalizeStrings.Get(3)); // 3 = Unknown + // if no contact item was found return null return caller; } @@ -122,8 +120,6 @@ { InternalPhoneBook internalPhoneBook = new InternalPhoneBook(); - // ... - foreach (PhoneBookItem phoneBookItem in phoneBook.Values) { internalPhoneBook.items.Add(phoneBookItem); @@ -162,111 +158,112 @@ { XmlSerializer xmlSerializer = new XmlSerializer(typeof(FritzPhoneBooks)); fritzPhoneBooks = (FritzPhoneBooks)xmlSerializer.Deserialize(new StringReader(fritzPhoneBooksSerialized)); - } - FritzManager.PhoneBook fritzPhoneBook = fritzPhoneBooks.Items[0]; // always choose first phone book - PhoneBookItem tempPhoneBookItem; - bool updateRequired, contactFound; - string name, uniqueID, imageURL; + FritzManager.PhoneBook fritzPhoneBook = fritzPhoneBooks.Items[0]; // always choose first phone book + PhoneBookItem tempPhoneBookItem; + bool updateRequired, contactFound; + string name, uniqueID, imageURL; - lock (sync) - { - // update/add entries from FRITZ!Box phone book to local phone book - foreach (Contact contact in fritzPhoneBook.contact) + lock (sync) { - name = contact.person[0].realName; - imageURL = contact.person[0].imageURL; - uniqueID = contact.uniqueid; + // update/add entries from FRITZ!Box phone book to local phone book + foreach (Contact contact in fritzPhoneBook.contact) + { + name = contact.person[0].realName; + imageURL = contact.person[0].imageURL; + uniqueID = contact.uniqueid; - updateRequired = false; + updateRequired = false; - // search if FRITZ!Box contact already exists in phone book - if (phoneBook.ContainsKey(uniqueID)) - { - // check for differences - for (int i = 0; i < contact.telephony.Length; i++) + // search if FRITZ!Box contact already exists in phone book + if (phoneBook.ContainsKey(uniqueID)) { - try + // check for differences + for (int i = 0; i < contact.telephony.Length; i++) { - if (phoneBook[uniqueID].Name != name || !contact.telephony[i].Equals(phoneBook[uniqueID].PhoneNumbers[i]) || imageURL != phoneBook[uniqueID].ImageURL) updateRequired = true; + try + { + if (phoneBook[uniqueID].Name != name || !contact.telephony[i].Equals(phoneBook[uniqueID].PhoneNumbers[i]) || imageURL != phoneBook[uniqueID].ImageURL) updateRequired = true; + } + catch + { + // on property changes the differences check may fail + Log.Debug("Phone book difference check failed. Forcing contact update"); + updateRequired = true; + break; + } } - catch + + if (updateRequired) { - // on property changes the differences check may fail - Log.Debug("Phone book difference check failed. Forcing contact update"); - updateRequired = true; - break; + Log.Info("Updating contact " + phoneBook[uniqueID].Name); + + phoneBook[uniqueID].Name = name; + phoneBook[uniqueID].PhoneNumbers = contact.telephony; + phoneBook[uniqueID].ImageURL = imageURL; + + phoneBookChanges = true; } } - - if (updateRequired) + else { - Log.Info("Updating contact " + phoneBook[uniqueID].Name); + Log.Info("Adding contact " + name); - phoneBook[uniqueID].Name = name; - phoneBook[uniqueID].PhoneNumbers = contact.telephony; - phoneBook[uniqueID].ImageURL = imageURL; + tempPhoneBookItem = new PhoneBookItem(); + tempPhoneBookItem.UniqueID = uniqueID; + tempPhoneBookItem.Name = name; + tempPhoneBookItem.PhoneNumbers = contact.telephony; + tempPhoneBookItem.ImageURL = imageURL; + phoneBook.Add(uniqueID, tempPhoneBookItem); + + phoneBookSortIsRequired = true; phoneBookChanges = true; } } - else - { - Log.Info("Adding contact " + name); - tempPhoneBookItem = new PhoneBookItem(); - tempPhoneBookItem.UniqueID = uniqueID; - tempPhoneBookItem.Name = name; - tempPhoneBookItem.PhoneNumbers = contact.telephony; - tempPhoneBookItem.ImageURL = imageURL; + // check for obsolete entries in local phone book (not existing in FRITZ!Box phone book anymore) + string[] contactsToDelete = new string[phoneBook.Count]; + int k = 0; - phoneBook.Add(uniqueID, tempPhoneBookItem); + foreach (PhoneBookItem phoneBookItem in phoneBook.Values) + { + uniqueID = phoneBookItem.UniqueID; + contactFound = false; - phoneBookSortIsRequired = true; - phoneBookChanges = true; - } - } + foreach (Contact contact in fritzPhoneBook.contact) + { + if (contact.uniqueid == uniqueID) + { + contactFound = true; + break; + } + } - // check for obsolete entries in local phone book (not existing in FRITZ!Box phone book anymore) - string[] contactsToDelete = new string[phoneBook.Count]; - int k = 0; - - foreach (PhoneBookItem phoneBookItem in phoneBook.Values) - { - uniqueID = phoneBookItem.UniqueID; - contactFound = false; - - foreach (Contact contact in fritzPhoneBook.contact) - { - if (contact.uniqueid == uniqueID) + if (!contactFound) { - contactFound = true; - break; + contactsToDelete[k] = uniqueID; + k++; } } - if (!contactFound) + lock (sync) { - contactsToDelete[k] = uniqueID; - k++; - } - } - - lock (sync) - { - foreach (string _uniqueID in contactsToDelete) // contacts cannot be deleted in above foreach loop, a second loop is required - { - if (_uniqueID != null) + foreach (string _uniqueID in contactsToDelete) // contacts cannot be deleted in above foreach loop, a second loop is required { - Log.Info("Removing contact " + phoneBook[_uniqueID].Name); - phoneBook.Remove(_uniqueID); - phoneBookChanges = true; + if (_uniqueID != null) + { + Log.Info("Removing contact " + phoneBook[_uniqueID].Name); + phoneBook.Remove(_uniqueID); + phoneBookChanges = true; + } } } } - } - Log.Debug("Synchronized " + phoneBook.Count + " contacts with FRITZ!Box"); + Log.Debug("Synchronized " + phoneBook.Count + " contacts with FRITZ!Box"); + } + else Log.Error("Phone book synchronisation with the FRITZ!Box failed"); } else Log.Debug("No connection to FRITZ!Box. Phone book synchronization not started"); @@ -284,8 +281,8 @@ } if (phoneBookChanges) - { - phoneBookSaveIsRequired = true; + { + phoneBookSaveIsRequired = true; return true; } else return false; Modified: trunk/plugins/FritzBox/FritzBox/Languages/strings_en-US.xml =================================================================== --- trunk/plugins/FritzBox/FritzBox/Languages/strings_en-US.xml 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/FritzBox/Languages/strings_en-US.xml 2012-01-10 22:45:33 UTC (rev 4401) @@ -15,7 +15,7 @@ <String id="13">View: Large icons</String> <String id="14">All</String> <String id="15">Incoming</String> - <String id="16">Ougoing</String> + <String id="16">Outgoing</String> <String id="17">Rejected</String> <String id="18">Call list</String> <String id="19">FritzBox messages</String> Modified: trunk/plugins/FritzBox/FritzBox/Languages/strings_en.xml =================================================================== --- trunk/plugins/FritzBox/FritzBox/Languages/strings_en.xml 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/FritzBox/Languages/strings_en.xml 2012-01-10 22:45:33 UTC (rev 4401) @@ -15,7 +15,7 @@ <String id="13">View: Large icons</String> <String id="14">All</String> <String id="15">Incoming</String> - <String id="16">Ougoing</String> + <String id="16">Outgoing</String> <String id="17">Rejected</String> <String id="18">Call list</String> <String id="19">FritzBox messages</String> Modified: trunk/plugins/FritzBox/FritzBox/Settings.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/Settings.cs 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/FritzBox/Settings.cs 2012-01-10 22:45:33 UTC (rev 4401) @@ -144,8 +144,6 @@ { Log.Info("Loading settings"); - //PhoneBook.LoadSettings(); - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { // connection settings @@ -260,7 +258,7 @@ xmlwriter.SetValueAsBool("fritzbox", "showMSNOnNotify", ShowMSNOnNotify); - xmlwriter.SetValueAsBool("fritzbox", "showMSNOnNotify", PhoneBookEnabled); + xmlwriter.SetValueAsBool("fritzbox", "usePhonebook", PhoneBookEnabled); xmlwriter.SetValueAsBool("fritzbox", "showUnknownCaller", ShowUnknownCaller); Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 =================================================================== --- trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-09 21:25:08 UTC (rev 4400) +++ trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-10 22:45:33 UTC (rev 4401) @@ -559,7 +559,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.0</DesignedForVersion> + <DesignedForVersion>1.1.7.4400</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -582,7 +582,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>0</Revision> + <Revision>4400</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -596,7 +596,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-09T18:24:56.1938676+01:00</ReleaseDate> + <ReleaseDate>2012-01-10T23:18:09.5983408+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.... [truncated message content] |
From: <Ba...@us...> - 2012-01-09 21:25:14
|
Revision: 4400 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4400&view=rev Author: BartEv Date: 2012-01-09 21:25:08 +0000 (Mon, 09 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/VeraControl.xmp2 trunk/plugins/VeraControl/releases/update.xml Modified: trunk/plugins/VeraControl/releases/VeraControl.xmp2 =================================================================== --- trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-09 19:40:41 UTC (rev 4399) +++ trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-09 21:25:08 UTC (rev 4400) @@ -810,7 +810,7 @@ </ExtensionDescription> <VersionDescription>Improved Vera response handling</VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> - <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/</OnlineLocation> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v[Version].mpe1</OnlineLocation> <ReleaseDate>2012-01-08T22:51:05</ReleaseDate> <Tags>home automation, z-wave, Modified: trunk/plugins/VeraControl/releases/update.xml =================================================================== --- trunk/plugins/VeraControl/releases/update.xml 2012-01-09 19:40:41 UTC (rev 4399) +++ trunk/plugins/VeraControl/releases/update.xml 2012-01-09 21:25:08 UTC (rev 4400) @@ -383,7 +383,7 @@ </ExtensionDescription> <VersionDescription>Improved Vera response handling</VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> - <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/</OnlineLocation> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/VeraControl_v0.5.1.0.mpe1</OnlineLocation> <ReleaseDate>2012-01-08T22:51:05</ReleaseDate> <Tags>home automation, z-wave, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hor...@us...> - 2012-01-09 19:40:53
|
Revision: 4399 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4399&view=rev Author: horned-reaper Date: 2012-01-09 19:40:41 +0000 (Mon, 09 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/CallAction.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/Caller.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/FritzManager/Task.cs trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.7.tlog trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.7.tlog trunk/plugins/FritzBox/releases/update.xml Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/Build/Build.log 2012-01-09 19:40:41 UTC (rev 4399) @@ -1,16 +1,12 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -SVN Version: 4389 -Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\Tools\FritzBoxConfigTester\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\Tools\FritzBoxDebugger\Properties\AssemblyInfo.cs +Unable to determine SVN version. Try with a SVN cleanup! +Local SVN not up to date Microsoft (R) Build Engine Version 4.0.30319.1 [Microsoft .NET Framework, Version 4.0.30319.239] Copyright (C) Microsoft Corporation 2007. All rights reserved. -Build started 07.01.2012 23:13:40. +Build started 09.01.2012 18:24:45. Project "D:\FritzBox\FritzBox.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Mixed Platforms". @@ -156,6 +152,8 @@ Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.pdb". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog". + Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog". + Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog". CoreResGen: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files\Team MediaPortal\MediaPortal\Core.dll" /r:D:\FritzBox\FritzBox\bin\Release\FritzBox.dll /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\mscorlib.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Drawing.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Windows.Forms.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll" /compile DebugForm.resx,obj\Release\FritzBoxDebugger.DebugForm.resources Processing resource file "DebugForm.resx" into "obj\Release\FritzBoxDebugger.DebugForm.resources". @@ -195,13 +193,8 @@ 0 Warning(s) 0 Error(s) -Time Elapsed 00:00:01.91 +Time Elapsed 00:00:05.87 Reverting to build 0 -Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\Tools\FritzBoxConfigTester\Properties\AssemblyInfo.cs -Updating: D:\FritzBox\Tools\FritzBoxDebugger\Properties\AssemblyInfo.cs ..\FritzBox\bin\Release\FritzBox.dll 1 File(s) copied ..\FritzBox\Resources\speexdec.exe @@ -280,7 +273,7 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 23:13:44 +Build started at 18:24:56 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Writing UpdateXML to "update.xml" Modified: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2012-01-09 19:40:41 UTC (rev 4399) @@ -239,9 +239,10 @@ // show call notification ShowNotify(callAction.Type, strHeading, strImage, strText); } - // update call list and voice box items + // update call list and voice box items and refresh GUI worker.queue.Enqueue(new Task(Task.TaskAction.LoadCallListItems, null)); worker.queue.Enqueue(new Task(Task.TaskAction.LoadVoiceBoxItems, null)); + worker.queue.Enqueue(new Task(Task.TaskAction.RefreshView, null)); } } @@ -632,7 +633,7 @@ // display error on missing FRITZ!Box settings if (String.IsNullOrEmpty(Settings.Password) && String.IsNullOrEmpty(Settings.VBPath)) showError(GUILocalizeStrings.Get(24)); // 24 = FRITZ!Box password and voice box path are missing in settings! - refreshView(Settings.CurrentMode); + RefreshView(Settings.CurrentMode); loadDataInBackground(); } @@ -678,7 +679,7 @@ } /// <summary> - /// update data for the views. + /// update data for the views and show the wait cursor. Practical for user-initiated view updates /// </summary> /// <param name="forceReload">if set the data is loaded during the update in any case</param> protected void updateGUI(bool forceReload) @@ -692,7 +693,7 @@ else if (Settings.CurrentMode == GUIMode.PhoneBook && forceReload) SynchronizePhoneBook(); } - refreshView(Settings.CurrentMode); + RefreshView(Settings.CurrentMode); updateButtonStates(); @@ -734,7 +735,7 @@ { voiceBoxItemList = newVoiceBoxItemList; - refreshView(GUIMode.VoiceBox); + worker.queue.Enqueue(new Task(Task.TaskAction.RefreshView, null)); } } else Log.Debug("No voice box items on the FRITZ!Box"); @@ -745,7 +746,7 @@ public void SynchronizePhoneBook() { - if (phoneBook.SynchronizePhoneBook()) refreshView(GUIMode.PhoneBook); + if (phoneBook.SynchronizePhoneBook()) worker.queue.Enqueue(new Task(Task.TaskAction.RefreshView, null)); } public void SynchronizeContactImages() @@ -754,9 +755,10 @@ } /// <summary> - /// refreshes the view. call when backing lists / maps have changed + /// refreshes a particular view. Practical for automatic view updates /// </summary> - protected void refreshView(GUIMode gUIMode) + /// <param name="forceReload">the view to be updated</param> + public void RefreshView(GUIMode gUIMode) { if (Settings.CurrentMode == gUIMode && windowIsDisplayed) { @@ -822,7 +824,7 @@ { callItemList = newCallItemList; - refreshView(GUIMode.CallList); + worker.queue.Enqueue(new Task(Task.TaskAction.RefreshView, null)); } } else Log.Debug("No voice box items on the FRITZ!Box"); @@ -1177,7 +1179,7 @@ break; } - refreshView(Settings.CurrentMode); + RefreshView(Settings.CurrentMode); updateButtonStates(); Modified: trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/CallAction.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/CallAction.cs 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/CallAction.cs 2012-01-09 19:40:41 UTC (rev 4399) @@ -34,7 +34,7 @@ Incoming, Outgoing, ConnectionStarted, - ConnectionClosed, + ConnectionClosed } #endregion Modified: trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/Caller.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/Caller.cs 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/Caller.cs 2012-01-09 19:40:41 UTC (rev 4399) @@ -22,26 +22,6 @@ namespace FritzBox { - //public class Caller - //{ - // public Caller() - // { - // ID = string.Empty; - // Name = string.Empty; - // Show = true; - // } - - // public Caller(string id, string name, bool show) - // { - // ID = id; - // Name = name; - // Show = show; - // } - - // public string ID { get; set; } - // public string Name { get; set; } - // public bool Show { get; set; } - //} public class Caller { public Caller() Modified: trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs 2012-01-09 19:40:41 UTC (rev 4399) @@ -331,21 +331,18 @@ case "RING": callAction.Type = CallAction.CallType.Incoming; - // sets the callerID callAction.Caller.PhoneNumber = strList[3]; callAction.MSN = strList[4]; break; case "CALL": callAction.Type = CallAction.CallType.Outgoing; - // sets the callerID callAction.Caller.PhoneNumber = strList[5]; callAction.MSN = strList[4]; break; case "CONNECT": callAction.Type = CallAction.CallType.ConnectionStarted; - // sets the callerID callAction.Caller.PhoneNumber = strList[4]; break; case "DISCONNECT": Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs 2012-01-09 19:40:41 UTC (rev 4399) @@ -60,6 +60,11 @@ Log.Debug("Running temp file cleanup task"); plugin.CleanupTempFiles(); break; + + case Task.TaskAction.RefreshView: + Log.Debug("Running refresh view task"); + plugin.RefreshView(FritzBox.Settings.CurrentMode); + break; } } } Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs 2012-01-09 19:40:41 UTC (rev 4399) @@ -4,6 +4,7 @@ using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; +using Microsoft.Win32; namespace FritzManager { @@ -33,6 +34,9 @@ this.cacheDir = cacheDir; this.cacheFileName = cacheDir + "\\FritzBox-CallList.csv"; this.dialport = dialport; + + // start monitoring Windows power mode changes (Standby & Hibernate) + SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); } public bool LoggedIn @@ -120,7 +124,7 @@ public byte[] loadCallListData(bool forceReload) { - byte[] result = { 0 } ; + byte[] result = { 0 }; if (loggedIn && (forceReload || DateTime.Now.Subtract(lastCallListUpdate).Minutes > 2)) { @@ -136,7 +140,7 @@ result = loadCachedCallListData(); } - + return result; } @@ -144,6 +148,8 @@ { if (LoggedIn) { + string returnData; + try { string postdata = @@ -166,20 +172,24 @@ "-----------------------------88612920297--\r\n" + "\r\n"; - return PostRequest("http://" + hostname + "/cgi-bin/firmwarecfg", postdata, "multipart/form-data; boundary=---------------------------88612920297", "ISO-8859-15"); + returnData = PostRequest("http://" + hostname + "/cgi-bin/firmwarecfg", postdata, "multipart/form-data; boundary=---------------------------88612920297", "ISO-8859-15"); + + if (!returnData.StartsWith("<!DOCTYPE html")) return returnData; // check if return data is FRITZ!Box logon page + else + { + loggedIn = false; + Log.Debug("Not logged in to FRITZ!Box. Phone book cannot be loaded"); + } } catch { Log.Debug("Error on loading phone book from FRITZ!Box"); loggedIn = false; - return ""; } } - else - { - Log.Debug("No connection to FRITZ!Box. Phone book cannot be loaded"); - return ""; - } + else Log.Debug("Not logged in to FRITZ!Box. Phone book cannot be loaded"); + + return null; } /// <summary> @@ -315,5 +325,18 @@ return ""; } } + + private void SystemEvents_PowerModeChanged(object sender, Microsoft.Win32.PowerModeChangedEventArgs e) + { + switch (e.Mode) + { + case PowerModes.Suspend: + loggedIn = false; + break; + + case PowerModes.Resume: + break; + } + } } } Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/PhoneBook.cs 2012-01-09 19:40:41 UTC (rev 4399) @@ -158,7 +158,7 @@ string fritzPhoneBooksSerialized = fritz.loadPhoneBookFromFritzBox(); - if (fritzPhoneBooksSerialized != "") + if (fritzPhoneBooksSerialized != null) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(FritzPhoneBooks)); fritzPhoneBooks = (FritzPhoneBooks)xmlSerializer.Deserialize(new StringReader(fritzPhoneBooksSerialized)); Modified: trunk/plugins/FritzBox/FritzBox/FritzManager/Task.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzManager/Task.cs 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/FritzBox/FritzManager/Task.cs 2012-01-09 19:40:41 UTC (rev 4399) @@ -15,7 +15,8 @@ LoadVoiceBoxItems, UpdateGUIProperties, SynchronizeContactImages, - CleanUpTempFiles + CleanUpTempFiles, + RefreshView } #endregion Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 =================================================================== --- trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-09 19:40:41 UTC (rev 4399) @@ -559,7 +559,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.4389</DesignedForVersion> + <DesignedForVersion>1.1.7.0</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -582,7 +582,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>4389</Revision> + <Revision>0</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -596,7 +596,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-07T23:13:44.2036574+01:00</ReleaseDate> + <ReleaseDate>2012-01-09T18:24:56.1938676+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Debug/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Debug/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt 2012-01-09 19:40:41 UTC (rev 4399) @@ -23,7 +23,5 @@ D:\FritzBox\Tools\FritzBoxDebugger\bin\Release\log4net.dll D:\FritzBox\Tools\FritzBoxDebugger\bin\Release\Ionic.Zip.dll D:\FritzBox\Tools\FritzBoxDebugger\bin\Release\FritzBox.pdb -D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog -D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.read.7.tlog =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/GenerateResource.write.7.tlog =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/releases/update.xml =================================================================== --- trunk/plugins/FritzBox/releases/update.xml 2012-01-08 22:16:47 UTC (rev 4398) +++ trunk/plugins/FritzBox/releases/update.xml 2012-01-09 19:40:41 UTC (rev 4399) @@ -88,7 +88,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.4389</DesignedForVersion> + <DesignedForVersion>1.1.7.0</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -111,7 +111,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>4389</Revision> + <Revision>0</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -125,7 +125,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-07T23:13:44.2036574+01:00</ReleaseDate> + <ReleaseDate>2012-01-09T18:24:56.1938676+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-08 22:16:54
|
Revision: 4398 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4398&view=rev Author: BartEv Date: 2012-01-08 22:16:47 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/VeraCommunication.cs trunk/plugins/VeraControl/VeraControl.cs trunk/plugins/VeraControl/VeraSetupForm.Designer.cs trunk/plugins/VeraControl/VeraSetupForm.cs Modified: trunk/plugins/VeraControl/VeraCommunication.cs =================================================================== --- trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-08 21:54:57 UTC (rev 4397) +++ trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-08 22:16:47 UTC (rev 4398) @@ -204,10 +204,10 @@ using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) { m_sVeraIPAddress = xmlreader.GetValueAsString("veracontroller", "ipaddress", "127.0.0.1"); - m_sVeraTCPIPPort = xmlreader.GetValueAsString("veracontroller", "portnumber", "49451"); - m_sVeraIPAddress = "192.10.1.240"; + m_sVeraTCPIPPort = xmlreader.GetValueAsString("veracontroller", "portnumber", "3480"); + //m_sVeraIPAddress = "192.10.1.240"; // m_sVeraIPAddress = "demo.mios.com"; - m_sVeraTCPIPPort = "3480"; + // m_sVeraTCPIPPort = "3480"; // Fill action table (config settings) for (Actiontrigger i = 0; i < Actiontrigger.LAST_ACTIONTRIGGER; i++) @@ -397,9 +397,15 @@ return response; } + public bool isVeraAlive(string ip, string port) + { + string response = retrieveURL("http://" + ip + ":" + port + "/data_request?id=lu_alive&time="+DateTime.Now.Ticks); + + return (response == "OK"); + } + public string doVeraRequest( string param ) { - return retrieveURL("http://" + vera_Address + "/data_request" + param + "&time="+DateTime.Now.Ticks); } @@ -425,7 +431,7 @@ return response; } - private long getSecondsSince1970() + public long getSecondsSince1970() { return (DateTime.Now.Ticks / 10000000); } @@ -480,7 +486,7 @@ public string vera_Address { - get { return m_sVeraIPAddress + " : " +m_sVeraTCPIPPort; } + get { return m_sVeraIPAddress + ":" +m_sVeraTCPIPPort; } set { } } } Modified: trunk/plugins/VeraControl/VeraControl.cs =================================================================== --- trunk/plugins/VeraControl/VeraControl.cs 2012-01-08 21:54:57 UTC (rev 4397) +++ trunk/plugins/VeraControl/VeraControl.cs 2012-01-08 22:16:47 UTC (rev 4398) @@ -31,6 +31,10 @@ [assembly: UsesSubsystem("MP.SkinEngine")] [assembly: UsesSubsystem("MP.Config")] +// TODO: support multiple Vera Box +// TODO: get all boxes for a specific user (http://sta1.mios.com/locator_json.php?username=<user>) +// TODO: support remote vera Boxes (http://fwd1.mios.com/<name>/<pass>/<serial>/data_request?...) + namespace VeraControl { public enum Actiontrigger Modified: trunk/plugins/VeraControl/VeraSetupForm.Designer.cs =================================================================== --- trunk/plugins/VeraControl/VeraSetupForm.Designer.cs 2012-01-08 21:54:57 UTC (rev 4397) +++ trunk/plugins/VeraControl/VeraSetupForm.Designer.cs 2012-01-08 22:16:47 UTC (rev 4398) @@ -33,6 +33,8 @@ this.labelIPaddress = new System.Windows.Forms.Label(); this.IPaddress = new System.Windows.Forms.TextBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.ConnectionResponse = new System.Windows.Forms.Label(); + this.CheckConnection = new System.Windows.Forms.Button(); this.labelPortNumber = new System.Windows.Forms.Label(); this.portnumber = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); @@ -46,7 +48,7 @@ // btnOK // this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.btnOK.Location = new System.Drawing.Point(31, 194); + this.btnOK.Location = new System.Drawing.Point(31, 236); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(75, 23); this.btnOK.TabIndex = 3; @@ -58,7 +60,7 @@ // this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(231, 194); + this.btnCancel.Location = new System.Drawing.Point(231, 236); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(75, 23); this.btnCancel.TabIndex = 4; @@ -88,17 +90,36 @@ // // groupBox1 // + this.groupBox1.Controls.Add(this.ConnectionResponse); + this.groupBox1.Controls.Add(this.CheckConnection); this.groupBox1.Controls.Add(this.labelPortNumber); this.groupBox1.Controls.Add(this.portnumber); this.groupBox1.Controls.Add(this.labelIPaddress); this.groupBox1.Controls.Add(this.IPaddress); this.groupBox1.Location = new System.Drawing.Point(12, 12); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(311, 78); + this.groupBox1.Size = new System.Drawing.Size(311, 121); this.groupBox1.TabIndex = 5; this.groupBox1.TabStop = false; this.groupBox1.Text = "Vera Box -setting"; // + // ConnectionResponse + // + this.ConnectionResponse.Location = new System.Drawing.Point(168, 88); + this.ConnectionResponse.Name = "ConnectionResponse"; + this.ConnectionResponse.Size = new System.Drawing.Size(123, 19); + this.ConnectionResponse.TabIndex = 7; + // + // CheckConnection + // + this.CheckConnection.Location = new System.Drawing.Point(19, 84); + this.CheckConnection.Name = "CheckConnection"; + this.CheckConnection.Size = new System.Drawing.Size(136, 23); + this.CheckConnection.TabIndex = 6; + this.CheckConnection.Text = "Check Connection"; + this.CheckConnection.UseVisualStyleBackColor = true; + this.CheckConnection.Click += new System.EventHandler(this.CheckConnection_Click); + // // labelPortNumber // this.labelPortNumber.AutoSize = true; @@ -118,7 +139,7 @@ this.portnumber.Name = "portnumber"; this.portnumber.Size = new System.Drawing.Size(205, 20); this.portnumber.TabIndex = 2; - this.portnumber.Text = "49451"; + this.portnumber.Text = "3480"; // // label1 // @@ -146,7 +167,7 @@ this.groupBox2.Controls.Add(this.enableSceneTrigger); this.groupBox2.Controls.Add(this.refreshdelay); this.groupBox2.Controls.Add(this.label1); - this.groupBox2.Location = new System.Drawing.Point(14, 96); + this.groupBox2.Location = new System.Drawing.Point(11, 139); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(309, 82); this.groupBox2.TabIndex = 8; @@ -168,7 +189,7 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(332, 229); + this.ClientSize = new System.Drawing.Size(332, 271); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Controls.Add(this.btnCancel); @@ -183,6 +204,8 @@ this.groupBox2.PerformLayout(); this.ResumeLayout(false); } + private System.Windows.Forms.Label ConnectionResponse; + private System.Windows.Forms.Button CheckConnection; private System.Windows.Forms.CheckBox enableSceneTrigger; private System.Windows.Forms.GroupBox groupBox2; private System.Windows.Forms.TextBox refreshdelay; Modified: trunk/plugins/VeraControl/VeraSetupForm.cs =================================================================== --- trunk/plugins/VeraControl/VeraSetupForm.cs 2012-01-08 21:54:57 UTC (rev 4397) +++ trunk/plugins/VeraControl/VeraSetupForm.cs 2012-01-08 22:16:47 UTC (rev 4398) @@ -25,6 +25,8 @@ using MediaPortal.Configuration; using MediaPortal.UserInterface.Controls; using MediaPortal.Profile; +using VeraControl.Properties; +using System.Net; namespace MediaPortal.GUI.VeraSetupForm { @@ -70,5 +72,49 @@ Close(); } + + void CheckConnection_Click(object sender, EventArgs e) + { + ConnectionResponse.Text = "testing"; + ConnectionResponse.Update(); + + try { + WebClient webClient = new WebClient(); + + Uri url = new Uri("http://" + IPaddress.Text + ":" + portnumber.Text + "/data_request?id=lu_alive&time="+DateTime.Now.Ticks); + webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(OnAsyncCompletedEventArgs); + webClient.DownloadStringAsync(url); + + int cnt = 0; + long time = VeraCommunication.Instance.getSecondsSince1970(); + while (webClient.IsBusy) + { + if (time != VeraCommunication.Instance.getSecondsSince1970()) + { + cnt++; + time = VeraCommunication.Instance.getSecondsSince1970(); + ConnectionResponse.Text = "testing" + new string('.', cnt % 10); + ConnectionResponse.Update(); + } + } + } + catch + { + ConnectionResponse.Text = "Bad response"; + } + } + + void OnAsyncCompletedEventArgs(Object sender, DownloadStringCompletedEventArgs e) + { + //if (VeraCommunication.Instance.isVeraAlive(IPaddress.Text, portnumber.Text)) + if (!e.Cancelled && e.Error == null && (string)e.Result == "OK") + { + ConnectionResponse.Text = "- Ok -"; + } + else + { + ConnectionResponse.Text = "ERR: Time out"; + } + } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-08 21:55:03
|
Revision: 4397 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4397&view=rev Author: BartEv Date: 2012-01-08 21:54:57 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/VeraControl.xmp2 trunk/plugins/VeraControl/releases/VeraControl_v0.5.1.0.mpe1 trunk/plugins/VeraControl/releases/update.xml Modified: trunk/plugins/VeraControl/releases/VeraControl.xmp2 =================================================================== --- trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-08 21:39:53 UTC (rev 4396) +++ trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-08 21:54:57 UTC (rev 4397) @@ -797,21 +797,21 @@ <Build>1</Build> <Revision>0</Revision> </Version> - <ExtensionDescription>Control your Vera controller from MediaPortal. -Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... - -Vera is a Z-wave home automation controller from MicasaVerde. -This version is tested with: - - Vera 1 v1.1.1338 - - Vera 2 v1.1.1267 - - Vera 2 v1.5.255 - - + <ExtensionDescription>Control your Vera controller from MediaPortal. +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... + +Vera is a Z-wave home automation controller from MicasaVerde. +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.5.255 + + </ExtensionDescription> <VersionDescription>Improved Vera response handling</VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/</OnlineLocation> - <ReleaseDate>2012-01-05T22:51:05</ReleaseDate> + <ReleaseDate>2012-01-08T22:51:05</ReleaseDate> <Tags>home automation, z-wave, micasaverde, Modified: trunk/plugins/VeraControl/releases/VeraControl_v0.5.1.0.mpe1 =================================================================== (Binary files differ) Modified: trunk/plugins/VeraControl/releases/update.xml =================================================================== --- trunk/plugins/VeraControl/releases/update.xml 2012-01-08 21:39:53 UTC (rev 4396) +++ trunk/plugins/VeraControl/releases/update.xml 2012-01-08 21:54:57 UTC (rev 4397) @@ -370,21 +370,21 @@ <Build>1</Build> <Revision>0</Revision> </Version> - <ExtensionDescription>Control your Vera controller from MediaPortal. -Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... - -Vera is a Z-wave home automation controller from MicasaVerde. -This version is tested with: - - Vera 1 v1.1.1338 - - Vera 2 v1.1.1267 - - Vera 2 v1.5.255 - - + <ExtensionDescription>Control your Vera controller from MediaPortal. +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... + +Vera is a Z-wave home automation controller from MicasaVerde. +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.5.255 + + </ExtensionDescription> <VersionDescription>Improved Vera response handling</VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/</OnlineLocation> - <ReleaseDate>2012-01-05T22:51:05</ReleaseDate> + <ReleaseDate>2012-01-08T22:51:05</ReleaseDate> <Tags>home automation, z-wave, micasaverde, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-08 21:40:00
|
Revision: 4396 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4396&view=rev Author: BartEv Date: 2012-01-08 21:39:53 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/VeraControl_v0.5.1.0.mpe1 Modified: trunk/plugins/VeraControl/releases/VeraControl_v0.5.1.0.mpe1 =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-08 21:36:15
|
Revision: 4395 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4395&view=rev Author: BartEv Date: 2012-01-08 21:36:09 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/VeraControl.xmp2 trunk/plugins/VeraControl/releases/VeraControl_v0.5.1.0.mpe1 trunk/plugins/VeraControl/releases/update.xml Modified: trunk/plugins/VeraControl/releases/VeraControl.xmp2 =================================================================== --- trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-08 19:33:34 UTC (rev 4394) +++ trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-08 21:36:09 UTC (rev 4395) @@ -759,7 +759,7 @@ <Revision>27644</Revision> </MaxVersion> <WarnOnly>false</WarnOnly> - <Message>requires MediaPortal version 1.1.0.0 to 1.5.9.255.</Message> + <Message>requires MediaPortal version 1.1.6.27644 to 1.1.6.27644</Message> <Name>MediaPortal</Name> </DependencyItem> </Items> @@ -797,16 +797,16 @@ <Build>1</Build> <Revision>0</Revision> </Version> - <ExtensionDescription>Control your Vera controller from MediaPortal. -Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... - -Vera is a Z-wave home automation controller from MicasaVerde. -This version is tested with: - - Vera 1 v1.1.1338 - - Vera 2 v1.1.1267 - - Vera 2 v1.5.255 - - + <ExtensionDescription>Control your Vera controller from MediaPortal. +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... + +Vera is a Z-wave home automation controller from MicasaVerde. +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.5.255 + + </ExtensionDescription> <VersionDescription>Improved Vera response handling</VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> Modified: trunk/plugins/VeraControl/releases/VeraControl_v0.5.1.0.mpe1 =================================================================== (Binary files differ) Modified: trunk/plugins/VeraControl/releases/update.xml =================================================================== --- trunk/plugins/VeraControl/releases/update.xml 2012-01-08 19:33:34 UTC (rev 4394) +++ trunk/plugins/VeraControl/releases/update.xml 2012-01-08 21:36:09 UTC (rev 4395) @@ -322,17 +322,17 @@ <MinVersion> <Major>1</Major> <Minor>1</Minor> - <Build>0</Build> - <Revision>0</Revision> + <Build>6</Build> + <Revision>27644</Revision> </MinVersion> <MaxVersion> <Major>1</Major> - <Minor>5</Minor> - <Build>9</Build> - <Revision>255</Revision> + <Minor>1</Minor> + <Build>6</Build> + <Revision>27644</Revision> </MaxVersion> <WarnOnly>false</WarnOnly> - <Message>requires MediaPortal version 1.1.0.0 to 1.5.9.255.</Message> + <Message>requires MediaPortal version 1.1.6.27644 to 1.1.6.27644</Message> <Name>MediaPortal</Name> </DependencyItem> </Items> @@ -370,16 +370,16 @@ <Build>1</Build> <Revision>0</Revision> </Version> - <ExtensionDescription>Control your Vera controller from MediaPortal. -Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... - -Vera is a Z-wave home automation controller from MicasaVerde. -This version is tested with: - - Vera 1 v1.1.1338 - - Vera 2 v1.1.1267 - - Vera 2 v1.5.255 - - + <ExtensionDescription>Control your Vera controller from MediaPortal. +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... + +Vera is a Z-wave home automation controller from MicasaVerde. +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.5.255 + + </ExtensionDescription> <VersionDescription>Improved Vera response handling</VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-08 19:33:42
|
Revision: 4394 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4394&view=rev Author: BartEv Date: 2012-01-08 19:33:34 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/DevCategories.cs trunk/plugins/VeraControl/DeviceDimmer.cs trunk/plugins/VeraControl/DeviceDoorlock.cs trunk/plugins/VeraControl/DeviceGWeather.cs trunk/plugins/VeraControl/DeviceGeneric.cs trunk/plugins/VeraControl/DeviceHumidity.cs trunk/plugins/VeraControl/DeviceLightSensor.cs trunk/plugins/VeraControl/DevicePowerMeter.cs trunk/plugins/VeraControl/DeviceSecurity.cs trunk/plugins/VeraControl/DeviceSprinkler.cs trunk/plugins/VeraControl/DeviceSwitch.cs trunk/plugins/VeraControl/DeviceTemperature.cs trunk/plugins/VeraControl/DeviceThermostat.cs trunk/plugins/VeraControl/DialogActionTrigger.cs trunk/plugins/VeraControl/DialogDeviceControl.cs trunk/plugins/VeraControl/Properties/AssemblyInfo.cs trunk/plugins/VeraControl/Room.cs trunk/plugins/VeraControl/Scene.cs trunk/plugins/VeraControl/Section.cs trunk/plugins/VeraControl/VeraCommunication.cs trunk/plugins/VeraControl/VeraControl.cs trunk/plugins/VeraControl/VeraControl.csproj trunk/plugins/VeraControl/skin/Default/VeraControl.xml trunk/plugins/VeraControl/skin/Default/VeraDialogDeviceControl.xml trunk/plugins/VeraControl/skin/DefaultWide/VeraDialogDeviceControl.xml Added Paths: ----------- trunk/plugins/VeraControl/VeraHelper.cs trunk/plugins/VeraControl/skin/Media/Vera/Ip_Camera.png trunk/plugins/VeraControl/skin/Media/Vera/location.png Modified: trunk/plugins/VeraControl/DevCategories.cs =================================================================== --- trunk/plugins/VeraControl/DevCategories.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DevCategories.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -20,21 +20,20 @@ { public DevCategories(XmlNode xn) { - if (xn == null) { - m_sName = ""; - m_iId = 0; - } else { + if (xn != null) + { update(xn); } } - private string m_sName; - private int m_iId; + private string m_sName = "unknown category"; + private int m_iId = 0; + public VeraHelper helper = VeraHelper.Instance; public bool update(XmlNode xn) { - m_sName = xn.Attributes["name"].Value; - m_iId = int.Parse(xn.Attributes["id"].Value); + m_sName = helper.getAttrAsString(xn, "name", m_sName); + m_iId = helper.getAttrAsInt (xn, "id", m_iId); return true; } Modified: trunk/plugins/VeraControl/DeviceDimmer.cs =================================================================== --- trunk/plugins/VeraControl/DeviceDimmer.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceDimmer.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -18,8 +18,9 @@ /// </summary> public class DeviceDimmer : DeviceGeneric { - private int m_iLevel; - private string m_sWatt; + private int m_iLevel = 0; + private string m_sWatt = "-"; + private string m_sKwh = "-"; public DeviceDimmer( XmlNode xn ): base (xn) { @@ -31,8 +32,9 @@ public override bool update(XmlNode xn) { - m_iLevel = (xn.Attributes["level"] != null ? int.Parse(xn.Attributes["level"].Value) : 0); - m_sWatt = (xn.Attributes["watts"] != null ? xn.Attributes["watts"].Value : "0"); + m_iLevel = helper.getAttrAsInt (xn, "level", m_iLevel); + m_sWatt = helper.getAttrAsString(xn, "watts", m_sWatt); + m_sKwh = helper.getAttrAsString(xn, "kwh", m_sKwh); return base.update(xn); } @@ -43,7 +45,7 @@ set { } } - public override bool state + public override bool status { get { return (m_iLevel > 0); } set { @@ -62,12 +64,14 @@ } else { if (newValue < 0) { newValue = 0; } } - VeraCommunication vera = VeraCommunication.Instance; - // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ - "&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget" + - "&newLoadlevelTarget="+value; - string sResult = vera.doVeraRequest(cmd); + if (id > 0) // Only send when a valid ID is found + { + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-org:serviceId:Dimming1&action=SetLoadLevelTarget" + + "&newLoadlevelTarget="+value; + vera.doVeraRequest(cmd); + } m_iLevel = newValue; } } @@ -100,9 +104,15 @@ return "Dimmable_Light_"+leveltxt; } + + public override string getExtraText() + { + return (m_sKwh != "" ? m_sKwh + "kWh" : ""); + } + public override string getStatusText() { - return ( state ? level.ToString() + "%" : "Off"); + return ( status ? level.ToString() + "%" : "Off"); } } } Modified: trunk/plugins/VeraControl/DeviceDoorlock.cs =================================================================== --- trunk/plugins/VeraControl/DeviceDoorlock.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceDoorlock.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -18,7 +18,7 @@ /// </summary> public class DeviceDoorlock : DeviceGeneric { - private bool m_bStatus; + private bool m_bStatus = false; public DeviceDoorlock( XmlNode xn ): base (xn) { @@ -30,21 +30,23 @@ public override bool update(XmlNode xn) { - m_bStatus = (xn.Attributes["status"].Value == "1"); + m_bStatus = helper.getAttrAsBool(xn, "status", m_bStatus); return base.update(xn); } - public override bool state + public override bool status { get { return m_bStatus; } set { - VeraCommunication vera = VeraCommunication.Instance; - // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ - "&serviceId=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget" + - "&newTargetValue="+(value ? "1" : "0"); - string sResult = vera.doVeraRequest(cmd); + if (id > 0) // Only send when a valid ID is found + { + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:micasaverde-com:serviceId:DoorLock1&action=SetTarget" + + "&newTargetValue="+(value ? "1" : "0"); + vera.doVeraRequest(cmd); + } m_bStatus = value; } } @@ -54,7 +56,7 @@ get { return (m_bStatus ? 1 : 0); } set { - state = (value > 0); + status = (value > 0); } } @@ -82,7 +84,7 @@ public override string getStatusText() { - return (state ? "Locked" : "Unlocked"); + return (status ? "Locked" : "Unlocked"); } } Modified: trunk/plugins/VeraControl/DeviceGWeather.cs =================================================================== --- trunk/plugins/VeraControl/DeviceGWeather.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceGWeather.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -18,8 +18,8 @@ /// </summary> public class DeviceGWeather : DeviceGeneric { - private string m_sCondition; - private string m_sWindCondition; + private string m_sCondition = "-"; + private string m_sWindCondition = "-"; public DeviceGWeather( XmlNode xn ): base (xn) { @@ -31,8 +31,10 @@ public override bool update(XmlNode xn) { - m_sCondition = (xn.Attributes["Condition"] != null ? xn.Attributes["Condition"].Value : "-"); - m_sWindCondition = (xn.Attributes["WindCondition"] != null ? xn.Attributes["WindCondition"].Value : "-"); + m_sCondition = helper.getAttrAsString(xn, "Condition", m_sCondition); // Google Weather Plugin + m_sCondition = helper.getAttrAsString(xn, "condition", m_sCondition); // World Weather plugin + m_sWindCondition = helper.getAttrAsString(xn, "WindCondition", m_sWindCondition); + m_sWindCondition = helper.getAttrAsString(xn, "windcondition", m_sWindCondition); return base.update(xn); } @@ -50,5 +52,10 @@ { return m_sWindCondition; } + + public override string getIconName() + { + return "location"; + } } } Modified: trunk/plugins/VeraControl/DeviceGeneric.cs =================================================================== --- trunk/plugins/VeraControl/DeviceGeneric.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceGeneric.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -4,8 +4,8 @@ * Date: 22-12-2011 * Time: 13:07 * - * Copyright: 2012 GPL - Bart Eversdijk - * MediaPort plugin - MicasaVerde (TM) Vera Controller + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller * E-mail: ba...@ev... */ using System; @@ -14,17 +14,26 @@ namespace VeraControl.Properties { + + /// <summary> /// Description of DeviceGeneric. /// </summary> public class DeviceGeneric { - private string m_sName = ""; + private string m_sName = "unknown device"; private int m_iId = 0; private string m_sAltId = ""; private int m_iCategory = 0; private int m_iRoom = 0; + // not connected (-2), none (-1), pending (0,1,5,6), success(4), error (2,3) + private DevState m_dsState = DevState.NONE; + private string m_sComment = ""; // red(error), green(success) or blue(pending) - icon/text + + public VeraHelper helper = VeraHelper.Instance; + public VeraCommunication vera = VeraCommunication.Instance; + public DeviceGeneric(XmlNode xn) { if (xn != null) @@ -35,11 +44,29 @@ public virtual bool update(XmlNode xn) { - m_sName = xn.Attributes["name"].Value; - m_iId = int.Parse(xn.Attributes["id"].Value); - m_sAltId = xn.Attributes["altid"].Value; - m_iCategory = int.Parse(xn.Attributes["category"].Value); - m_iRoom = int.Parse(xn.Attributes["room"].Value); + m_sName = helper.getAttrAsString(xn, "name", m_sName); + m_iId = helper.getAttrAsInt (xn, "id", m_iId); + m_sAltId = helper.getAttrAsString(xn, "altid", m_sAltId); + m_iCategory = helper.getAttrAsInt (xn, "category", m_iCategory); + m_iRoom = helper.getAttrAsInt (xn, "room", m_iRoom); + + m_sComment = helper.getAttrAsString(xn, "comment", m_sComment ); + m_dsState = helper.toDevState(helper.getAttrAsInt(xn, "state", -1)); + + if (m_iId == 0) + { + // void device no further processing needed + return true; + } + // Make sure room exists + if (m_iRoom == 0 || !vera.status.isRoomFound(m_iRoom)) + { + if (!vera.status.isRoomFound(0)) + { // create dummy room to attach to + vera.rooms.Add(new Room(null)); + } + m_iRoom = 0; + } return true; } @@ -88,9 +115,21 @@ get { return false; } set { } } - - public virtual bool state + + public virtual DevState commstate { + get { return m_dsState; } + set { } + } + + public virtual string comment + { + get { return (commstate != DevState.NONE ? m_sComment : ""); } + set { } + } + + public virtual bool status + { get { return false; } set { } } Modified: trunk/plugins/VeraControl/DeviceHumidity.cs =================================================================== --- trunk/plugins/VeraControl/DeviceHumidity.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceHumidity.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -18,7 +18,7 @@ /// </summary> public class DeviceHumidity : DeviceGeneric { - private int m_iLevel; + private int m_iLevel = 0; public DeviceHumidity( XmlNode xn ): base (xn) { @@ -30,7 +30,7 @@ public override bool update(XmlNode xn) { - m_iLevel = int.Parse(xn.Attributes["humidity"].Value); + m_iLevel = helper.getAttrAsInt(xn, "humidity", m_iLevel); return base.update(xn); } Modified: trunk/plugins/VeraControl/DeviceLightSensor.cs =================================================================== --- trunk/plugins/VeraControl/DeviceLightSensor.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceLightSensor.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -18,7 +18,7 @@ /// </summary> public class DeviceLightSensor : DeviceGeneric { - private int m_iLevel; + private int m_iLevel = 0; public DeviceLightSensor( XmlNode xn ): base (xn) { @@ -30,11 +30,12 @@ public override bool update(XmlNode xn) { - m_iLevel = (xn.Attributes["level"] != null ? int.Parse(xn.Attributes["level"].Value) : 0); + m_iLevel = helper.getAttrAsInt(xn, "level", m_iLevel); + m_iLevel = helper.getAttrAsInt(xn, "light", m_iLevel); return base.update(xn); } - public override bool state + public override bool status { get { return (m_iLevel > 0); } set { } Modified: trunk/plugins/VeraControl/DevicePowerMeter.cs =================================================================== --- trunk/plugins/VeraControl/DevicePowerMeter.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DevicePowerMeter.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -18,7 +18,8 @@ /// </summary> public class DevicePowerMeter : DeviceGeneric { - private int m_iLevel; + private int m_iLevel = 0; + private string m_sKwh = ""; public DevicePowerMeter( XmlNode xn ): base (xn) { @@ -30,7 +31,8 @@ public override bool update(XmlNode xn) { - m_iLevel = (xn.Attributes["level"] != null ? int.Parse(xn.Attributes["watts"].Value) : 0); + m_iLevel = helper.getAttrAsInt (xn, "watts", m_iLevel); + m_sKwh = helper.getAttrAsString(xn, "kwh", m_sKwh); return base.update(xn); } @@ -40,7 +42,7 @@ set { } } - public override bool state + public override bool status { get { return (m_iLevel > 0); } set { } @@ -68,6 +70,11 @@ return "Power_Meter"; } + public override string getExtraText() + { + return (m_sKwh != "" ? m_sKwh + "kWh" : ""); + } + public override string getStatusText() { return level.ToString() + "W"; Modified: trunk/plugins/VeraControl/DeviceSecurity.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSecurity.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceSecurity.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -19,8 +19,8 @@ /// </summary> public class DeviceSecurity: DeviceGeneric { - private bool m_bTripped; - private bool m_bArmed; + private bool m_bTripped = false; + private bool m_bArmed = true; public DeviceSecurity( XmlNode xn ): base (xn) { @@ -32,20 +32,23 @@ public override bool update(XmlNode xn) { - m_bTripped = (xn.Attributes["tripped"].Value == "1"); - m_bArmed = (xn.Attributes["armed"].Value == "1"); + m_bTripped = helper.getAttrAsBool(xn, "tripped", m_bTripped); + m_bArmed = helper.getAttrAsBool(xn, "armed", m_bArmed); return base.update(xn); } - public override bool state + public override bool status { get { return m_bArmed; } - set { VeraCommunication vera = VeraCommunication.Instance; - // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ - "&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&action=SetArmed" + - "&newArmedValue=" + (value ? "1" : "0"); - string sResult = vera.doVeraRequest(cmd); + set { + if (id > 0) // Only send when a valid ID is found + { + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:micasaverde-com:serviceId:SecuritySensor1&action=SetArmed" + + "&newArmedValue=" + (value ? "1" : "0"); + vera.doVeraRequest(cmd); + } m_bArmed = value; } } @@ -59,7 +62,7 @@ public override int level { get { return (m_bArmed ? 1 : 0); } - set { state = (value > 0); } + set { status = (value > 0); } } public override int maxLevel @@ -84,7 +87,7 @@ public override string getStatusText() { - return (state ? ( tripped ? "TRIPPED" : "standby") : "bypass"); + return (status ? ( tripped ? "TRIPPED" : "standby") : "bypass"); } public override string[] getCommands() Modified: trunk/plugins/VeraControl/DeviceSprinkler.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSprinkler.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceSprinkler.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -19,11 +19,11 @@ /// </summary> public class DeviceSprinkler : DeviceGeneric { - private bool m_bStatus; - private string m_sMode; - private string m_sShortMode; - private string m_sOperationMode; - private string m_sCondition; + private bool m_bStatus = false; + private string m_sMode = "-"; + private string m_sShortMode = "-"; + private string m_sOperationMode = "-"; + private string m_sCondition = "-"; public DeviceSprinkler( XmlNode xn ): base (xn) { @@ -35,24 +35,26 @@ public override bool update(XmlNode xn) { - m_bStatus = (xn.Attributes["status"].Value == "1"); - m_sMode = (xn.Attributes["Mode"] != null ? xn.Attributes["Mode"].Value : "-"); - m_sShortMode = (xn.Attributes["ShortMode"] != null ? xn.Attributes["ShortMode"].Value : "-"); - m_sOperationMode = (xn.Attributes["OperationMode"] != null ? xn.Attributes["OperationMode"].Value : "-"); - m_sCondition = (xn.Attributes["Condition"] != null ? xn.Attributes["Condition"].Value : "-"); + m_bStatus = helper.getAttrAsBool (xn, "status", m_bStatus); + m_sMode = helper.getAttrAsString(xn, "Mode", m_sMode); + m_sShortMode = helper.getAttrAsString(xn, "ShortMode", m_sShortMode); + m_sOperationMode = helper.getAttrAsString(xn, "OperationMode", m_sOperationMode); + m_sCondition = helper.getAttrAsString(xn, "Condition", m_sCondition); return base.update(xn); } - public override bool state + public override bool status { get { return m_bStatus; } set { - VeraCommunication vera = VeraCommunication.Instance; - // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ - "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + - "&newTargetValue="+(value ? "1" : "0"); - string sResult = vera.doVeraRequest(cmd); + if (id > 0) // Only send when a valid ID is found + { + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + + "&newTargetValue="+(value ? "1" : "0"); + vera.doVeraRequest(cmd); + } m_bStatus = value; } } @@ -60,19 +62,21 @@ public override int level { get { return (m_bStatus ? 1 : 0); } - set { state = (value > 0); } + set { status = (value > 0); } } public override string mode { get { return m_sMode; } set { - VeraCommunication vera = VeraCommunication.Instance; - // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ - "&serviceId=urn:upnp-micasaverde-com:serviceId:Sprinkler1&action=" + - (value == "Auto" ? "SetModeAuto" : (value == "Block" ? "SetModeBlock" : "SetModeManual")); - string sResult = vera.doVeraRequest(cmd); + if (id > 0) // Only send when a valid ID is found + { + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-micasaverde-com:serviceId:Sprinkler1&action=" + + (value == "Auto" ? "SetModeAuto" : (value == "Block" ? "SetModeBlock" : "SetModeManual")); + vera.doVeraRequest(cmd); + } m_sMode = value; } } @@ -108,8 +112,6 @@ { return m_sCondition; } - - public override string [] getCommands() { Modified: trunk/plugins/VeraControl/DeviceSwitch.cs =================================================================== --- trunk/plugins/VeraControl/DeviceSwitch.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceSwitch.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -18,8 +18,9 @@ /// </summary> public class DeviceSwitch : DeviceGeneric { - private bool m_bStatus; - private string m_sWatt; + private bool m_bStatus = false; + private string m_sWatt = "-"; + private string m_sKwh = "-"; public DeviceSwitch( XmlNode xn ): base (xn) { @@ -31,8 +32,10 @@ public override bool update(XmlNode xn) { - m_bStatus = (xn.Attributes["status"].Value == "1"); - m_sWatt = (xn.Attributes["watts"] != null ? xn.Attributes["watts"].Value : "0"); + m_bStatus = helper.getAttrAsBool (xn, "status", m_bStatus); + m_sWatt = helper.getAttrAsString(xn, "watts", m_sWatt); + m_sKwh = helper.getAttrAsString(xn, "kwh", m_sKwh); + return base.update(xn); } @@ -42,16 +45,18 @@ set { } } - public override bool state + public override bool status { get { return m_bStatus; } set { - VeraCommunication vera = VeraCommunication.Instance; - // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ - "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + - "&newTargetValue="+(value ? "1" : "0"); - string sResult = vera.doVeraRequest(cmd); + if (id > 0) // Only send when a valid ID is found + { + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget" + + "&newTargetValue="+(value ? "1" : "0"); + vera.doVeraRequest(cmd); + } m_bStatus = value; } } @@ -59,7 +64,7 @@ public override int level { get { return (m_bStatus ? 1 : 0); } - set { state = (value > 0); } + set { status = (value > 0); } } public override int maxLevel @@ -84,9 +89,14 @@ return "Binary_Light_" + (m_bStatus ? "100" : "0"); } + public override string getExtraText() + { + return (m_sKwh != "" ? m_sKwh + "kWh" : ""); + } + public override string getStatusText() { - return (state ? "On" : "Off"); + return (status ? "On" : "Off"); } } } Modified: trunk/plugins/VeraControl/DeviceTemperature.cs =================================================================== --- trunk/plugins/VeraControl/DeviceTemperature.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceTemperature.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -18,8 +18,8 @@ /// </summary> public class DeviceTemperature : DeviceGeneric { - public int m_iLevel; - private bool m_bMetric = true; + public string m_sTemp = "0"; // public thermostat class + private bool m_bMetric = true; public DeviceTemperature( XmlNode xn, bool bMetric ): base (xn) { @@ -32,13 +32,13 @@ public override bool update(XmlNode xn) { - m_iLevel = (xn.Attributes["temperature"] != null ? int.Parse(xn.Attributes["temperature"].Value) : 0); + m_sTemp = helper.getAttrAsString(xn, "temperature", m_sTemp); return base.update(xn); } public override int level { - get { return m_iLevel; } + get { return int.Parse(m_sTemp); } set { } } @@ -66,7 +66,7 @@ public override string getStatusText() { - return level + (m_bMetric ? "°C" : "F"); + return m_sTemp + (m_bMetric ? "°C" : "°F"); } } Modified: trunk/plugins/VeraControl/DeviceThermostat.cs =================================================================== --- trunk/plugins/VeraControl/DeviceThermostat.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DeviceThermostat.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -18,10 +18,10 @@ /// </summary> public class DeviceThermostat : DeviceTemperature { - private bool m_bMetric = true; - private string m_sFan = ""; - private string m_sState = "Off"; // "Off', "Idle", "Heating", "Cooling", "FanOnly", "PendingHeat", "PendingCool", "Vent" - private string m_sMode = "Off"; // "Off', "InDeadBand", "HeatOn", "CoolOn", "AutoChangeOver", "AuxHeatOn", "EconomyHeatOn", "EmergencyHeatOn", + private bool m_bMetric = true; + private string m_sFanMode = ""; + private string m_sHvacState = "Off"; // "Off', "Idle", "Heating", "Cooling", "FanOnly", "PendingHeat", "PendingCool", "Vent" + private string m_sMode = "Off"; // "Off', "InDeadBand", "HeatOn", "CoolOn", "AutoChangeOver", "AuxHeatOn", "EconomyHeatOn", "EmergencyHeatOn", // "AuxCoolOn", "EconomyCoolOn", "BuildingProtection", "EnergySavingsHeating", "EnergySavingsCooling" public DeviceThermostat( XmlNode xn, bool bMetric ): base (xn, bMetric) @@ -35,14 +35,14 @@ public override bool update(XmlNode xn) { - m_iLevel = (xn.Attributes["temperature"] != null ? int.Parse(xn.Attributes["temperature"].Value) : 0); - m_sFan = (xn.Attributes["fan"] != null ? xn.Attributes["fn"].Value : "Off"); - m_sState = (xn.Attributes["hvacstate"] != null ? xn.Attributes["hvacstate"].Value : "Off"); - m_sMode = (xn.Attributes["mode"] != null ? xn.Attributes["mode"].Value : "Off"); + m_sTemp = helper.getAttrAsString(xn, "temperature", m_sTemp); + m_sFanMode = helper.getAttrAsString(xn, "fanmode", m_sFanMode); + m_sHvacState = helper.getAttrAsString(xn, "hvacstate", m_sHvacState); + m_sMode = helper.getAttrAsString(xn, "mode", m_sMode); return base.update(xn); } - public override bool state + public override bool status { get { return (mode != "Off"); } set { mode = (value ? "Auto" : "Off"); } @@ -58,13 +58,15 @@ { get { return m_sMode; } set { - VeraCommunication vera = VeraCommunication.Instance; - // Do something with vera - string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ - "&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget" + - "&NewModeTarget="+(value == "Off" ? "Off" : (value == "Cool" ? "CoolOn" : (value == "Heat" ? "HeatOn" : "AutoChangeOver")) - ); - string sResult = vera.doVeraRequest(cmd); + if (id > 0) // Only send when a valid ID is found + { + // Do something with vera + string cmd = "?id=lu_action&DeviceNum="+id.ToString()+ + "&serviceId=urn:upnp-org:serviceId:HVAC_UserOperatingMode1&action=SetModeTarget" + + "&NewModeTarget="+(value == "Off" ? "Off" : (value == "Cool" ? "CoolOn" : (value == "Heat" ? "HeatOn" : "AutoChangeOver")) + ); + vera.doVeraRequest(cmd); + } m_sMode = value; } } @@ -93,7 +95,7 @@ public override string getExtraText() { - return m_sState + " - Fan : " + m_sFan + " - " + m_iLevel + (m_bMetric ? "°C" : "F") ; + return m_sHvacState + " - Fan : " + m_sFanMode + " - " + m_sTemp + (m_bMetric ? "°C" : "°F") ; } public override string getIconName() Modified: trunk/plugins/VeraControl/DialogActionTrigger.cs =================================================================== --- trunk/plugins/VeraControl/DialogActionTrigger.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DialogActionTrigger.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -65,6 +65,8 @@ [SkinControlAttribute(52)] protected GUISpinButton spMPExit = null; + private VeraCommunication vera = VeraCommunication.Instance; + public DialogActionTrigger() { GetID = (int)1974; @@ -89,7 +91,7 @@ // (P)re load spin contor for (int i = 0; i < spinList.Length; i++) { - initSpinButtons(spinList[i], VeraCommunication.Instance.actionTriggerTable[i]); + initSpinButtons(spinList[i], vera.actionTriggerTable[i]); } lblHeading.Label = strLine; @@ -97,13 +99,6 @@ public override bool Init() { - using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.MPSettings()) - { - for (Actiontrigger i = 0; i < Actiontrigger.LAST_ACTIONTRIGGER; i++) - { - VeraCommunication.Instance.actionTriggerTable[(int)i] = xmlreader.GetValueAsInt("veracontroller", i.ToString(), 0); - } - } return Load(GUIGraphicsContext.Skin + @"\VeraDialogActionTrigger.xml"); } @@ -128,10 +123,10 @@ int iSceneIndex = 0; spin.AddSpinLabel("- none -", 0); - for (int i = 0; i < VeraCommunication.Instance.scenes.Count; i++) + for (int i = 0; i < vera.scenes.Count; i++) { - spin.AddSpinLabel(shortString(VeraCommunication.Instance.scenes[i].name), VeraCommunication.Instance.scenes[i].id); - if (VeraCommunication.Instance.scenes[i].id == iSelectedScene) + spin.AddSpinLabel(shortString(vera.scenes[i].name), vera.scenes[i].id); + if (vera.scenes[i].id == iSelectedScene) { iSceneIndex = i + 1; // 0 is - none - } @@ -164,11 +159,11 @@ for (int i = 0; i < spinList.Length; i++) { if (spinList[i].SpinValue == 0) { - VeraCommunication.Instance.actionTriggerTable[i] = 0; + vera.actionTriggerTable[i] = 0; } else { - VeraCommunication.Instance.actionTriggerTable[i] = VeraCommunication.Instance.scenes[spinList[i].SpinValue - 1].id; + vera.actionTriggerTable[i] = vera.scenes[spinList[i].SpinValue - 1].id; } - xmlwritter.SetValue("veracontroller", ((Actiontrigger) i).ToString(), VeraCommunication.Instance.actionTriggerTable[i].ToString()); + xmlwritter.SetValue("veracontroller", ((Actiontrigger) i).ToString(), vera.actionTriggerTable[i].ToString()); } } } Modified: trunk/plugins/VeraControl/DialogDeviceControl.cs =================================================================== --- trunk/plugins/VeraControl/DialogDeviceControl.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/DialogDeviceControl.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -41,7 +41,9 @@ [SkinControl(13)] protected GUIButtonControl btnMode2 = null; [SkinControl(14)] protected GUIButtonControl btnMode3 = null; [SkinControl(15)] protected GUISliderControl slider = null; + [SkinControl(20)] protected GUIImage camImage = null; + DeviceGeneric myDev = null; public DialogDeviceControl() @@ -183,6 +185,17 @@ } } + public void SetCamImage(string url) + { + + camImage.Dispose(); + camImage.SetFileName(url); + camImage.AllocResources(); + camImage.KeepAspectRatio = true; + camImage.Visibility = System.Windows.Visibility.Visible; + imgLogo.Visibility = System.Windows.Visibility.Hidden; + } + public void SetImage(string filename) { imgLogo.Dispose(); Modified: trunk/plugins/VeraControl/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/VeraControl/Properties/AssemblyInfo.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/Properties/AssemblyInfo.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -16,7 +16,7 @@ [assembly: AssemblyProduct("VeraControl")] [assembly: AssemblyCopyright("Copyright 2012")] [assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("ba...@ev...")] +[assembly: AssemblyCulture("")] // This sets the default COM visibility of types in the assembly to invisible. // If you need to expose a type to COM, use [ComVisible(true)] on that type. Modified: trunk/plugins/VeraControl/Room.cs =================================================================== --- trunk/plugins/VeraControl/Room.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/Room.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -20,25 +20,40 @@ { public Room(XmlNode xn) { - if (xn == null) + if (xn != null) { - m_sName = ""; - m_iId = 0; - m_iSection = 0; - } else { update(xn); } } - private string m_sName; - private int m_iId; - private int m_iSection; + public VeraHelper helper = VeraHelper.Instance; + public VeraCommunication vera = VeraCommunication.Instance; + private string m_sName = "unknown room"; + private int m_iId = 0; + private int m_iSection = 0; + public bool update(XmlNode xn) { - m_sName = xn.Attributes["name"].Value; - m_iId = int.Parse(xn.Attributes["id"].Value); - m_iSection = int.Parse(xn.Attributes["section"].Value); + m_sName = helper.getAttrAsString(xn, "name", m_sName); + m_iId = helper.getAttrAsInt (xn, "id", m_iId); + m_iSection = helper.getAttrAsInt (xn, "section", m_iSection); + + if (m_iId == 0) + { + // void room no further processing needed + return true; + } + // Make sure room exists + if (m_iSection == 0 || !vera.status.isSectionFound(m_iSection)) + { + if (!vera.status.isSectionFound(0)) + { // create dummy room to attach to + vera.sections.Add(new Section(null)); + } + m_iSection = 0; + } + return true; } Modified: trunk/plugins/VeraControl/Scene.cs =================================================================== --- trunk/plugins/VeraControl/Scene.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/Scene.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -10,6 +10,7 @@ */ using System; using System.Xml; +using VeraControl; namespace VeraControl.Properties { @@ -20,28 +21,32 @@ { public Scene(XmlNode xn) { - if (xn == null) + if (xn != null) { - m_sName = ""; - m_iId = 0; - m_bActive = false; - m_iRoom = 0; - } else { update(xn); } } + public VeraHelper helper = VeraHelper.Instance; - private string m_sName; - private int m_iId; - private bool m_bActive; - private int m_iRoom; + private string m_sName = "unknown scene"; + private int m_iId = 0; + private bool m_bActive = false; + private int m_iRoom = 0; + // not connected (-2), none (-1), pending (0,1,5,6), success(4), error (2,3) + private string m_sComment = ""; // red(error), green(success) or blue(pending) - icon/text + private DevState m_dsState = DevState.NONE; + public bool update(XmlNode xn) { - m_sName = xn.Attributes["name"].Value; - m_iId = int.Parse(xn.Attributes["id"].Value); - m_iRoom = int.Parse(xn.Attributes["room"].Value); - m_bActive = (xn.Attributes["name"].Value == "1"); + m_sName = helper.getAttrAsString(xn, "name", m_sName); + m_iId = helper.getAttrAsInt (xn, "id", m_iId); + m_iRoom = helper.getAttrAsInt (xn, "room", m_iRoom); + m_bActive = helper.getAttrAsBool (xn, "active", m_bActive); + + m_sComment = helper.getAttrAsString(xn, "comment", m_sComment ); + m_dsState = helper.toDevState(helper.getAttrAsInt(xn, "state", -1)); + return true; } @@ -56,7 +61,17 @@ get { return m_sName; } set { } } - + + public virtual DevState commstate + { + get { return m_dsState; } + set { } + } + public virtual string comment + { + get { return (commstate != DevState.NONE ? m_sComment : ""); } + set { } + } public bool isActive() { Modified: trunk/plugins/VeraControl/Section.cs =================================================================== --- trunk/plugins/VeraControl/Section.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/Section.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -20,22 +20,21 @@ { public Section(XmlNode xn) { - if (xn == null) + if (xn != null) { - m_sName = ""; - m_iId = 0; - } else { update(xn); } } - private string m_sName; - private int m_iId; + public VeraHelper helper = VeraHelper.Instance; + private string m_sName = "unknown section"; + private int m_iId = 0; + public bool update(XmlNode xn) { - m_sName = xn.Attributes["name"].Value; - m_iId = int.Parse(xn.Attributes["id"].Value); + m_sName = helper.getAttrAsString(xn, "name", m_sName); + m_iId = helper.getAttrAsInt (xn, "id", m_iId); return true; } Modified: trunk/plugins/VeraControl/VeraCommunication.cs =================================================================== --- trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/VeraCommunication.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -166,17 +166,20 @@ private static volatile VeraCommunication instance; private static object syncRoot = new Object(); - private string m_sVeraIPAddress; - private string m_sVeraTCPIPPort; - private string m_sDataVersion = ""; - private bool m_bMetric = true; + private string m_sVeraIPAddress; + private string m_sVeraTCPIPPort; + private string m_sDataVersion = ""; + private bool m_bMetric = true; + private DevState m_dsVeraState = DevState.NONE; + private string m_sComment = ""; private VeraStatus m_status = new VeraStatus(); private long m_lLastUpdate = 0; private bool m_bUpdatePending = false; public int[] actionTriggerTable = new int[(int)Actiontrigger.LAST_ACTIONTRIGGER]; - + private VeraHelper helper = VeraHelper.Instance; + public static VeraCommunication Instance { get @@ -202,12 +205,16 @@ { m_sVeraIPAddress = xmlreader.GetValueAsString("veracontroller", "ipaddress", "127.0.0.1"); m_sVeraTCPIPPort = xmlreader.GetValueAsString("veracontroller", "portnumber", "49451"); + m_sVeraIPAddress = "192.10.1.240"; + // m_sVeraIPAddress = "demo.mios.com"; + m_sVeraTCPIPPort = "3480"; + + // Fill action table (config settings) + for (Actiontrigger i = 0; i < Actiontrigger.LAST_ACTIONTRIGGER; i++) + { + actionTriggerTable[(int)i] = xmlreader.GetValueAsInt("veracontroller", i.ToString(), 0); + } } - // Clear action table (TO DO: load with config settings) - for (int i = 0; i < (int)Actiontrigger.LAST_ACTIONTRIGGER; i++) - { - actionTriggerTable[i] = 0; - } } public bool updateCurrentStatus() @@ -218,16 +225,18 @@ } m_bUpdatePending = true; string verastatus = doVeraRequest("?id=lu_sdata&output_format=xml"); - m_lLastUpdate = getSecondSince1970(); + m_lLastUpdate = getSecondsSince1970(); var xmlDoc = new XmlDocument(); xmlDoc.LoadXml(verastatus); // Parse header - XmlNode rootnode = xmlDoc.SelectSingleNode("/root"); - m_bMetric = (rootnode.Attributes["temperature"].Value == "C"); - bool bFullRefresh = (m_sDataVersion != rootnode.Attributes["dataversion"].Value); - m_sDataVersion = rootnode.Attributes["dataversion"].Value; + XmlNode rootnode = xmlDoc.SelectSingleNode("/root"); + m_bMetric = (helper.getAttrAsString(rootnode, "temperature", "C") == "C"); + bool bFullRefresh = helper.getAttrAsBool (rootnode, "full", true); + m_sDataVersion = helper.getAttrAsString (rootnode, "dataversion", "0"); + m_sComment = helper.getAttrAsString (rootnode, "comment", ""); + m_dsVeraState = helper.toDevState(helper.getAttrAsInt(rootnode, "state", -1)); if (bFullRefresh) { @@ -247,6 +256,18 @@ } } + // Process Rooms + xnList = xmlDoc.SelectNodes("/root/rooms/room"); + foreach (XmlNode xn in xnList) + { + Room room = m_status.getRoomById( int.Parse(xn.Attributes["id"].Value) ); + if (room.id != 0) { + room.update(xn); + } else { + m_status.rooms.Add(new Room(xn)); + } + } + // Process Scenes xnList = xmlDoc.SelectNodes("/root/scenes/scene"); foreach (XmlNode xn in xnList) @@ -259,17 +280,6 @@ } } - // Process Rooms - xnList = xmlDoc.SelectNodes("/root/rooms/room"); - foreach (XmlNode xn in xnList) - { - Room room = m_status.getRoomById( int.Parse(xn.Attributes["id"].Value) ); - if (room.id != 0) { - room.update(xn); - } else { - m_status.rooms.Add(new Room(xn)); - } - } // Process Categories xnList = xmlDoc.SelectNodes("/root/categories/categorie"); @@ -293,6 +303,10 @@ } else { switch (xn.Attributes["category"].Value) { + //case "1": + // m_status.devices.Add(new DeviceInterface(xn)); + // break; + case "2": m_status.devices.Add(new DeviceDimmer(xn)); break; @@ -311,9 +325,9 @@ m_status.devices.Add(new DeviceThermostat(xn, m_bMetric)); break; - // case "6": // TODO: Implement camera class ? - // m_status.devices.Add(new DeviceCamera(xn, m_bMetric)); - // break; + case "6": + m_status.devices.Add(new DeviceCam(xn)); + break; case "7": m_status.devices.Add(new DeviceDoorlock(xn)); @@ -323,9 +337,9 @@ m_status.devices.Add(new DeviceWindowCovering(xn)); break; - // case "14": // TODO: Implement Scene controller device ? - // m_status.devices.Add(new DeviceSceneController(xn)); - // break; + case "14": + m_status.devices.Add(new DeviceSceneController(xn)); + break; // case "15": // TODO: Implement AV device ? // m_status.devices.Add(new DeviceSensor(xn)); @@ -350,7 +364,7 @@ case "0": default: // Check for Google Weather Device - if (xn.Attributes["WindCondition"] != null) + if (xn.Attributes["WindCondition"] != null || xn.Attributes["windcondition"] != null) { m_status.devices.Add(new DeviceGWeather(xn)); break; @@ -368,7 +382,7 @@ } } // update timer again (took some time to get the data) - m_lLastUpdate = getSecondSince1970(); + m_lLastUpdate = getSecondsSince1970(); m_bUpdatePending = false; return bFullRefresh; } @@ -385,7 +399,8 @@ public string doVeraRequest( string param ) { - return retrieveURL("http://" + m_sVeraIPAddress + ":" + m_sVeraTCPIPPort + "/data_request" + param + "&time="+DateTime.Now.Ticks); + + return retrieveURL("http://" + vera_Address + "/data_request" + param + "&time="+DateTime.Now.Ticks); } private string retrieveURL( string url ) @@ -410,14 +425,14 @@ return response; } - private long getSecondSince1970() + private long getSecondsSince1970() { return (DateTime.Now.Ticks / 10000000); } public long secondsSinceLastUpdate { - get { return (getSecondSince1970() - m_lLastUpdate); } + get { return (getSecondsSince1970() - m_lLastUpdate); } set { } } Modified: trunk/plugins/VeraControl/VeraControl.cs =================================================================== --- trunk/plugins/VeraControl/VeraControl.cs 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/VeraControl.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -1,6 +1,6 @@ /* * Created by SharpDevelop. - * User: Bart Everrsdijk + * User: Bart * Date: 21-12-2011 * Time: 21:20 * @@ -444,9 +444,9 @@ //Store last action - never send the same action twice... iLastAction = action; - if ((VeraCommunication.Instance.actionTriggerTable[(int)action] > 0) && (VeraCommunication.Instance.actionTriggerTable[(int)action] < Int16.MaxValue)) + if ((vera.actionTriggerTable[(int)action] > 0) && (vera.actionTriggerTable[(int)action] < Int16.MaxValue)) { - Scene scene = vera.status.getSceneById(VeraCommunication.Instance.actionTriggerTable[(int)action]); + Scene scene = vera.status.getSceneById(vera.actionTriggerTable[(int)action]); if (scene.id > 0) { scene.run(); @@ -683,25 +683,30 @@ if (dev.GetType() == typeof(DeviceSprinkler)) { dlg.SetText(dev.name, dev.getStatusText() + " - " + dev.mode, dev.getExtraText() ); - dlg.SetActiveBut((dev.state ? 1 : 0), (dev.mode == "Auto" ? 0 : (dev.mode == "Block" ? 2 : 1) )); + dlg.SetActiveBut((dev.status ? 1 : 0), (dev.mode == "Auto" ? 0 : (dev.mode == "Block" ? 2 : 1) )); } else if (dev.GetType() == typeof(DeviceThermostat)) { dlg.SetText(dev.name, dev.getStatusText(), dev.getExtraText() ); - dlg.SetActiveBut((dev.state ? 1 : 0), (dev.mode == "Auto" ? 0 : + dlg.SetActiveBut((dev.status ? 1 : 0), (dev.mode == "Auto" ? 0 : (dev.mode == "CoolOn" || dev.mode == "Cool" ? 1 : (dev.mode == "HeatOn" || dev.mode == "Heat" ? 2 : 3) ))); - } + } else { dlg.SetText(dev.name, "", ""); - dlg.SetActiveBut(dev.state ? 1 : 0, -1); + dlg.SetActiveBut(dev.status ? 1 : 0, -1); } dlg.SetButtons(dev.getCommands()); dlg.SetSlider(dev.level, dev.maxLevel); } else { + if (dev.GetType() == typeof(DeviceCam)) + { + DeviceCam cam = (DeviceCam) dev; + dlg.SetCamImage(cam.imgUrl); + } dlg.SetText(dev.name, dev.getStatusText(), dev.getExtraText()); } dlg.DoModal(GUIWindowManager.ActiveWindow); Modified: trunk/plugins/VeraControl/VeraControl.csproj =================================================================== --- trunk/plugins/VeraControl/VeraControl.csproj 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/VeraControl.csproj 2012-01-08 19:33:34 UTC (rev 4394) @@ -84,6 +84,7 @@ </ItemGroup> <ItemGroup> <Compile Include="DevCategories.cs" /> + <Compile Include="DeviceCam.cs" /> <Compile Include="DeviceDimmer.cs" /> <Compile Include="DeviceDoorlock.cs" /> <Compile Include="DeviceGeneric.cs" /> @@ -91,6 +92,7 @@ <Compile Include="DeviceHumidity.cs" /> <Compile Include="DeviceLightSensor.cs" /> <Compile Include="DevicePowerMeter.cs" /> + <Compile Include="DeviceSceneController.cs" /> <Compile Include="DeviceSecurity.cs" /> <Compile Include="DeviceSprinkler.cs" /> <Compile Include="DeviceSwitch.cs" /> @@ -105,6 +107,7 @@ <Compile Include="Scene.cs" /> <Compile Include="Section.cs" /> <Compile Include="VeraCommunication.cs" /> + <Compile Include="VeraHelper.cs" /> <Compile Include="VeraSetupForm.cs" /> <Compile Include="VeraSetupForm.Designer.cs"> <DependentUpon>VeraSetupForm.cs</DependentUpon> Added: trunk/plugins/VeraControl/VeraHelper.cs =================================================================== --- trunk/plugins/VeraControl/VeraHelper.cs (rev 0) +++ trunk/plugins/VeraControl/VeraHelper.cs 2012-01-08 19:33:34 UTC (rev 4394) @@ -0,0 +1,104 @@ +/* + * Created by SharpDevelop. + * User: Bart + * Date: 7-1-2012 + * Time: 12:07 + * + * Copyright: 2012 GPL - Bart Eversdijk + * MediaPort plugin - MicasaVerde (TM) Vera Controller + * E-mail: ba...@ev... + */ +using System; +using System.Xml; + +namespace VeraControl.Properties +{ + + public enum DevState + { + NONE = 0, + PENDING, + SUCCESS, + ERROR + } + + /// <summary> + /// Description of VeraHelper. + /// </summary> + public class VeraHelper + { + public VeraHelper() + { + } + + private static volatile VeraHelper instance; + private static object syncRoot = new Object(); + + public static VeraHelper Instance + { + get + { + if (instance == null) + { + lock (syncRoot) + { + if (instance == null) + { + instance = new VeraHelper(); + } + } + } + + return instance; + } + } + + public DevState toDevState (int iRawState) + { // not connected (-2), none (-1), pending (0,1,5,6), success(4), error (2,3) + switch (iRawState) + { + case -1: + return DevState.NONE; + case 0: + case 1: + case 5: + case 6: + return DevState.PENDING; + case 4: + return DevState.SUCCESS; + case 2: + case 3: + default: + return DevState.ERROR; + } + } + + public int getAttrAsInt(XmlNode xn, string key, int iDefault) + { + if (xn == null || xn.Attributes[key] == null) + { + return iDefault; + } + return int.Parse(xn.Attributes[key].Value); + } + + public bool getAttrAsBool(XmlNode xn, string key, bool bDefault) + { + if (xn == null || xn.Attributes[key] == null) + { + return bDefault; + } + string value = xn.Attributes[key].Value.ToLower(); + return (value == "true" || value == "1" || value == "yes"); + } + + public string getAttrAsString(XmlNode xn, string key, string sDefault) + { + if (xn == null || xn.Attributes[key] == null) + { + return sDefault; + } + return xn.Attributes[key].Value; + } + } +} Modified: trunk/plugins/VeraControl/skin/Default/VeraControl.xml =================================================================== --- trunk/plugins/VeraControl/skin/Default/VeraControl.xml 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/skin/Default/VeraControl.xml 2012-01-08 19:33:34 UTC (rev 4394) @@ -104,7 +104,7 @@ <id>40</id> <posX>30</posX> <posY>85</posY> - <height>200</height> + <height>300</height> <width>250</width> <onup>20</onup> <ondown>70</ondown> @@ -147,7 +147,7 @@ <id>50</id> <posX>300</posX> <posY>55</posY> - <height>400</height> + <height>460</height> <width>300</width> <onleft>40</onleft> <onright>60</onright> Modified: trunk/plugins/VeraControl/skin/Default/VeraDialogDeviceControl.xml =================================================================== --- trunk/plugins/VeraControl/skin/Default/VeraDialogDeviceControl.xml 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/skin/Default/VeraDialogDeviceControl.xml 2012-01-08 19:33:34 UTC (rev 4394) @@ -64,7 +64,7 @@ <type>label</type> <id>6</id> <posX>180</posX> - <posY>150</posY> + <posY>130</posY> <label>Dit is een label!!!</label> <font>font13</font> <textcolor>FFFFFFFF</textcolor> @@ -215,6 +215,17 @@ <animation effect="fade" time="250">visiblechange</animation> <animation effect="fade" time="250">windowopen</animation> </control> - + + <control> + <type>image</type> + <id>20</id> + <posX>240</posX> + <posY>160</posY> + <width>600</width> + <height>240</height> + <texture></texture> + <visible>no</visible> + </control> + </controls> </window> Modified: trunk/plugins/VeraControl/skin/DefaultWide/VeraDialogDeviceControl.xml =================================================================== --- trunk/plugins/VeraControl/skin/DefaultWide/VeraDialogDeviceControl.xml 2012-01-08 19:32:04 UTC (rev 4393) +++ trunk/plugins/VeraControl/skin/DefaultWide/VeraDialogDeviceControl.xml 2012-01-08 19:33:34 UTC (rev 4394) @@ -216,6 +216,17 @@ <animation effect="fade" time="250">visiblechange</animation> <animation effect="fade" time="250">windowopen</animation> </control> - + + <control> + <type>image</type> + <id>20</id> + <posX>450</posX> + <posY>200</posY> + <width>600</width> + <height>300</height> + <texture></texture> + <visible>no</visible> + </control> + </controls> </window> Added: trunk/plugins/VeraControl/skin/Media/Vera/Ip_Camera.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/VeraControl/skin/Media/Vera/Ip_Camera.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/VeraControl/skin/Media/Vera/location.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/VeraControl/skin/Media/Vera/location.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <Ba...@us...> - 2012-01-08 19:32:11
|
Revision: 4393 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4393&view=rev Author: BartEv Date: 2012-01-08 19:32:04 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/VeraControl/releases/VeraControl.xmp2 trunk/plugins/VeraControl/releases/update.xml Added Paths: ----------- trunk/plugins/VeraControl/releases/VeraControl_v0.5.1.0.mpe1 Modified: trunk/plugins/VeraControl/releases/VeraControl.xmp2 =================================================================== --- trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-08 17:56:22 UTC (rev 4392) +++ trunk/plugins/VeraControl/releases/VeraControl.xmp2 2012-01-08 19:32:04 UTC (rev 4393) @@ -243,6 +243,104 @@ <ZipFileName>Installer{CopyFile}\{81d4d577-b083-4b25-ad60-86ae9f624f8b}-Window_Covering.png</ZipFileName> <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering.png</DestinationFilename> </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\advanced.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{63312c3e-2696-49f1-87bf-d15e3a07f0d4}-advanced.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\advanced.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\default.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{0b08f4fe-7000-42c9-a4b3-ae1522f1e16a}-default.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\default.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\default_device.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{6b3f2e0d-08cb-4493-aa49-1f3886463941}-default_device.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\default_device.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\intro.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{fc4e328d-fc34-4009-92b4-8d2f0c2003cc}-intro.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\intro.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Ip_Camera.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{9798eb40-4335-4f68-bb2a-fd0f0d5fbe1e}-Ip_Camera.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Ip_Camera.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\IR_Transmitter.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{53a9dd83-eab8-438e-baba-8a268ee55847}-IR_Transmitter.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\IR_Transmitter.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\location.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{a76e2517-8056-4311-97b4-181db1ac212e}-location.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\location.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\music_audio.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{a08262fe-c4ab-46f9-aaa0-7c1df5132a94}-music_audio.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\music_audio.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\plugins.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{ac0d4441-6541-40ff-bec2-7dd1d56b9397}-plugins.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\plugins.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\USB_UIRT.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{551b3c18-0551-4f3a-bb9c-00cc1f9a4875}-USB_UIRT.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\USB_UIRT.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\users.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{e052286c-3cda-4b21-bb78-985eefdba6e6}-users.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\users.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Zwave.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{81a313d6-96ac-4fcf-a7ed-fcd37bde69d8}-Zwave.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Zwave.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Ip_Camera.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{433c3d38-38fd-40d7-8113-4cfacd60f3d4}-Ip_Camera.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Ip_Camera.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\location.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{2823c561-dbd2-46fc-841c-8439218fcb7d}-location.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\location.png</DestinationFilename> + </FileItem> </Items> </Files> </GroupItem> @@ -427,6 +525,104 @@ <ZipFileName>Installer{CopyFile}\{10317a0b-8169-4b3c-acff-db60a3118d2e}-Window_Covering.png</ZipFileName> <DestinationFilename>%Skin%\DefaultWide\media\Vera\Window_Covering.png</DestinationFilename> </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\advanced.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{ca0606da-52a7-40db-af36-bd1459ea56af}-advanced.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\advanced.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\default.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{b6ab2003-2051-407e-adea-7cdcabc4c46b}-default.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\default.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\default_device.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{0f9f894f-de4a-4344-a895-845795af7738}-default_device.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\default_device.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\intro.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{2dadbe86-834c-4a1b-a418-0b63646c7630}-intro.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\intro.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Ip_Camera.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{e3859750-0172-4b85-acc1-d39e89c8cf29}-Ip_Camera.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\Ip_Camera.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\IR_Transmitter.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{49637889-6452-4bf4-a055-d0d3f9b75aed}-IR_Transmitter.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\IR_Transmitter.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\location.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{7508be47-6587-49ef-a1fe-24c5caddfcfe}-location.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\location.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\music_audio.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{8bbb4ef9-0f53-4cd2-a03c-7fcf04a5cf3b}-music_audio.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\music_audio.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\plugins.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{fe1a5914-080e-4d19-8cfb-cb15ecf29fb4}-plugins.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\plugins.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\USB_UIRT.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{91e9dbd6-0776-43a6-909e-ad625cc4376f}-USB_UIRT.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\USB_UIRT.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\users.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{1a4dae24-7e9e-4aaf-9ce0-55950d6f8f86}-users.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\users.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Zwave.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{8fd8bdd9-c2c5-4a1f-8f3d-7407e56b25b7}-Zwave.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\Zwave.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Ip_Camera.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{d2baea25-e088-4345-8eec-a2b6a69c0c53}-Ip_Camera.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\Ip_Camera.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="true"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\location.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{0fe2a1ae-a16e-4982-95ea-b3f2d39566e6}-location.png</ZipFileName> + <DestinationFilename>%Skin%\DefaultWide\media\Vera\location.png</DestinationFilename> + </FileItem> </Items> </Files> </GroupItem> @@ -563,7 +759,7 @@ <Revision>27644</Revision> </MaxVersion> <WarnOnly>false</WarnOnly> - <Message>requires MediaPortal version 1.1.6.27644 to 1.1.6.27644.</Message> + <Message>requires MediaPortal version 1.1.0.0 to 1.5.9.255.</Message> <Name>MediaPortal</Name> </DependencyItem> </Items> @@ -598,19 +794,21 @@ <Version> <Major>0</Major> <Minor>5</Minor> - <Build>0</Build> - <Revision>1</Revision> + <Build>1</Build> + <Revision>0</Revision> </Version> - <ExtensionDescription>Control your Vera controller from MediaPortal. -Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... - -Vera is a Z-wave home automation controller from MicasaVerde. This version is tested with Vera 2 UI4 v.1.1.1267 - - - + <ExtensionDescription>Control your Vera controller from MediaPortal. +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... + +Vera is a Z-wave home automation controller from MicasaVerde. +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.5.255 + + </ExtensionDescription> - <VersionDescription>First version - for beta testing only -Minor updates</VersionDescription> + <VersionDescription>Improved Vera response handling</VersionDescription> <DevelopmentStatus>Beta</DevelopmentStatus> <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/</OnlineLocation> <ReleaseDate>2012-01-05T22:51:05</ReleaseDate> @@ -877,6 +1075,90 @@ <ZipFileName>Installer{CopyFile}\{81d4d577-b083-4b25-ad60-86ae9f624f8b}-Window_Covering.png</ZipFileName> <DestinationFilename>%Skin%\Default\media\Vera\Window_Covering.png</DestinationFilename> </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\advanced.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{63312c3e-2696-49f1-87bf-d15e3a07f0d4}-advanced.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\advanced.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\default.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{0b08f4fe-7000-42c9-a4b3-ae1522f1e16a}-default.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\default.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\default_device.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{6b3f2e0d-08cb-4493-aa49-1f3886463941}-default_device.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\default_device.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\intro.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{fc4e328d-fc34-4009-92b4-8d2f0c2003cc}-intro.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\intro.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Ip_Camera.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{9798eb40-4335-4f68-bb2a-fd0f0d5fbe1e}-Ip_Camera.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Ip_Camera.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\IR_Transmitter.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{53a9dd83-eab8-438e-baba-8a268ee55847}-IR_Transmitter.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\IR_Transmitter.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\location.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{a76e2517-8056-4311-97b4-181db1ac212e}-location.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\location.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\music_audio.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{a08262fe-c4ab-46f9-aaa0-7c1df5132a94}-music_audio.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\music_audio.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\plugins.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{ac0d4441-6541-40ff-bec2-7dd1d56b9397}-plugins.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\plugins.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\USB_UIRT.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{551b3c18-0551-4f3a-bb9c-00cc1f9a4875}-USB_UIRT.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\USB_UIRT.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\users.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{e052286c-3cda-4b21-bb78-985eefdba6e6}-users.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\users.png</DestinationFilename> + </FileItem> + <FileItem InstallType="CopyFile" SystemFile="false" Modified="false"> + <Param1 /> + <UpdateOption>OverwriteIfOlder</UpdateOption> + <LocalFileName>..\skin\Media\Vera\Zwave.png</LocalFileName> + <ZipFileName>Installer{CopyFile}\{81a313d6-96ac-4fcf-a7ed-fcd37bde69d8}-Zwave.png</ZipFileName> + <DestinationFilename>%Skin%\Default\media\Vera\Zwave.png</DestinationFilename> + </FileItem> </Items> </UniqueFileList> <ProjectSettings> Added: trunk/plugins/VeraControl/releases/VeraControl_v0.5.1.0.mpe1 =================================================================== (Binary files differ) Property changes on: trunk/plugins/VeraControl/releases/VeraControl_v0.5.1.0.mpe1 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/VeraControl/releases/update.xml =================================================================== --- trunk/plugins/VeraControl/releases/update.xml 2012-01-08 17:56:22 UTC (rev 4392) +++ trunk/plugins/VeraControl/releases/update.xml 2012-01-08 19:32:04 UTC (rev 4393) @@ -281,5 +281,149 @@ </ProjectSettings> <IsSkin>false</IsSkin> </PackageClass> + <PackageClass> + <Version>2.0</Version> + <Groups> + <Items> + <GroupItem Name="Default"> + <DisplayName>Default</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Default</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="IconsDefault"> + <DisplayName>IconsDefault</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>IconsDefault</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="IconsDefaultWide"> + <DisplayName>IconsDefaultWide</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>IconsDefaultWide</Description> + <Files> + <Items /> + </Files> + </GroupItem> + </Items> + </Groups> + <Sections> + <Items /> + </Sections> + <Dependencies> + <Items> + <DependencyItem> + <Type>MediaPortal</Type> + <Id /> + <MinVersion> + <Major>1</Major> + <Minor>1</Minor> + <Build>0</Build> + <Revision>0</Revision> + </MinVersion> + <MaxVersion> + <Major>1</Major> + <Minor>5</Minor> + <Build>9</Build> + <Revision>255</Revision> + </MaxVersion> + <WarnOnly>false</WarnOnly> + <Message>requires MediaPortal version 1.1.0.0 to 1.5.9.255.</Message> + <Name>MediaPortal</Name> + </DependencyItem> + </Items> + </Dependencies> + <PluginDependencies> + <Items> + <PluginDependencyItem AssemblyName="VeraControl.dll"> + <CompatibleVersion> + <Items> + <CompatibleVersionItem> + <MinRequiredVersion>1.1.6.27644</MinRequiredVersion> + <DesignedForVersion>1.1.6.27644</DesignedForVersion> + </CompatibleVersionItem> + </Items> + </CompatibleVersion> + <SubSystemsUsed> + <Items> + <SubSystemItem Name="MP.SkinEngine" /> + <SubSystemItem Name="MP.Config" /> + </Items> + </SubSystemsUsed> + </PluginDependencyItem> + </Items> + </PluginDependencies> + <GeneralInfo> + <Name>Vera Controller</Name> + <Id>ebb6b1af-6fb9-44e5-a859-9d32ffe20a9e</Id> + <Author>Bart Eversdijk</Author> + <HomePage>http://www.team-mediaportal.com/extensions/micasaverde-vera-controller</HomePage> + <ForumPage>http://forum.team-mediaportal.com/mediaportal-plugins-47/plugin-micasaverde-vera-controller-104337/</ForumPage> + <UpdateUrl>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/update.xml</UpdateUrl> + <Version> + <Major>0</Major> + <Minor>5</Minor> + <Build>1</Build> + <Revision>0</Revision> + </Version> + <ExtensionDescription>Control your Vera controller from MediaPortal. +Supports Scene triggers for starting, hibernating and exiting MediaPortal; Also starting, pausing and stopping media streams. So dim your lights and close the curtain autmatically when MediaPortal starts a movie... + +Vera is a Z-wave home automation controller from MicasaVerde. +This version is tested with: + - Vera 1 v1.1.1338 + - Vera 2 v1.1.1267 + - Vera 2 v1.5.255 + + +</ExtensionDescription> + <VersionDescription>Improved Vera response handling</VersionDescription> + <DevelopmentStatus>Beta</DevelopmentStatus> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/VeraControl/releases/</OnlineLocation> + <ReleaseDate>2012-01-05T22:51:05</ReleaseDate> + <Tags>home automation, +z-wave, +micasaverde, +vera</Tags> + <Location>C:\Users\Bart\Documents\SharpDevelop Projects\VeraControl\releases\VeraControl_v[Version].mpe1</Location> + <Params> + <Items> + <SectionParam Name="Online Icon"> + <Value /> + <ValueType>String</ValueType> + <Description>The icon file of the package stored online (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Configuration file"> + <Value /> + <ValueType>Template</ValueType> + <Description>The file used to configure the extension. + If have .exe extension the will be executed + If have .dll extension used like MP plugin configuration</Description> + </SectionParam> + <SectionParam Name="Online Screenshots"> + <Value /> + <ValueType>String</ValueType> + <Description>Online stored screenshot urls separated by ; </Description> + </SectionParam> + <SectionParam Name="Force to uninstall on update"> + <Value>yes</Value> + <ValueType>Bool</ValueType> + <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description> + </SectionParam> + </Items> + </Params> + </GeneralInfo> + <UniqueFileList> + <Items /> + </UniqueFileList> + <ProjectSettings> + <FolderGroups /> + </ProjectSettings> + <IsSkin>false</IsSkin> + </PackageClass> </Items> </ExtensionCollection> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mca...@us...> - 2012-01-08 17:56:28
|
Revision: 4392 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4392&view=rev Author: mcarter2006 Date: 2012-01-08 17:56:22 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/UKTVThumb/Normal/package/UK_Logos.mpe1 trunk/plugins/UKTVThumb/Normal/update.xml Modified: trunk/plugins/UKTVThumb/Normal/package/UK_Logos.mpe1 =================================================================== (Binary files differ) Modified: trunk/plugins/UKTVThumb/Normal/update.xml =================================================================== --- trunk/plugins/UKTVThumb/Normal/update.xml 2012-01-08 17:17:13 UTC (rev 4391) +++ trunk/plugins/UKTVThumb/Normal/update.xml 2012-01-08 17:56:22 UTC (rev 4392) @@ -82,7 +82,7 @@ <Major>4</Major> <Minor>0</Minor> <Build>0</Build> - <Revision>6</Revision> + <Revision>7</Revision> </Version> <ExtensionDescription>In this pack you find a large selection of UK TV and Radio channel logos. If the logo you require isn't in this pack, let me know or create your own. Please if you do make your own logos for a channel remember to share them with the rest of the community on this thread. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mca...@us...> - 2012-01-08 17:17:20
|
Revision: 4391 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4391&view=rev Author: mcarter2006 Date: 2012-01-08 17:17:13 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/UKTVThumb/Normal/package/UK_Logos.mpe1 trunk/plugins/UKTVThumb/Normal/update.xml Modified: trunk/plugins/UKTVThumb/Normal/package/UK_Logos.mpe1 =================================================================== (Binary files differ) Modified: trunk/plugins/UKTVThumb/Normal/update.xml =================================================================== --- trunk/plugins/UKTVThumb/Normal/update.xml 2012-01-08 07:31:19 UTC (rev 4390) +++ trunk/plugins/UKTVThumb/Normal/update.xml 2012-01-08 17:17:13 UTC (rev 4391) @@ -82,45 +82,21 @@ <Major>4</Major> <Minor>0</Minor> <Build>0</Build> - <Revision>5</Revision> + <Revision>6</Revision> </Version> <ExtensionDescription>In this pack you find a large selection of UK TV and Radio channel logos. If the logo you require isn't in this pack, let me know or create your own. Please if you do make your own logos for a channel remember to share them with the rest of the community on this thread. - - - - - - Standard TV thumbs are designed to simply use the channels logo with a transparent background and all TV logos are 80x80px. The radio guide uses the channel logo with a black background at 300x300px. - - - - - - Glossy TV & radio thumbs are 100x100px with a colour background. - - - - - - Duplicate logos are included due to different default names on Freeview and FreeToAir. All regional naming variations for BBC and ITV should be included, if I've missed yours let me know. - - - - - - Big thanks go to cheetah05 for the glossy template and the core of the Freeview TV logos. Thanks also go to Mew, TritonT and jsimo01 and many others.</ExtensionDescription> <VersionDescription>TV and Radio logos for UK Freeview & Freesat.</VersionDescription> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/UKTVThumb/Normal/package/UK_Logos.mpe1</OnlineLocation> - <ReleaseDate>2011-12-06T21:46:40</ReleaseDate> + <ReleaseDate>2012-01-08T21:46:40</ReleaseDate> <Tags>logos, thumbs, tv, radio</Tags> <Location>C:\Users\Matthew\Documents\TV Logos\Logos\mp-plugins\UKTVThumb\Normal\package\UK_Logos.mpe1</Location> <Params> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hor...@us...> - 2012-01-08 07:31:26
|
Revision: 4390 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4390&view=rev Author: horned-reaper Date: 2012-01-08 07:31:19 +0000 (Sun, 08 Jan 2012) Log Message: ----------- Modified Paths: -------------- trunk/plugins/FritzBox/Build/Build FritzBoxManager.bat trunk/plugins/FritzBox/Build/Build.log trunk/plugins/FritzBox/Docs/Ausstehend.txt trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb trunk/plugins/FritzBox/releases/update.xml Added Paths: ----------- trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4389.mpe1 Modified: trunk/plugins/FritzBox/Build/Build FritzBoxManager.bat =================================================================== --- trunk/plugins/FritzBox/Build/Build FritzBoxManager.bat 2012-01-07 19:39:56 UTC (rev 4389) +++ trunk/plugins/FritzBox/Build/Build FritzBoxManager.bat 2012-01-08 07:31:19 UTC (rev 4390) @@ -8,7 +8,7 @@ if not "%ProgramFiles(x86)%".=="". set ProgramDir=%ProgramFiles(x86)% REM Set build path -set BuildPath=%ProgramDir%\Team MediaPortal\MediaPortal\plugins\Windows +set BuildPath=..\FritzBox\bin\Release REM Set plugin DLL path set PluginDLL=%BuildPath%\FritzBox.dll @@ -43,11 +43,11 @@ echo. echo Reading the version number... if not exist "%PluginDLL%" goto version_error -for /f "Tokens=5" %%a in ('filever "%plugindll%"') do set version=%%a +for /f "Tokens=5" %%a in ('filever "%PluginDLL%"') do set version=%%a goto :version_done :version_error -echo fritzbox.dll not found. version could not be read >> %LOG% -echo fritzbox.dll not found. version could not be read. Build is cancelled +echo FritzBox.dll not found. version could not be read >> %LOG% +echo FritzBox.dll not found. version could not be read. Build is cancelled pause goto :EOF :version_done Modified: trunk/plugins/FritzBox/Build/Build.log =================================================================== --- trunk/plugins/FritzBox/Build/Build.log 2012-01-07 19:39:56 UTC (rev 4389) +++ trunk/plugins/FritzBox/Build/Build.log 2012-01-08 07:31:19 UTC (rev 4390) @@ -1,12 +1,16 @@ Running : C:\Program Files\TortoiseSVN\bin\SubWCRev.exe -Unable to determine SVN version. Try with a SVN cleanup! -Local SVN not up to date +SVN Version: 4389 +Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\Tools\FritzBoxConfigTester\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\Tools\FritzBoxDebugger\Properties\AssemblyInfo.cs Microsoft (R) Build Engine Version 4.0.30319.1 [Microsoft .NET Framework, Version 4.0.30319.239] Copyright (C) Microsoft Corporation 2007. All rights reserved. -Build started 07.01.2012 17:50:23. +Build started 07.01.2012 23:13:40. Project "D:\FritzBox\FritzBox.sln" on node 1 (Rebuild target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Mixed Platforms". @@ -150,8 +154,6 @@ Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.DebugForm.resources". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.exe". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\FritzBoxDebugger.pdb". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog". - Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog". Deleting file "D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog". CoreResGen: @@ -193,9 +195,14 @@ 0 Warning(s) 0 Error(s) -Time Elapsed 00:00:02.09 +Time Elapsed 00:00:01.91 Reverting to build 0 -C:\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\FritzBox.dll +Updating: D:\FritzBox\FritzBox\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\MP2version\Listeners\FritzBox\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\MP2version\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\Tools\FritzBoxConfigTester\Properties\AssemblyInfo.cs +Updating: D:\FritzBox\Tools\FritzBoxDebugger\Properties\AssemblyInfo.cs +..\FritzBox\bin\Release\FritzBox.dll 1 File(s) copied ..\FritzBox\Resources\speexdec.exe 1 File(s) copied @@ -273,7 +280,7 @@ ..\FritzBox\Languages\Unsupported\strings_zh-CN.xml 36 File(s) copied MpeMaker version: 1.2.1.0 -Build started at 17:50:27 +Build started at 23:13:44 Building "D:\FritzBox\MpeRelease\FritzBox.xmp2" Output: "..\MpeRelease\FritzBox.mpe1" Writing UpdateXML to "update.xml" Modified: trunk/plugins/FritzBox/Docs/Ausstehend.txt =================================================================== --- trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-01-07 19:39:56 UTC (rev 4389) +++ trunk/plugins/FritzBox/Docs/Ausstehend.txt 2012-01-08 07:31:19 UTC (rev 4390) @@ -9,8 +9,6 @@ - GUI-Properties \xFCberpr\xFCfen und Dokumentation vervollst\xE4ndigen Neue Funktionen: -- Telefonbuch-Konsolidierung - - Handbuch aktualisieren - Schalter zum Deaktivieren von Benachrichtigungen bei ausgehenden Anrufen - Rufnummer-Typ hinzuf\xFCgen - GUI-Adressbuch @@ -49,4 +47,7 @@ Burkh2407, 30.12.2011: ich benutze Stremed MP... mich st\xF6rt das ich zum Umschalten zwischen den einzelnen Listen seitlich ins Untermen\xFC wechseln mu\xDF warum gibt es kein Buttons wo ich die Listen direKt anw\xE4hlen kann oder \xFCbersehe ich da was. -Gru\xDF Burkh2407 \ No newline at end of file +Gru\xDF Burkh2407 + +IchBinsShort, 05.01.2012, 18:02:. +Noch eine andere Frage ist es auch m\xF6glich das bei ausgehenden Anrufen nur bei bestimmten Handger\xE4ten der Pause Befehl gesendet wird. Ich benutze drei Funktelefone \xFCber die Dect Funktion der Fritzbox 7020, Garten, Eltern und bei mir. W\xE4re also sch\xF6n wenn nur auf Pause gestellt wird wenn von meinem Telefon eine Anruf get\xE4tigt wird. \ No newline at end of file Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/FritzBox/obj/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 =================================================================== --- trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-07 19:39:56 UTC (rev 4389) +++ trunk/plugins/FritzBox/MpeRelease/FritzBox.xmp2 2012-01-08 07:31:19 UTC (rev 4390) @@ -559,7 +559,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.0</DesignedForVersion> + <DesignedForVersion>1.1.7.4389</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -582,7 +582,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>0</Revision> + <Revision>4389</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -596,7 +596,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-07T17:50:27.4469452+01:00</ReleaseDate> + <ReleaseDate>2012-01-07T23:13:44.2036574+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/bin/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/FritzBoxConfigTester.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/obj/Release/ResolveAssemblyReference.cache =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.dll =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBox.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/bin/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt =================================================================== --- trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt 2012-01-07 19:39:56 UTC (rev 4389) +++ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.csproj.FileListAbsolute.txt 2012-01-08 07:31:19 UTC (rev 4390) @@ -25,3 +25,5 @@ D:\FritzBox\Tools\FritzBoxDebugger\bin\Release\FritzBox.pdb D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.6.tlog D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.6.tlog +D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.read.7.tlog +D:\FritzBox\Tools\FritzBoxDebugger\obj\Release\GenerateResource.write.7.tlog Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.exe =================================================================== (Binary files differ) Modified: trunk/plugins/FritzBox/Tools/FritzBoxDebugger/obj/Release/FritzBoxDebugger.pdb =================================================================== (Binary files differ) Added: trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4389.mpe1 =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/releases/FritzBox_v0.4.0.4389.mpe1 ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/plugins/FritzBox/releases/update.xml =================================================================== --- trunk/plugins/FritzBox/releases/update.xml 2012-01-07 19:39:56 UTC (rev 4389) +++ trunk/plugins/FritzBox/releases/update.xml 2012-01-08 07:31:19 UTC (rev 4390) @@ -88,7 +88,7 @@ <Items> <CompatibleVersionItem> <MinRequiredVersion>1.1.0.0</MinRequiredVersion> - <DesignedForVersion>1.1.7.0</DesignedForVersion> + <DesignedForVersion>1.1.7.4389</DesignedForVersion> </CompatibleVersionItem> </Items> </CompatibleVersion> @@ -111,7 +111,7 @@ <Major>0</Major> <Minor>4</Minor> <Build>0</Build> - <Revision>0</Revision> + <Revision>4389</Revision> </Version> <ExtensionDescription>With FRITZ!Box Manager you can access several AVM FRITZ!Box informations from MediaPortal. @@ -125,7 +125,7 @@ <VersionDescription /> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>http://www.team-mediaportal.com/index.php?option=com_mtree&task=att_download&link_id=118&cf_id=24</OnlineLocation> - <ReleaseDate>2012-01-07T17:50:27.4469452+01:00</ReleaseDate> + <ReleaseDate>2012-01-07T23:13:44.2036574+01:00</ReleaseDate> <Tags>fritzbox, fritzbox manager, callmonitor</Tags> <Location>..\MpeRelease\FritzBox.mpe1</Location> <Params> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |