Minor changes
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 22 Sep 2004 18:30:21 +0000 (18:30 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 22 Sep 2004 18:30:21 +0000 (18:30 +0000)
TODO
src/console/cmdline/main.cpp
src/console/win32/DataCollectionEditor.cpp
src/console/win32/Graph.cpp
src/console/win32/nxcon.clw
src/console/win32/nxcon.rc
src/console/win32/resource.h

diff --git a/TODO b/TODO
index 5e9f50d..f24af19 100644 (file)
--- a/TODO
+++ b/TODO
@@ -50,7 +50,6 @@ WINDOWS CONSOLE:
 - Add custom background erasing code in policy editor for smooth painting
 - Add support for "View -> Refresh" in data collection configurator
   (or, even better, automatic update)
-- Add status bar to alarm browser
 - Automatically select data type in DCI configuration dialog based on
   selected parameter
 - Add parameter selection for native agents in DCI configuration dialog
index ec4c0c2..683cb66 100644 (file)
@@ -54,7 +54,7 @@ static void EventHandler(DWORD dwEvent, DWORD dwCode, void *pArg)
          break;
       case NXC_EVENT_NEW_ELOG_RECORD:
          printf("EVENT: %s\n", ((NXC_EVENT *)pArg)->szMessage);
-         MemFree(pArg);
+         free(pArg);
          break;
       default:
          break;
@@ -156,7 +156,6 @@ int main(int argc, char *argv[])
    {
       printf("Password: ");
       gets(szPassword);
-      printf("'%s'\n",szPassword);
    }
 
    NXCSetEventHandler(EventHandler);
@@ -171,21 +170,8 @@ int main(int argc, char *argv[])
    }
    else
    {
-      NXC_DCI_DATA *pData;
-
       printf("Connection established.\n");
 
-      dwResult = NXCGetDCIData(5, 143, 100, 0, 0, &pData);
-      if (dwResult == RCC_SUCCESS)
-      {
-         printf("data receieved\n");
-         NXCDestroyDCIData(pData);
-      }
-      else
-      {
-         printf("ERROR: %s\n", NXCGetErrorText(dwResult));
-      }
-
       CommandLoop();
       NXCDisconnect();
    }
index dfe7481..e8d685e 100644 (file)
@@ -453,9 +453,8 @@ void CDataCollectionEditor::OnItemShowdata()
       dwItemId = m_wndListCtrl.GetItemData(iItem);
       dwIndex = NXCItemIndex(m_pItemList, dwItemId);
       pObject = NXCFindObjectById(m_pItemList->dwNodeId);
-      sprintf(szBuffer, "%s - %s:%s", pObject->szName, 
-              g_pszItemOrigin[m_pItemList->pItems[dwIndex].iSource],
-              m_pItemList->pItems[dwIndex].szName);
+      sprintf(szBuffer, "%s - %s", pObject->szName, 
+              m_pItemList->pItems[dwIndex].szDescription);
       theApp.ShowDCIData(m_pItemList->dwNodeId, dwItemId, szBuffer);
       iItem = m_wndListCtrl.GetNextItem(iItem, LVNI_SELECTED);
    }
@@ -479,9 +478,8 @@ void CDataCollectionEditor::OnItemGraph()
       dwItemId = m_wndListCtrl.GetItemData(iItem);
       dwIndex = NXCItemIndex(m_pItemList, dwItemId);
       pObject = NXCFindObjectById(m_pItemList->dwNodeId);
-      sprintf(szBuffer, "%s - %s:%s", pObject->szName, 
-              g_pszItemOrigin[m_pItemList->pItems[dwIndex].iSource],
-              m_pItemList->pItems[dwIndex].szName);
+      sprintf(szBuffer, "%s - %s", pObject->szName, 
+              m_pItemList->pItems[dwIndex].szDescription);
       theApp.ShowDCIGraph(m_pItemList->dwNodeId, dwItemId, szBuffer);
    }
 }
index 4018eb8..ae6f0b1 100644 (file)
@@ -30,6 +30,11 @@ CGraph::CGraph()
    m_bAutoScale = TRUE;
    m_bShowGrid = TRUE;
    m_dwNumItems = 0;
