Merging STORAGE-dev to master
[u/mrichter/AliRoot.git] / MONITOR / alistoragemanager / AliStorageAdministratorPanelMarkEvent.cxx
@@ -2,13 +2,11 @@
 #include "AliStorageTypes.h"
 
 #include <iostream>
-#include "zmq.hpp"
 
 #include <TGFrame.h>
 #include <TGButton.h>
 
 using namespace std;
-using namespace zmq;
 
 AliStorageAdministratorPanelMarkEvent *AliStorageAdministratorPanelMarkEvent::fInstance=0;
 
@@ -32,21 +30,17 @@ AliStorageAdministratorPanelMarkEvent::AliStorageAdministratorPanelMarkEvent() :
        fStatusLabel(0),
        fRunNumberEntry(0),
        fEventNumberEntry(0),
-       fServerSocket(0),
+       fServerSocket(SERVER_COMMUNICATION_REQ),
        fEventManager(0)
 {
-       fEventManager = new AliStorageEventManager();
+       fEventManager = AliStorageEventManager::GetEventManagerInstance();
+       fEventManager->CreateSocket(fServerSocket);
        InitWindow();
 }
 
 AliStorageAdministratorPanelMarkEvent::~AliStorageAdministratorPanelMarkEvent()
 {
        cout<<"ADMIN PANEL -- Mark Window descructor called";
-//     if(fStatusLabel)delete fStatusLabel;
-//     if(fRunNumberEntry)delete fRunNumberEntry;
-//     if(fEventNumberEntry)delete fEventNumberEntry;
-       //if(fServerSocket)delete fServerSocket;
-//     DestroyWindow();
        cout<<" --- OK"<<endl;
 }
 
@@ -56,11 +50,6 @@ AliStorageAdministratorPanelMarkEvent* AliStorageAdministratorPanelMarkEvent::Ge
        return fInstance;
 }
 
-void AliStorageAdministratorPanelMarkEvent::SetSocket(socket_t *socket)
-{
-       fServerSocket = socket;
-}
-
 void AliStorageAdministratorPanelMarkEvent::InitWindow()
 {
        SetCleanup(kDeepCleanup);
@@ -123,12 +112,9 @@ void AliStorageAdministratorPanelMarkEvent::onMarkButton()
        requestMessage->event = mark;
 
        fEventManager->Send(requestMessage,fServerSocket);
-
-       message_t *response = new message_t();
-       fServerSocket->recv(response);
-       char *result = (char*)response->data();
+       bool response = fEventManager->GetBool(fServerSocket);
        
-       if(!strcmp("true",result))
+       if(response)
        {
                fStatusLabel->SetText("Event marked");
                cout<<"ADMIN PANEL -- Event marked succesfully"<<endl;