27#include "hugin_config.h"
36#include "wx/process.h"
37#include "wx/mimetype.h"
38#include <wx/sstream.h>
39#include <wx/tokenzr.h>
46 #include <sys/types.h>
75 m_timerIdleWakeUp(
this), m_queue(
nullptr), m_queueLength(0), m_checkReturnCode(
true)
109 _T(
"signal not supported"),
110 _T(
"permission denied"),
111 _T(
"no such process"),
112 _T(
"unspecified error"),
115 wxLogError(
_(
"Failed to kill process %ld, error %d: %s"),
200#if defined __WXMAC__ && defined __ppc__
206 cout <<
"osVersionCheck: os is " << os <<
"\n" << endl;
207 cout <<
"osVersionCheck: osVersionMajor = " <<
osVersionMajor << endl;
208 cout <<
"osVersionCheck: osVersionMinor = " <<
osVersionMinor << endl;
214 cout <<
"osVersionCheck: Leopard loop 1" << endl;
218 cout <<
"osVersionCheck: Tiger loop 1" << endl;
245 const long threads =
config->Read(
"/output/NumberOfThreads", 0l);
294 this->
GetParent()->GetEventHandler()->AddPendingEvent(event);
355 }
else if (c == 0x0) {
358 }
else if (c == 0x0d) {
369 }
else if (c ==
'\n') {
399 for (
size_t n = 0;
n < count;
n++ )
412#if defined __WXMAC__ && defined __ppc__
418 cerr <<
"osVersionCheck: os is " << os <<
"\n" << endl;
419 cerr <<
"osVersionCheck: osVersionMajor = " <<
osVersionMajor << endl;
420 cerr <<
"osVersionCheck: osVersionMinor = " <<
osVersionMinor << endl;
424 cerr <<
"osVersionCheck: Leopard loop 2" << endl;
437 event.SetEventObject(
this );
439 this->
GetParent()->ProcessEvent( event );
446 cerr <<
"osVersionCheck: Tiger loop 2" << endl;
453 DEBUG_TRACE(
"process terminated: pid " <<
pid <<
" exit code:" << status);
477 std::ldiv_t result=std::ldiv(duration, 60l);
478 *
m_textctrl <<
"\n" << wxString::Format(
_(
"Process took %ld:%2ld min"), result.quot, result.rem) <<
"\n";
482 *
m_textctrl <<
"\n" << wxString::Format(
_(
"Process took %ld s"), duration) <<
"\n";
489 event.SetEventObject(
this);
491 this->
GetParent()->GetEventHandler()->AddPendingEvent(event);
495 this->
GetParent()->GetEventHandler()->AddPendingEvent(event2);
551 DEBUG_DEBUG(
"Process " <<
pid <<
" terminated with return code: " << status);
581 DEBUG_DEBUG(
"Process terminated with return code: " <<
event.GetExitCode());
582 if(wxConfigBase::Get()->Read(
"CopyLogToClipboard", 0l)==1l)
639 dlg.CentreOnParent();
648 dlg.CentreOnParent();
wxDEFINE_EVENT(EVT_QUEUE_PROGRESS, wxCommandEvent)
int MyExecuteCommandQueue(HuginQueue::CommandQueue *queue, wxWindow *parent, const wxString &title, const wxString &comment)
execute all commands in queue with redirection of output to frame and allow canceling the queue will ...
int MyExecuteCommandOnDialog(wxString command, wxString args, wxWindow *parent, wxString title, bool isQuoted)
execute a single command in own dialog, redirect output to frame and allow canceling
const int HUGIN_EXIT_CODE_CANCELLED
normal command for queue, processing is stopped if an error occurred in program
virtual wxString GetCommand() const
MyExecPanel * m_execPanel
void AddString(const wxString &s)
display the string in the panel
void OnProcessTerminate(wxProcessEvent &event)
void OnCancel(wxCommandEvent &event)
int ExecQueue(HuginQueue::CommandQueue *queue)
MyExecDialog(wxWindow *parent, const wxString &title, const wxPoint &pos, const wxSize &size)
int ExecWithRedirect(wxString command)
void OnProcessTerminated(MyPipedProcess *process, int pid, int status)
MyExecPanel(wxWindow *parent)
void AddToOutput(wxInputStream &s)
void CopyLogToClipboard()
copy the content of the log window into the clipboard
int ExecNextQueue()
execute next command in queue
int ExecQueue(HuginQueue::CommandQueue *queue)
void AddString(const wxString &s)
display the string in the panel
MyProcessesArray m_running
void RemoveAsyncProcess(MyPipedProcess *process)
int ExecWithRedirect(wxString command)
wxTimer m_timerIdleWakeUp
wxArrayString GetLogAsArrayString()
returns the output
void PauseProcess(bool pause=true)
function to pause running process, argument pause defaults to true - to resume, set it to false
bool SaveLog(const wxString &filename)
save the content of the window into a given log file
wxExecuteEnv m_executeEnv
HuginQueue::CommandQueue * m_queue
void AddAsyncProcess(MyPipedProcess *process)
void ClearOutput()
clear the output
void OnTimer(wxTimerEvent &event)
virtual void OnTerminate(int pid, int status)
MyProcessListener * m_parent
virtual void OnProcessTerminated(MyPipedProcess *process, int pid, int status)=0
std::vector< NormalCommand * > CommandQueue
str wxQuoteFilename(const str &arg)
Quote a filename, so that it is surrounded by "".
include file for the hugin project
include file for the hugin project
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.