Skip to content

Commit

Permalink
clang-formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
pkubanek committed Nov 28, 2023
1 parent b715b32 commit 82c866e
Show file tree
Hide file tree
Showing 28 changed files with 1,307 additions and 1,298 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ ts-VMSd
.mypy.ini
.ruff.toml
src/version.c
towncrier.toml
1,056 changes: 528 additions & 528 deletions Bitfiles/NiFpga.c

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/LSST/VMS/Accelerometer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#define ACCELEROMETER_H_

#include <SAL_MTVMS.h>
#include <VMSApplicationSettings.h>
#include <Telemetry/PSD.h>
#include <VMSApplicationSettings.h>

namespace LSST {
namespace VMS {
Expand All @@ -36,7 +36,7 @@ namespace VMS {
*/
class Accelerometer {
public:
Accelerometer(VMSApplicationSettings* vmsApplicationSettings);
Accelerometer(VMSApplicationSettings *vmsApplicationSettings);
virtual ~Accelerometer(void);

void enableAccelerometers();
Expand All @@ -49,11 +49,11 @@ class Accelerometer {

int _numberOfSensors;
int _dataIndex;
MTVMS_dataC* _sampleData;
Telemetry::PSD* _psds;
VMSApplicationSettings* _vmsApplicationSettings;
MTVMS_dataC *_sampleData;
Telemetry::PSD *_psds;
VMSApplicationSettings *_vmsApplicationSettings;

float _convert(uint32_t** data);
float _convert(uint32_t **data);
};

} /* namespace VMS */
Expand Down
10 changes: 5 additions & 5 deletions src/LSST/VMS/Commands/EnterControl.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* EnterControl command.
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand All @@ -23,9 +23,9 @@
#ifndef _VMS_Command_EnterControl_
#define _VMS_Command_ENterControl_

#include <cRIO/Command.h>
#include <SAL_MTVMS.h>
#include <VMSPublisher.h>
#include <cRIO/Command.h>

#include <Events/SummaryState.h>

Expand Down
8 changes: 4 additions & 4 deletions src/LSST/VMS/Commands/SAL.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* SAL command.
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand Down
8 changes: 4 additions & 4 deletions src/LSST/VMS/Commands/SAL.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* SAL commands
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand Down
3 changes: 0 additions & 3 deletions src/LSST/VMS/Commands/Update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,12 @@
*/

#include <Commands/Update.h>
#include <Events/Heartbeat.h>
#include <FPGA.h>
#include <VMSPublisher.h>

using namespace LSST::VMS;
using namespace LSST::VMS::Commands;

void Update::execute() {
VMSPublisher::instance().putMiscellaneous(FPGA::instance().chassisTemperature(),
FPGA::instance().chassisTicks());
Events::Heartbeat::instance().tryToggle();
}
10 changes: 5 additions & 5 deletions src/LSST/VMS/Events/FPGAState.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* AcquistionPeriod event handling class.
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand All @@ -20,8 +20,8 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/

#include <FPGA.h>
#include <Events/FPGAState.h>
#include <FPGA.h>

#include <spdlog/spdlog.h>

Expand Down
10 changes: 5 additions & 5 deletions src/LSST/VMS/Events/FPGAState.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* AcquisitionPeriod event handling class.
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand All @@ -28,8 +28,8 @@

#include <VMSPublisher.h>

#include <spdlog/spdlog.h>
#include <mutex>
#include <spdlog/spdlog.h>

namespace LSST {
namespace VMS {
Expand Down
7 changes: 5 additions & 2 deletions src/LSST/VMS/Events/Heartbeat.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ class Heartbeat : public MTVMS_logevent_heartbeatC, public cRIO::Singleton<Heart
Heartbeat(token);

/**
* Sets heartbeat, publish data if the last heartbeat was send more than 500ms in past.
* Sets heartbeat, publish data if the last heartbeat was send more than 500ms
* in past.
*/
void tryToggle();

private:
double _lastToggleTimestamp;
};

}}}
} // namespace Events
} // namespace VMS
} // namespace LSST

#endif // LSST_INTERLOCKSTATUS_H
8 changes: 4 additions & 4 deletions src/LSST/VMS/Events/SummaryState.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* SummaryState event handling class.
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand Down
13 changes: 7 additions & 6 deletions src/LSST/VMS/Events/SummaryState.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* SummaryState event handling class.
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand All @@ -28,8 +28,8 @@

#include <VMSPublisher.h>

#include <spdlog/spdlog.h>
#include <mutex>
#include <spdlog/spdlog.h>

namespace LSST {
namespace VMS {
Expand All @@ -44,7 +44,8 @@ class SummaryState final : MTVMS_logevent_summaryStateC, public cRIO::Singleton<
SummaryState(token);

/**
* Returns true if summary state is disabled or enabled (e.g. not standby or fault).
* Returns true if summary state is disabled or enabled (e.g. not standby or
* fault).
*
* @return true if state is DISABLED or ENABLED
*
Expand Down
8 changes: 4 additions & 4 deletions src/LSST/VMS/FPGA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#include <spdlog/spdlog.h>
#include <unistd.h>
#include <chrono>
#include <spdlog/spdlog.h>
#include <thread>
#include <unistd.h>

#ifdef SIMULATOR
#include <math.h>
#include <Events/FPGAState.h>
#include <math.h>
#endif

#include <cRIO/NiError.h>
#include <Events/FPGAState.h>
#include <FPGA.h>
#include <FPGAAddresses.h>
Expand All @@ -42,6 +41,7 @@
#include <NiFpga_VMS_CameraRotator.h>
#include <VMSApplicationSettings.h>
#include <VMSPublisher.h>
#include <cRIO/NiError.h>

namespace LSST {
namespace VMS {
Expand Down
10 changes: 5 additions & 5 deletions src/LSST/VMS/Telemetry/PSD.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* PSD telemetry handling class.
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand All @@ -22,8 +22,8 @@

#include <spdlog/fmt/fmt.h>

#include "VMSPublisher.h"
#include "PSD.h"
#include "VMSPublisher.h"

// length of PSD array is defined in XML
constexpr size_t MAX_DATAPOINTS = 200;
Expand Down
12 changes: 6 additions & 6 deletions src/LSST/VMS/Telemetry/PSD.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* PSD telemetry handling class.
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand Down Expand Up @@ -81,8 +81,8 @@ class PSD final : public MTVMS_psdC {
float _samplingPeriod;
// axis cache
size_t _cache_size;
double* _cache[3];
fftw_complex* _output[3];
double *_cache[3];
fftw_complex *_output[3];
fftw_plan _plans[3];

void _clearPSDs();
Expand Down
2 changes: 1 addition & 1 deletion src/LSST/VMS/VMSApplicationSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
*/

#include <VMSApplicationSettings.h>
#include <yaml-cpp/yaml.h>
#include <spdlog/spdlog.h>
#include <yaml-cpp/yaml.h>

#include <vector>

Expand Down
2 changes: 1 addition & 1 deletion src/LSST/VMS/VMSPublisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* Author: ccontaxis
*/

#include <spdlog/spdlog.h>
#include <SAL_MTVMS.h>
#include <VMSPublisher.h>
#include <spdlog/spdlog.h>

namespace LSST {
namespace VMS {
Expand Down
12 changes: 6 additions & 6 deletions src/LSST/VMS/VMSSubscriber.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* VMSSubscriber class.
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand All @@ -20,12 +20,12 @@
* this program. If not, see <https://www.gnu.org/licenses/>.
*/

#include <VMSSubscriber.h>
#include <Commands/SAL.h>
#include <VMSSubscriber.h>

#include <SAL_MTVMS.h>
#include <cRIO/Command.h>
#include <cRIO/ControllerThread.h>
#include <SAL_MTVMS.h>
#include <spdlog/spdlog.h>

#include <chrono>
Expand Down
12 changes: 6 additions & 6 deletions src/LSST/VMS/VMSSubscriber.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* Thread to subscribe to other CSC.
*
* Developed for the Vera C. Rubin Observatory Telescope & Site Software Systems.
* This product includes software developed by the Vera C.Rubin Observatory Project
* (https://www.lsst.org). See the COPYRIGHT file at the top-level directory of
* this distribution for details of code ownership.
* Developed for the Vera C. Rubin Observatory Telescope & Site Software
* Systems. This product includes software developed by the Vera C.Rubin
* Observatory Project (https://www.lsst.org). See the COPYRIGHT file at the
* top-level directory of this distribution for details of code ownership.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand All @@ -23,8 +23,8 @@
#ifndef _VMS_VMSSubscriber_h
#define _VMS_VMSSubscriber_h

#include <map>
#include <functional>
#include <map>
#include <string>

#include <SAL_MTVMS.h>
Expand All @@ -40,7 +40,7 @@ class VMSSubscriber : public cRIO::Thread {
virtual ~VMSSubscriber();

protected:
void run(std::unique_lock<std::mutex>& lock) override;
void run(std::unique_lock<std::mutex> &lock) override;

private:
std::map<std::string, std::function<void(void)>> _commands;
Expand Down
Loading

0 comments on commit 82c866e

Please sign in to comment.