- Changes in module support
authorVictor Kirhenshtein <victor@netxms.org>
Sun, 12 Dec 2004 20:40:29 +0000 (20:40 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Sun, 12 Dec 2004 20:40:29 +0000 (20:40 +0000)
- Unfinished graph properties dialog

23 files changed:
.gitattributes
include/getopt.h
include/nms_agent.h
src/agent/subagents/winperf/winperf.cpp
src/console/win32/GraphFrame.cpp
src/console/win32/GraphFrame.h
src/console/win32/GraphPropDlg.cpp [new file with mode: 0644]
src/console/win32/GraphPropDlg.h [new file with mode: 0644]
src/console/win32/nxcon.clw
src/console/win32/nxcon.cpp
src/console/win32/nxcon.dsp
src/console/win32/nxcon.h
src/console/win32/nxcon.rc
src/console/win32/resource.h
src/libnetxms/getopt.c
src/libnetxms/inline.cpp
src/libnetxms/libnetxms.h
src/libnetxms/tools.cpp
src/server/core/container.cpp
src/server/core/main.cpp
src/server/core/objects.cpp
src/server/core/session.cpp
src/server/include/nms_objects.h

index 5235bf1..0aa9ee5 100644 (file)
@@ -256,6 +256,8 @@ src/console/win32/Graph.cpp -text
 src/console/win32/Graph.h -text
 src/console/win32/GraphFrame.cpp -text
 src/console/win32/GraphFrame.h -text
+src/console/win32/GraphPropDlg.cpp -text
+src/console/win32/GraphPropDlg.h -text
 src/console/win32/GroupPropDlg.cpp -text
 src/console/win32/GroupPropDlg.h -text
 src/console/win32/LoginDialog.cpp -text
index 99d424f..90b801c 100644 (file)
 
 #ifdef _WIN32
 #ifdef LIBNETXMS_EXPORTS
-#define EXPORTABLE __declspec(dllexport)
+#define GETOPT_EXPORTABLE __declspec(dllexport)
 #else
-#define EXPORTABLE __declspec(dllimport)
+#define GETOPT_EXPORTABLE __declspec(dllimport)
 #endif
 #else    /* _WIN32 */
-#define EXPORTABLE
+#define GETOPT_EXPORTABLE
 #endif
 
 #ifdef __cplusplus
@@ -38,7 +38,7 @@ extern "C" {
    Also, when `ordering' is RETURN_IN_ORDER,
    each non-option ARGV-element is returned here.  */
 
-extern EXPORTABLE char *optarg;
+extern GETOPT_EXPORTABLE char *optarg;
 
 /* Index in ARGV of the next element to be scanned.
    This is used for communication to and from the caller
@@ -52,16 +52,16 @@ extern EXPORTABLE char *optarg;
    Otherwise, `optind' communicates from one call to the next
    how much of ARGV has been scanned so far.  */
 
-extern EXPORTABLE int optind;
+extern GETOPT_EXPORTABLE int optind;
 
 /* Callers store zero here to inhibit the error message `getopt' prints
    for unrecognized options.  */
 
-extern EXPORTABLE int opterr;
+extern GETOPT_EXPORTABLE int opterr;
 
 /* Set to an option character which was unrecognized.  */
 
-extern EXPORTABLE int optopt;
+extern GETOPT_EXPORTABLE int optopt;
 
 /* Describe the long-named options requested by the application.
    The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
@@ -104,10 +104,10 @@ struct option
 #define required_argument      1
 #define optional_argument      2
 
-extern int EXPORTABLE getopt (int argc, char *const *argv, const char *shortopts);
-extern int EXPORTABLE getopt_long (int argc, char *const *argv, const char *shortopts,
+extern int GETOPT_EXPORTABLE getopt (int argc, char *const *argv, const char *shortopts);
+extern int GETOPT_EXPORTABLE getopt_long (int argc, char *const *argv, const char *shortopts,
                        const struct option *longopts, int *longind);
-extern int EXPORTABLE getopt_long_only (int argc, char *const *argv,
+extern int GETOPT_EXPORTABLE getopt_long_only (int argc, char *const *argv,
                             const char *shortopts,
                             const struct option *longopts, int *longind);
 
index 49020e5..7d3b394 100644 (file)
@@ -115,7 +115,9 @@ typedef struct
 // Subagent initialization structure
 //
 
-#define NETXMS_SUBAGENT_INFO_MAGIC     ((DWORD)0x0E782501)
+#define NETXMS_SUBAGENT_INFO_MAGIC     ((DWORD)0xAD000109)
+
+class CSCPMessage;
 
 typedef struct
 {
@@ -123,6 +125,7 @@ typedef struct
    TCHAR szName[MAX_SUBAGENT_NAME];
    TCHAR szVersion[16];
    void (* pUnloadHandler)(void);   // Called at subagent unload. Can be NULL.
+   BOOL (* pCommandHandler)(DWORD dwCommand, CSCPMessage *pMsg);
    DWORD dwNumParameters;
    NETXMS_SUBAGENT_PARAM *pParamList;
    DWORD dwNumEnums;
@@ -137,6 +140,8 @@ typedef struct
 #ifdef __cplusplus
 #ifndef LIBNETXMS_INLINE
 
+#include <nms_agent.h>
+
 inline void ret_string(TCHAR *rbuf, TCHAR *value)
 {
    _tcsncpy(rbuf, value, MAX_RESULT_LENGTH);
index 4b4b3be..81ffffa 100644 (file)
@@ -309,7 +309,7 @@ static NETXMS_SUBAGENT_INFO m_info =
 {
    NETXMS_SUBAGENT_INFO_MAGIC,
        _T("WinPerf"), _T(NETXMS_VERSION_STRING) _T(DEBUG_SUFFIX), OnUnload,
-       0, NULL,
+       0, NULL, NULL,
        sizeof(m_enums) / sizeof(NETXMS_SUBAGENT_ENUM),
        m_enums
 };
index 168fbdd..386d24b 100644 (file)
@@ -4,6 +4,7 @@
 #include "stdafx.h"
 #include "nxcon.h"
 #include "GraphFrame.h"
+#include "GraphPropDlg.h"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -32,6 +33,7 @@ BEGIN_MESSAGE_MAP(CGraphFrame, CMDIChildWnd)
        ON_WM_SIZE()
        ON_COMMAND(ID_VIEW_REFRESH, OnViewRefresh)
        ON_WM_SETFOCUS()
+       ON_COMMAND(ID_GRAPH_PROPERTIES, OnGraphProperties)
        //}}AFX_MSG_MAP
 END_MESSAGE_MAP()
 
@@ -153,3 +155,17 @@ BOOL CGraphFrame::PreCreateWindow(CREATESTRUCT& cs)
                                          AfxGetApp()->LoadIcon(IDI_GRAPH));
        return CMDIChildWnd::PreCreateWindow(cs);
 }
+
+
+//
+// WM_COMMAND::ID_GRAPH_PROPERTIES
+//
+
+void CGraphFrame::OnGraphProperties() 
+{
+   CGraphPropDlg dlg;
+
+   if (dlg.DoModal() == IDOK)
+   {
+   }
+}
index 7eba2b1..86ccff7 100644 (file)
@@ -42,6 +42,7 @@ protected:
        afx_msg void OnSize(UINT nType, int cx, int cy);
        afx_msg void OnViewRefresh();
        afx_msg void OnSetFocus(CWnd* pOldWnd);
+       afx_msg void OnGraphProperties();
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 private:
diff --git a/src/console/win32/GraphPropDlg.cpp b/src/console/win32/GraphPropDlg.cpp
new file mode 100644 (file)
index 0000000..1c532a6
--- /dev/null
@@ -0,0 +1,76 @@
+// GraphPropDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "nxcon.h"
+#include "GraphPropDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CGraphPropDlg dialog
+
+
+CGraphPropDlg::CGraphPropDlg(CWnd* pParent /*=NULL*/)
+       : CDialog(CGraphPropDlg::IDD, pParent)
+{
+       //{{AFX_DATA_INIT(CGraphPropDlg)
+       m_dwRefreshInterval = 0;
+       //}}AFX_DATA_INIT
+}
+
+
+void CGraphPropDlg::DoDataExchange(CDataExchange* pDX)
+{
+       CDialog::DoDataExchange(pDX);
+       //{{AFX_DATA_MAP(CGraphPropDlg)
+       DDX_Text(pDX, IDC_EDIT_REFRESH, m_dwRefreshInterval);
+       DDV_MinMaxDWord(pDX, m_dwRefreshInterval, 5, 3600);
+       //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CGraphPropDlg, CDialog)
+       //{{AFX_MSG_MAP(CGraphPropDlg)
+       ON_WM_CTLCOLOR()
+       ON_BN_CLICKED(IDC_CB_BACKGROUND, OnCbBackground)
+       //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CGraphPropDlg message handlers
+
+
+//
+// WM_CTLCOLOR message handler
+//
+
+HBRUSH CGraphPropDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
+{
+   HBRUSH hbr;
+
+   switch(pWnd->GetDlgCtrlID())
+   {
+      case IDC_CB_BACKGROUND:
+         pDC->SetBkColor(RGB(200,0,0));
+         hbr = CreateSolidBrush(RGB(200,0,0));
+         break;
+      default:
+             hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
+         break;
+   }
+       return hbr;
+}
+
+
+//
+// BN_CLICK handlers for color selectors
+//
+
+void CGraphPropDlg::OnCbBackground() 
+{
+}
diff --git a/src/console/win32/GraphPropDlg.h b/src/console/win32/GraphPropDlg.h
new file mode 100644 (file)
index 0000000..3e484d4
--- /dev/null
@@ -0,0 +1,47 @@
+#if !defined(AFX_GRAPHPROPDLG_H__2C17056D_6D61_4B55_9D1A_C7BE1338047F__INCLUDED_)
+#define AFX_GRAPHPROPDLG_H__2C17056D_6D61_4B55_9D1A_C7BE1338047F__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// GraphPropDlg.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CGraphPropDlg dialog
+
+class CGraphPropDlg : public CDialog
+{
+// Construction
+public:
+       CGraphPropDlg(CWnd* pParent = NULL);   // standard constructor
+
+// Dialog Data
+       //{{AFX_DATA(CGraphPropDlg)
+       enum { IDD = IDD_GRAPH_PROPERTIES };
+       DWORD   m_dwRefreshInterval;
+       //}}AFX_DATA
+
+
+// Overrides
+       // ClassWizard generated virtual function overrides
+       //{{AFX_VIRTUAL(CGraphPropDlg)
+       protected:
+       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+       //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+
+       // Generated message map functions
+       //{{AFX_MSG(CGraphPropDlg)
+       afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
+       afx_msg void OnCbBackground();
+       //}}AFX_MSG
+       DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_GRAPHPROPDLG_H__2C17056D_6D61_4B55_9D1A_C7BE1338047F__INCLUDED_)
index 4910eac..4c3e761 100644 (file)
@@ -2,35 +2,35 @@
 
 [General Info]
 Version=1
-LastClass=CNodePropsGeneral
+LastClass=CGraphPropDlg
 LastTemplate=CDialog
 NewFileInclude1=#include "stdafx.h"
 NewFileInclude2=#include "nxcon.h"
 LastPage=0
 
-ClassCount=71
+ClassCount=72
 Class1=CConsoleApp
 Class3=CMainFrame
 Class4=CChildFrame
 Class7=CEventBrowser
 Class9=CMapView
 
-ResourceCount=92
+ResourceCount=94
 Resource1=IDD_THRESHOLD (English (U.S.))
-Resource2=IDD_EDIT_RULE_SEVERITY
+Resource2=IDA_ACTION_EDITOR
 Resource3=IDM_VIEW_SPECIFIC (English (U.S.))
-Resource4=IDD_DCI_TRANSFORM
-Resource5=IDD_MIB_BROWSER
+Resource4=IDD_REQUEST_PROCESSING
+Resource5=IDA_OBJECT_BROWSER
 Class2=CChildView
 Class5=CAboutDlg
 Class6=CControlPanel
 Class8=CMapFrame
 Class10=CLoginDialog
-Resource6=IDD_NEW_ACTION
+Resource6=IDD_ABOUTBOX
 Class11=CProgressDialog
-Resource7=IDA_ALARM_BROWSER
+Resource7=IDD_DCI_THRESHOLDS
 Class12=CObjectBrowser
-Resource8=IDD_ABOUTBOX
+Resource8=IDD_EDIT_RULE_SEVERITY
 Class13=CObjectPropDlg
 Resource9=IDD_CP_GENERAL (English (U.S.))
 Resource10=IDA_OBJECT_BROWSER (English (U.S.))
@@ -46,7 +46,7 @@ Resource17=IDD_SET_PASSWORD (English (U.S.))
 Class16=CDebugFrame
 Resource18=IDD_OBJECT_SECURITY (English (U.S.))
 Resource19=IDD_OBJECT_PROPERTIES (English (U.S.))
-Resource20=IDD_CREATE_TEMPLATE
+Resource20=IDD_OBJECT_SECURITY
 Class17=CObjectPreview
 Resource21=IDD_DCI_TRANSFORM (English (U.S.))
 Class18=CToolBox
@@ -59,32 +59,32 @@ Class23=CNodePropsGeneral
 Resource23=IDD_LOGIN (English (U.S.))
 Class24=CObjectPropCaps
 Class25=CObjectPropSheet
-Resource24=IDR_MAINFRAME
+Resource24=IDD_OBJECT_PRESENTATION
 Class26=CRequestProcessingDlg
 Resource25=IDD_EDIT_EVENT (English (U.S.))
 Resource26=IDD_PROGRESS (English (U.S.))
-Resource27=IDM_VIEW_SPECIFIC
+Resource27=IDD_USER_PROPERTIES
 Resource28=IDD_USER_PROPERTIES (English (U.S.))
 Class27=CObjectPropsGeneral
 Resource29=IDA_ALARM_BROWSER (English (U.S.))
 Class28=CObjectPropsSecurity
 Resource30=IDD_CREATE_NODE (English (U.S.))
-Resource31=IDD_EDIT_EVENT
-Resource32=IDM_CONTEXT
+Resource31=IDD_CP_GENERAL
+Resource32=IDM_VIEW_SPECIFIC
 Class29=CUserSelectDlg
-Resource33=IDA_OBJECT_BROWSER
+Resource33=IDD_SET_PASSWORD
 Class30=CUserEditor
 Resource34=IDD_DCI_PROPERTIES
 Class31=CNewUserDlg
-Resource35=IDD_EDIT_TRAP
-Resource36=IDD_REQUEST_PROCESSING
+Resource35=IDD_NEW_USER
+Resource36=IDD_SELECT_ACTION
 Class32=CUserPropDlg
 Resource37=IDM_CONTEXT (English (U.S.))
-Resource38=IDD_SET_PASSWORD
+Resource38=IDD_EDIT_TRAP
 Class33=CGroupPropDlg
-Resource39=IDA_MDI_DEFAULT
-Resource40=IDD_CREATE_TG
-Resource41=IDD_DCI_THRESHOLDS
+Resource39=IDD_GROUP_PROPERTIES
+Resource40=IDD_OBJECT_GENERAL
+Resource41=IDR_MAINFRAME
 Resource42=IDD_SELECT_OBJECT (English (U.S.))
 Class34=CPasswordChangeDlg
 Class35=CNodeSummary
@@ -100,55 +100,55 @@ Class41=CGraphFrame
 Class42=CDCIThresholdsPage
 Resource46=IDA_MDI_DEFAULT (English (U.S.))
 Resource47=IDD_OBJECT_CAPS (English (U.S.))
-Resource48=IDA_EVENT_EDITOR
+Resource48=IDD_MIB_BROWSER
 Class43=CThresholdDlg
 Resource49=IDD_SELECT_USER (English (U.S.))
-Resource50=IDD_THRESHOLD
+Resource50=IDA_MDI_DEFAULT
 Class44=CMIBBrowserDlg
 Class45=CEventPolicyEditor
 Class46=CRuleList
 Class47=CRuleHeader
 Resource51=IDR_MAINFRAME (English (U.S.))
-Resource52=IDD_USER_PROPERTIES
+Resource52=IDD_CREATE_TEMPLATE
 Class48=CObjectSelDlg
-Resource53=IDD_DCI_COLLECTION
-Resource54=IDD_DATA_QUERY
+Resource53=IDD_EDIT_TRAP_ARG
+Resource54=IDD_SELECT_USER
 Class49=CRuleCommentDlg
-Resource55=IDD_ACTION_PROPERTIES
+Resource55=IDD_LOGIN
 Class50=CEventSelDlg
-Resource56=IDD_CP_GENERAL
+Resource56=IDA_GRAPH
 Resource57=IDD_REQUEST_PROCESSING (English (U.S.))
-Resource58=IDD_OBJECT_NODE_GENERAL
+Resource58=IDD_NEW_ACTION
 Resource59=IDD_ABOUTBOX (English (U.S.))
 Resource60=IDD_MIB_BROWSER (English (U.S.))
 Class51=CObjectPropsPresentation
 Resource61=IDD_OBJECT_PRESENTATION (English (U.S.))
-Resource62=IDD_NEW_USER
+Resource62=IDD_CREATE_TG
 Class52=CRuleSeverityDlg
-Resource63=IDA_EPP
+Resource63=IDD_DCI_COLLECTION
 Class53=CRuleAlarmDlg
 Class54=CAlarmBrowser
 Resource64=IDD_SELECT_EVENT (English (U.S.))
-Resource65=IDA_ACTION_EDITOR
+Resource65=IDD_SELECT_OBJECT
 Resource66=IDD_NEW_ACTION (English (U.S.))
 Resource67=IDD_DCI_COLLECTION (English (U.S.))
 Resource68=IDD_NEW_USER (English (U.S.))
 Class55=CConsolePropsGeneral
 Class56=CActionEditor
-Resource69=IDA_TRAP_EDITOR
-Resource70=IDD_OBJECT_PRESENTATION
+Resource69=IDD_EDIT_RULE_COMMENT
+Resource70=IDA_EVENT_EDITOR
 Class57=CNewActionDlg
-Resource71=IDD_GROUP_PROPERTIES
+Resource71=IDD_DATA_QUERY
 Class58=CEditActionDlg
-Resource72=IDD_OBJECT_SECURITY
+Resource72=IDD_CREATE_NODE
 Class59=CActionSelDlg
-Resource73=IDD_CREATE_NODE
+Resource73=IDD_OBJECT_CAPS
 Resource74=IDD_EDIT_RULE_COMMENT (English (U.S.))
 Resource75=IDD_EDIT_RULE_ALARM (English (U.S.))
-Resource76=IDD_EDIT_RULE_ALARM
+Resource76=IDA_TRAP_EDITOR
 Class60=CCreateObjectDlg
 Class61=CCreateContainerDlg
-Resource77=IDD_SELECT_ACTION
+Resource77=IDD_EDIT_EVENT
 Class62=CCreateNodeDlg
 Resource78=IDA_EPP (English (U.S.))
 Resource79=IDD_CREATE_CONTAINER (English (U.S.))
@@ -158,22 +158,25 @@ Resource81=IDD_ACTION_PROPERTIES (English (U.S.))
 Class64=CPollNodeDlg
 Resource82=IDD_POLL_NODE (English (U.S.))
 Class65=CNodePoller
-Resource83=IDD_OBJECT_GENERAL
-Resource84=IDD_LOGIN
+Resource83=IDD_CREATE_CONTAINER
+Resource84=IDD_EDIT_RULE_ALARM
 Class66=CCreateTemplateDlg
 Class67=CCreateTGDlg
-Resource85=IDD_OBJECT_CAPS
-Resource86=IDD_SELECT_OBJECT
+Resource85=IDD_ACTION_PROPERTIES
+Resource86=IDA_EPP
 Class68=CTrapEditor
-Resource87=IDD_SELECT_USER
-Resource88=IDD_EDIT_RULE_COMMENT
-Resource89=IDD_CREATE_CONTAINER
+Resource87=IDD_DCI_TRANSFORM
+Resource88=IDA_ALARM_BROWSER
+Resource89=IDD_OBJECT_NODE_GENERAL
 Class69=CDataQueryDlg
-Resource90=IDA_NETMAP
+Resource90=IDD_THRESHOLD
 Class70=CTrapEditDlg
-Resource91=IDD_SELECT_EVENT
+Resource91=IDA_NETMAP
 Class71=CTrapParamDlg
-Resource92=IDD_EDIT_TRAP_ARG
+Resource92=IDM_CONTEXT
+Resource93=IDD_SELECT_EVENT
+Class72=CGraphPropDlg
+Resource94=IDD_GRAPH_PROPERTIES
 
 [CLS:CConsoleApp]
 Type=0
@@ -679,7 +682,10 @@ Command83=ID_ACTION_PROPERTIES
 Command84=ID_TRAP_NEW
 Command85=ID_TRAP_EDIT
 Command86=ID_TRAP_DELETE
-CommandCount=86
+Command87=ID_GRAPH_AUTOSCALE
+Command88=ID_GRAPH_FREEZE
+Command89=ID_GRAPH_PROPERTIES
+CommandCount=89
 
 [ACL:IDA_MDI_DEFAULT]
 Type=1
@@ -1315,7 +1321,10 @@ Command80=ID_EVENT_DELETE
 Command81=ID_TRAP_NEW
 Command82=ID_TRAP_EDIT
 Command83=ID_TRAP_DELETE
-CommandCount=83
+Command84=ID_GRAPH_AUTOSCALE
+Command85=ID_GRAPH_FREEZE
+Command86=ID_GRAPH_PROPERTIES
+CommandCount=86
 
 [MNU:IDM_CONTEXT (English (U.S.))]
 Type=1
@@ -2391,3 +2400,42 @@ Filter=D
 LastObject=CTrapParamDlg
 VirtualFilter=dWC
 
+[ACL:IDA_GRAPH]
+Type=1
+Class=?
+Command1=ID_GRAPH_AUTOSCALE
+Command2=ID_GRAPH_PROPERTIES
+Command3=ID_GRAPH_FREEZE
+CommandCount=3
+
+[DLG:IDD_GRAPH_PROPERTIES]
+Type=1
+Class=CGraphPropDlg
+ControlCount=17
+Control1=IDOK,button,1342242817
+Control2=IDCANCEL,button,1342242816
+Control3=IDC_STATIC,button,1342177287
+Control4=IDC_CHECK_GRID,button,1342242819
+Control5=IDC_CHECK_AUTOSCALE,button,1342242819
+Control6=IDC_CHECK_REFRESH,button,1342242819
+Control7=IDC_EDIT_REFRESH,edit,1350639744
+Control8=IDC_STATIC_REFRESH,static,1342308352
+Control9=IDC_STATIC_SECONDS,static,1342308352
+Control10=IDC_STATIC,button,1342177287
+Control11=IDC_STATIC,static,1342308352
+Control12=IDC_STATIC,static,1342308352
+Control13=IDC_STATIC,static,1342308352
+Control14=IDC_STATIC,static,1342308352
+Control15=IDC_STATIC,static,1342308352
+Control16=IDC_STATIC,static,1342308352
+Control17=IDC_CB_BACKGROUND,static,1342308608
+
+[CLS:CGraphPropDlg]
+Type=0
+HeaderFile=GraphPropDlg.h
+ImplementationFile=GraphPropDlg.cpp
+BaseClass=CDialog
+Filter=D
+VirtualFilter=dWC
+LastObject=CGraphPropDlg
+
index 29f63a8..28821e8 100644 (file)
@@ -285,6 +285,10 @@ BOOL CConsoleApp::InitInstance()
    InsertMenu(m_hTrapEditorMenu, LAST_APP_MENU, MF_BYPOSITION | MF_POPUP, (UINT_PTR)GetSubMenu(hMenu, 0), "&Window");
    InsertMenu(m_hTrapEditorMenu, LAST_APP_MENU - 1, MF_BYPOSITION | MF_POPUP, (UINT_PTR)GetSubMenu(hMenu, 12), "T&rap");
 
+   m_hGraphMenu = LoadAppMenu(hMenu);
+   InsertMenu(m_hGraphMenu, LAST_APP_MENU, MF_BYPOSITION | MF_POPUP, (UINT_PTR)GetSubMenu(hMenu, 0), "&Window");
+   InsertMenu(m_hGraphMenu, LAST_APP_MENU - 1, MF_BYPOSITION | MF_POPUP, (UINT_PTR)GetSubMenu(hMenu, 13), "&Graph");
+
        m_hMDIAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_MDI_DEFAULT));
        m_hAlarmBrowserAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_ALARM_BROWSER));
        m_hEventBrowserAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_MDI_DEFAULT));
@@ -296,6 +300,7 @@ BOOL CConsoleApp::InitInstance()
        m_hMapAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_NETMAP));
        m_hActionEditorAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_ACTION_EDITOR));
        m_hTrapEditorAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_TRAP_EDITOR));
+       m_hGraphAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_GRAPH));
 
        // The main window has been initialized, so show and update it.
    if (bSetWindowPos)
@@ -345,6 +350,8 @@ int CConsoleApp::ExitInstance()
    SafeFreeResource(m_hActionEditorAccel);
    SafeFreeResource(m_hTrapEditorMenu);
    SafeFreeResource(m_hTrapEditorAccel);
+   SafeFreeResource(m_hGraphMenu);
+   SafeFreeResource(m_hGraphAccel);
 
    CloseHandle(g_mutexActionListAccess);
 
@@ -1071,7 +1078,7 @@ void CConsoleApp::ShowDCIGraph(DWORD dwNodeId, DWORD dwItemId, char *pszItemName
       strTitle += "]";
 
           // set the handles and redraw the frame and parent
-          pWnd->SetHandles(m_hMDIMenu, m_hMDIAccel);
+          pWnd->SetHandles(m_hGraphMenu, m_hGraphAccel);
           pWnd->SetTitle(strTitle);
           pWnd->InitialUpdateFrame(NULL, TRUE);
    }