+   /*m_rgbBkColor = RGB(200,200,200);
+   m_rgbGridColor = RGB(64, 64, 64);
+   m_rgbAxisColor = RGB(0, 0, 0);
+   m_rgbTextColor = RGB(0, 0, 0);
+   m_rgbLineColors[0] = RGB(0, 127, 0);*/
    m_rgbBkColor = RGB(0,0,0);
    m_rgbGridColor = RGB(64, 64, 64);
    m_rgbAxisColor = RGB(127, 127, 127);
@@ -103,6 +108,7 @@ void CGraph::OnPaint()
    CBitmap *pOldBitmap;
    CPen pen, *pOldPen;
    CFont font, *pOldFont;
+   CBrush brush;
    RECT rect;
    CSize textSize;
    DWORD i, dwTimeStamp;
@@ -118,6 +124,10 @@ void CGraph::OnPaint()
    pOldBitmap = dc.SelectObject(&bitmap);
    dc.SetBkColor(m_rgbBkColor);
 
+   // Fill background
+   brush.CreateSolidBrush(m_rgbBkColor);
+   dc.FillRect(&rect, &brush);
+
    // Setup text parameters
    font.CreateFont(-MulDiv(7, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 72),
                    0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
@@ -292,7 +302,7 @@ void CGraph::DrawLineGraph(CDC &dc, NXC_DCI_DATA *pData, COLORREF rgbColor)
    if (pData->dwNumRows < 2)
       return;  // Nothing to draw
 
-   pen.CreatePen(PS_SOLID, 2, RGB(0, 255, 0));
+   pen.CreatePen(PS_SOLID, 2, rgbColor);
    pOldPen = dc.SelectObject(&pen);
 
    // Calculate scale factor for values
index 806e294..4c67a72 100644 (file)
@@ -61,7 +61,7 @@ Class24=CObjectPropCaps
 Class25=CObjectPropSheet
 Resource24=IDD_SELECT_USER
 Class26=CRequestProcessingDlg
-Resource25=IDM_VIEW_SPECIFIC (English (U.S.))
+Resource25=IDA_OBJECT_BROWSER (English (U.S.))
 Resource26=IDD_PROGRESS (English (U.S.))
 Resource27=IDA_OBJECT_BROWSER
 Resource28=IDD_LOGIN (English (U.S.))
@@ -119,7 +119,7 @@ Class50=CEventSelDlg
 Resource56=IDD_OBJECT_PRESENTATION
 Resource57=IDM_CONTEXT (English (U.S.))
 Resource58=IDD_CREATE_NODE
-Resource59=IDA_OBJECT_BROWSER (English (U.S.))
+Resource59=IDD_DCI_TRANSFORM (English (U.S.))
 Resource60=IDD_GROUP_PROPERTIES (English (U.S.))
 Class51=CObjectPropsPresentation
 Resource61=IDD_THRESHOLD (English (U.S.))
@@ -154,7 +154,7 @@ Resource78=IDD_CREATE_CONTAINER (English (U.S.))
 Resource79=IDD_EDIT_RULE_SEVERITY (English (U.S.))
 Resource80=IDD_REQUEST_PROCESSING (English (U.S.))
 Class63=CDCITransformPage
-Resource81=IDD_DCI_TRANSFORM (English (U.S.))
+Resource81=IDM_VIEW_SPECIFIC (English (U.S.))
 
 [CLS:CConsoleApp]
 Type=0
@@ -657,40 +657,42 @@ Command14=ID_OBJECT_RENAME
 Command15=ID_OBJECT_DELETE
 Command16=ID_OBJECT_MANAGE
 Command17=ID_OBJECT_UNMANAGE
-Command18=ID_OBJECT_DATACOLLECTION
-Command19=ID_OBJECT_PROPERTIES
-Command20=ID_USER_CREATE_USER
-Command21=ID_USER_CREATE_GROUP
-Command22=ID_USER_DELETE
-Command23=ID_USER_SETPASSWORD
-Command24=ID_USER_PROPERTIES
-Command25=ID_ITEM_NEW
-Command26=ID_ITEM_EDIT
-Command27=ID_ITEM_DELETE
-Command28=ID_ITEM_ACTIVATE
-Command29=ID_ITEM_DISABLE
-Command30=ID_ITEM_SHOWDATA
-Command31=ID_ITEM_GRAPH
-Command32=ID_POLICY_ADD
-Command33=ID_POLICY_DELETE
-Command34=ID_POLICY_EDIT
-Command35=ID_POLICY_NEGATECELL
-Command36=ID_POLICY_INSERTRULE_ABOVE
-Command37=ID_POLICY_INSERTRULE_BELOW
-Command38=ID_POLICY_INSERTRULE_TOP
-Command39=ID_POLICY_INSERTRULE_BOTTOM
-Command40=ID_POLICY_DELETERULE
-Command41=ID_POLICY_ENABLERULE
-Command42=ID_POLICY_DISABLERULE
-Command43=ID_ALARM_ACKNOWLEGE
-Command44=ID_ALARM_DELETE
-Command45=ID_ALARM_GOTOSOURCE
-Command46=ID_UPDATE_EVENT_LIST
-Command47=ID_CONTROLPANEL_ACTIONS
-Command48=ID_CONTROLPANEL_EVENTS
-Command49=ID_CONTROLPANEL_EVENTPOLICY
-Command50=ID_CONTROLPANEL_USERS
-CommandCount=50
+Command18=ID_OBJECT_POLL_STATUS
+Command19=ID_OBJECT_POLL_CONFIGURATION
+Command20=ID_OBJECT_DATACOLLECTION
+Command21=ID_OBJECT_PROPERTIES
+Command22=ID_USER_CREATE_USER
+Command23=ID_USER_CREATE_GROUP
+Command24=ID_USER_DELETE
+Command25=ID_USER_SETPASSWORD
+Command26=ID_USER_PROPERTIES
+Command27=ID_ITEM_NEW
+Command28=ID_ITEM_EDIT
+Command29=ID_ITEM_DELETE
+Command30=ID_ITEM_ACTIVATE
+Command31=ID_ITEM_DISABLE
+Command32=ID_ITEM_SHOWDATA
+Command33=ID_ITEM_GRAPH
+Command34=ID_POLICY_ADD
+Command35=ID_POLICY_DELETE
+Command36=ID_POLICY_EDIT
+Command37=ID_POLICY_NEGATECELL
+Command38=ID_POLICY_INSERTRULE_ABOVE
+Command39=ID_POLICY_INSERTRULE_BELOW
+Command40=ID_POLICY_INSERTRULE_TOP
+Command41=ID_POLICY_INSERTRULE_BOTTOM
+Command42=ID_POLICY_DELETERULE
+Command43=ID_POLICY_ENABLERULE
+Command44=ID_POLICY_DISABLERULE
+Command45=ID_ALARM_ACKNOWLEGE
+Command46=ID_ALARM_DELETE
+Command47=ID_ALARM_GOTOSOURCE
+Command48=ID_UPDATE_EVENT_LIST
+Command49=ID_CONTROLPANEL_ACTIONS
+Command50=ID_CONTROLPANEL_EVENTS
+Command51=ID_CONTROLPANEL_EVENTPOLICY
+Command52=ID_CONTROLPANEL_USERS
+CommandCount=52
 
 [ACL:IDA_MDI_DEFAULT (English (U.S.))]
 Type=1
@@ -762,12 +764,14 @@ Filter=W
 Type=1
 Class=?
 Command1=ID_OBJECT_BIND
-Command2=ID_OBJECT_FIND
-Command3=ID_OBJECT_VIEW_SELECTION
-Command4=ID_OBJECT_VIEW_VIEWASLIST
-Command5=ID_OBJECT_VIEW_SHOWPREVIEWPANE
-Command6=ID_OBJECT_VIEW_VIEWASTREE
-CommandCount=6
+Command2=ID_OBJECT_POLL_CONFIGURATION
+Command3=ID_OBJECT_FIND
+Command4=ID_OBJECT_VIEW_SELECTION
+Command5=ID_OBJECT_VIEW_VIEWASLIST
+Command6=ID_OBJECT_VIEW_SHOWPREVIEWPANE
+Command7=ID_OBJECT_POLL_STATUS
+Command8=ID_OBJECT_VIEW_VIEWASTREE
+CommandCount=8
 
 [CLS:CEditBox]
 Type=0
@@ -1239,48 +1243,50 @@ Command10=ID_OBJECT_RENAME
 Command11=ID_OBJECT_DELETE
 Command12=ID_OBJECT_MANAGE
 Command13=ID_OBJECT_UNMANAGE
-Command14=ID_OBJECT_DATACOLLECTION
-Command15=ID_OBJECT_PROPERTIES
-Command16=ID_ITEM_NEW
-Command17=ID_ITEM_EDIT
-Command18=ID_ITEM_DELETE
-Command19=ID_ITEM_ACTIVATE
-Command20=ID_ITEM_DISABLE
-Command21=ID_ITEM_SHOWDATA
-Command22=ID_ITEM_GRAPH
-Command23=ID_POLICY_INSERTRULE_ABOVE
-Command24=ID_POLICY_INSERTRULE_BELOW
-Command25=ID_POLICY_INSERTRULE_TOP
-Command26=ID_POLICY_INSERTRULE_BOTTOM
-Command27=ID_POLICY_DELETERULE
-Command28=ID_POLICY_ENABLERULE
-Command29=ID_POLICY_DISABLERULE
-Command30=ID_POLICY_ADD
-Command31=ID_POLICY_DELETE
-Command32=ID_POLICY_NEGATECELL
-Command33=ID_POLICY_INSERTRULE_ABOVE
-Command34=ID_POLICY_INSERTRULE_BELOW
-Command35=ID_POLICY_INSERTRULE_TOP
-Command36=ID_POLICY_INSERTRULE_BOTTOM
-Command37=ID_POLICY_DELETERULE
-Command38=ID_POLICY_ENABLERULE
-Command39=ID_POLICY_DISABLERULE
-Command40=ID_POLICY_EDIT
-Command41=ID_POLICY_INSERTRULE_ABOVE
-Command42=ID_POLICY_INSERTRULE_BELOW
-Command43=ID_POLICY_INSERTRULE_TOP
-Command44=ID_POLICY_INSERTRULE_BOTTOM
-Command45=ID_POLICY_DELETERULE
-Command46=ID_POLICY_ENABLERULE
-Command47=ID_POLICY_DISABLERULE
-Command48=ID_ALARM_ACKNOWLEGE
-Command49=ID_ALARM_DELETE
-Command50=ID_ALARM_GOTOSOURCE
-Command51=ID_ACTION_NEW
-Command52=ID_ACTION_RENAME
-Command53=ID_ACTION_DELETE
-Command54=ID_ACTION_PROPERTIES
-CommandCount=54
+Command14=ID_OBJECT_POLL_STATUS
+Command15=ID_OBJECT_POLL_CONFIGURATION
+Command16=ID_OBJECT_DATACOLLECTION
+Command17=ID_OBJECT_PROPERTIES
+Command18=ID_ITEM_NEW
+Command19=ID_ITEM_EDIT
+Command20=ID_ITEM_DELETE
+Command21=ID_ITEM_ACTIVATE
+Command22=ID_ITEM_DISABLE
+Command23=ID_ITEM_SHOWDATA
+Command24=ID_ITEM_GRAPH
+Command25=ID_POLICY_INSERTRULE_ABOVE
+Command26=ID_POLICY_INSERTRULE_BELOW
+Command27=ID_POLICY_INSERTRULE_TOP
+Command28=ID_POLICY_INSERTRULE_BOTTOM
+Command29=ID_POLICY_DELETERULE
+Command30=ID_POLICY_ENABLERULE
+Command31=ID_POLICY_DISABLERULE
+Command32=ID_POLICY_ADD
+Command33=ID_POLICY_DELETE
+Command34=ID_POLICY_NEGATECELL
+Command35=ID_POLICY_INSERTRULE_ABOVE
+Command36=ID_POLICY_INSERTRULE_BELOW
+Command37=ID_POLICY_INSERTRULE_TOP
+Command38=ID_POLICY_INSERTRULE_BOTTOM
+Command39=ID_POLICY_DELETERULE
+Command40=ID_POLICY_ENABLERULE
+Command41=ID_POLICY_DISABLERULE
+Command42=ID_POLICY_EDIT
+Command43=ID_POLICY_INSERTRULE_ABOVE
+Command44=ID_POLICY_INSERTRULE_BELOW
+Command45=ID_POLICY_INSERTRULE_TOP
+Command46=ID_POLICY_INSERTRULE_BOTTOM
+Command47=ID_POLICY_DELETERULE
+Command48=ID_POLICY_ENABLERULE
+Command49=ID_POLICY_DISABLERULE
+Command50=ID_ALARM_ACKNOWLEGE
+Command51=ID_ALARM_DELETE
+Command52=ID_ALARM_GOTOSOURCE
+Command53=ID_ACTION_NEW
+Command54=ID_ACTION_RENAME
+Command55=ID_ACTION_DELETE
+Command56=ID_ACTION_PROPERTIES
+CommandCount=56
 
 [DLG:IDD_SET_PASSWORD (English (U.S.))]
 Type=1
index ff594db..2f58c43 100644 (file)
@@ -205,8 +205,14 @@ BEGIN
         MENUITEM SEPARATOR
         MENUITEM "&Manage object(s)\tCtrl+M",   ID_OBJECT_MANAGE
         MENUITEM "&Unmanage object(s)\tCtrl+U", ID_OBJECT_UNMANAGE
+        POPUP "P&oll"
+        BEGIN
+            MENUITEM "&Status\tCtrl+Alt+S",         ID_OBJECT_POLL_STATUS
+            MENUITEM "&Configuration\tCtrl+Alt+C",  ID_OBJECT_POLL_CONFIGURATION
+
+        END
         MENUITEM SEPARATOR
-        MENUITEM "Data &collection",            ID_OBJECT_DATACOLLECTION
+        MENUITEM "D&ata collection",            ID_OBJECT_DATACOLLECTION
         MENUITEM "&Properties",                 ID_OBJECT_PROPERTIES
     END
     POPUP "&User"
@@ -305,8 +311,14 @@ BEGIN
         MENUITEM SEPARATOR
         MENUITEM "&Manage",                     ID_OBJECT_MANAGE
         MENUITEM "&Unmanage",                   ID_OBJECT_UNMANAGE
+        POPUP "P&oll"
+        BEGIN
+            MENUITEM "&Status",                     ID_OBJECT_POLL_STATUS
+            MENUITEM "&Configuration",              ID_OBJECT_POLL_CONFIGURATION
+
+        END
         MENUITEM SEPARATOR
-        MENUITEM "Data &collection",            ID_OBJECT_DATACOLLECTION
+        MENUITEM "D&ata collection",            ID_OBJECT_DATACOLLECTION
         MENUITEM "&Properties...",              ID_OBJECT_PROPERTIES
     END
     POPUP "Item"
@@ -438,10 +450,13 @@ END
 IDA_OBJECT_BROWSER ACCELERATORS DISCARDABLE 
 BEGIN
     "B",            ID_OBJECT_BIND,         VIRTKEY, CONTROL, NOINVERT
+    "C",            ID_OBJECT_POLL_CONFIGURATION, VIRTKEY, CONTROL, ALT, 
+                                                    NOINVERT
     "F",            ID_OBJECT_FIND,         VIRTKEY, CONTROL, NOINVERT
     "F",            ID_OBJECT_VIEW_SELECTION, VIRTKEY, ALT, NOINVERT
     "L",            ID_OBJECT_VIEW_VIEWASLIST, VIRTKEY, CONTROL, NOINVERT
     "P",            ID_OBJECT_VIEW_SHOWPREVIEWPANE, VIRTKEY, ALT, NOINVERT
+    "S",            ID_OBJECT_POLL_STATUS,  VIRTKEY, CONTROL, ALT, NOINVERT
     "T",            ID_OBJECT_VIEW_VIEWASTREE, VIRTKEY, CONTROL, NOINVERT
 END
 
index 0dd7391..987f7b3 100644 (file)
 #define ID_ACTION_RENAME                32873
 #define ID_ACTION_DELETE                32874
 #define ID_ACTION_PROPERTIES            32875
+#define ID_OBJECT_POLL_STATUS           32876
+#define ID_OBJECT_POLL_CONFIGURATION    32877
 #define IDS_GETFOLDERPATH_FAILED        61216
 #define IDS_WORKDIR_CREATION_FAILED     61217
 
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_3D_CONTROLS                     1
 #define _APS_NEXT_RESOURCE_VALUE        223
-#define _APS_NEXT_COMMAND_VALUE         32876
+#define _APS_NEXT_COMMAND_VALUE         32880
 #define _APS_NEXT_CONTROL_VALUE         1169
 #define _APS_NEXT_SYMED_VALUE           119
 #endif