syswindow  1.0
ekomsys::SysWinClient Class Reference

#include <syswin_client.h>

Public Member Functions

 SysWinClient (void)
 
 ~SysWinClient (void)
 
SysWinErrorCode ConnectServer (std::string ip, std::string port)
 
SysWinErrorCode Authenticate (std::string user, std::string password)
 
SysWinErrorCode AddModule (std::string module_id, std::string name)
 
SysWinErrorCode AddWidget (std::string module_id, std::string widget_id, WidgetType type, std::string name)
 
SysWinErrorCode UpdateLineChartWidget (std::string module_id, std::string widget_id, float x, float y)
 
SysWinErrorCode UpdateSingleValueWidget (std::string module_id, std::string widget_id, std::string value)
 
SysWinErrorCode UpdateProgressBarWidget (std::string module_id, std::string widget_id, double value, double max_value)
 
SysWinErrorCode UpdatePieChartWidget (std::string module_id, std::string widget_id, std::string label, double value)
 
SysWinErrorCode UpdateBarChartWidget (std::string module_id, std::string widget_id, std::string label, double value)
 
SysWinErrorCode UpdateListWidget (std::string module_id, std::string widget_id, std::string text)
 
SysWinErrorCode UpdateImageWidget (std::string module_id, std::string widget_id, void *data, int width, int height, int bpp)
 
SysWinErrorCode UpdateImageWidget (std::string module_id, std::string widget_id, std::string path)
 
SysWinErrorCode AddProcessorCountWidget (std::string module_id, std::string widget_id, std::string name)
 
SysWinErrorCode AddSystemNameWidget (std::string module_id, std::string widget_id, std::string name)
 
SysWinErrorCode AddLoggedInUserWidget (std::string module_id, std::string widget_id, std::string name)
 
SysWinErrorCode AddTotalSystemMemoryWidget (std::string module_id, std::string widget_id, std::string name)
 
SysWinErrorCode AddAvailableSystemMemoryWidget (std::string module_id, std::string widget_id, std::string name, long update_interval_secs)
 
SysWinErrorCode AddOSNameWidget (std::string module_id, std::string widget_id, std::string name)
 
SysWinErrorCode AddProcessMemoryUsageWidget (std::string module_id, std::string widget_id, std::string name, long pid, long update_interval_secs)
 
SysWinErrorCode AddProcessThreadUsageWidget (std::string module_id, std::string widget_id, std::string name, long pid, long update_interval_secs)
 
SysWinErrorCode AddProcessCPUUsageWidget (std::string module_id, std::string widget_id, std::string name, long pid, long update_interval_secs)
 
SysWinErrorCode AddProcessHandleCountWidget (std::string module_id, std::string widget_id, std::string name, long pid, long update_interval_secs)
 
std::string GetProcessName (long pid)
 
long GetProcessID ()
 
std::string GetProcessFullPath (long pid)
 
std::string GetArchitecture (long pid)
 

Constructor & Destructor Documentation

ekomsys::SysWinClient::SysWinClient ( void  )
ekomsys::SysWinClient::~SysWinClient ( void  )

Member Function Documentation

SysWinErrorCode ekomsys::SysWinClient::AddAvailableSystemMemoryWidget ( std::string  module_id,
std::string  widget_id,
std::string  name,
long  update_interval_secs 
)

Adds the widget showing the available system memory of the host machine

Parameters
[in]module_idModule identifier.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::AddLoggedInUserWidget ( std::string  module_id,
std::string  widget_id,
std::string  name 
)

Adds the widget showing the logged in user

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]nameName of the widget.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::AddModule ( std::string  module_id,
std::string  name 
)

Adds a module in the application. Adding a module adds a separate tab on the dashboard. User can add multiple modules and can group the related widgets under the same module.

Parameters
[in]module_idModule identifier.
[in]nameModule name.
Returns
Error code.

This identifer will be used to identify the widget on the server so its important to keep it unique in the application

SysWinErrorCode ekomsys::SysWinClient::AddOSNameWidget ( std::string  module_id,
std::string  widget_id,
std::string  name 
)

Adds the widget showing the Operating System of the host machine

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]nameName of the widget.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::AddProcessCPUUsageWidget ( std::string  module_id,
std::string  widget_id,
std::string  name,
long  pid,
long  update_interval_secs 
)

Adds the widget showing the CPU usage of a process

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]nameName of the widget.
[in]process_idPID of the process.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::AddProcessHandleCountWidget ( std::string  module_id,
std::string  widget_id,
std::string  name,
long  pid,
long  update_interval_secs 
)

Adds the widget showing the handles used by a process

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]nameName of the widget.
[in]process_idPID of the process.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::AddProcessMemoryUsageWidget ( std::string  module_id,
std::string  widget_id,
std::string  name,
long  pid,
long  update_interval_secs 
)

Adds the widget showing the memory usage of a process

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]nameName of the widget.
[in]process_idPID of the process.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::AddProcessorCountWidget ( std::string  module_id,
std::string  widget_id,
std::string  name 
)

Adds the widget showing the processor count on the host machine

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]nameName of the widget.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::AddProcessThreadUsageWidget ( std::string  module_id,
std::string  widget_id,
std::string  name,
long  pid,
long  update_interval_secs 
)

Adds the widget showing the threads used by a process

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]nameName of the widget.
[in]process_idPID of the process.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::AddSystemNameWidget ( std::string  module_id,
std::string  widget_id,
std::string  name 
)

Adds the widget showing the machine name of the host machine

Parameters
[in]module_idModule identifier.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::AddTotalSystemMemoryWidget ( std::string  module_id,
std::string  widget_id,
std::string  name 
)

Adds the widget showing the total system memory of the host machine

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]nameName of the widget.
[in]update_intervalUpdate interval in seconds.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::AddWidget ( std::string  module_id,
std::string  widget_id,
WidgetType  type,
std::string  name 
)

Adds a widget in the dashboard. Adding a widget adds a widget on the dashboard under the specified module. User can add multiple widgets in a module

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]typeWidget type.
[in]nameWidget name.
Returns
Error code.

This identifer will be used to identify the widget on the server so its important to keep it unique in the module

SysWinErrorCode ekomsys::SysWinClient::Authenticate ( std::string  user,
std::string  password 
)

Authenticated with the server using username and password. Server will use the same credentials to authenticate with the web applciation and if user has registered to use online services than server will push the data to the web application.

Parameters
[in]userUsername of the client.
[in]passwordPassword.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::ConnectServer ( std::string  ip,
std::string  port 
)

Connect to the sysd server.

Parameters
[in]ipIP Address of the server.
[in]portPort where the server is listening, default port is 40000.
Returns
Error code.
std::string ekomsys::SysWinClient::GetArchitecture ( long  pid)

Gets the process architecture

Parameters
[in]module_idModule identifier.
[in]process_idPID of the process.
Returns
Process full path.
std::string ekomsys::SysWinClient::GetProcessFullPath ( long  pid)

Gets the process full path given its PID

Parameters
[in]module_idModule identifier.
[in]process_idPID of the process.
Returns
Process full path.
long ekomsys::SysWinClient::GetProcessID ( )

Gets the host application process PID

Returns
Process ID.
std::string ekomsys::SysWinClient::GetProcessName ( long  pid)

Gets the process name given its PID

Parameters
[in]module_idModule identifier.
[in]process_idPID of the process.
Returns
Process name.
SysWinErrorCode ekomsys::SysWinClient::UpdateBarChartWidget ( std::string  module_id,
std::string  widget_id,
std::string  label,
double  value 
)

Appends the data to the bar chart widget

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]labelLabel.
[in]valueValue for the label.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::UpdateImageWidget ( std::string  module_id,
std::string  widget_id,
void *  data,
int  width,
int  height,
int  bpp 
)

Appends the data to the image widget. The image data here can be in RGBA or RGB format.

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]dataImage data.
[in]widthImage width.
[in]heightImage height.
[in]bppBits per pixel, for RGBA its 32, for RGB its 24.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::UpdateImageWidget ( std::string  module_id,
std::string  widget_id,
std::string  path 
)

Appends the image widget with data from the image file. The image data here is the data from the image file.

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]file_pathPath of the image file.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::UpdateLineChartWidget ( std::string  module_id,
std::string  widget_id,
float  x,
float  y 
)

Appends the data to the line chart widget

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]xx value of the data.
[in]yy value of the data.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::UpdateListWidget ( std::string  module_id,
std::string  widget_id,
std::string  text 
)

Appends the data to the list widget

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]textText to add to the widget.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::UpdatePieChartWidget ( std::string  module_id,
std::string  widget_id,
std::string  label,
double  value 
)

Appends the data to the pie-chart widget

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]labelLabel.
[in]valueValue for the label.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::UpdateProgressBarWidget ( std::string  module_id,
std::string  widget_id,
double  value,
double  max_value 
)

Appends the data to the progress bar widget

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]valuevalue of the data.
[in]max_valueMaximum value of the data.
Returns
Error code.
SysWinErrorCode ekomsys::SysWinClient::UpdateSingleValueWidget ( std::string  module_id,
std::string  widget_id,
std::string  value 
)

Appends the data to the single value widget

Parameters
[in]module_idModule identifier.
[in]widget_idWidget identifier.
[in]valuevalue of the data.
Returns
Error code.

The documentation for this class was generated from the following file: