git-svn-id: svn://db.shs.com.ru/pip@759 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -94,7 +94,7 @@ macro(pip_resources RESULT INPUT)
|
||||
#message("RC_DEPS: ${RC_DEPS}")
|
||||
add_custom_command(OUTPUT ${RC_OUT}
|
||||
COMMAND ${PIP_RC}
|
||||
ARGS -i ${RC_FILES} -o ${RC_OUT} -n ${SRC_RC_OUT}
|
||||
ARGS -s -i ${RC_FILES} -o ${RC_OUT} -n ${SRC_RC_OUT}
|
||||
DEPENDS ${RC_DEPS}
|
||||
WORKING_DIRECTORY ${PIP_DLL_DIR}
|
||||
COMMENT "Generating ${RC_FILE}"
|
||||
|
||||
@@ -26,14 +26,11 @@ PIBaseTransfer::PIBaseTransfer(): crc(standardCRC_16()), diag(false) {
|
||||
setPacketSize(4096);
|
||||
#endif
|
||||
randomize();
|
||||
piCout << "PIBaseTransfer" << &diag;
|
||||
}
|
||||
|
||||
|
||||
PIBaseTransfer::~PIBaseTransfer() {
|
||||
piCout << "~PIBaseTransfer" << &diag;
|
||||
diag.stop();
|
||||
piCout << "~PIBaseTransfer done";
|
||||
break_ = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,19 +60,19 @@ PIDiagnostics::State::State() {
|
||||
|
||||
PIDiagnostics::PIDiagnostics(bool start_): PITimer(/*PITimer::Pool*/) {
|
||||
disconn_ = 0.;
|
||||
piCout << "PIDiagnostics construct";
|
||||
//piCout << "PIDiagnostics construct";
|
||||
setInterval(500);
|
||||
reset();
|
||||
setDisconnectTimeout(3.);
|
||||
changeDisconnectTimeout(3.);
|
||||
if (start_) PITimer::start(500);
|
||||
piCout << "PIDiagnostics construct done";
|
||||
//piCout << "PIDiagnostics construct done";
|
||||
}
|
||||
|
||||
PIDiagnostics::~PIDiagnostics() {
|
||||
piCout << "~PIDiagnostics start...";
|
||||
PITimer::stop();
|
||||
piCout << "~PIDiagnostics done!";
|
||||
//piCout << "~PIDiagnostics start...";
|
||||
//PITimer::stop();
|
||||
//piCout << "~PIDiagnostics done!";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -393,17 +393,44 @@ void PIThread::setPriority(PIThread::Priority prior) {
|
||||
}
|
||||
|
||||
|
||||
#ifdef WINDOWS
|
||||
bool isExists(HANDLE hThread) {
|
||||
//errorClear();
|
||||
//piCout << "isExists" << hThread;
|
||||
DWORD dw = 0;
|
||||
GetExitCodeThread(hThread, &dw);
|
||||
//piCout << ret << dw << errorString();
|
||||
if (dw == STILL_ACTIVE) return true;
|
||||
//piCout << errorString();
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool PIThread::waitForFinish(int timeout_msecs) {
|
||||
//PICout(PICoutManipulators::DefaultControls) << "thread" << this << "PIThread::waitForFinish" << running_ << terminating << timeout_msecs;
|
||||
if (!running_) return true;
|
||||
if (timeout_msecs < 0) {
|
||||
while (running_)
|
||||
while (running_) {
|
||||
msleep(PIP_MIN_MSLEEP);
|
||||
#ifdef WINDOWS
|
||||
if (!isExists(PRIVATE->thread)) {
|
||||
unlock();
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
tmf_.reset();
|
||||
while (running_ && tmf_.elapsed_m() < timeout_msecs)
|
||||
while (running_ && tmf_.elapsed_m() < timeout_msecs) {
|
||||
msleep(PIP_MIN_MSLEEP);
|
||||
#ifdef WINDOWS
|
||||
if (!isExists(PRIVATE->thread)) {
|
||||
unlock();
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return tmf_.elapsed_m() < timeout_msecs;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ void usage() {
|
||||
piCout << "-i --input <in_file> " << Green << "- resources description file";
|
||||
piCout << "-o --out <out_file> " << Green << "- output .cpp file";
|
||||
piCout << "-l --list " << Green << "- print readed files from description and exit";
|
||||
piCout << "-s --silent " << Green << "- no console output";
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +26,10 @@ int main (int argc, char * argv[]) {
|
||||
cli.addArgument("name", true);
|
||||
cli.addArgument("help");
|
||||
cli.addArgument("list");
|
||||
cli.addArgument("silent");
|
||||
|
||||
if (cli.hasArgument("silent"))
|
||||
piDebug = false;
|
||||
if (cli.hasArgument("help") || !cli.hasArgument("input") ||
|
||||
(!cli.hasArgument("out") && !cli.hasArgument("list"))) {
|
||||
usage();
|
||||
|
||||
Reference in New Issue
Block a user