mirror of
https://github.com/RawAccelOfficial/rawaccel.git
synced 2025-05-10 18:06:38 +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 = {};
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -64,9 +64,9 @@ namespace rawaccel {
|
|||
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;
|
||||
|
||||
double output_dpi = NORMALIZED_DPI;
|
||||
double yx_sens_ratio = 1;
|
||||
double lr_sens_ratio = 1;
|
||||
double ud_sens_ratio = 1;
|
||||
double yx_output_dpi_ratio = 1;
|
||||
double lr_output_dpi_ratio = 1;
|
||||
double ud_output_dpi_ratio = 1;
|
||||
|
||||
double degrees_rotation = 0;
|
||||
|
||||
|
|
|
@ -154,11 +154,11 @@ namespace rawaccel {
|
|||
}
|
||||
|
||||
if (args.output_dpi == 0) {
|
||||
error("sens multiplier is 0");
|
||||
error("output DPI is 0");
|
||||
}
|
||||
|
||||
if (args.yx_sens_ratio == 0) {
|
||||
error("Y/X sens ratio is 0");
|
||||
if (args.yx_output_dpi_ratio == 0) {
|
||||
error("Y/X output DPI ratio is 0");
|
||||
}
|
||||
|
||||
if (args.domain_weights.x <= 0 ||
|
||||
|
@ -166,8 +166,8 @@ namespace rawaccel {
|
|||
error("domain weights"" must be positive");
|
||||
}
|
||||
|
||||
if (args.lr_sens_ratio <= 0 || args.ud_sens_ratio <= 0) {
|
||||
error("sens ratio must be positive");
|
||||
if (args.lr_output_dpi_ratio <= 0 || args.ud_output_dpi_ratio <= 0) {
|
||||
error("output DPI ratio must be positive");
|
||||
}
|
||||
|
||||
if (args.speed_processor_args.lp_norm <= 0) {
|
||||
|
|
|
@ -49,8 +49,8 @@ namespace rawaccel {
|
|||
apply_directional_weight = args.speed_processor_args.whole &&
|
||||
args.range_weights.x != args.range_weights.y;
|
||||
compute_ref_angle = apply_snap || apply_directional_weight;
|
||||
apply_dir_mul_x = args.lr_sens_ratio != 1;
|
||||
apply_dir_mul_y = args.ud_sens_ratio != 1;
|
||||
apply_dir_mul_x = args.lr_output_dpi_ratio != 1;
|
||||
apply_dir_mul_y = args.ud_output_dpi_ratio != 1;
|
||||
}
|
||||
|
||||
modifier_flags() = default;
|
||||
|
@ -411,14 +411,14 @@ namespace rawaccel {
|
|||
|
||||
double dpi_adjustment = output_dpi_adjustment_factor * dpi_factor;
|
||||
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) {
|
||||
in.x *= args.lr_sens_ratio;
|
||||
in.x *= args.lr_output_dpi_ratio;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
// TODO - separate sensitivity fields, add new label for ratio
|
||||
settings.yxSensRatio = ApplyOptions.YToXRatio.Value;
|
||||
settings.yxOutputDPIRatio = ApplyOptions.YToXRatio.Value;
|
||||
settings.inputSpeedArgs.combineMagnitudes = ApplyOptions.IsWhole;
|
||||
ApplyOptions.SetArgsFromActiveValues(ref settings.argsX, ref settings.argsY);
|
||||
|
||||
|
|
|
@ -479,7 +479,7 @@ namespace grapher.Models.Calculations
|
|||
}
|
||||
|
||||
public static bool ShouldStripSens(Profile settings) =>
|
||||
settings.yxSensRatio != 1;
|
||||
settings.yxOutputDPIRatio != 1;
|
||||
|
||||
public static bool ShouldStripRot(Profile settings) =>
|
||||
settings.rotation > 0;
|
||||
|
@ -487,7 +487,7 @@ namespace grapher.Models.Calculations
|
|||
public static (double, double) GetSens(Profile settings)
|
||||
{
|
||||
var sensFactor = Helper.GetSensitivityFactor(settings);
|
||||
return (sensFactor, sensFactor * settings.yxSensRatio);
|
||||
return (sensFactor, sensFactor * settings.yxOutputDPIRatio);
|
||||
}
|
||||
|
||||
public static (double, double) GetRotVector(Profile settings) =>
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace grapher.Models.Calculations.Data
|
|||
{
|
||||
Clear();
|
||||
var sensFactor = Helper.GetSensitivityFactor(settings);
|
||||
var sensY = sensFactor * settings.yxSensRatio;
|
||||
var sensY = sensFactor * settings.yxOutputDPIRatio;
|
||||
Calculator.Calculate(X, accel, sensFactor, Calculator.SimulatedInputX);
|
||||
Calculator.Calculate(Y, accel, sensY, Calculator.SimulatedInputY);
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace grapher.Models.Charts.ChartState
|
|||
|
||||
if (settings.inputSpeedArgs.combineMagnitudes)
|
||||
{
|
||||
if (settings.yxSensRatio != 1 ||
|
||||
if (settings.yxOutputDPIRatio != 1 ||
|
||||
settings.domainXY.x != settings.domainXY.y ||
|
||||
settings.rangeXY.x != settings.rangeXY.y)
|
||||
{
|
||||
|
|
|
@ -785,8 +785,8 @@ namespace grapher.Models.Mouse
|
|||
|
||||
Vec2<double> dirMults = new Vec2<double>
|
||||
{
|
||||
x = SettingsManager.ActiveProfile.lrSensRatio,
|
||||
y = SettingsManager.ActiveProfile.udSensRatio
|
||||
x = SettingsManager.ActiveProfile.lrOutputDPIRatio,
|
||||
y = SettingsManager.ActiveProfile.udOutputDPIRatio
|
||||
};
|
||||
|
||||
if (dirMults.x > 0 && x < 0)
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace grapher.Models.Options
|
|||
public void SetActiveValues(Profile settings)
|
||||
{
|
||||
Sensitivity.SetActiveValue(Helper.GetSensitivityFactor(settings));
|
||||
YToXRatio.SetActiveValue(settings.yxSensRatio);
|
||||
YToXRatio.SetActiveValue(settings.yxOutputDPIRatio);
|
||||
Rotation.SetActiveValue(settings.rotation);
|
||||
|
||||
WholeVectorCheckBox.Checked = settings.inputSpeedArgs.combineMagnitudes;
|
||||
|
|
|
@ -201,8 +201,8 @@ namespace grapher.Models.Serialized
|
|||
settings.snap = UserProfile.snap;
|
||||
settings.maximumSpeed = UserProfile.maximumSpeed;
|
||||
settings.minimumSpeed = UserProfile.minimumSpeed;
|
||||
settings.lrSensRatio = UserProfile.lrSensRatio;
|
||||
settings.udSensRatio = UserProfile.udSensRatio;
|
||||
settings.lrOutputDPIRatio = UserProfile.lrOutputDPIRatio;
|
||||
settings.udOutputDPIRatio = UserProfile.udOutputDPIRatio;
|
||||
}
|
||||
|
||||
public GUISettings MakeGUISettingsFromFields()
|
||||
|
|
|
@ -138,12 +138,12 @@ public ref struct Profile
|
|||
|
||||
[JsonProperty("Output DPI")]
|
||||
double outputDPI;
|
||||
[JsonProperty("Y/X sensitivity ratio (vertical sens multiplier)")]
|
||||
double yxSensRatio;
|
||||
[JsonProperty("L/R sensitivity ratio (left sens multiplier)")]
|
||||
double lrSensRatio;
|
||||
[JsonProperty("U/D sensitivity ratio (up sens multiplier)")]
|
||||
double udSensRatio;
|
||||
[JsonProperty("Y/X output DPI ratio (vertical sens multiplier)")]
|
||||
double yxOutputDPIRatio;
|
||||
[JsonProperty("L/R output DPI ratio (left sens multiplier)")]
|
||||
double lrOutputDPIRatio;
|
||||
[JsonProperty("U/D output DPI ratio (up sens multiplier)")]
|
||||
double udOutputDPIRatio;
|
||||
|
||||
[JsonProperty("Degrees of rotation")]
|
||||
double rotation;
|
||||
|
@ -179,7 +179,7 @@ public value struct DeviceConfig {
|
|||
[JsonProperty("Use constant time interval based on polling rate", Required = Required::Default)]
|
||||
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;
|
||||
|
||||
[JsonProperty("Polling rate Hz (keep at 0 for automatic adjustment)")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue