Skip to content

Commit

Permalink
Added new PipeServer functions GetEffectNames and GetControllerNames
Browse files Browse the repository at this point in the history
- Version Bump 0.0.3.0
- Cleanup
- Added List output for sfx-100-streamdeck-console (Needed for new functions)
  • Loading branch information
ashupp committed Jul 21, 2020
1 parent 5f6a902 commit 086abb2
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 26 deletions.
19 changes: 18 additions & 1 deletion sfx-100-streamdeck-console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static void Main(string[] args)
Console.WriteLine("Command line arguments: " + (args.Length - 1));
Console.WriteLine("Method arguments: " + miParams.Length);

if (miParams.Length > 0 && (args.Length -1) == miParams.Length)
if (miParams.Length > 0 || (args.Length -1) == miParams.Length)
{
// Prüfen ob die Anzahl der Parameter mit der Anzahl der Argumente übereinstimmt
if (args.Length - 1 == miParams.Length)
Expand All @@ -87,6 +87,23 @@ static void Main(string[] args)
try
{
result = mi.Invoke(PipeServerConnection.Instance.Channel, paramElems.ToArray());
if (result != null && result.GetType() == typeof(List<string>))
{
Console.WriteLine("Got List - Exitcode will be list length.");
var newList = result as List<string>;
if (newList != null)
{
foreach (var listElem in newList)
{
Console.WriteLine(listElem);
}
Environment.Exit(newList.Count);
}
else
{
Environment.Exit(Int32.MinValue);
}
}
Console.WriteLine("Result: " + result);
}
catch (Exception e)
Expand Down
4 changes: 2 additions & 2 deletions sfx-100-streamdeck-console/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.2.8")]
[assembly: AssemblyFileVersion("0.0.2.8")]
[assembly: AssemblyVersion("0.0.3.0")]
[assembly: AssemblyFileVersion("0.0.3.0")]
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.ServiceModel;
using System.Collections.Generic;
using System.ServiceModel;

namespace sfx_100_streamdeck_pipecontract
{
Expand All @@ -8,6 +9,12 @@ public interface ISfxStreamDeckPipeContract
[OperationContract]
bool CheckConnection();

[OperationContract]
List<string> GetControllerNames();

[OperationContract]
List<string> GetEffectNames();

[OperationContract]
bool IsRunning();

Expand Down
4 changes: 2 additions & 2 deletions sfx-100-streamdeck-pipecontract/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.2.8")]
[assembly: AssemblyFileVersion("0.0.2.8")]
[assembly: AssemblyVersion("0.0.3.0")]
[assembly: AssemblyFileVersion("0.0.3.0")]
4 changes: 2 additions & 2 deletions sfx-100-streamdeck-plugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.2.8")]
[assembly: AssemblyFileVersion("0.0.2.8")]
[assembly: AssemblyVersion("0.0.3.0")]
[assembly: AssemblyFileVersion("0.0.3.0")]
2 changes: 1 addition & 1 deletion sfx-100-streamdeck-plugin/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@
"Description": "Plugin to control SimFeedback via Streamdeck",
"Icon": "Images/pluginIcon",
"URL": "http://ashnet.de",
"Version": "0.0.2.8",
"Version": "0.0.3.0",
"CodePath": "sfx-100-streamdeck-plugin",
"Category": "SFX-100 SimFeedback",
"CategoryIcon": "Images/categoryIcon",
Expand Down
14 changes: 3 additions & 11 deletions sfx-100-streamdeck-sfb-extension/ActionElements.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Windows.Automation;

namespace WpfApp2
namespace sfx_100_streamdeck_sfb_extension
{
class ActionElements
{
Expand Down Expand Up @@ -42,8 +38,4 @@ class ControllerActionElement
public AutomationElement MinSpeed;
public AutomationElement MaxSpeed;
}




}
}
4 changes: 2 additions & 2 deletions sfx-100-streamdeck-sfb-extension/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.2.8")]
[assembly: AssemblyFileVersion("0.0.2.8")]
[assembly: AssemblyVersion("0.0.3.0")]
[assembly: AssemblyFileVersion("0.0.3.0")]
17 changes: 15 additions & 2 deletions sfx-100-streamdeck-sfb-extension/SfxStreamDeckPipeServer.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.ServiceModel;
using sfx_100_streamdeck_pipecontract;
using WpfApp2;

namespace sfx_100_streamdeck_sfb_extension
{
Expand All @@ -14,6 +14,20 @@ public bool CheckConnection()
return true;
}

#region Get Controller Names and Effect Names
public List<string> GetControllerNames()
{
GuiLoggerProvider.Instance.Log("Incoming Command: GetControllerNames");
return SimFeedbackInvoker.Instance.actionElements.ControllerIndexAssignment ?? new List<string>();
}

public List<string> GetEffectNames()
{
GuiLoggerProvider.Instance.Log("Incoming Command: GetEffectNames");
return SimFeedbackInvoker.Instance.actionElements.EffectIndexAssignment ?? new List<string>();
}
#endregion

#region Running / TelemetryProvider States
public bool IsRunning()
{
Expand All @@ -26,7 +40,6 @@ public bool IsRunning()

public bool IsTelemetryProviderConnected()
{

GuiLoggerProvider.Instance.Log("Incoming Command: IsTelemetryProviderConnected");
var isTelemetryProviderConnected = SimFeedbackFacadeProvider.Instance.SimFeedbackFacade.IsTelemetryProviderConnected();
GuiLoggerProvider.Instance.Log("Returning: " + isTelemetryProviderConnected);
Expand Down
3 changes: 1 addition & 2 deletions sfx-100-streamdeck-sfb-extension/SimFeedbackInvoker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Windows.Automation;
using System.Xml.Linq;
using sfx_100_streamdeck_sfb_extension.Properties;
using WpfApp2;

namespace sfx_100_streamdeck_sfb_extension
{
Expand Down Expand Up @@ -276,7 +275,7 @@ private static void GetActiveProfileEffects()

//SimFeedbackInvoker.Instance.actionElements.Effects.Add( effectName, null);
SimFeedbackInvoker.Instance.actionElements.EffectIndexAssignment.Add(effectName);

}
}
}
Expand Down

0 comments on commit 086abb2

Please sign in to comment.