Build 62 - first iteration - saved to GIT

- add Strafe Tuning
- get Tuning closer to CIG implementation
- remove Sensitivity
- add Saturation instead
- update flight model to support the above
- lot's of refacturing in that process
- add three 3D scenes
pull/104/head
bm98 8 years ago
parent 1e78d268b5
commit 23649da891

5
Form1.Designer.cs generated

@ -528,7 +528,7 @@
this.tdiAddMod2, this.tdiAddMod2,
this.tdiAddMod3}); this.tdiAddMod3});
this.cmAddDel.Name = "cmAddDel"; this.cmAddDel.Name = "cmAddDel";
this.cmAddDel.Size = new System.Drawing.Size(221, 479); this.cmAddDel.Size = new System.Drawing.Size(221, 457);
this.cmAddDel.Closed += new System.Windows.Forms.ToolStripDropDownClosedEventHandler(this.cmAddDel_Closed); this.cmAddDel.Closed += new System.Windows.Forms.ToolStripDropDownClosedEventHandler(this.cmAddDel_Closed);
this.cmAddDel.Opening += new System.ComponentModel.CancelEventHandler(this.cmAddDel_Opening); this.cmAddDel.Opening += new System.ComponentModel.CancelEventHandler(this.cmAddDel_Opening);
// //
@ -1205,6 +1205,7 @@
this.cbxInvStrafeVert.TabIndex = 0; this.cbxInvStrafeVert.TabIndex = 0;
this.cbxInvStrafeVert.Text = "Inv. Strafe vertical"; this.cbxInvStrafeVert.Text = "Inv. Strafe vertical";
this.cbxInvStrafeVert.UseVisualStyleBackColor = true; this.cbxInvStrafeVert.UseVisualStyleBackColor = true;
this.cbxInvStrafeVert.Visible = false;
this.cbxInvStrafeVert.MouseClick += new System.Windows.Forms.MouseEventHandler(this.cbxInv_XY_MouseClick); this.cbxInvStrafeVert.MouseClick += new System.Windows.Forms.MouseEventHandler(this.cbxInv_XY_MouseClick);
// //
// cbxInvStrafeLat // cbxInvStrafeLat
@ -1215,6 +1216,7 @@
this.cbxInvStrafeLat.TabIndex = 0; this.cbxInvStrafeLat.TabIndex = 0;
this.cbxInvStrafeLat.Text = "Inv. Strafe lateral"; this.cbxInvStrafeLat.Text = "Inv. Strafe lateral";
this.cbxInvStrafeLat.UseVisualStyleBackColor = true; this.cbxInvStrafeLat.UseVisualStyleBackColor = true;
this.cbxInvStrafeLat.Visible = false;
this.cbxInvStrafeLat.MouseClick += new System.Windows.Forms.MouseEventHandler(this.cbxInv_XY_MouseClick); this.cbxInvStrafeLat.MouseClick += new System.Windows.Forms.MouseEventHandler(this.cbxInv_XY_MouseClick);
// //
// cbxInvStrafeLon // cbxInvStrafeLon
@ -1225,6 +1227,7 @@
this.cbxInvStrafeLon.TabIndex = 0; this.cbxInvStrafeLon.TabIndex = 0;
this.cbxInvStrafeLon.Text = "Inv. Strafe longitudinal"; this.cbxInvStrafeLon.Text = "Inv. Strafe longitudinal";
this.cbxInvStrafeLon.UseVisualStyleBackColor = true; this.cbxInvStrafeLon.UseVisualStyleBackColor = true;
this.cbxInvStrafeLon.Visible = false;
this.cbxInvStrafeLon.MouseClick += new System.Windows.Forms.MouseEventHandler(this.cbxInv_XY_MouseClick); this.cbxInvStrafeLon.MouseClick += new System.Windows.Forms.MouseEventHandler(this.cbxInv_XY_MouseClick);
// //
// tableLayoutPanel4 // tableLayoutPanel4

