Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4GUI/TGo4StartClientSlots.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4StartClientSlots.h"
00017 
00018 #include "qstatusbar.h"
00019 #include "qapplication.h"
00020 #include "qmessagebox.h"
00021 
00022 #include "Go4GUIRegistry/TGo4GUIRegistry.h"
00023 #include "Go4Display/TGo4Display.h"
00024 //#include "Go4CommandsTaskHandler/TGo4ComLaunchClient.h"
00025 #include "Go4CommandsBase/TGo4Command.h"
00026 #include "Go4CommandsTaskHandler/TGo4ComConnectSlave.h"
00027 #include "TGo4StartClientStatus.h"
00028 #include "TGo4StartClient.h"
00029 #include "TGo4MainWindow.h"
00030 
00031 TGo4StartClientSlots::TGo4StartClientSlots(const char * name, const char * title, TGo4StartClient * p)
00032                        :TGo4SlotsBaseClass(name , title)
00033 {
00034    // TGo4LockGuard Global;
00035    fxTGo4StartClient = p;
00036    fxTGo4GUIRegistry = TGo4GUIRegistry::Instance();
00037    fxTGo4StartClientStatus= new TGo4StartClientStatus("TGo4StartClientStatus", "Test Status 1");
00038    fxTGo4GUIRegistry->RegisterSlotClass(this, fxTGo4StartClientStatus, p);
00039 
00040 }
00041 TGo4Status * TGo4StartClientSlots::GetStatus()
00042 {
00043    return fxTGo4StartClientStatus;
00044 }
00045 void TGo4StartClientSlots::SetGUI(TGo4StartClient *GUI )
00046 {
00047    fxTGo4StartClient=GUI;
00048    fxTGo4GUIRegistry->GuiIsChanged(this, GUI);
00049 }
00050 
00051 void TGo4StartClientSlots::StartClient(const char* Name, 
00052                                        const char* Node, 
00053                                        const char* Dir, 
00054                                        const char* Executable,
00055                                        UInt_t port,
00056                                        Bool_t startserver)
00057 {
00058    // TGo4LockGuard Global;
00059    TGo4Display *fxDisplay=fxTGo4GUIRegistry->GetDisplay();
00060        if(!fxDisplay->IsConnected())
00061          {
00062          TGo4ComConnectSlave *com = new TGo4ComConnectSlave();
00063          com->SetSlaveName(Name);
00064          com->SetSlaveHost(Node);
00065          com->SetSlaveDir(Dir);
00066          com->SetSlaveExecutable(Executable);
00067          com->SetSlavePort(port);
00068          com->SetStartServer(startserver);
00069          com->SetLogin((Go4CommandMode_t) fxTGo4StartClientStatus->GetLoginMode());
00070          com->SetPassword(fxTGo4StartClientStatus->GetPasswd());
00071          Int_t Mode = fxTGo4StartClientStatus->GetSlaveMode();
00072          Int_t Shell = fxTGo4StartClientStatus->GetSlaveShell();
00073          
00074          if(Mode==1 && Shell==1){ // rsh and Qt window
00075             com->SetSlaveMode(TGo4ServerTask::kGuiEmbed);
00076          }else if (Mode==1 && Shell ==2) { //rsh and Xterm
00077             com->SetSlaveMode(0);
00078          }else if(Mode==2 && Shell==1){ // ssh and Qt window
00079             com->SetSlaveMode(TGo4ServerTask::kSecureShell+TGo4ServerTask::kGuiEmbed);
00080          }else if (Mode==2 && Shell ==2) { //ssh and Xterm
00081             com->SetSlaveMode(TGo4ServerTask::kSecureShell);
00082          }
00083 
00084 
00085          fxTGo4GUIRegistry->SetAnalysisReady(kFALSE); // reset ready flag, will be set when analysis is connected
00086          fxTGo4GUIRegistry->SubmitCommand(com);
00087          
00088          TGo4MainWindow *MW= (TGo4MainWindow *)fxTGo4GUIRegistry->GetMainWindow();
00089          
00090          MW->statusBar()->message("Starting Analysis Slave....  Please wait");
00091          
00092          MW->AnalysisConfigAppearance(1);
00093 //         MW->AnalysisConfigSlot();
00094          
00095          //delete fxTGo4StartClient;
00096          }
00097       else 
00098          {
00099             QMessageBox::warning( fxTGo4StartClient, "Slave is already connected", "Slave is already connected" );
00100          }
00101 }
00102 
00103 TGo4StartClientSlots::~TGo4StartClientSlots()
00104 {
00105    delete   fxTGo4StartClientStatus;
00106 }
00107 
00108 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:56:03 2005 for Go4-v2.10-5 by doxygen1.2.15