index 24f1a73..125241b 100644 (file)
@@ -217,6 +217,10 @@ SOURCE=.\GraphFrame.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\GraphPropDlg.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=.\GroupPropDlg.cpp
 # End Source File
 # Begin Source File
@@ -494,6 +498,10 @@ SOURCE=.\GraphFrame.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\GraphPropDlg.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\GroupPropDlg.h
 # End Source File
 # Begin Source File
index c1686d0..97707bf 100644 (file)
@@ -134,8 +134,10 @@ protected:
        HACCEL m_hMapAccel;           // Accelerator for map view
        HMENU m_hTrapEditorMenu;      // Menu for trap editor
        HACCEL m_hTrapEditorAccel;    // Accelerator for trap editor
-       HMENU m_hActionEditorMenu;      // Menu for user editor
-       HACCEL m_hActionEditorAccel;    // Accelerator for user editor
+       HMENU m_hActionEditorMenu;    // Menu for user editor
+       HACCEL m_hActionEditorAccel;  // Accelerator for user editor
+       HMENU m_hGraphMenu;           // Menu for history and real-time graphs
+       HACCEL m_hGraphAccel;         // Accelerator for history and real-time graphs
        
 public:
        void EventHandler(DWORD dwEvent, DWORD dwCode, void *pArg);
index 8de8c93..f889bd4 100644 (file)
@@ -362,6 +362,13 @@ BEGIN
         MENUITEM "&Edit...\tEnter",             ID_TRAP_EDIT
         MENUITEM "&Delete\tDel",                ID_TRAP_DELETE
     END
+    POPUP "Graph"
+    BEGIN
+        MENUITEM "&Autoscale\tAlt+A",           ID_GRAPH_AUTOSCALE
+        MENUITEM "&Freeze\tPause",              ID_GRAPH_FREEZE
+        MENUITEM SEPARATOR
+        MENUITEM "&Properties...\tAlt+P",       ID_GRAPH_PROPERTIES
+    END
 END
 
 IDM_CONTEXT MENU DISCARDABLE 
@@ -545,6 +552,13 @@ BEGIN
         MENUITEM "&Edit...",                    ID_TRAP_EDIT
         MENUITEM "&Delete",                     ID_TRAP_DELETE
     END
+    POPUP "Graph"
+    BEGIN
+        MENUITEM "&Autoscale",                  ID_GRAPH_AUTOSCALE
+        MENUITEM "&Freeze",                     ID_GRAPH_FREEZE
+        MENUITEM SEPARATOR
+        MENUITEM "&Properties...",              ID_GRAPH_PROPERTIES
+    END
 END
 
 
@@ -648,6 +662,13 @@ BEGIN
     VK_RETURN,      ID_TRAP_EDIT,           VIRTKEY, NOINVERT
 END
 
+IDA_GRAPH ACCELERATORS DISCARDABLE 
+BEGIN
+    "A",            ID_GRAPH_AUTOSCALE,     VIRTKEY, ALT, NOINVERT
+    "P",            ID_GRAPH_PROPERTIES,    VIRTKEY, ALT, NOINVERT
+    VK_PAUSE,       ID_GRAPH_FREEZE,        VIRTKEY, NOINVERT
+END
+
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -1376,6 +1397,34 @@ BEGIN
     LTEXT           "Varbind OID",IDC_STATIC,7,37,40,8
 END
 
+IDD_GRAPH_PROPERTIES DIALOGEX 0, 0, 227, 186
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Graph Properties"
+FONT 8, "MS Sans Serif"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,170,7,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,170,24,50,14
+    GROUPBOX        "Options",IDC_STATIC,7,7,154,57
+    CONTROL         "Show &grid lines",IDC_CHECK_GRID,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,14,18,63,10
+    CONTROL         "&Autoscale",IDC_CHECK_AUTOSCALE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,100,18,47,10
+    CONTROL         "&Refresh automatically",IDC_CHECK_REFRESH,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,14,31,83,10
+    EDITTEXT        IDC_EDIT_REFRESH,67,43,30,14,ES_AUTOHSCROLL | ES_NUMBER
+    LTEXT           "Refresh interval",IDC_STATIC_REFRESH,14,46,50,8
+    LTEXT           "seconds",IDC_STATIC_SECONDS,101,46,28,8
+    GROUPBOX        "Colors",IDC_STATIC,7,71,151,100
+    LTEXT           "Background",IDC_STATIC,14,83,40,8
+    LTEXT           "Axis lines",IDC_STATIC,13,94,30,8
+    LTEXT           "Grid lines",IDC_STATIC,13,106,30,8
+    LTEXT           "Text",IDC_STATIC,13,117,15,8
+    LTEXT           "Label background",IDC_STATIC,15,127,58,8
+    LTEXT           "Label text",IDC_STATIC,15,137,32,8
+    LTEXT           "",IDC_CB_BACKGROUND,59,83,19,10,SS_NOTIFY,
+                    WS_EX_CLIENTEDGE
+END
+
 
 #ifndef _MAC
 /////////////////////////////////////////////////////////////////////////////
@@ -1707,6 +1756,14 @@ BEGIN
         TOPMARGIN, 7
         BOTTOMMARGIN, 63
     END
+
+    IDD_GRAPH_PROPERTIES, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 220
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 179
+    END
 END
 #endif    // APSTUDIO_INVOKED
 
index ae1d2ab..3ddffc1 100644 (file)
 #define IDD_DATA_QUERY                  244
 #define IDD_EDIT_TRAP                   245
 #define IDD_EDIT_TRAP_ARG               246
+#define IDA_GRAPH                       247
+#define IDD_GRAPH_PROPERTIES            248
 #define ID_EDIT_BOX                     525
 #define IDC_EDIT_SERVER                 1000
 #define IDC_EDIT_LOGIN                  1001
 #define IDC_STATIC_INSTANCE             1201
 #define IDC_SELECT_OID                  1202
 #define IDC_BUTTON_EDIT                 1203
+#define IDC_CHECK_AUTOSCALE             1205
+#define IDC_CHECK_REFRESH               1206
+#define IDC_EDIT_REFRESH                1207
+#define IDC_STATIC_REFRESH              1208
+#define IDC_STATIC_SECONDS              1209
+#define IDC_CB_BACKGROUND               1211
 #define ID_VIEW_CONTROLPANEL            32771
 #define ID_VIEW_EVENTS                  32774
 #define ID_VIEW_MAP                     32776
 #define ID_TRAP_DELETE                  32901
 #define ID_TRAP_MOVEUP                  32902
 #define ID_TRAP_MOVEDOWN                32903
