mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-05 01:55:43 +01:00
refactor(sonar): remove unused variables, captures and private fields (cpp:S1481, cpp:S1068)
This commit is contained in:
@@ -1353,8 +1353,6 @@ void TMoverParameters::Derail(DerailReason const Reason)
|
|||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShape &Shape, TTrackParam &Track, TTractionParam &ElectricTraction, TLocation const &NewLoc, TRotation const &NewRot)
|
double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShape &Shape, TTrackParam &Track, TTractionParam &ElectricTraction, TLocation const &NewLoc, TRotation const &NewRot)
|
||||||
{
|
{
|
||||||
const double Vepsilon = 1e-5;
|
|
||||||
const double Aepsilon = 1e-3; // ASBSpeed=0.8;
|
|
||||||
|
|
||||||
if (!TestFlag(DamageFlag, dtrain_out))
|
if (!TestFlag(DamageFlag, dtrain_out))
|
||||||
{ // Ra: to przepisywanie tu jest bez sensu
|
{ // Ra: to przepisywanie tu jest bez sensu
|
||||||
@@ -4450,8 +4448,6 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
|||||||
Pipe->Act();
|
Pipe->Act();
|
||||||
}
|
}
|
||||||
|
|
||||||
const double LBDelay = 100;
|
|
||||||
const double kL = 0.5;
|
|
||||||
// double dV;
|
// double dV;
|
||||||
// TMoverParameters *c; // T_MoverParameters
|
// TMoverParameters *c; // T_MoverParameters
|
||||||
double temp;
|
double temp;
|
||||||
@@ -5161,7 +5157,6 @@ double TMoverParameters::BrakeForce(TTrackParam const & /*Track*/)
|
|||||||
|
|
||||||
double K{0};
|
double K{0};
|
||||||
double Fb{0};
|
double Fb{0};
|
||||||
double sm{0};
|
|
||||||
|
|
||||||
switch (LocalBrake)
|
switch (LocalBrake)
|
||||||
{
|
{
|
||||||
@@ -6827,7 +6822,6 @@ bool TMoverParameters::AutoRelaySwitch(bool State)
|
|||||||
bool TMoverParameters::AutoRelayCheck(void)
|
bool TMoverParameters::AutoRelayCheck(void)
|
||||||
{
|
{
|
||||||
bool OK = false; // b:int;
|
bool OK = false; // b:int;
|
||||||
bool ARC = false;
|
|
||||||
|
|
||||||
auto const motorconnectorsoff{false == MotorConnectorsCheck()};
|
auto const motorconnectorsoff{false == MotorConnectorsCheck()};
|
||||||
|
|
||||||
@@ -9585,9 +9579,6 @@ void TMoverParameters::BrakeSubsystemDecode()
|
|||||||
bool TMoverParameters::LoadFIZ(std::string chkpath)
|
bool TMoverParameters::LoadFIZ(std::string chkpath)
|
||||||
{
|
{
|
||||||
chkPath = chkpath; // assign class path for reloading
|
chkPath = chkpath; // assign class path for reloading
|
||||||
const int param_ok = 1;
|
|
||||||
const int wheels_ok = 2;
|
|
||||||
const int dimensions_ok = 4;
|
|
||||||
|
|
||||||
ConversionError = 666;
|
ConversionError = 666;
|
||||||
LISTLINE = 0;
|
LISTLINE = 0;
|
||||||
|
|||||||
@@ -1232,7 +1232,6 @@ class TMHZ_K5P : public TDriverHandle
|
|||||||
/// <summary>Time chamber pressure [bar].</summary>
|
/// <summary>Time chamber pressure [bar].</summary>
|
||||||
double TP = 0.0; // zbiornik czasowy
|
double TP = 0.0; // zbiornik czasowy
|
||||||
/// <summary>Reductor reservoir pressure [bar].</summary>
|
/// <summary>Reductor reservoir pressure [bar].</summary>
|
||||||
double RP = 0.0; // zbiornik redukcyjny
|
|
||||||
/// <summary>Reductor adjustment offset.</summary>
|
/// <summary>Reductor adjustment offset.</summary>
|
||||||
double RedAdj = 0.0; // dostosowanie reduktora cisnienia (krecenie kapturkiem)
|
double RedAdj = 0.0; // dostosowanie reduktora cisnienia (krecenie kapturkiem)
|
||||||
/// <summary>True while filling-stroke / release wave is active.</summary>
|
/// <summary>True while filling-stroke / release wave is active.</summary>
|
||||||
@@ -1285,7 +1284,6 @@ class TMHZ_6P : public TDriverHandle
|
|||||||
/// <summary>Time chamber pressure [bar].</summary>
|
/// <summary>Time chamber pressure [bar].</summary>
|
||||||
double TP = 0.0; // zbiornik czasowy
|
double TP = 0.0; // zbiornik czasowy
|
||||||
/// <summary>Reductor reservoir pressure [bar].</summary>
|
/// <summary>Reductor reservoir pressure [bar].</summary>
|
||||||
double RP = 0.0; // zbiornik redukcyjny
|
|
||||||
/// <summary>Reductor adjustment offset.</summary>
|
/// <summary>Reductor adjustment offset.</summary>
|
||||||
double RedAdj = 0.0; // dostosowanie reduktora cisnienia (krecenie kapturkiem)
|
double RedAdj = 0.0; // dostosowanie reduktora cisnienia (krecenie kapturkiem)
|
||||||
/// <summary>True while filling-stroke / release wave is active.</summary>
|
/// <summary>True while filling-stroke / release wave is active.</summary>
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
// members
|
// members
|
||||||
std::array<char, 256> m_buffer;
|
|
||||||
TDynamicObject const *m_nearest { nullptr };
|
TDynamicObject const *m_nearest { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -133,8 +132,6 @@ private:
|
|||||||
graph_data AccN_acc_graph;
|
graph_data AccN_acc_graph;
|
||||||
float last_AccN;
|
float last_AccN;
|
||||||
|
|
||||||
std::array<char, 128> queue_event_buf = { 0 };
|
|
||||||
std::array<char, 128> queue_event_activator_buf = { 0 };
|
|
||||||
|
|
||||||
bool m_eventqueueactivevehicleonly { false };
|
bool m_eventqueueactivevehicleonly { false };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -263,7 +263,6 @@ void cMoon::refract() {
|
|||||||
|
|
||||||
void cMoon::irradiance() {
|
void cMoon::irradiance() {
|
||||||
|
|
||||||
static double radtodeg = 57.295779513; // converts from radians to degrees
|
|
||||||
static double degtorad = 0.0174532925; // converts from degrees to radians
|
static double degtorad = 0.0174532925; // converts from degrees to radians
|
||||||
|
|
||||||
m_body.dayang = ( simulation::Time.year_day() - 1 ) * 360.0 / 365.0;
|
m_body.dayang = ( simulation::Time.year_day() - 1 ) * 360.0 / 365.0;
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ drivermouse_input::button( int const Button, int const Action ) {
|
|||||||
// left mouse button launches on_click event associated with to the node
|
// left mouse button launches on_click event associated with to the node
|
||||||
if (Button == GLFW_MOUSE_BUTTON_LEFT && Action == GLFW_PRESS) {
|
if (Button == GLFW_MOUSE_BUTTON_LEFT && Action == GLFW_PRESS) {
|
||||||
GfxRenderer->Pick_Node_Callback(
|
GfxRenderer->Pick_Node_Callback(
|
||||||
[this](scene::basic_node *node) {
|
[](scene::basic_node *node) {
|
||||||
if( node == nullptr
|
if( node == nullptr
|
||||||
|| typeid(*node) != typeid(TAnimModel) )
|
|| typeid(*node) != typeid(TAnimModel) )
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -332,7 +332,6 @@ smoke_source::initialize( smoke_particle &Particle ) {
|
|||||||
|
|
||||||
if( m_ownertype == owner_type::vehicle ) {
|
if( m_ownertype == owner_type::vehicle ) {
|
||||||
Particle.opacity *= static_cast<float>(m_owner.vehicle->MoverParameters->dizel_fill);
|
Particle.opacity *= static_cast<float>(m_owner.vehicle->MoverParameters->dizel_fill);
|
||||||
auto const enginerevolutionsfactor { 1.5f }; // high engine revolutions increase initial particle velocity
|
|
||||||
switch( m_owner.vehicle->MoverParameters->EngineType ) {
|
switch( m_owner.vehicle->MoverParameters->EngineType ) {
|
||||||
case TEngineType::DieselElectric: {
|
case TEngineType::DieselElectric: {
|
||||||
if (m_owner.vehicle->MoverParameters->dizel_spinup == true)
|
if (m_owner.vehicle->MoverParameters->dizel_spinup == true)
|
||||||
|
|||||||
@@ -6886,7 +6886,6 @@ void TTrain::OnCommand_speedcontrolbutton(TTrain *Train, command_data const &Com
|
|||||||
{
|
{
|
||||||
|
|
||||||
auto const itemindex = static_cast<int>(Command.command) - static_cast<int>(user_command::speedcontrolbutton0);
|
auto const itemindex = static_cast<int>(Command.command) - static_cast<int>(user_command::speedcontrolbutton0);
|
||||||
auto &item = Train->ggSpeedCtrlButtons[itemindex];
|
|
||||||
|
|
||||||
if (Command.action == GLFW_PRESS)
|
if (Command.action == GLFW_PRESS)
|
||||||
{
|
{
|
||||||
@@ -11448,7 +11447,7 @@ void TTrain::set_cab_controls(int const Cab)
|
|||||||
bool kier = DynamicObject->DirectionGet() * mvOccupied->CabOccupied > 0;
|
bool kier = DynamicObject->DirectionGet() * mvOccupied->CabOccupied > 0;
|
||||||
int flag = DynamicObject->MoverParameters->InverterControlCouplerFlag;
|
int flag = DynamicObject->MoverParameters->InverterControlCouplerFlag;
|
||||||
int itemstart = 0;
|
int itemstart = 0;
|
||||||
for (auto &item : ggInverterToggleButtons) // for each button
|
for ([[maybe_unused]] auto &item : ggInverterToggleButtons) // for each button
|
||||||
{
|
{
|
||||||
int itemindex = itemstart;
|
int itemindex = itemstart;
|
||||||
itemstart++;
|
itemstart++;
|
||||||
|
|||||||
Reference in New Issue
Block a user