pift fix
git-svn-id: svn://db.shs.com.ru/pip@65 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -154,7 +154,7 @@ set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
#find_package(Qt4 REQUIRED)
|
||||
#include_directories(${QT_INCLUDES})
|
||||
add_executable(pip_test "main.cpp" "ccm_kbd.cpp")
|
||||
target_link_libraries(pip_test pip gmp-3)# ${QT_QTCORE_LIBRARY})
|
||||
target_link_libraries(pip_test pip)# ${QT_QTCORE_LIBRARY})
|
||||
#target_link_libraries(pip_test pip)
|
||||
|
||||
|
||||
|
||||
14
main.cpp
14
main.cpp
@@ -155,8 +155,8 @@ public:
|
||||
fp & operator=(const double &v) {val = FixedPoint(v).val; return *this;}
|
||||
fp & operator=(const long double &v) {val = FixedPoint(v).val; return *this;}
|
||||
fp & operator-() {fp p = fp(*this); p.val = -val; return p;}
|
||||
bool operator==(const fp & v) const {val == v.val;}
|
||||
bool operator!=(const fp & v) const {val != v.val;}
|
||||
bool operator==(const fp & v) const {return val == v.val;}
|
||||
bool operator!=(const fp & v) const {return val != v.val;}
|
||||
|
||||
void operator+=(const fp & v) {val += v.val;}
|
||||
void operator-=(const fp & v) {val -= v.val;}
|
||||
@@ -215,14 +215,14 @@ inline PICout operator <<(PICout s, const FixedPoint<Precision, Type> & v) {
|
||||
|
||||
|
||||
|
||||
#include "mpint.h"
|
||||
//#include "mpint.h"
|
||||
int main (int argc, char * argv[]) {
|
||||
FixedPoint<16, long long> a, b;
|
||||
/*FixedPoint<16, long long> a, b;
|
||||
a = 10;
|
||||
b = 3;
|
||||
piCout << a << b << a/b;
|
||||
FixedPoint<7,ushort> c = 507.03;
|
||||
piCout << c;
|
||||
piCout << c;*/
|
||||
// gmp::mpint m1("1003456789098765432334567890743278908743789087345678909876543213456789098765422"),
|
||||
// m2("523456789085039345678909856787656787654383071478723617832987864856248765784547826784659267894659782645824317172186776677");
|
||||
// FixedPoint<1, gmp::mpint> mf1(m1);
|
||||
@@ -235,7 +235,7 @@ int main (int argc, char * argv[]) {
|
||||
// piCout << m1;
|
||||
// piCout << tm3.elapsed_m();
|
||||
//m1++;
|
||||
complex<FixedPoint<8,int> > ccc;
|
||||
/*complex<FixedPoint<8,int> > ccc;
|
||||
piCout << ccc;
|
||||
return 0;
|
||||
|
||||
@@ -246,7 +246,7 @@ int main (int argc, char * argv[]) {
|
||||
piCout << x;
|
||||
piCout << y;
|
||||
piCout << z;
|
||||
return 0;
|
||||
return 0;*/
|
||||
/*
|
||||
hostent * he = 0;
|
||||
he = gethostbyname(argv[1]);
|
||||
|
||||
@@ -41,16 +41,15 @@ void PIBaseTransfer::stopReceive() {
|
||||
|
||||
void PIBaseTransfer::received(PIByteArray data) {
|
||||
packet_header_size = sizeof(PacketHeader) + customHeader().size();
|
||||
// piCoutObj << "receive" << data.size();
|
||||
if (data.size() < sizeof(PacketHeader)) {
|
||||
diag.received(data.size(), false);
|
||||
return;
|
||||
}
|
||||
diag.received(data.size(), true);
|
||||
PacketHeader h;
|
||||
data >> h;
|
||||
PacketType pt = (PacketType)h.type;
|
||||
// piCoutObj << "receive" << h.session_id << h.type << h.id;
|
||||
diag.received(data.size(), true);
|
||||
switch (pt) {
|
||||
case pt_Unknown: break;
|
||||
case pt_Data:
|
||||
@@ -123,7 +122,7 @@ void PIBaseTransfer::received(PIByteArray data) {
|
||||
is_receiving = true;
|
||||
break_ = false;
|
||||
diag.reset();
|
||||
diag.start();
|
||||
diag.start(100);
|
||||
receiveStarted();
|
||||
replies_cnt = send_queue = 0;
|
||||
state_string = "receiving";
|
||||
@@ -141,7 +140,7 @@ bool PIBaseTransfer::send_process() {
|
||||
break_ = false;
|
||||
is_sending = true;
|
||||
diag.reset();
|
||||
diag.start();
|
||||
diag.start(100);
|
||||
sendStarted();
|
||||
replies.resize(session.size() + 1);
|
||||
replies.fill(pt_Unknown);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
* */
|
||||
|
||||
|
||||
PIDiagnostics::PIDiagnostics(bool start_): PITimer() {
|
||||
PIDiagnostics::PIDiagnostics(bool start_): PITimer(PITimer::Pool) {
|
||||
reset();
|
||||
if (start_) start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user