Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tcfshcrw committed Nov 8, 2024
1 parent ed23e36 commit 9c546b1
Showing 1 changed file with 32 additions and 38 deletions.
70 changes: 32 additions & 38 deletions SimHubPlugin/DataPluginDemo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -771,52 +771,46 @@ unsafe public void DataUpdate(PluginManager pluginManager, ref GameData data)
//custom effcts
if (Settings.CV1_enable_flag[pedalIdx] == true)
{
if (pluginManager.GetPropertyValue(Settings.CV1_bindings[pedalIdx]) != null)
//CV1_value = Convert.ToByte(pluginManager.GetPropertyValue(Settings.CV1_bindings[pedalIdx]));
string temp_string = Ncalc_reading(Settings.CV1_bindings[pedalIdx]);
if (temp_string != "Error")
{

//CV1_value = Convert.ToByte(pluginManager.GetPropertyValue(Settings.CV1_bindings[pedalIdx]));
string temp_string = Ncalc_reading(Settings.CV1_bindings[pedalIdx]);
if (temp_string != "Error")
{
CV1_value = Convert.ToByte(temp_string);
}
else
{
CV1_value = 0;
SimHub.Logging.Current.Error("CV1 Reading error");
}
CV1_value = Convert.ToByte(temp_string);
}
else
{
CV1_value = 0;
SimHub.Logging.Current.Error("CV1 Reading error");
}


if (CV1_value > (Settings.CV1_trigger[pedalIdx]))
{
tmp.payloadPedalAction_.Trigger_CV_1 = 1;
update_flag = true;
}
if (CV1_value > (Settings.CV1_trigger[pedalIdx]))
{
tmp.payloadPedalAction_.Trigger_CV_1 = 1;
update_flag = true;
}
}
}
if (Settings.CV2_enable_flag[pedalIdx] == true)
{
if (pluginManager.GetPropertyValue(Settings.CV2_bindings[pedalIdx]) != null)
{

//CV2_value = Convert.ToByte(pluginManager.GetPropertyValue(Settings.CV2_bindings[pedalIdx]));
string temp_string = Ncalc_reading(Settings.CV2_bindings[pedalIdx]);
if (temp_string != "Error")
{
CV2_value = Convert.ToByte(temp_string);
}
else
{
CV2_value = 0;
SimHub.Logging.Current.Error("CV2 Reading error");
}
if (CV2_value > (Settings.CV2_trigger[pedalIdx]))
{
tmp.payloadPedalAction_.Trigger_CV_2 = 1;
update_flag = true;
}
//CV2_value = Convert.ToByte(pluginManager.GetPropertyValue(Settings.CV2_bindings[pedalIdx]));
string temp_string = Ncalc_reading(Settings.CV2_bindings[pedalIdx]);
if (temp_string != "Error")
{
CV2_value = Convert.ToByte(temp_string);
}
else
{
CV2_value = 0;
SimHub.Logging.Current.Error("CV2 Reading error");
}
}
if (CV2_value > (Settings.CV2_trigger[pedalIdx]))
{
tmp.payloadPedalAction_.Trigger_CV_2 = 1;
update_flag = true;
}

}



Expand Down

0 comments on commit 9c546b1

Please sign in to comment.