mirror of
https://github.com/RawAccelOfficial/rawaccel.git
synced 2025-05-11 10:26:58 +02:00
change other mentions of sens to output dpi
This commit is contained in:
parent
9e8020bd52
commit
7cc1950d1c
12 changed files with 33 additions and 33 deletions
|
@ -30,7 +30,7 @@ namespace rawaccel {
|
||||||
*/
|
*/
|
||||||
offset = {};
|
offset = {};
|
||||||
constant = 0;
|
constant = 0;
|
||||||
scale = scale_from_sens_point(args.cap.x, args.cap.y, n, constant);
|
scale = scale_from_output_point(args.cap.x, args.cap.y, n, constant);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,9 +64,9 @@ namespace rawaccel {
|
||||||
return pow(gain / (power + 1), 1 / power) / input;
|
return pow(gain / (power + 1), 1 / power) / input;
|
||||||
}
|
}
|
||||||
|
|
||||||
static double scale_from_sens_point(double input, double sens, double power, double C)
|
static double scale_from_output_point(double input, double output, double power, double C)
|
||||||
{
|
{
|
||||||
return pow(sens - C / input, 1 / power) / input;
|
return pow(output - C / input, 1 / power) / input;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -85,9 +85,9 @@ namespace rawaccel {
|
||||||
speed_args speed_processor_args;
|
speed_args speed_processor_args;
|
||||||
|
|
||||||
double output_dpi = NORMALIZED_DPI;
|
double output_dpi = NORMALIZED_DPI;
|
||||||
double yx_sens_ratio = 1;
|
double yx_output_dpi_ratio = 1;
|
||||||
double lr_sens_ratio = 1;
|
double lr_output_dpi_ratio = 1;
|
||||||
double ud_sens_ratio = 1;
|
double ud_output_dpi_ratio = 1;
|
||||||
|
|
||||||
double degrees_rotation = 0;
|
double degrees_rotation = 0;
|
||||||
|
|
||||||
|
|
|
@ -154,11 +154,11 @@ namespace rawaccel {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.output_dpi == 0) {
|
if (args.output_dpi == 0) {
|
||||||
error("sens multiplier is 0");
|
error("output DPI is 0");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.yx_sens_ratio == 0) {
|
if (args.yx_output_dpi_ratio == 0) {
|
||||||
error("Y/X sens ratio is 0");
|
error("Y/X output DPI ratio is 0");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.domain_weights.x <= 0 ||
|
if (args.domain_weights.x <= 0 ||
|
||||||
|
@ -166,8 +166,8 @@ namespace rawaccel {
|
||||||
error("domain weights"" must be positive");
|
error("domain weights"" must be positive");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.lr_sens_ratio <= 0 || args.ud_sens_ratio <= 0) {
|
if (args.lr_output_dpi_ratio <= 0 || args.ud_output_dpi_ratio <= 0) {
|
||||||
error("sens ratio must be positive");
|
error("output DPI ratio must be positive");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.speed_processor_args.lp_norm <= 0) {
|
if (args.speed_processor_args.lp_norm <= 0) {
|
||||||
|
|
|
@ -49,8 +49,8 @@ namespace rawaccel {
|
||||||
apply_directional_weight = args.speed_processor_args.whole &&
|
apply_directional_weight = args.speed_processor_args.whole &&
|
||||||
args.range_weights.x != args.range_weights.y;
|
args.range_weights.x != args.range_weights.y;
|
||||||
compute_ref_angle = apply_snap || apply_directional_weight;
|
compute_ref_angle = apply_snap || apply_directional_weight;
|
||||||
apply_dir_mul_x = args.lr_sens_ratio != 1;
|
apply_dir_mul_x = args.lr_output_dpi_ratio != 1;
|
||||||
apply_dir_mul_y = args.ud_sens_ratio != 1;
|
apply_dir_mul_y = args.ud_output_dpi_ratio != 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
modifier_flags() = default;
|
modifier_flags() = default;
|
||||||
|
@ -411,14 +411,14 @@ namespace rawaccel {
|
||||||
|
|
||||||
double dpi_adjustment = output_dpi_adjustment_factor * dpi_factor;
|
double dpi_adjustment = output_dpi_adjustment_factor * dpi_factor;
|
||||||
in.x *= dpi_adjustment;
|
in.x *= dpi_adjustment;
|
||||||
in.y *= dpi_adjustment * args.yx_sens_ratio;
|
in.y *= dpi_adjustment * args.yx_output_dpi_ratio;
|
||||||
|
|
||||||
if (flags.apply_dir_mul_x && in.x < 0) {
|
if (flags.apply_dir_mul_x && in.x < 0) {
|
||||||
in.x *= args.lr_sens_ratio;
|
in.x *= args.lr_output_dpi_ratio;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags.apply_dir_mul_y && in.y < 0) {
|
if (flags.apply_dir_mul_y && in.y < 0) {
|
||||||
in.y *= args.ud_sens_ratio;
|
in.y *= args.ud_output_dpi_ratio;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,7 @@ namespace grapher
|
||||||
settings.outputDPI = Helper.CalculatOutputDPI(ApplyOptions.Sensitivity.Field.Data);
|
settings.outputDPI = Helper.CalculatOutputDPI(ApplyOptions.Sensitivity.Field.Data);
|
||||||
|
|
||||||
// TODO - separate sensitivity fields, add new label for ratio
|
// TODO - separate sensitivity fields, add new label for ratio
|
||||||
settings.yxSensRatio = ApplyOptions.YToXRatio.Value;
|
settings.yxOutputDPIRatio = ApplyOptions.YToXRatio.Value;
|
||||||
settings.inputSpeedArgs.combineMagnitudes = ApplyOptions.IsWhole;
|
settings.inputSpeedArgs.combineMagnitudes = ApplyOptions.IsWhole;
|
||||||
ApplyOptions.SetArgsFromActiveValues(ref settings.argsX, ref settings.argsY);
|
ApplyOptions.SetArgsFromActiveValues(ref settings.argsX, ref settings.argsY);
|
||||||
|
|
||||||
|
|
|
@ -479,7 +479,7 @@ namespace grapher.Models.Calculations
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool ShouldStripSens(Profile settings) =>
|
public static bool ShouldStripSens(Profile settings) =>
|
||||||
settings.yxSensRatio != 1;
|
settings.yxOutputDPIRatio != 1;
|
||||||
|
|
||||||
public static bool ShouldStripRot(Profile settings) =>
|
public static bool ShouldStripRot(Profile settings) =>
|
||||||
settings.rotation > 0;
|
settings.rotation > 0;
|
||||||
|
@ -487,7 +487,7 @@ namespace grapher.Models.Calculations
|
||||||
public static (double, double) GetSens(Profile settings)
|
public static (double, double) GetSens(Profile settings)
|
||||||
{
|
{
|
||||||
var sensFactor = Helper.GetSensitivityFactor(settings);
|
var sensFactor = Helper.GetSensitivityFactor(settings);
|
||||||
return (sensFactor, sensFactor * settings.yxSensRatio);
|
return (sensFactor, sensFactor * settings.yxOutputDPIRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static (double, double) GetRotVector(Profile settings) =>
|
public static (double, double) GetRotVector(Profile settings) =>
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace grapher.Models.Calculations.Data
|
||||||
{
|
{
|
||||||
Clear();
|
Clear();
|
||||||
var sensFactor = Helper.GetSensitivityFactor(settings);
|
var sensFactor = Helper.GetSensitivityFactor(settings);
|
||||||
var sensY = sensFactor * settings.yxSensRatio;
|
var sensY = sensFactor * settings.yxOutputDPIRatio;
|
||||||
Calculator.Calculate(X, accel, sensFactor, Calculator.SimulatedInputX);
|
Calculator.Calculate(X, accel, sensFactor, Calculator.SimulatedInputX);
|
||||||
Calculator.Calculate(Y, accel, sensY, Calculator.SimulatedInputY);
|
Calculator.Calculate(Y, accel, sensY, Calculator.SimulatedInputY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace grapher.Models.Charts.ChartState
|
||||||
|
|
||||||
if (settings.inputSpeedArgs.combineMagnitudes)
|
if (settings.inputSpeedArgs.combineMagnitudes)
|
||||||
{
|
{
|
||||||
if (settings.yxSensRatio != 1 ||
|
if (settings.yxOutputDPIRatio != 1 ||
|
||||||
settings.domainXY.x != settings.domainXY.y ||
|
settings.domainXY.x != settings.domainXY.y ||
|
||||||
settings.rangeXY.x != settings.rangeXY.y)
|
settings.rangeXY.x != settings.rangeXY.y)
|
||||||
{
|
{
|
||||||
|
|
|
@ -785,8 +785,8 @@ namespace grapher.Models.Mouse
|
||||||
|
|
||||||
Vec2<double> dirMults = new Vec2<double>
|
Vec2<double> dirMults = new Vec2<double>
|
||||||
{
|
{
|
||||||
x = SettingsManager.ActiveProfile.lrSensRatio,
|
x = SettingsManager.ActiveProfile.lrOutputDPIRatio,
|
||||||
y = SettingsManager.ActiveProfile.udSensRatio
|
y = SettingsManager.ActiveProfile.udOutputDPIRatio
|
||||||
};
|
};
|
||||||
|
|
||||||
if (dirMults.x > 0 && x < 0)
|
if (dirMults.x > 0 && x < 0)
|
||||||
|
|
|
@ -103,7 +103,7 @@ namespace grapher.Models.Options
|
||||||
public void SetActiveValues(Profile settings)
|
public void SetActiveValues(Profile settings)
|
||||||
{
|
{
|
||||||
Sensitivity.SetActiveValue(Helper.GetSensitivityFactor(settings));
|
Sensitivity.SetActiveValue(Helper.GetSensitivityFactor(settings));
|
||||||
YToXRatio.SetActiveValue(settings.yxSensRatio);
|
YToXRatio.SetActiveValue(settings.yxOutputDPIRatio);
|
||||||
Rotation.SetActiveValue(settings.rotation);
|
Rotation.SetActiveValue(settings.rotation);
|
||||||
|
|
||||||
WholeVectorCheckBox.Checked = settings.inputSpeedArgs.combineMagnitudes;
|
WholeVectorCheckBox.Checked = settings.inputSpeedArgs.combineMagnitudes;
|
||||||
|
|
|
@ -201,8 +201,8 @@ namespace grapher.Models.Serialized
|
||||||
settings.snap = UserProfile.snap;
|
settings.snap = UserProfile.snap;
|
||||||
settings.maximumSpeed = UserProfile.maximumSpeed;
|
settings.maximumSpeed = UserProfile.maximumSpeed;
|
||||||
settings.minimumSpeed = UserProfile.minimumSpeed;
|
settings.minimumSpeed = UserProfile.minimumSpeed;
|
||||||
settings.lrSensRatio = UserProfile.lrSensRatio;
|
settings.lrOutputDPIRatio = UserProfile.lrOutputDPIRatio;
|
||||||
settings.udSensRatio = UserProfile.udSensRatio;
|
settings.udOutputDPIRatio = UserProfile.udOutputDPIRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GUISettings MakeGUISettingsFromFields()
|
public GUISettings MakeGUISettingsFromFields()
|
||||||
|
|
|
@ -138,12 +138,12 @@ public ref struct Profile
|
||||||
|
|
||||||
[JsonProperty("Output DPI")]
|
[JsonProperty("Output DPI")]
|
||||||
double outputDPI;
|
double outputDPI;
|
||||||
[JsonProperty("Y/X sensitivity ratio (vertical sens multiplier)")]
|
[JsonProperty("Y/X output DPI ratio (vertical sens multiplier)")]
|
||||||
double yxSensRatio;
|
double yxOutputDPIRatio;
|
||||||
[JsonProperty("L/R sensitivity ratio (left sens multiplier)")]
|
[JsonProperty("L/R output DPI ratio (left sens multiplier)")]
|
||||||
double lrSensRatio;
|
double lrOutputDPIRatio;
|
||||||
[JsonProperty("U/D sensitivity ratio (up sens multiplier)")]
|
[JsonProperty("U/D output DPI ratio (up sens multiplier)")]
|
||||||
double udSensRatio;
|
double udOutputDPIRatio;
|
||||||
|
|
||||||
[JsonProperty("Degrees of rotation")]
|
[JsonProperty("Degrees of rotation")]
|
||||||
double rotation;
|
double rotation;
|
||||||
|
@ -179,7 +179,7 @@ public value struct DeviceConfig {
|
||||||
[JsonProperty("Use constant time interval based on polling rate", Required = Required::Default)]
|
[JsonProperty("Use constant time interval based on polling rate", Required = Required::Default)]
|
||||||
bool pollTimeLock;
|
bool pollTimeLock;
|
||||||
|
|
||||||
[JsonProperty("DPI (normalizes sens to 1000dpi and converts input speed unit: counts/ms -> in/s)")]
|
[JsonProperty("DPI (normalizes input speed unit: counts/ms -> in/s)")]
|
||||||
int dpi;
|
int dpi;
|
||||||
|
|
||||||
[JsonProperty("Polling rate Hz (keep at 0 for automatic adjustment)")]
|
[JsonProperty("Polling rate Hz (keep at 0 for automatic adjustment)")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue