[DEV] update new etk Uri API
This commit is contained in:
parent
5ab9704b6f
commit
c4826fe2b9
@ -7,7 +7,6 @@
|
|||||||
#include <test-debug/debug.hpp>
|
#include <test-debug/debug.hpp>
|
||||||
#include <etk/etk.hpp>
|
#include <etk/etk.hpp>
|
||||||
#include <audio/algo/drain/Equalizer.hpp>
|
#include <audio/algo/drain/Equalizer.hpp>
|
||||||
#include <etk/os/FSNode.hpp>
|
|
||||||
#include <echrono/echrono.hpp>
|
#include <echrono/echrono.hpp>
|
||||||
#include <ethread/Thread.hpp>
|
#include <ethread/Thread.hpp>
|
||||||
#include <ethread/tools.hpp>
|
#include <ethread/tools.hpp>
|
||||||
|
@ -11,8 +11,8 @@ extern "C" {
|
|||||||
|
|
||||||
#include <etk/etk.hpp>
|
#include <etk/etk.hpp>
|
||||||
#include <test-debug/debug.hpp>
|
#include <test-debug/debug.hpp>
|
||||||
#include <etk/os/FSNode.hpp>
|
|
||||||
#include <etk/math/Vector3D.hpp>
|
#include <etk/math/Vector3D.hpp>
|
||||||
|
#include <etk/uri/uri.hpp>
|
||||||
|
|
||||||
const double speedSound = 340.29; // m/s
|
const double speedSound = 340.29; // m/s
|
||||||
|
|
||||||
@ -155,12 +155,12 @@ const double distanceEar = 3;
|
|||||||
int main(int argc, const char *argv[]) {
|
int main(int argc, const char *argv[]) {
|
||||||
etk::init(argc, argv);
|
etk::init(argc, argv);
|
||||||
TEST_INFO("start calculation");
|
TEST_INFO("start calculation");
|
||||||
etk::FSNode node("beamPattern.dat");
|
ememory::SharedPtr<etk::io::Interface> fileIO = etk::uri::get(etk::Path("beamPattern.dat"));
|
||||||
node.fileOpenWrite();
|
if (fileIO->open(etk::io::OpenMode::Write) == false) {
|
||||||
|
TEST_ERROR("Can not open file...");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
double freq = 3000.0; // Signal frequency in Hz
|
double freq = 3000.0; // Signal frequency in Hz
|
||||||
|
|
||||||
|
|
||||||
double basicApplyDelay[posCount];
|
double basicApplyDelay[posCount];
|
||||||
for (int32_t iii=0; iii<posCount; iii++) {
|
for (int32_t iii=0; iii<posCount; iii++) {
|
||||||
basicApplyDelay[iii] = 0.0f;
|
basicApplyDelay[iii] = 0.0f;
|
||||||
@ -189,9 +189,9 @@ int main(int argc, const char *argv[]) {
|
|||||||
}
|
}
|
||||||
char ploppp[4096];
|
char ploppp[4096];
|
||||||
sprintf(ploppp, "%d %f %f %f %f\n", aaa, angle, angleRad, output, logOutput);
|
sprintf(ploppp, "%d %f %f %f %f\n", aaa, angle, angleRad, output, logOutput);
|
||||||
node.filePuts(ploppp);
|
fileIO->puts(ploppp);
|
||||||
}
|
}
|
||||||
node.fileClose();
|
fileIO->close();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ extern "C" {
|
|||||||
// gnuplot> call 'freqResp.gnuplot'
|
// gnuplot> call 'freqResp.gnuplot'
|
||||||
|
|
||||||
#include <etk/etk.hpp>
|
#include <etk/etk.hpp>
|
||||||
|
#include <etk/uri/uri.hpp>
|
||||||
#include <test-debug/debug.hpp>
|
#include <test-debug/debug.hpp>
|
||||||
#include <etk/os/FSNode.hpp>
|
|
||||||
#include <etk/math/Vector3D.hpp>
|
#include <etk/math/Vector3D.hpp>
|
||||||
|
|
||||||
const double speedSound = 340.29; // m/s
|
const double speedSound = 340.29; // m/s
|
||||||
@ -154,8 +154,11 @@ const double distanceEar = 3;
|
|||||||
int main(int argc, const char *argv[]) {
|
int main(int argc, const char *argv[]) {
|
||||||
etk::init(argc, argv);
|
etk::init(argc, argv);
|
||||||
TEST_INFO("start calculation");
|
TEST_INFO("start calculation");
|
||||||
etk::FSNode node("freqResp.dat");
|
ememory::SharedPtr<etk::io::Interface> fileIO = etk::uri::get(etk::Path("freqResp.dat"));
|
||||||
node.fileOpenWrite();
|
if (fileIO->open(etk::io::OpenMode::Write) == false) {
|
||||||
|
TEST_ERROR("Can not open file...");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
double basicApplyDelay[posCount];
|
double basicApplyDelay[posCount];
|
||||||
for (int32_t iii=0; iii<posCount; iii++) {
|
for (int32_t iii=0; iii<posCount; iii++) {
|
||||||
basicApplyDelay[iii] = 0.0f;
|
basicApplyDelay[iii] = 0.0f;
|
||||||
@ -186,10 +189,10 @@ int main(int argc, const char *argv[]) {
|
|||||||
}
|
}
|
||||||
char ploppp[4096];
|
char ploppp[4096];
|
||||||
sprintf(ploppp, "%f %f %f\n", angle, freq, logOutput);
|
sprintf(ploppp, "%f %f %f\n", angle, freq, logOutput);
|
||||||
node.filePuts(ploppp);
|
fileIO->puts(ploppp);
|
||||||
}
|
}
|
||||||
node.filePuts("\n");
|
fileIO->puts("\n");
|
||||||
}
|
}
|
||||||
node.fileClose();
|
fileIO->close();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user