+#define ID_GRAPH_AUTOSCALE              32904
+#define ID_GRAPH_PROPERTIES             32905
+#define ID_GRAPH_FREEZE                 32906
 #define IDS_GETFOLDERPATH_FAILED        61216
 #define IDS_WORKDIR_CREATION_FAILED     61217
 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        247
-#define _APS_NEXT_COMMAND_VALUE         32904
-#define _APS_NEXT_CONTROL_VALUE         1204
+#define _APS_NEXT_RESOURCE_VALUE        249
+#define _APS_NEXT_COMMAND_VALUE         32907
+#define _APS_NEXT_CONTROL_VALUE         1212
 #define _APS_NEXT_SYMED_VALUE           120
 #endif
 #endif
index 451f74e..0591fc4 100644 (file)
@@ -83,7 +83,7 @@
    Also, when `ordering' is RETURN_IN_ORDER,
    each non-option ARGV-element is returned here.  */
 
-EXPORTABLE char *optarg = 0;
+GETOPT_EXPORTABLE char *optarg = 0;
 
 /* Index in ARGV of the next element to be scanned.
    This is used for communication to and from the caller
@@ -98,7 +98,7 @@ EXPORTABLE char *optarg = 0;
    how much of ARGV has been scanned so far.  */
 
 /* XXX 1003.2 says this must be 1 before any call.  */
-EXPORTABLE int optind = 0;
+GETOPT_EXPORTABLE int optind = 0;
 
 /* The next char to be scanned in the option-element
    in which the last option character we returned was found.
@@ -112,14 +112,14 @@ static char *nextchar;
 /* Callers store zero here to inhibit the error message
    for unrecognized options.  */
 
-EXPORTABLE int opterr = 1;
+GETOPT_EXPORTABLE int opterr = 1;
 
 /* Set to an option character which was unrecognized.
    This must be initialized on some systems to avoid linking in the
    system's own getopt implementation.  */
 
 #define BAD_OPTION '\0'
-EXPORTABLE int optopt = BAD_OPTION;
+GETOPT_EXPORTABLE int optopt = BAD_OPTION;
 
 /* Describe how to deal with options that follow non-option ARGV-elements.
 
@@ -657,7 +657,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
 }
 
 int
-EXPORTABLE getopt (argc, argv, optstring)
+GETOPT_EXPORTABLE getopt (argc, argv, optstring)
      int argc;
      char *const *argv;
      const char *optstring;
@@ -669,7 +669,7 @@ EXPORTABLE getopt (argc, argv, optstring)
 }
 
 int
-EXPORTABLE getopt_long (argc, argv, options, long_options, opt_index)
+GETOPT_EXPORTABLE getopt_long (argc, argv, options, long_options, opt_index)
      int argc;
      char *const *argv;
      const char *options;
index d2d7b41..beafc8e 100644 (file)
@@ -22,6 +22,7 @@
 
 #define LIBNETXMS_INLINE
 #include "libnetxms.h"
+#include <nms_agent.h>
 
 
 //
index 8d55639..eaba5f1 100644 (file)
@@ -26,6 +26,5 @@
 
 #include <nms_common.h>
 #include <nms_util.h>
-#include <nms_agent.h>
 
 #endif   /* _libnetxms_h_ */
index ff4e3f2..c1a5504 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "libnetxms.h"
 #include <stdarg.h>
+#include <nms_agent.h>
 
 #if !defined(_WIN32) && !defined(UNDER_CE)
 # include <sys/time.h>
index c7ca95d..359ce49 100644 (file)
@@ -27,7 +27,7 @@
 // Find container category by id
 //
 
-CONTAINER_CATEGORY *FindContainerCategory(DWORD dwId)
+CONTAINER_CATEGORY NXCORE_EXPORTABLE *FindContainerCategory(DWORD dwId)
 {
    DWORD i;
 
index 5565f1d..fb3f520 100644 (file)
@@ -581,3 +581,17 @@ void NXCORE_EXPORTABLE Main(void)
 #endif
    }
 }
+
+
+//
+// DLL Entry point
+//
+
+#ifdef _WIN32
+
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+   return TRUE;
+}
+
+#endif
index ef6b674..036d689 100644 (file)
@@ -330,7 +330,7 @@ void NetObjDelete(NetObj *pObject)
 // Find node by IP address
 //
 
-Node *FindNodeByIP(DWORD dwAddr)
+Node NXCORE_EXPORTABLE *FindNodeByIP(DWORD dwAddr)
 {
    DWORD dwPos;
    Node *pNode;
@@ -350,7 +350,7 @@ Node *FindNodeByIP(DWORD dwAddr)
 // Find subnet by IP address
 //
 
-Subnet *FindSubnetByIP(DWORD dwAddr)
+Subnet NXCORE_EXPORTABLE *FindSubnetByIP(DWORD dwAddr)
 {
    DWORD dwPos;
    Subnet *pSubnet;
@@ -370,7 +370,7 @@ Subnet *FindSubnetByIP(DWORD dwAddr)
 // Find subnet for given IP address
 //
 
-Subnet *FindSubnetForNode(DWORD dwNodeAddr)
+Subnet NXCORE_EXPORTABLE *FindSubnetForNode(DWORD dwNodeAddr)
 {
    DWORD i;
    Subnet *pSubnet = NULL;
@@ -395,7 +395,7 @@ Subnet *FindSubnetForNode(DWORD dwNodeAddr)
 // Find object by ID
 //
 
-NetObj *FindObjectById(DWORD dwId)
+NetObj NXCORE_EXPORTABLE *FindObjectById(DWORD dwId)
 {
    DWORD dwPos;
    NetObj *pObject;
index 8bf1511..c372d1e 100644 (file)
@@ -415,6 +415,7 @@ void ClientSession::ProcessingThread(void)
 {
    CSCPMessage *pMsg;
    char szBuffer[128];
+   DWORD i, dwCode;
 
    while(1)
    {
@@ -430,7 +431,8 @@ void ClientSession::ProcessingThread(void)
          continue;
       }
 
-      switch(pMsg->GetCode())
+      dwCode = pMsg->GetCode();
+      switch(dwCode)
       {
          case CMD_LOGIN:
             Login(pMsg);
@@ -614,6 +616,11 @@ void ClientSession::ProcessingThread(void)
             QueryParameter(pMsg);
             break;
          default:
+            // Pass message to loaded modules
+            for(i = 0; i < g_dwNumModules; i++)
+               if (g_pModuleList[i].pfCommandHandler(dwCode, pMsg, this))
+                  break;   // Message was processed by the module
+            if (i == g_dwNumModules)
             {
                CSCPMessage responce;
 
index d7456ba..e056dc7 100644 (file)
@@ -75,7 +75,7 @@ extern DWORD g_dwConfigurationPollingInterval;
 // Base class for network objects
 //
 
-class NetObj
+class NXCORE_EXPORTABLE NetObj
 {
 protected:
    DWORD m_dwId;
@@ -167,7 +167,7 @@ public:
 // Node template class
 //
 
-class Template : public NetObj
+class NXCORE_EXPORTABLE Template : public NetObj
 {
 protected:
    DWORD m_dwNumItems;     // Number of data collection items
@@ -218,9 +218,9 @@ public:
 // Interface class
 //
 
-class Node;
+class NXCORE_EXPORTABLE Node;
 
-class Interface : public NetObj
+class NXCORE_EXPORTABLE Interface : public NetObj
 {
 protected:
    DWORD m_dwIfIndex;
@@ -258,7 +258,7 @@ public:
 // Node
 //
 
-class Node : public Template
+class NXCORE_EXPORTABLE Node : public Template
 {
 protected:
    DWORD m_dwFlags;
@@ -374,7 +374,7 @@ inline BOOL Node::ReadyForDiscoveryPoll(void)
 // Subnet
 //
 
-class Subnet : public NetObj
+class NXCORE_EXPORTABLE Subnet : public NetObj
 {
 protected:
    DWORD m_dwIpNetMask;
@@ -401,7 +401,7 @@ public:
 // Universal root object
 //
 
-class UniversalRoot : public NetObj
+class NXCORE_EXPORTABLE UniversalRoot : public NetObj
 {
 public:
    UniversalRoot();
@@ -420,7 +420,7 @@ public:
 // Entire network
 //
 
-class Network : public NetObj
+class NXCORE_EXPORTABLE Network : public NetObj
 {
 public:
    Network();
@@ -438,7 +438,7 @@ public:
 // Service root
 //
 
-class ServiceRoot : public UniversalRoot
+class NXCORE_EXPORTABLE ServiceRoot : public UniversalRoot
 {
 public:
    ServiceRoot();
@@ -453,7 +453,7 @@ public:
 // Template root
 //
 
-class TemplateRoot : public UniversalRoot
+class NXCORE_EXPORTABLE TemplateRoot : public UniversalRoot
 {
 public:
    TemplateRoot();
@@ -469,7 +469,7 @@ public:
 // Generic container object
 //
 
-class Container : public NetObj
+class NXCORE_EXPORTABLE Container : public NetObj
 {
 private:
    DWORD *m_pdwChildIdList;
@@ -504,7 +504,7 @@ public:
 // Template group object
 //
 
-class TemplateGroup : public Container
+class NXCORE_EXPORTABLE TemplateGroup : public Container
 {
 public:
    TemplateGroup() : Container() { }
@@ -551,12 +551,12 @@ void NetObjInsert(NetObj *pObject, BOOL bNewObject);
 void NetObjDeleteFromIndexes(NetObj *pObject);
 void NetObjDelete(NetObj *pObject);
 
-NetObj *FindObjectById(DWORD dwId);
-Node *FindNodeByIP(DWORD dwAddr);
-Subnet *FindSubnetByIP(DWORD dwAddr);
-Subnet *FindSubnetForNode(DWORD dwNodeAddr);
-DWORD FindLocalMgmtNode(void);
-CONTAINER_CATEGORY *FindContainerCategory(DWORD dwId);
+NetObj NXCORE_EXPORTABLE *FindObjectById(DWORD dwId);
+Node NXCORE_EXPORTABLE *FindNodeByIP(DWORD dwAddr);
+Subnet NXCORE_EXPORTABLE *FindSubnetByIP(DWORD dwAddr);
+Subnet NXCORE_EXPORTABLE *FindSubnetForNode(DWORD dwNodeAddr);
+DWORD NXCORE_EXPORTABLE FindLocalMgmtNode(void);
+CONTAINER_CATEGORY NXCORE_EXPORTABLE *FindContainerCategory(DWORD dwId);
 
 BOOL LoadObjects(void);
 void DumpObjects(void);