* runtime - loading and translating * design-time - works with *.ts file (pip_tr utility) * compile-time - CMake macro for compile *.ts
94 lines
2.5 KiB
C++
94 lines
2.5 KiB
C++
#include "pibytearray.h"
|
|
#include "piclientserver_client.h"
|
|
#include "piclientserver_server.h"
|
|
#include "picodeparser.h"
|
|
#include "piintrospection_server.h"
|
|
#include "piiostream.h"
|
|
#include "pijson.h"
|
|
#include "pilog.h"
|
|
#include "pimathbase.h"
|
|
#include "pip.h"
|
|
#include "pitranslator_p.h"
|
|
#include "pivaluetree_conversions.h"
|
|
|
|
using namespace PICoutManipulators;
|
|
|
|
int main(int argc, char * argv[]) {
|
|
PITranslator::loadLang("ru");
|
|
PISerial f("COM123");
|
|
f.open();
|
|
|
|
/*auto test = [](PIString s, PIString v) {
|
|
piCout << " in:" << s;
|
|
piCout << "arg:" << minArgPlaceholder(s);
|
|
piCout << "out:" << arg(s, v);
|
|
piCout << "";
|
|
};
|
|
|
|
test(" %", "asd");
|
|
test("%", "asd");
|
|
test("1", "asd");
|
|
test(" %11", "asd");
|
|
test("%1%2 %0f%0g", "asd");
|
|
test("%01 ", "asd");*/
|
|
|
|
/*piCout << PIString::readableSize(50_KiB);
|
|
piCout << PIString::readableSize(1_GB);
|
|
PITranslator::loadLang("ru");
|
|
piCout << PIString::readableSize(50_KiB);
|
|
piCout << PIString::readableSize(1_GB);
|
|
piCout << "test\nstring"_tr;
|
|
PITranslator::clear();
|
|
piCout << PIString::readableSize(50_KiB);
|
|
piCout << PIString::readableSize(1_GB);
|
|
piCout << "test\nstring"_tr;
|
|
piCout << "hello!"_tr;
|
|
PITranslator::loadConfig("[]\nhello!=привет!\n[Co]\nhello!=привет CO!\n"_u8);
|
|
piCout << "hello!"_tr("Co") << "hello!"_tr;*/
|
|
// piCout << "hello!"_trNoOp;
|
|
|
|
// PICodeParser parser;
|
|
// parser.parseFile("cmg_test.h");
|
|
/*for (auto m: parser.macros) {
|
|
piCout << "";
|
|
piCout << m.name << m.args << m.value;
|
|
piCout << m.expand({"hello"});
|
|
}
|
|
*/
|
|
|
|
/*PISet<int> set;
|
|
piCout << set << piSerialize(set) << piDeserialize<PISet<int>>(piSerialize(set));
|
|
set << 1 << 2 << 3;
|
|
piCout << set << piSerialize(set) << piDeserialize<PISet<int>>(piSerialize(set));
|
|
set << 1 << -2 << 50 << -100;
|
|
piCout << set << piSerialize(set) << piDeserialize<PISet<int>>(piSerialize(set));*/
|
|
return 0;
|
|
|
|
std::numeric_limits<complexf>::epsilon();
|
|
using cmlp = complexf;
|
|
PIMathMatrixT<3, 3, double> v0;
|
|
PIMathMatrixT<3, 3, cmlp> v1;
|
|
v0[0][1] = 1;
|
|
v0[1][1] = 2;
|
|
v0[2][1] = 3;
|
|
v1[0][1] = cmlp(1., 0);
|
|
v1[1][1] = cmlp(2., -1);
|
|
v1[2][1] = cmlp(3., 2);
|
|
piCout << v0 << v1;
|
|
piCout << (v0 * 2.) << (v1 * cmlp(2., 2.));
|
|
piCout << (v0 + 2.) << (v1 + cmlp(2.));
|
|
piCout << (v0 - 2.) << (v1 - cmlp(2.));
|
|
piCout << (v0 / 2.) << (v1 / cmlp(2., 1.));
|
|
// piCout << (v0.length()) << (v1.length());
|
|
// piCout << (v0.lengthSqr()) << (v1.lengthSqr());
|
|
// piCout << (v0.manhattanLength()) << (v1.manhattanLength());
|
|
|
|
/*foo<int>();
|
|
foo<double>();
|
|
foo<complexf>();
|
|
foo<complexd>();
|
|
return 0;*/
|
|
|
|
return 0;
|
|
}
|