@ -1349,27 +1349,27 @@ namespace SCJMapper_V2
m_AT.ActionMaps.TuningY.Reset( ); // set defaults m_AT.ActionMaps.TuningY.Reset( ); // set defaults
if ( dev != null ) { if ( dev != null ) {
// JS commands that are supported // JS commands that are supported
if ( nodeText.ToLowerInvariant( ).EndsWith( "_x" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotx" ) ) { if ( nodeText.ToLowerInvariant( ).EndsWith( "_x" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotx" )
|| nodeText.ToLowerInvariant( ).EndsWith( "_y" ) || nodeText.ToLowerInvariant( ).EndsWith( "_roty" )
|| nodeText.ToLowerInvariant( ).EndsWith( "_Z" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotz" ) ) {
m_AT.ActionMaps.TuningY.GameDevice = dev; m_AT.ActionMaps.TuningY.GameDevice = dev;
m_AT.ActionMaps.TuningY.Action = nodeText; m_AT.ActionMaps.TuningY.Action = nodeText;
m_AT.ActionMaps.TuningY.Deadzone = m_AT.ActionMaps.DeadzoneX; string doID = Deviceoptions.DevOptionID( dev.DevName, nodeText );
JSCAL.YawTuning = m_AT.ActionMaps.TuningY; if ( ! m_AT.ActionMaps.Deadzones.ContainsKey(doID) ){
} else if ( nodeText.ToLowerInvariant( ).EndsWith( "_y" ) || nodeText.ToLowerInvariant( ).EndsWith( "_roty" ) ) { m_AT.ActionMaps.Deadzones.Add( doID, new DeviceOptionParameter( ) );
m_AT.ActionMaps.TuningY.GameDevice = dev; }
m_AT.ActionMaps.TuningY.Action = nodeText; m_AT.ActionMaps.TuningY.Deviceoption = m_AT.ActionMaps.Deadzones[doID];
m_AT.ActionMaps.TuningY.Deadzone = m_AT.ActionMaps.DeadzoneY;
JSCAL.YawTuning = m_AT.ActionMaps.TuningY;
} else if ( nodeText.ToLowerInvariant( ).EndsWith( "_z" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotz" ) ) {
m_AT.ActionMaps.TuningY.GameDevice = dev;
m_AT.ActionMaps.TuningY.Action = nodeText;
m_AT.ActionMaps.TuningY.Deadzone = m_AT.ActionMaps.DeadzoneZ;
JSCAL.YawTuning = m_AT.ActionMaps.TuningY; JSCAL.YawTuning = m_AT.ActionMaps.TuningY;
} }
// GP commands that are supported - X // GP commands that are supported - X
else if ( nodeText.ToLowerInvariant( ).Contains( "_thumblx" ) || nodeText.ToLowerInvariant( ).Contains( "_thumbrx" ) ) { else if ( nodeText.ToLowerInvariant( ).Contains( "_thumblx" ) || nodeText.ToLowerInvariant( ).Contains( "_thumbrx" ) ) {
m_AT.ActionMaps.TuningY.GameDevice = dev; m_AT.ActionMaps.TuningY.GameDevice = dev;
m_AT.ActionMaps.TuningY.Action = nodeText; m_AT.ActionMaps.TuningY.Action = nodeText;
m_AT.ActionMaps.TuningY.Deadzone = m_AT.ActionMaps.DeadzoneX; string doID = Deviceoptions.DevOptionID( dev.DevName, "x" );
if ( !m_AT.ActionMaps.Deadzones.ContainsKey( doID ) ) {
m_AT.ActionMaps.Deadzones.Add( doID, new DeviceOptionParameter( ) );
}
m_AT.ActionMaps.TuningY.Deviceoption = m_AT.ActionMaps.Deadzones[doID];
JSCAL.YawTuning = m_AT.ActionMaps.TuningY; JSCAL.YawTuning = m_AT.ActionMaps.TuningY;
} }
} }
@ -1391,27 +1391,27 @@ namespace SCJMapper_V2
m_AT.ActionMaps.TuningP.Reset( ); // set defaults m_AT.ActionMaps.TuningP.Reset( ); // set defaults
if ( dev != null ) { if ( dev != null ) {
// JS commands that are supported // JS commands that are supported
if ( nodeText.ToLowerInvariant( ).EndsWith( "_x" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotx" ) ) { if ( nodeText.ToLowerInvariant( ).EndsWith( "_x" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotx" )
m_AT.ActionMaps.TuningP.GameDevice = dev; || nodeText.ToLowerInvariant( ).EndsWith( "_y" ) || nodeText.ToLowerInvariant( ).EndsWith( "_roty" )
m_AT.ActionMaps.TuningP.Action = nodeText; || nodeText.ToLowerInvariant( ).EndsWith( "_Z" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotz" ) ) {
m_AT.ActionMaps.TuningP.Deadzone = m_AT.ActionMaps.DeadzoneX;
JSCAL.PitchTuning = m_AT.ActionMaps.TuningP;
} else if ( nodeText.ToLowerInvariant( ).EndsWith( "_y" ) || nodeText.ToLowerInvariant( ).EndsWith( "_roty" ) ) {
m_AT.ActionMaps.TuningP.GameDevice = dev; m_AT.ActionMaps.TuningP.GameDevice = dev;
m_AT.ActionMaps.TuningP.Action = nodeText; m_AT.ActionMaps.TuningP.Action = nodeText;
m_AT.ActionMaps.TuningP.Deadzone = m_AT.ActionMaps.DeadzoneY; string doID = Deviceoptions.DevOptionID( dev.DevName, nodeText );
JSCAL.PitchTuning = m_AT.ActionMaps.TuningP; if ( !m_AT.ActionMaps.Deadzones.ContainsKey( doID ) ) {
} else if ( nodeText.ToLowerInvariant( ).EndsWith( "_z" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotz" ) ) { m_AT.ActionMaps.Deadzones.Add( doID, new DeviceOptionParameter( ) );
m_AT.ActionMaps.TuningP.GameDevice = dev; }
m_AT.ActionMaps.TuningP.Action = nodeText; m_AT.ActionMaps.TuningP.Deviceoption = m_AT.ActionMaps.Deadzones[doID];
m_AT.ActionMaps.TuningP.Deadzone = m_AT.ActionMaps.DeadzoneZ;
JSCAL.PitchTuning = m_AT.ActionMaps.TuningP; JSCAL.PitchTuning = m_AT.ActionMaps.TuningP;
} }
// GP commands that are supported - either Y // GP commands that are supported - either Y
else if ( nodeText.ToLowerInvariant( ).Contains( "_thumbly" ) || nodeText.ToLowerInvariant( ).Contains( "_thumbry" ) ) { else if ( nodeText.ToLowerInvariant( ).Contains( "_thumbly" ) || nodeText.ToLowerInvariant( ).Contains( "_thumbry" ) ) {
m_AT.ActionMaps.TuningP.GameDevice = dev; m_AT.ActionMaps.TuningP.GameDevice = dev;
m_AT.ActionMaps.TuningP.Action = nodeText; m_AT.ActionMaps.TuningP.Action = nodeText;
m_AT.ActionMaps.TuningP.Deadzone = m_AT.ActionMaps.DeadzoneY; string doID = Deviceoptions.DevOptionID( dev.DevName, "y" );
if ( !m_AT.ActionMaps.Deadzones.ContainsKey( doID ) ) {
m_AT.ActionMaps.Deadzones.Add( doID, new DeviceOptionParameter( ) );
}
m_AT.ActionMaps.TuningP.Deviceoption = m_AT.ActionMaps.Deadzones[doID];
JSCAL.PitchTuning = m_AT.ActionMaps.TuningP; JSCAL.PitchTuning = m_AT.ActionMaps.TuningP;
} }
} }
@ -1427,24 +1427,96 @@ namespace SCJMapper_V2
m_AT.ActionMaps.TuningR.Reset( ); // set defaults m_AT.ActionMaps.TuningR.Reset( ); // set defaults
if ( dev != null ) { if ( dev != null ) {
// JS commands that are supported // JS commands that are supported
if ( nodeText.ToLowerInvariant( ).EndsWith( "_x" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotx" ) ) { if ( nodeText.ToLowerInvariant( ).EndsWith( "_x" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotx" )
m_AT.ActionMaps.TuningR.GameDevice = dev; || nodeText.ToLowerInvariant( ).EndsWith( "_y" ) || nodeText.ToLowerInvariant( ).EndsWith( "_roty" )
m_AT.ActionMaps.TuningR.Action = nodeText; || nodeText.ToLowerInvariant( ).EndsWith( "_Z" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotz" ) ) {
m_AT.ActionMaps.TuningR.Deadzone = m_AT.ActionMaps.DeadzoneX;
JSCAL.RollTuning = m_AT.ActionMaps.TuningR;
} else if ( nodeText.ToLowerInvariant( ).EndsWith( "_y" ) || nodeText.ToLowerInvariant( ).EndsWith( "_roty" ) ) {
m_AT.ActionMaps.TuningR.GameDevice = dev; m_AT.ActionMaps.TuningR.GameDevice = dev;
m_AT.ActionMaps.TuningR.Action = nodeText; m_AT.ActionMaps.TuningR.Action = nodeText;
m_AT.ActionMaps.TuningR.Deadzone = m_AT.ActionMaps.DeadzoneY; string doID = Deviceoptions.DevOptionID( dev.DevName, nodeText );
JSCAL.RollTuning = m_AT.ActionMaps.TuningR; if ( !m_AT.ActionMaps.Deadzones.ContainsKey( doID ) ) {
} else if ( nodeText.ToLowerInvariant( ).EndsWith( "_z" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotz" ) ) { m_AT.ActionMaps.Deadzones.Add( doID, new DeviceOptionParameter( ) );
m_AT.ActionMaps.TuningR.GameDevice = dev; }
m_AT.ActionMaps.TuningR.Action = nodeText; m_AT.ActionMaps.TuningR.Deviceoption = m_AT.ActionMaps.Deadzones[doID];
m_AT.ActionMaps.TuningR.Deadzone = m_AT.ActionMaps.DeadzoneZ;
JSCAL.RollTuning = m_AT.ActionMaps.TuningR; JSCAL.RollTuning = m_AT.ActionMaps.TuningR;
} }
} }
// find action item for Strafe Lateral - cannot use gamepad here
find = ActionTreeNode.ComposeNodeText( "v_strafe_lateral", "js" );
nodeText = m_AT.FindText( "spaceship_movement", find ); // returns "" or a complete text ("action - command")
if ( !String.IsNullOrWhiteSpace( nodeText ) ) {
dev = m_Joystick.Find_jsN( JoystickCls.JSNum( ActionTreeNode.CommandFromNodeText( nodeText ) ) );
}
m_AT.ActionMaps.TuningStrafeLateral.Reset( ); // set defaults
if ( dev != null ) {
// JS commands that are supported
if ( nodeText.ToLowerInvariant( ).EndsWith( "_x" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotx" )
|| nodeText.ToLowerInvariant( ).EndsWith( "_y" ) || nodeText.ToLowerInvariant( ).EndsWith( "_roty" )
|| nodeText.ToLowerInvariant( ).EndsWith( "_Z" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotz" ) ) {
m_AT.ActionMaps.TuningStrafeLateral.GameDevice = dev;
m_AT.ActionMaps.TuningStrafeLateral.Action = nodeText;
string doID = Deviceoptions.DevOptionID( dev.DevName, nodeText );
if ( !m_AT.ActionMaps.Deadzones.ContainsKey( doID ) ) {
m_AT.ActionMaps.Deadzones.Add( doID, new DeviceOptionParameter( ) );
}
m_AT.ActionMaps.TuningStrafeLateral.Deviceoption = m_AT.ActionMaps.Deadzones[doID];
JSCAL.StrafeLatTuning = m_AT.ActionMaps.TuningStrafeLateral;
}
}
// attach Strafe Vertical command - cannot use gamepad here
dev = null;
find = ActionTreeNode.ComposeNodeText( "v_strafe_vertical", "js" );
nodeText = m_AT.FindText( "spaceship_movement", find ); // returns "" or a complete text ("action - command")
if ( !String.IsNullOrWhiteSpace( nodeText ) ) {
dev = m_Joystick.Find_jsN( JoystickCls.JSNum( ActionTreeNode.CommandFromNodeText( nodeText ) ) );
}
m_AT.ActionMaps.TuningStrafeVertical.Reset( ); // set defaults
if ( dev != null ) {
// JS commands that are supported
if ( nodeText.ToLowerInvariant( ).EndsWith( "_x" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotx" )
|| nodeText.ToLowerInvariant( ).EndsWith( "_y" ) || nodeText.ToLowerInvariant( ).EndsWith( "_roty" )
|| nodeText.ToLowerInvariant( ).EndsWith( "_Z" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotz" ) ) {
m_AT.ActionMaps.TuningStrafeVertical.GameDevice = dev;
m_AT.ActionMaps.TuningStrafeVertical.Action = nodeText;
string doID = Deviceoptions.DevOptionID( dev.DevName, nodeText );
if ( !m_AT.ActionMaps.Deadzones.ContainsKey( doID ) ) {
m_AT.ActionMaps.Deadzones.Add( doID, new DeviceOptionParameter( ) );
}
m_AT.ActionMaps.TuningStrafeVertical.Deviceoption = m_AT.ActionMaps.Deadzones[doID];
JSCAL.StrafeVertTuning = m_AT.ActionMaps.TuningStrafeVertical;
}
}
// attach Strafe Longitudinal command - cannot use gamepad here
dev = null;
find = ActionTreeNode.ComposeNodeText( "v_strafe_longitudinal", "js" );
nodeText = m_AT.FindText( "spaceship_movement", find ); // returns "" or a complete text ("action - command")
if ( !String.IsNullOrWhiteSpace( nodeText ) ) {
dev = m_Joystick.Find_jsN( JoystickCls.JSNum( ActionTreeNode.CommandFromNodeText( nodeText ) ) );
}
m_AT.ActionMaps.TuningStrafeLongitudinal.Reset( ); // set defaults
if ( dev != null ) {
// JS commands that are supported
if ( nodeText.ToLowerInvariant( ).EndsWith( "_x" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotx" )
|| nodeText.ToLowerInvariant( ).EndsWith( "_y" ) || nodeText.ToLowerInvariant( ).EndsWith( "_roty" )
|| nodeText.ToLowerInvariant( ).EndsWith( "_Z" ) || nodeText.ToLowerInvariant( ).EndsWith( "_rotz" ) ) {
m_AT.ActionMaps.TuningStrafeLongitudinal.GameDevice = dev;
m_AT.ActionMaps.TuningStrafeLongitudinal.Action = nodeText;
string doID = Deviceoptions.DevOptionID( dev.DevName, nodeText );
if ( !m_AT.ActionMaps.Deadzones.ContainsKey( doID ) ) {
m_AT.ActionMaps.Deadzones.Add( doID, new DeviceOptionParameter( ) );
}
m_AT.ActionMaps.TuningStrafeLongitudinal.Deviceoption = m_AT.ActionMaps.Deadzones[doID];
JSCAL.StrafeLonTuning = m_AT.ActionMaps.TuningStrafeLongitudinal;
}
}
// run // run
JSCAL.ShowDialog( ); JSCAL.ShowDialog( );
m_AT.Dirty = true; m_AT.Dirty = true;

@ -128,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA6 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAA6
EAAAAk1TRnQBSQFMAgEBCQEAAcgBEAHIAhABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA EAAAAk1TRnQBSQFMAgEBCQEAAdABEAHQAhABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
AUADAAEwAwABAQEAAQgGAAEMGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA AUADAAEwAwABAQEAAQgGAAEMGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm

@ -1,81 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SCJMapper_V2.Joystick
{
public class DeviceDeadzoneParameter
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
private String m_deviceName = "";
private String m_cmdCtrl = ""; // x, y, rotz ...
private bool m_deadzoneEnabled = false; // default
private String m_deadzone = "0.000";
public DeviceDeadzoneParameter( )
{
}
#region Properties
public String DeviceName
{
get { return m_deviceName; }
set { m_deviceName = value; }
}
public String CommandCtrl
{
get { return m_cmdCtrl; }
set { m_cmdCtrl = value; }
}
public bool DeadzoneUsed
{
get { return m_deadzoneEnabled; }
set { m_deadzoneEnabled = value; }
}
public String Deadzone
{
get { return m_deadzone; }
set { m_deadzone = value; }
}
#endregion
/// <summary>
/// Format an XML -deviceoptions- node from the tuning contents
/// </summary>
/// <returns>The XML string or an empty string</returns>
public String Deviceoptions_toXML( )
{
/*
<deviceoptions name="Joystick - HOTAS Warthog">
<!-- Reduce the deadzone -->
<option input="x" deadzone="0.015" />
<option input="y" deadzone="0.015" />
</deviceoptions>
*/
String tmp = "";
if ( m_deadzoneEnabled ) {
tmp += String.Format( "\t<deviceoptions name=\"{0}\">\n", m_deviceName );
tmp += String.Format( "\t\t<option input=\"{0}\" deadzone=\"{1}\" />\n", m_cmdCtrl, m_deadzone );
tmp += String.Format( "\t</deviceoptions>\n \n" );
}
return tmp;
}
}
}

@ -0,0 +1,124 @@
namespace SCJMapper_V2.Joystick
{
public class DeviceOptionParameter
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
private string m_deviceName = "";
private string m_cmdCtrl = ""; // x, y, rotz ...
private bool m_deadzoneEnabled = false; // default
private string m_deadzone = "0.000";
private bool m_saturationEnabled = false; // default
private string m_saturation = "1.000";
public DeviceOptionParameter( )
{
}
/// <summary>
/// cTor with content
/// </summary>
/// <param name="deviceName">The device name</param>
/// <param name="cmdCtrl">The command e.g. x,y, rotz etc</param>
/// <param name="dz">The deadzone value as string (empty string disables)</param>
/// <param name="sa">The saturation value as string (empty string disables)</param>
public DeviceOptionParameter(string deviceName, string cmdCtrl, string dz, string sa )
{
m_deviceName = deviceName;
m_cmdCtrl = cmdCtrl;
if ( string.IsNullOrEmpty( dz ) ) {
m_deadzone = "0.00";
m_deadzoneEnabled = false;
} else {
m_deadzone = dz;
m_deadzoneEnabled = true;
}
if ( string.IsNullOrEmpty(sa)) {
m_saturation = "1.00";
m_saturationEnabled = false;
} else {
m_saturation = sa;
m_saturationEnabled = true;
}
}
#region Properties
public string DeviceName
{
get { return m_deviceName; }
set { m_deviceName = value; }
}
public string CommandCtrl
{
get { return m_cmdCtrl; }
set { m_cmdCtrl = value; }
}
public bool DeadzoneUsed
{
get {
return ( m_deadzoneEnabled && ( m_deadzone != "0.00" ) );
}
set { m_deadzoneEnabled = value; }
}
public string Deadzone
{
get { return m_deadzone; }
set { m_deadzone = value; }
}
public bool SaturationUsed
{
get {
return ( m_saturationEnabled && ( m_saturation != "1.00" ) );
}
set { m_saturationEnabled = value; }
}
public string Saturation
{
get { return m_saturation; }
set { m_saturation = value; }
}
#endregion
/// <summary>
/// Format an XML -deviceoptions- node from the tuning contents
/// </summary>
/// <returns>The XML string or an empty string</returns>
public string Deviceoptions_toXML( )
{
/*
<deviceoptions name="Joystick - HOTAS Warthog">
<!-- Reduce the deadzone -->
<option input="x" deadzone="0.015" />
<option input="y" deadzone="0.015" />
<option input="y" saturation="0.85" />
</deviceoptions>
*/
string tmp = "";
if ( DeadzoneUsed || SaturationUsed ) {
tmp += string.Format( "\t<deviceoptions name=\"{0}\">\n", m_deviceName );
if ( DeadzoneUsed ) tmp += string.Format( "\t\t<option input=\"{0}\" deadzone=\"{1}\" />\n", m_cmdCtrl, m_deadzone );
if ( SaturationUsed ) tmp += string.Format( "\t\t<option input=\"{0}\" saturation=\"{1}\" />\n", m_cmdCtrl, m_saturation );
tmp += string.Format( "\t</deviceoptions>\n \n" );
}
return tmp;
}
}
}

@ -1,9 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml; using System.Xml;
using System.Windows.Forms;
namespace SCJMapper_V2.Joystick namespace SCJMapper_V2.Joystick
{ {
@ -14,30 +11,31 @@ namespace SCJMapper_V2.Joystick
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType ); private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
private String m_action = ""; // v_pitch private string m_action = ""; // v_pitch
private String m_cmdCtrl = ""; // js1_x, js1_y, js1_rotz ... private string m_cmdCtrl = ""; // js1_x, js1_y, js1_rotz ...
private String m_type = ""; // joystick OR xboxpad private string m_type = ""; // joystick OR xboxpad
private int m_devInstanceNo = -1; // jsN - instance in XML private int m_devInstanceNo = -1; // jsN - instance in XML
String m_option = ""; // the option name (level where it applies) string m_option = ""; // the option name (level where it applies)
private String m_deviceName = ""; private string m_deviceName = "";
private bool m_isStrafe = false; // default
private bool m_senseEnabled = false; // default // private bool m_senseEnabled = false; // default
private String m_sense = "1.00"; // private string m_sense = "1.00";
private bool m_expEnabled = false; // default private bool m_expEnabled = false; // default
private String m_exponent = "1.000"; private string m_exponent = "1.000";
private bool m_ptsEnabled = false; // default private bool m_ptsEnabled = false; // default
private List<String> m_PtsIn = new List<String>( ); private List<string> m_PtsIn = new List<string>( );
private List<String> m_PtsOut = new List<String>( ); private List<string> m_PtsOut = new List<string>( );
private bool m_invertEnabled = false; // default private bool m_invertEnabled = false; // default
private DeviceCls m_device = null; private DeviceCls m_device = null;
private DeviceDeadzoneParameter m_deadzone = null; private DeviceOptionParameter m_deviceoption = null;
public DeviceTuningParameter( ) public DeviceTuningParameter( )
{ {
@ -48,8 +46,7 @@ namespace SCJMapper_V2.Joystick
public DeviceCls GameDevice public DeviceCls GameDevice
{ {
get { return m_device; } get { return m_device; }
set set {
{
m_device = value; m_device = value;
m_type = ""; m_type = "";
m_devInstanceNo = -1; m_devInstanceNo = -1;
@ -58,8 +55,7 @@ namespace SCJMapper_V2.Joystick
if ( JoystickCls.IsDeviceClass( m_device.DevClass ) ) { if ( JoystickCls.IsDeviceClass( m_device.DevClass ) ) {
m_type = m_device.DevClass; m_type = m_device.DevClass;
m_devInstanceNo = ( m_device as JoystickCls ).JSAssignment; m_devInstanceNo = ( m_device as JoystickCls ).JSAssignment;
} } else if ( Gamepad.GamepadCls.IsDeviceClass( m_device.DevClass ) ) {
else if ( Gamepad.GamepadCls.IsDeviceClass( m_device.DevClass ) ) {
m_type = m_device.DevClass; m_type = m_device.DevClass;
m_devInstanceNo = 1; // supports ONE gamepad m_devInstanceNo = 1; // supports ONE gamepad
} }
@ -72,50 +68,55 @@ namespace SCJMapper_V2.Joystick
get { return m_devInstanceNo; } get { return m_devInstanceNo; }
} }
public String DeviceName public string DeviceName
{ {
get { return m_deviceName; } get { return m_deviceName; }
set { m_deviceName = value; } set { m_deviceName = value; }
} }
public String Action public string Action
{ {
get { return m_action; } get { return m_action; }
set { m_action = value; DecomposeCommand( ); } set { m_action = value; DecomposeCommand( ); }
} }
public String CommandCtrl public string CommandCtrl
{ {
get { return m_cmdCtrl; } get { return m_cmdCtrl; }
set { m_cmdCtrl = value; } set { m_cmdCtrl = value; }
} }
public bool IsStrafeCommand
{
get { return m_isStrafe; }
set { m_isStrafe = value; }
}
public DeviceDeadzoneParameter Deadzone public DeviceOptionParameter Deviceoption
{ {
get { return m_deadzone; } get { return m_deviceoption; }
set set {
{ m_deviceoption = value;
m_deadzone = value; if ( m_deviceoption != null ) {
if ( m_deadzone != null ) { m_deviceoption.DeviceName = DeviceName; // must know too
m_deadzone.DeviceName = DeviceName; // must know too m_deviceoption.CommandCtrl = CommandCtrl; // must know too
m_deadzone.CommandCtrl = CommandCtrl; // must know too
} }
} }
} }
/*
public bool SensitivityUsed public bool SensitivityUsed
{ {
get { return m_senseEnabled; } get { return m_senseEnabled; }
set { m_senseEnabled = value; } set { m_senseEnabled = value; }
} }
public String Sensitivity public string Sensitivity
{ {
get { return m_sense; } get { return m_sense; }
set { m_sense = value; } set { m_sense = value; }
} }
*/
public bool InvertUsed public bool InvertUsed
{ {
get { return m_invertEnabled; } get { return m_invertEnabled; }
@ -128,7 +129,7 @@ namespace SCJMapper_V2.Joystick
set { m_expEnabled = value; } set { m_expEnabled = value; }
} }
public String Exponent public string Exponent
{ {
get { return m_exponent; } get { return m_exponent; }
set { m_exponent = value; } set { m_exponent = value; }
@ -141,12 +142,12 @@ namespace SCJMapper_V2.Joystick
set { m_ptsEnabled = value; } set { m_ptsEnabled = value; }
} }
public List<String> NonLinCurvePtsIn public List<string> NonLinCurvePtsIn
{ {
get { return m_PtsIn; } get { return m_PtsIn; }
set { m_PtsIn = value; } set { m_PtsIn = value; }
} }
public List<String> NonLinCurvePtsOut public List<string> NonLinCurvePtsOut
{ {
get { return m_PtsOut; } get { return m_PtsOut; }
set { m_PtsOut = value; } set { m_PtsOut = value; }
@ -158,7 +159,7 @@ namespace SCJMapper_V2.Joystick
public void Reset( ) public void Reset( )
{ {
GameDevice = null; GameDevice = null;
Deadzone = null; Deviceoption = null;
Action = ""; Action = "";
} }
@ -170,47 +171,56 @@ namespace SCJMapper_V2.Joystick
{ {
// populate from input // populate from input
// something like "v_pitch - js1_x" OR "v_pitch - xi_thumbl" OR "v_pitch - ximod+xi_thumbl+xi_mod" // something like "v_pitch - js1_x" OR "v_pitch - xi_thumbl" OR "v_pitch - ximod+xi_thumbl+xi_mod"
String cmd = ActionTreeNode.CommandFromNodeText( Action ); string cmd = ActionTreeNode.CommandFromNodeText( Action );
String action = ActionTreeNode.ActionFromNodeText( Action ); string action = ActionTreeNode.ActionFromNodeText( Action );
m_cmdCtrl = ""; m_cmdCtrl = "";
if ( !String.IsNullOrWhiteSpace( cmd ) ) { if ( !string.IsNullOrWhiteSpace( cmd ) ) {
// decomp gamepad entries - could have modifiers so check for contains... // decomp gamepad entries - could have modifiers so check for contains...
if ( cmd.Contains( "xi_thumblx" ) ) { if ( cmd.Contains( "xi_thumblx" ) ) {
// gamepad // gamepad
m_cmdCtrl = "xi_thumblx"; m_cmdCtrl = "xi_thumblx";
m_deviceName = m_device.DevName; m_deviceName = m_device.DevName;
if ( action.Contains( "pitch" ) ) m_option = String.Format( "flight_move_pitch" ); if ( action.Contains( "pitch" ) ) m_option = string.Format( "flight_move_pitch" );
else m_option = String.Format( "flight_move_yaw" ); else m_option = string.Format( "flight_move_yaw" );
} } else if ( cmd.Contains( "xi_thumbly" ) ) {
else if ( cmd.Contains( "xi_thumbly" ) ) {
// gamepad // gamepad
m_cmdCtrl = "xi_thumbly"; m_cmdCtrl = "xi_thumbly";
m_deviceName = m_device.DevName; m_deviceName = m_device.DevName;
if ( action.Contains( "pitch" ) ) m_option = String.Format( "flight_move_pitch" ); if ( action.Contains( "pitch" ) ) m_option = string.Format( "flight_move_pitch" );
else m_option = String.Format( "flight_move_yaw" ); else m_option = string.Format( "flight_move_yaw" );
} } else if ( cmd.Contains( "xi_thumbrx" ) ) {
else if ( cmd.Contains( "xi_thumbrx" ) ) {
// gamepad // gamepad
m_cmdCtrl = "xi_thumbrx"; m_cmdCtrl = "xi_thumbrx";
m_deviceName = m_device.DevName; m_deviceName = m_device.DevName;
if ( action.Contains( "pitch" ) ) m_option = String.Format( "flight_move_pitch" ); if ( action.Contains( "pitch" ) ) m_option = string.Format( "flight_move_pitch" );
else m_option = String.Format( "flight_move_yaw" ); else m_option = string.Format( "flight_move_yaw" );
} } else if ( cmd.Contains( "xi_thumbry" ) ) {
else if ( cmd.Contains( "xi_thumbry" ) ) {
// gamepad // gamepad
m_cmdCtrl = "xi_thumbry"; m_cmdCtrl = "xi_thumbry";
m_deviceName = m_device.DevName; m_deviceName = m_device.DevName;
if ( action.Contains( "pitch" ) ) m_option = String.Format( "flight_move_pitch" ); if ( action.Contains( "pitch" ) ) m_option = string.Format( "flight_move_pitch" );
else m_option = String.Format( "flight_move_yaw" ); else m_option = string.Format( "flight_move_yaw" );
} }
// assume joystick // assume joystick
else { else {
// get parts // get parts
m_cmdCtrl = JoystickCls.ActionFromJsCommand( cmd ); //js1_x -> x; js2_rotz -> rotz m_cmdCtrl = JoystickCls.ActionFromJsCommand( cmd ); //js1_x -> x; js2_rotz -> rotz
m_deviceName = m_device.DevName; m_deviceName = m_device.DevName;
if ( action.Contains( "pitch" ) ) m_option = String.Format( "flight_move_pitch" ); if ( action.Contains( "pitch" ) ) {
else if ( action.Contains( "yaw" ) ) m_option = String.Format( "flight_move_yaw" ); m_option = string.Format( "flight_move_pitch" ); m_isStrafe = false;
else m_option = String.Format( "flight_move_roll" ); } else if ( action.Contains( "yaw" ) ) {
m_option = string.Format( "flight_move_yaw" ); m_isStrafe = false;
} else if ( action.Contains( "roll" ) ) {
m_option = string.Format( "flight_move_roll" ); m_isStrafe = false;
}
// strafes
else if ( action.Contains( "vertical" ) ) {
m_option = string.Format( "flight_move_strafe_vertical" ); m_isStrafe = true;
} else if ( action.Contains( "lateral" ) ) {
m_option = string.Format( "flight_move_strafe_lateral" ); m_isStrafe = true;
} else if ( action.Contains( "longitudinal" ) ) {
m_option = string.Format( "flight_move_strafe_longitudinal" ); m_isStrafe = true;
} else m_option = string.Format( "????" ); // don't know what it is ...
} }
} }
} }
@ -220,40 +230,40 @@ namespace SCJMapper_V2.Joystick
/// Format an XML -options- node from the tuning contents /// Format an XML -options- node from the tuning contents
/// </summary> /// </summary>
/// <returns>The XML string or an empty string</returns> /// <returns>The XML string or an empty string</returns>
public String Options_toXML( ) public string Options_toXML( )
{ {
if ( ( SensitivityUsed || ExponentUsed || InvertUsed || NonLinCurveUsed ) == false ) return ""; // not used if ( ( /*SensitivityUsed ||*/ ExponentUsed || InvertUsed || NonLinCurveUsed ) == false ) return ""; // not used
String tmp = ""; string tmp = "";
tmp += String.Format( "\t<options type=\"{0}\" instance=\"{1}\">\n", m_type, m_devInstanceNo.ToString( ) ); tmp += string.Format( "\t<options type=\"{0}\" instance=\"{1}\">\n", m_type, m_devInstanceNo.ToString( ) );
tmp += String.Format( "\t\t<{0} ", m_option ); tmp += string.Format( "\t\t<{0} ", m_option );
if ( InvertUsed ) { if ( InvertUsed ) {
tmp += String.Format( "invert=\"1\" " ); tmp += string.Format( "invert=\"1\" " );
} }
/*
if ( SensitivityUsed ) { if ( SensitivityUsed ) {
tmp += String.Format( "sensitivity=\"{0}\" ", Sensitivity ); tmp += string.Format( "sensitivity=\"{0}\" ", Sensitivity );
} }
*/
if ( NonLinCurveUsed ) { if ( NonLinCurveUsed ) {
// add exp to avoid merge of things... // add exp to avoid merge of things...
tmp += String.Format( "exponent=\"1.00\" > \n" ); // CIG get to default expo 2.something if not set to 1 here tmp += string.Format( "exponent=\"1.00\" > \n" ); // CIG get to default expo 2.something if not set to 1 here
tmp += String.Format( "\t\t\t<nonlinearity_curve>\n" ); tmp += string.Format( "\t\t\t<nonlinearity_curve>\n" );
tmp += String.Format( "\t\t\t\t<point in=\"{0}\" out=\"{1}\"/>\n", m_PtsIn[0], m_PtsOut[0] ); tmp += string.Format( "\t\t\t\t<point in=\"{0}\" out=\"{1}\"/>\n", m_PtsIn[0], m_PtsOut[0] );
tmp += String.Format( "\t\t\t\t<point in=\"{0}\" out=\"{1}\"/>\n", m_PtsIn[1], m_PtsOut[1] ); tmp += string.Format( "\t\t\t\t<point in=\"{0}\" out=\"{1}\"/>\n", m_PtsIn[1], m_PtsOut[1] );
tmp += String.Format( "\t\t\t\t<point in=\"{0}\" out=\"{1}\"/>\n", m_PtsIn[2], m_PtsOut[2] ); tmp += string.Format( "\t\t\t\t<point in=\"{0}\" out=\"{1}\"/>\n", m_PtsIn[2], m_PtsOut[2] );
tmp += String.Format( "\t\t\t</nonlinearity_curve>\n" ); tmp += string.Format( "\t\t\t</nonlinearity_curve>\n" );
tmp += String.Format( "\t\t</{0}> \n", m_option ); tmp += string.Format( "\t\t</{0}> \n", m_option );
} } else if ( ExponentUsed ) {
else if ( ExponentUsed ) {
// only exp used // only exp used
tmp += String.Format( "exponent=\"{0}\" /> \n", Exponent ); tmp += string.Format( "exponent=\"{0}\" /> \n", Exponent );
} } else {
else {
// neither exp or curve // neither exp or curve
tmp += String.Format( " /> \n" );// nothing... tmp += string.Format( " /> \n" );// nothing...
} }
tmp += String.Format( "\t</options>\n \n" ); tmp += string.Format( "\t</options>\n \n" );
return tmp; return tmp;
} }
@ -266,52 +276,54 @@ namespace SCJMapper_V2.Joystick
/// <param name="reader">A prepared XML reader</param> /// <param name="reader">A prepared XML reader</param>
/// <param name="instance">the Joystick instance number</param> /// <param name="instance">the Joystick instance number</param>
/// <returns></returns> /// <returns></returns>
public Boolean Options_fromXML( XmlReader reader, String type, int instance ) public Boolean Options_fromXML( XmlReader reader, string type, int instance )
{ {
m_type = type; m_type = type;
String invert = ""; string invert = "";
String sensitivity = ""; string sensitivity = "";
String exponent = ""; string exponent = "";
m_option = reader.Name; m_option = reader.Name;
m_devInstanceNo = instance; m_devInstanceNo = instance;
// derive from flight_move_pitch || flight_move_yaw || flight_move_roll (nothing bad should arrive here) // derive from flight_move_pitch || flight_move_yaw || flight_move_roll (nothing bad should arrive here)
String[] e = m_option.ToLowerInvariant( ).Split( new char[] { '_' } ); string[] e = m_option.ToLowerInvariant( ).Split( new char[] { '_' } );
if ( e.Length > 2 ) m_cmdCtrl = e[2]; // TODO - see if m_cmdCtrl is needed to be derived here if ( e.Length > 2 ) m_cmdCtrl = e[2]; // TODO - see if m_cmdCtrl is needed to be derived here
if ( reader.HasAttributes ) { if ( reader.HasAttributes ) {
invert = reader["invert"]; invert = reader["invert"];
if ( !String.IsNullOrWhiteSpace( invert ) ) { if ( !string.IsNullOrWhiteSpace( invert ) ) {
InvertUsed = false; InvertUsed = false;
if ( invert == "1" ) InvertUsed = true; if ( invert == "1" ) InvertUsed = true;
} }
/*
sensitivity = reader["sensitivity"]; sensitivity = reader["sensitivity"];
if ( !String.IsNullOrWhiteSpace( sensitivity ) ) { if ( !string.IsNullOrWhiteSpace( sensitivity ) ) {
Sensitivity = sensitivity; Sensitivity = sensitivity;
SensitivityUsed = true; SensitivityUsed = true;
} }
*/
exponent = reader["exponent"]; exponent = reader["exponent"];
if ( !String.IsNullOrWhiteSpace( exponent ) ) { if ( !string.IsNullOrWhiteSpace( exponent ) ) {
Exponent = exponent; Exponent = exponent;
ExponentUsed = true; ExponentUsed = true;
} }
} }
// we may have a nonlin curve... // we may have a nonlin curve...
if ( ! reader.IsEmptyElement ) { if ( !reader.IsEmptyElement ) {
reader.Read( ); reader.Read( );
if ( !reader.EOF ) { if ( !reader.EOF ) {
if ( reader.Name.ToLowerInvariant( ) == "nonlinearity_curve" ) { if ( reader.Name.ToLowerInvariant( ) == "nonlinearity_curve" ) {
m_PtsIn.Clear( ); m_PtsOut.Clear( ); // reset pts m_PtsIn.Clear( ); m_PtsOut.Clear( ); // reset pts
ExponentUsed = false; // NonLin Curve takes prio
reader.Read( ); reader.Read( );
while ( !reader.EOF ) { while ( !reader.EOF ) {
String ptIn = ""; string ptIn = "";
String ptOut = ""; string ptOut = "";
if ( reader.Name.ToLowerInvariant( ) == "point" ) { if ( reader.Name.ToLowerInvariant( ) == "point" ) {
if ( reader.HasAttributes ) { if ( reader.HasAttributes ) {
ptIn = reader["in"]; ptIn = reader["in"];

@ -1,7 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml; using System.Xml;
using System.IO; using System.IO;
using System.Xml.Linq; using System.Xml.Linq;
@ -15,6 +13,7 @@ namespace SCJMapper_V2.Joystick
/// <!-- Reduce the deadzone --> /// <!-- Reduce the deadzone -->
/// <option input="x" deadzone="0.015" /> /// <option input="x" deadzone="0.015" />
/// <option input="y" deadzone="0.015" /> /// <option input="y" deadzone="0.015" />
/// <option input="y" saturation="0.85" />
/// </deviceoptions> /// </deviceoptions>
/// ///
/// [device] : set to device name (name shown in Windows Game Controllers control panel), currently known names follow /// [device] : set to device name (name shown in Windows Game Controllers control panel), currently known names follow
@ -22,64 +21,44 @@ namespace SCJMapper_V2.Joystick
/// Saitek X52 Pro Flight Controller /// Saitek X52 Pro Flight Controller
/// ///
/// </summary> /// </summary>
public class Deviceoptions public class Deviceoptions : Dictionary<string, DeviceOptionParameter>
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType ); private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
List<String> m_stringOptions = new List<String>( ); private static char ID_Delimiter = '⁞';
public static string DevOptionID( string devName, string cmdCtrl )
{
string cmd = cmdCtrl.Trim();
if ( cmd.Contains( "_" ) ) {
int l = cmd.LastIndexOf("_");
cmd = cmd.Substring( l + 1 ); // assuming it is never the last one..
}
return string.Format( "{0}{1}{2}", devName, ID_Delimiter, cmd );
}
List<string> m_stringOptions = new List<string>( );
DeviceDeadzoneParameter m_deadzoneX = null;
DeviceDeadzoneParameter m_deadzoneY = null;
DeviceDeadzoneParameter m_deadzoneZ = null;
// ctor // ctor
public Deviceoptions( Options options ) public Deviceoptions( Options options )
{ {
m_deadzoneX = new DeviceDeadzoneParameter();
m_deadzoneY = new DeviceDeadzoneParameter( );
m_deadzoneZ = new DeviceDeadzoneParameter( );
} }
public int Count new public int Count
{ {
get { return ( m_stringOptions.Count + ( ( m_deadzoneX != null ) ? 1 : 0 ) + ( ( m_deadzoneY != null ) ? 1 : 0 ) + ( ( m_deadzoneZ != null ) ? 1 : 0 ) ); } get { return ( m_stringOptions.Count + base.Count ); }
} }
// provide access to Sense items // provide access to Sense items
/// <summary> private string[] FormatXml( string xml )
/// Returns the Z-sensitivity item
/// </summary>
public DeviceDeadzoneParameter DeadzoneX
{
get { return m_deadzoneX; }
}
/// <summary>
/// Returns the Z-sensitivity item
/// </summary>
public DeviceDeadzoneParameter DeadzoneY
{
get { return m_deadzoneY; }
}
/// <summary>
/// Returns the Z-sensitivity item
/// </summary>
public DeviceDeadzoneParameter DeadzoneZ
{
get { return m_deadzoneZ; }
}
private String[] FormatXml( string xml )
{ {
try { try {
XDocument doc = XDocument.Parse( xml ); XDocument doc = XDocument.Parse( xml );
return doc.ToString( ).Split( new String[] { String.Format( "\n" ) }, StringSplitOptions.RemoveEmptyEntries ); return doc.ToString( ).Split( new string[] { string.Format( "\n" ) }, StringSplitOptions.RemoveEmptyEntries );
} } catch ( Exception ) {
catch ( Exception ) { return new string[] { xml };
return new String[] { xml };
} }
} }
@ -87,26 +66,26 @@ namespace SCJMapper_V2.Joystick
/// Dump the Deviceoptions as partial XML nicely formatted /// Dump the Deviceoptions as partial XML nicely formatted
/// </summary> /// </summary>
/// <returns>the action as XML fragment</returns> /// <returns>the action as XML fragment</returns>
public String toXML( ) public string toXML( )
{ {
String r = ""; string r = "";
// and dump the contents of plain string options // and dump the contents of plain string options
foreach ( String x in m_stringOptions ) { foreach ( string x in m_stringOptions ) {
if ( !String.IsNullOrWhiteSpace( x ) ) { if ( !string.IsNullOrWhiteSpace( x ) ) {
foreach ( String line in FormatXml( x ) ) { foreach ( string line in FormatXml( x ) ) {
r += String.Format( "\t{0}", line ); r += string.Format( "\t{0}", line );
} }
} }
r += String.Format( "\n" ); r += string.Format( "\n" );
} }
// dump Tuning // dump Tuning
r += m_deadzoneX.Deviceoptions_toXML( ); foreach ( KeyValuePair<string, DeviceOptionParameter> kv in this ) {
r += m_deadzoneY.Deviceoptions_toXML( ); r += kv.Value.Deviceoptions_toXML( );
r += m_deadzoneZ.Deviceoptions_toXML( ); }
return r; return r;
} }
@ -118,7 +97,7 @@ namespace SCJMapper_V2.Joystick
/// </summary> /// </summary>
/// <param name="xml">the XML action fragment</param> /// <param name="xml">the XML action fragment</param>
/// <returns>True if an action was decoded</returns> /// <returns>True if an action was decoded</returns>
public Boolean fromXML( String xml ) public Boolean fromXML( string xml )
{ {
/* /*
* This can be a lot of the following options * This can be a lot of the following options
@ -140,7 +119,7 @@ namespace SCJMapper_V2.Joystick
reader.Read( ); reader.Read( );
String name = ""; string name = "";
if ( reader.HasAttributes ) { if ( reader.HasAttributes ) {
name = reader["name"]; name = reader["name"];
@ -150,53 +129,40 @@ namespace SCJMapper_V2.Joystick
while ( !reader.EOF ) { while ( !reader.EOF ) {
if ( reader.Name.ToLowerInvariant( ) == "option" ) { if ( reader.Name.ToLowerInvariant( ) == "option" ) {
if ( reader.HasAttributes ) { if ( reader.HasAttributes ) {
String input = reader["input"]; string input = reader["input"];
String deadzone = reader["deadzone"]; string deadzone = reader["deadzone"];
if ( ! (String.IsNullOrWhiteSpace( input ) || String.IsNullOrWhiteSpace( deadzone )) ) { string saturation = reader["saturation"];
if ( input.ToLowerInvariant( ).EndsWith("x") ) { if ( !string.IsNullOrWhiteSpace( input ) ) {
if ( String.IsNullOrWhiteSpace( m_deadzoneX.CommandCtrl ) ) m_deadzoneX.CommandCtrl = input; // if no options have been given... string doID = DevOptionID(name, input);
if ( String.IsNullOrWhiteSpace( m_deadzoneX.DeviceName ) ) m_deadzoneX.DeviceName = name; // if no devicename has been given... if ( !string.IsNullOrWhiteSpace( deadzone ) ) {
float testF;
if ( float.TryParse( deadzone, out testF ) ) { // check for valid number in string
m_deadzoneX.DeadzoneUsed = true; m_deadzoneX.Deadzone = deadzone;
}
else {
m_deadzoneX.DeadzoneUsed = false; m_deadzoneX.Deadzone = "0.00";
}
}
else if ( input.ToLowerInvariant( ).EndsWith("y") ) {
if ( String.IsNullOrWhiteSpace( m_deadzoneY.CommandCtrl ) ) m_deadzoneY.CommandCtrl = input; // if no options have been given...
if ( String.IsNullOrWhiteSpace( m_deadzoneY.DeviceName ) ) m_deadzoneY.DeviceName = name; // if no devicename has been given...
float testF; float testF;
if ( float.TryParse( deadzone, out testF ) ) { // check for valid number in string if ( !float.TryParse( deadzone, out testF ) ) { // check for valid number in string
m_deadzoneY.DeadzoneUsed = true; m_deadzoneY.Deadzone = deadzone; deadzone = "0.00";
} }
else { if ( !this.ContainsKey( doID ) ) {
m_deadzoneY.DeadzoneUsed = false; m_deadzoneY.Deadzone = "0.00"; this.Add( doID, new DeviceOptionParameter( name, input, deadzone, saturation ) );
}else {
// add deadzone value tp existing
this[doID].Deadzone = deadzone;
} }
} }
else if ( input.ToLowerInvariant( ).EndsWith( "z" ) ) { if ( !string.IsNullOrWhiteSpace( saturation ) ) {
if ( String.IsNullOrWhiteSpace( m_deadzoneZ.CommandCtrl )) m_deadzoneZ.CommandCtrl=input; // if no options have been given...
if ( String.IsNullOrWhiteSpace( m_deadzoneZ.DeviceName ) ) m_deadzoneZ.DeviceName = name; // if no devicename has been given...
float testF; float testF;
if ( float.TryParse( deadzone, out testF ) ) { // check for valid number in string if ( !float.TryParse( saturation, out testF ) ) { // check for valid number in string
m_deadzoneZ.DeadzoneUsed = true; m_deadzoneZ.Deadzone = deadzone; saturation = "1.00";
} }
else { if ( !this.ContainsKey( doID ) ) {
m_deadzoneZ.DeadzoneUsed = false; m_deadzoneZ.Deadzone = "0.00"; this.Add( doID, new DeviceOptionParameter( name, input, deadzone, saturation ) );
} else {
// add saturation value tp existing
this[doID].Saturation = saturation;
} }
} }
else { } else {
//?? option node refers to unknown axis (not x,y,rotz)
log.ErrorFormat( "Deviceoptions.fromXML: option node refers to unknown axis {0}", input );
}
}
else {
//? option node has not the needed attributes //? option node has not the needed attributes
log.ErrorFormat( "Deviceoptions.fromXML: option node has not the needed attributes" ); log.ErrorFormat( "Deviceoptions.fromXML: option node has not the needed attributes" );
} }
} } else {
else {
//?? option node has NO attributes //?? option node has NO attributes
log.ErrorFormat( "Deviceoptions.fromXML: option node has NO attributes" ); log.ErrorFormat( "Deviceoptions.fromXML: option node has NO attributes" );
} }
@ -204,8 +170,7 @@ namespace SCJMapper_V2.Joystick
reader.Read( ); reader.Read( );
}//while }//while
} } else {
else {
//?? //??
if ( !m_stringOptions.Contains( xml ) ) m_stringOptions.Add( xml ); if ( !m_stringOptions.Contains( xml ) ) m_stringOptions.Add( xml );
} }

@ -17,6 +17,10 @@ namespace SCJMapper_V2.Joystick
/// <pilot exponent="1" /> /// <pilot exponent="1" />
/// </options> /// </options>
/// ///
/// <options type="joystick" instance="2" >
/// <flight_move_strafe_longitudinal invert="1" />
/// </options>
///
/// [type] : set to shared, keyboard, xboxpad, or joystick /// [type] : set to shared, keyboard, xboxpad, or joystick
/// [instance] : set to the device number; js1=1, js2=2, etc /// [instance] : set to the device number; js1=1, js2=2, etc
/// [optiongroup] : set to what group the option should affect (for available groups see default actionmap) /// [optiongroup] : set to what group the option should affect (for available groups see default actionmap)
@ -30,12 +34,16 @@ namespace SCJMapper_V2.Joystick
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType ); private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
// Support only one set of independent options (string storage) // Support only one set of independent options (string storage)
List<String> m_stringOptions = new List<String>( ); List<string> m_stringOptions = new List<string>( );
// Support only one set of TuningParameters (there is only ONE Joystick Pitch, Yaw, Roll control possible, they can be on different instances however) // Support only one set of TuningParameters (there is only ONE Joystick Pitch, Yaw, Roll control possible, they can be on different instances however)
DeviceTuningParameter m_tuningP = null; // pitch DeviceTuningParameter m_tuningP = null; // pitch
DeviceTuningParameter m_tuningY = null; // yaw DeviceTuningParameter m_tuningY = null; // yaw
DeviceTuningParameter m_tuningR = null; // roll DeviceTuningParameter m_tuningR = null; // roll
DeviceTuningParameter m_tuningVert = null; // strafe vertical
DeviceTuningParameter m_tuningLat = null; // strafe lateral
DeviceTuningParameter m_tuningLon = null; // strafe longitudinal
// Have to support Inverters for all possible JS Instances here - right now 4 are supported - provide them for all 12 we support.. // Have to support Inverters for all possible JS Instances here - right now 4 are supported - provide them for all 12 we support..
public List<OptionsInvert> m_inverter = new List<OptionsInvert>( ); // all inverters public List<OptionsInvert> m_inverter = new List<OptionsInvert>( ); // all inverters
@ -49,6 +57,10 @@ namespace SCJMapper_V2.Joystick
m_tuningY = new DeviceTuningParameter( ); m_tuningY = new DeviceTuningParameter( );
m_tuningR = new DeviceTuningParameter( ); m_tuningR = new DeviceTuningParameter( );
m_tuningVert = new DeviceTuningParameter( );
m_tuningLat = new DeviceTuningParameter( );
m_tuningLon = new DeviceTuningParameter( );
// create inverters ( // create inverters (
for ( int i = 0; i < ( int )OptionsInvert.Inversions.I_LAST; i++ ) { for ( int i = 0; i < ( int )OptionsInvert.Inversions.I_LAST; i++ ) {
OptionsInvert inv = new OptionsInvert((OptionsInvert.Inversions)i); OptionsInvert inv = new OptionsInvert((OptionsInvert.Inversions)i);
@ -87,6 +99,28 @@ namespace SCJMapper_V2.Joystick
get { return m_tuningR; } get { return m_tuningR; }
} }
/// <summary>
/// Returns the Strafe Vertical-Tuning item
/// </summary>
public DeviceTuningParameter TuneVert
{
get { return m_tuningVert; }
}
/// <summary>
/// Returns the Strafe Lateral-Tuning item
/// </summary>
public DeviceTuningParameter TuneLat
{
get { return m_tuningLat; }
}
/// <summary>
/// Returns the Strafe Longitudinal-Tuning item
/// </summary>
public DeviceTuningParameter TuneLon
{
get { return m_tuningLon; }
}
/// <summary> /// <summary>
/// Returns the inverter based on the enum given /// Returns the inverter based on the enum given
/// </summary> /// </summary>
@ -126,13 +160,13 @@ namespace SCJMapper_V2.Joystick
private String[] FormatXml( string xml ) private string[] FormatXml( string xml )
{ {
try { try {
XDocument doc = XDocument.Parse( xml ); XDocument doc = XDocument.Parse( xml );
return doc.ToString( ).Split( new String[] { String.Format( "\n" ) }, StringSplitOptions.RemoveEmptyEntries ); return doc.ToString( ).Split( new string[] { string.Format( "\n" ) }, StringSplitOptions.RemoveEmptyEntries );
} catch ( Exception ) { } catch ( Exception ) {
return new String[] { xml }; return new string[] { xml };
} }
} }
@ -140,36 +174,40 @@ namespace SCJMapper_V2.Joystick
/// Dump the Options as partial XML nicely formatted /// Dump the Options as partial XML nicely formatted
/// </summary> /// </summary>
/// <returns>the action as XML fragment</returns> /// <returns>the action as XML fragment</returns>
public String toXML( ) public string toXML( )
{ {
String r = ""; string r = "";
// and dump the contents of plain string options // and dump the contents of plain string options
foreach ( String x in m_stringOptions ) { foreach ( string x in m_stringOptions ) {
if ( !String.IsNullOrWhiteSpace( x ) ) { if ( !string.IsNullOrWhiteSpace( x ) ) {
foreach ( String line in FormatXml( x ) ) { foreach ( string line in FormatXml( x ) ) {
r += String.Format( "\t{0}", line ); r += string.Format( "\t{0}", line );
} }
} }
r += String.Format( "\n" ); r += string.Format( "\n" );
} }
// dump Tuning // dump Tuning
r += m_tuningP.Options_toXML( );
r += m_tuningY.Options_toXML( ); r += m_tuningY.Options_toXML( );
r += m_tuningP.Options_toXML( );
r += m_tuningR.Options_toXML( ); r += m_tuningR.Options_toXML( );
r += m_tuningLat.Options_toXML( );
r += m_tuningVert.Options_toXML( );
r += m_tuningLon.Options_toXML( );
r += m_inverter[( int )OptionsInvert.Inversions.flight_aim_pitch].Options_toXML( ); r += m_inverter[( int )OptionsInvert.Inversions.flight_aim_pitch].Options_toXML( );
r += m_inverter[( int )OptionsInvert.Inversions.flight_aim_yaw].Options_toXML( ); r += m_inverter[( int )OptionsInvert.Inversions.flight_aim_yaw].Options_toXML( );
r += m_inverter[( int )OptionsInvert.Inversions.flight_view_pitch].Options_toXML( ); r += m_inverter[( int )OptionsInvert.Inversions.flight_view_pitch].Options_toXML( );
r += m_inverter[( int )OptionsInvert.Inversions.flight_view_yaw].Options_toXML( ); r += m_inverter[( int )OptionsInvert.Inversions.flight_view_yaw].Options_toXML( );
r += m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_vertical].Options_toXML( ); // r += m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_vertical].Options_toXML( );
r += m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_lateral].Options_toXML( ); // r += m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_lateral].Options_toXML( );
r += m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_longitudinal].Options_toXML( ); // r += m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_longitudinal].Options_toXML( );
r += m_inverter[( int )OptionsInvert.Inversions.flight_throttle].Options_toXML( ); r += m_inverter[( int )OptionsInvert.Inversions.flight_throttle].Options_toXML( );
@ -183,7 +221,7 @@ namespace SCJMapper_V2.Joystick
/// </summary> /// </summary>
/// <param name="xml">the XML action fragment</param> /// <param name="xml">the XML action fragment</param>
/// <returns>True if an action was decoded</returns> /// <returns>True if an action was decoded</returns>
public Boolean fromXML( String xml ) public Boolean fromXML( string xml )
{ {
/* /*
* This can be a lot of the following options * This can be a lot of the following options
@ -219,8 +257,8 @@ namespace SCJMapper_V2.Joystick
reader.Read( ); reader.Read( );
String type = ""; string type = "";
String instance = ""; int nInstance = 0; string instance = ""; int nInstance = 0;
if ( reader.HasAttributes ) { if ( reader.HasAttributes ) {
type = reader["type"]; type = reader["type"];
@ -272,11 +310,14 @@ namespace SCJMapper_V2.Joystick
} else if ( reader.Name.ToLowerInvariant( ) == "flight_move_roll" ) { } else if ( reader.Name.ToLowerInvariant( ) == "flight_move_roll" ) {
m_tuningR.Options_fromXML( reader, type, int.Parse( instance ) ); m_tuningR.Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_vertical" ) { } else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_vertical" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_vertical].Options_fromXML( reader, type, int.Parse( instance ) ); m_tuningVert.Options_fromXML( reader, type, int.Parse( instance ) );
//m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_vertical].Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_lateral" ) { } else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_lateral" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_lateral].Options_fromXML( reader, type, int.Parse( instance ) ); m_tuningLat.Options_fromXML( reader, type, int.Parse( instance ) );
//m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_lateral].Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_longitudinal" ) { } else if ( reader.Name.ToLowerInvariant( ) == "flight_move_strafe_longitudinal" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_longitudinal].Options_fromXML( reader, type, int.Parse( instance ) ); m_tuningLon.Options_fromXML( reader, type, int.Parse( instance ) );
//m_inverter[( int )OptionsInvert.Inversions.flight_move_strafe_longitudinal].Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_aim_pitch" ) { } else if ( reader.Name.ToLowerInvariant( ) == "flight_aim_pitch" ) {
m_inverter[( int )OptionsInvert.Inversions.flight_aim_pitch].Options_fromXML( reader, type, int.Parse( instance ) ); m_inverter[( int )OptionsInvert.Inversions.flight_aim_pitch].Options_fromXML( reader, type, int.Parse( instance ) );
} else if ( reader.Name.ToLowerInvariant( ) == "flight_aim_yaw" ) { } else if ( reader.Name.ToLowerInvariant( ) == "flight_aim_yaw" ) {

@ -17,9 +17,9 @@ namespace SCJMapper_V2.Joystick
flight_aim_yaw, flight_aim_yaw,
flight_view_yaw, flight_view_yaw,
flight_throttle, flight_throttle,
flight_move_strafe_vertical, // flight_move_strafe_vertical,
flight_move_strafe_lateral, // flight_move_strafe_lateral,
flight_move_strafe_longitudinal, // flight_move_strafe_longitudinal,
I_LAST // designates the last item for loop handling I_LAST // designates the last item for loop handling
} }
@ -39,9 +39,9 @@ namespace SCJMapper_V2.Joystick
new MappedActionRec("spaceship_targeting", "v_aim_yaw"), new MappedActionRec("spaceship_targeting", "v_aim_yaw"),
new MappedActionRec("spaceship_view", "v_view_yaw"), new MappedActionRec("spaceship_view", "v_view_yaw"),
new MappedActionRec("spaceship_movement", "v_throttle_abs"), new MappedActionRec("spaceship_movement", "v_throttle_abs"),
new MappedActionRec("spaceship_movement", "v_strafe_vertical"), // new MappedActionRec("spaceship_movement", "v_strafe_vertical"),
new MappedActionRec("spaceship_movement", "v_strafe_lateral"), // new MappedActionRec("spaceship_movement", "v_strafe_lateral"),
new MappedActionRec("spaceship_movement", "v_strafe_longitudinal"), // new MappedActionRec("spaceship_movement", "v_strafe_longitudinal"),
}; };
private CheckBox m_cbInvert = null; private CheckBox m_cbInvert = null;

@ -81,6 +81,15 @@ namespace SCJMapper_V2.Joystick
m_outCurve[m_maxpts - 1] = 1.0; // force MAX m_outCurve[m_maxpts - 1] = 1.0; // force MAX
} }
public Vector2 Pt (int index )
{
// we return only the input points - i.e. not pt0 and ptMax
if ( index >= (m_points.Length-2) ) return new Vector2( 0, 0 );
return m_points[index+1];
}
public void Curve( ) public void Curve( )
{ {
Setup( 1 ); Setup( 1 );
@ -152,7 +161,12 @@ namespace SCJMapper_V2.Joystick
GetOutput( cout ); GetOutput( cout );
} }
/// <summary>
/// Returns the f(x) value of the curve
/// assumes a symmetric curve and handles the sign appropriately
/// </summary>
/// <param name="atX">Device Input (-1000 .. 0 .. 1000)</param>
/// <returns>The unity curve value (-1.0 .. 1.0) </returns>
public double EvalX( int atX ) public double EvalX( int atX )
{ {
int sng = Math.Sign( atX ); int sng = Math.Sign( atX );

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "2.27.0.61" )] [assembly: AssemblyVersion( "2.28.0.62" )]
[assembly: AssemblyFileVersion( "2.27.0.61" )] [assembly: AssemblyFileVersion( "2.28.0.62" )]

@ -26,8 +26,8 @@
<UpdatePeriodically>false</UpdatePeriodically> <UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired> <UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions> <MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>61</ApplicationRevision> <ApplicationRevision>62</ApplicationRevision>
<ApplicationVersion>2.27.0.%2a</ApplicationVersion> <ApplicationVersion>2.28.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
@ -143,7 +143,7 @@
<Compile Include="Table\FormTable.Designer.cs"> <Compile Include="Table\FormTable.Designer.cs">
<DependentUpon>FormTable.cs</DependentUpon> <DependentUpon>FormTable.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Joystick\DeviceDeadzoneParameter.cs" /> <Compile Include="Joystick\DeviceOptionParameter.cs" />
<Compile Include="Gamepad\GamepadCls.cs" /> <Compile Include="Gamepad\GamepadCls.cs" />
<Compile Include="Joystick\JsReassingList.cs" /> <Compile Include="Joystick\JsReassingList.cs" />
<Compile Include="Keyboard\KeyboardCls.cs" /> <Compile Include="Keyboard\KeyboardCls.cs" />
@ -256,6 +256,15 @@
<DependentUpon>UC_GpadPanel.cs</DependentUpon> <DependentUpon>UC_GpadPanel.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.config" /> <None Include="app.config" />
<None Include="graphics\SB_LA_Helipad.dds">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="graphics\SB_OutThere3.dds">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="graphics\SB_Sunset.dds">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Table\DS_ActionMaps.xsc"> <None Include="Table\DS_ActionMaps.xsc">
<DependentUpon>DS_ActionMaps.xsd</DependentUpon> <DependentUpon>DS_ActionMaps.xsd</DependentUpon>
</None> </None>

Binary file not shown.

@ -116,25 +116,34 @@ namespace SCJMapper_V2
} }
/// <summary> /// <summary>
/// Returns the X-Sensitivity item /// Returns the StrafeLateral-Tuning item
/// </summary> /// </summary>
public DeviceDeadzoneParameter DeadzoneX public DeviceTuningParameter TuningStrafeLateral
{ {
get { return m_deviceOptions.DeadzoneX; } get { return m_options.TuneLat; }
} }
/// <summary> /// <summary>
/// Returns the Y-Sensitivity item /// Returns the StrafeVertical-Tuning item
/// </summary> /// </summary>
public DeviceDeadzoneParameter DeadzoneY public DeviceTuningParameter TuningStrafeVertical
{ {
get { return m_deviceOptions.DeadzoneY; } get { return m_options.TuneVert; }
} }
/// <summary> /// <summary>
/// Returns the Z-Sensitivity item /// Returns the StrafeLongitudinal-Tuning item
/// </summary> /// </summary>
public DeviceDeadzoneParameter DeadzoneZ public DeviceTuningParameter TuningStrafeLongitudinal
{ {
get { return m_deviceOptions.DeadzoneZ; } get { return m_options.TuneLon; }
}
/// <summary>
/// Returns the DeviceOptions containing the deadzones
/// </summary>
public Deviceoptions Deadzones
{
get { return m_deviceOptions; }
} }
/// <summary> /// <summary>

@ -1010,7 +1010,7 @@ namespace SCJMapper_V2
{ {
log.Debug( "FindText - Entry" ); log.Debug( "FindText - Entry" );
foreach ( ActionTreeNode tn in Ctrl.Nodes ) { foreach ( ActionTreeNode tn in m_MasterTree.Nodes ) {
if ( String.IsNullOrEmpty( actionmap ) || ( tn.Text == actionmap ) ) { if ( String.IsNullOrEmpty( actionmap ) || ( tn.Text == actionmap ) ) {
// have to search nodes of nodes // have to search nodes of nodes
foreach ( ActionTreeNode stn in tn.Nodes ) { foreach ( ActionTreeNode stn in tn.Nodes ) {

@ -19,9 +19,15 @@ namespace SCJMapper_V2
// Handle all text label composition and extraction here // Handle all text label composition and extraction here
public static String ComposeNodeText( String cmd, Boolean modified = false ) /// <summary>
/// Returns a the cmd with standard modifier if modified == true
/// </summary>
/// <param name="cmd">Any string</param>
/// <param name="modified">Bool true if a modifier shall be added</param>
/// <returns>The string with added Modifier if requested</returns>
public static string ComposeNodeText( string cmd, bool modified = false )
{ {
if ( String.IsNullOrEmpty( cmd ) ) { if ( string.IsNullOrEmpty( cmd ) ) {
return ""; return "";
} }
else { else {
@ -32,10 +38,14 @@ namespace SCJMapper_V2
} }
} }
/// <summary>
public static void DecompNodeText( String nodeText, out String cmd ) /// Returns the cmd part of a string like "cmd - anything #"
/// </summary>
/// <param name="nodeText">A nodetext string like "cmd - anything #"</param>
/// <param name="cmd">contains the cmd part if delimiters are present - else returns the input</param>
public static void DecompNodeText( string nodeText, out string cmd )
{ {
String[] e = nodeText.Split( new char[] { RegDiv, ModDiv }, StringSplitOptions.RemoveEmptyEntries ); string[] e = nodeText.Split( new char[] { RegDiv, ModDiv }, StringSplitOptions.RemoveEmptyEntries );
if ( e.Length > 0 ) if ( e.Length > 0 )
cmd = e[0].TrimEnd( ); cmd = e[0].TrimEnd( );
else else
@ -45,13 +55,13 @@ namespace SCJMapper_V2
/// <summary> /// <summary>
/// Returns the command part from a node text /// Returns the command part from a node text
/// i.e. v_pitch - js1_x returns js1_x /// i.e. "v_pitch - js1_x" returns v_pitch
/// </summary> /// </summary>
/// <param name="nodeText">The node text in 'action - command' notation</param> /// <param name="nodeText">The node text in 'action - command' notation</param>
/// <returns>the command part or an empty string</returns> /// <returns>the command part or an empty string</returns>
public new static String CommandFromNodeText( String nodeText ) public new static string CommandFromNodeText( string nodeText )
{ {
String cmd; string cmd;
ActionTreeInputNode.DecompNodeText( nodeText, out cmd ); ActionTreeInputNode.DecompNodeText( nodeText, out cmd );
return cmd; return cmd;
} }
@ -98,9 +108,9 @@ namespace SCJMapper_V2
} }
//private String m_command =""; //private string m_command ="";
public new String Text public new string Text
{ {
get { return base.Text; } get { return base.Text; }
set set
@ -111,7 +121,7 @@ namespace SCJMapper_V2
} }
public new String Command public new string Command
{ {
get { return m_command; } get { return m_command; }
set set

@ -1,9 +1,14 @@
Canyon, Highway, Shiodome, BigSight: Canyon, Highway, Shiodome, BigSight, LA Heliport:
http://www.hdrlabs.com/sibl/archive.html http://www.hdrlabs.com/sibl/archive.html
sIBL Archive - Free HDRI sets for smart Image-Based Lighting sIBL Archive - Free HDRI sets for smart Image-Based Lighting
Sunset
https://commons.wikimedia.org/wiki/File:Afterglow_of_a_sunset.jpg
This file is licensed under the Creative Commons Attribution 2.0 Generic license.
At Toyomi fishermen's wharf, Tokyo.
Author: Author Masato OHTA
OutThere1 made with Spacescape: OutThere1 and 3 made with Spacescape:
http://alexcpeterson.com/spacescape http://alexcpeterson.com/spacescape

Binary file not shown.

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save