House Individual Visualization and graphical control from eHouse System Automation – Java

Graphical visualization of eHouse Home Automation extends the development environment for the system and creates the possibility of an independent software development for end users ofeHouse system , associated companies and businesses wishing to contribute individually programming in JSE (Java) environment.

eHouse for Java (eHouse4Java) is compatible to the Android and Windows Mobile libraries, allowing you to create your own software for control panels and tablets.

The library is the application template and enables:

  • load configuration , the names of the controllers , Outputs , Inputs , sensors, etc.
  • ensuring communication system controller
  • receiving and decoding the data controller status
  • send control commands graphically (with the visualization of objects) or from text form (with field selectable)
  • control system via WiFi , Internet , SMS , eMail
  • Graphical visualization and control – load the text file of graphic objects associated with the events to be executed (of eHouse system) and equipment statuses
  • Automatic visualization for the controller (room)

Visualization is created using java library “swing” with elements of a “JPanel” , “JButton” etc.

These objects are automatically “double-buffered” , so that the effect of flicker is eliminated ,which is very annoying for the user .

The user can also control the image:

  • zoom in and out
  • move up , down and from side to side
  • change the current view by selecting the “Options”
  • return to the graphical visualization of the system by selecting the “View”

Example of visualization eHouse system:

 Intelligent home control eHouse online graphics and visualization - java open source

 Intelligent home control eHouse online graphics and visualization - java open source

Zooming in and out was carried out with the use of scalable vector graphics (SVG) , so that the image does not lose its quality after the change of scale:


Undo edits

New!;

controllers status are automatically displayed:

It is updated via a computer network or the Internet (TCP or UDP) – online (in real time)

 Intelligent home control eHouse online graphics and visualization - java open source

 Intelligent home control eHouse online graphics and visualization - java open source

 Intelligent home control eHouse online graphics and visualization - java open source

 Intelligent home control eHouse online graphics and visualization - java open source

By selecting the ” Options ” and the room can be seen states controllers and select programs.

Changing the status of incoming UDP will automatically refresh visualization™:  Intelligent home control eHouse online graphics and visualization - java open source

 Intelligent home control eHouse online graphics and visualization - java open source

In addition to visualization of individually designed based on the architectural design and installation of smart home is automatically created the visualization independently for each controller in the system (in particular for RoomManagers and EthernetRoomManager – for individual rooms).
This allows for independent control panels and visualization for each room individually , without tedious to create project-based visualization system .

For CommManager (states of alarm sensors , Ouputs)

 Intelligent home control eHouse graphics and visualization automatic online - java open source

For RoomManager and EthernetRoomManager:

 Intelligent home control eHouse graphics and visualization automatic online - java open source

 Intelligent home control eHouse graphics and visualization automatic online - java open source

 Intelligent home control eHouse graphics and visualization automatic online - java open source

The boiler controller , recovery of CO (HeatManager)

 Intelligent home control eHouse graphics and visualization automatic online - java open source

 Intelligent home control eHouse graphics and visualization automatic online - java open source

More information can be found in the articles devoted to programming libraries eHouse4Android (eHouse for Android – Android Java), which have been translated into Java SE for compatibility and ease of software development on different operating systems .

THE SOURCE CODE

/*

* Template applications for graphic visualization system, smart home eHouse

* Only for registered users of the system eHouse , Cooperating companies All Rights Reserved

*

* Requires Classes:

* Ehousecommunication.class – send events to the system

* EhouseTCP.class – Initialization and maintenance of communications over TCP / IP controller , Updated data from the system inputs and outputs

* StatusEhouse.class – data storage and controller settings , updated on an ongoing basis over TCP / IP controllers ehouse1 (485)

* StatusCommManager.class – store current data and settings controllers , updated on an ongoing basis over TCP / IP controllers ehouse2 (Ethernet)

* GraphicObject.class – storage of graphical objects

* Visualization.class – draw graphical objects (lines , ellipses , rectangles) and service related events

*

* Application template designed a graphic visualization of eHouse System

* ONLY FOR REGISTERED USERS , Vendors , COOPERATIVES Copyright ISYS.En All Rights Reserved

*

* Required classes:

* Ehousecommunication.class – sending events to the system

* EhouseTCP.class – initialization and maintenance TCP / IP communication with controllers , updating current status of controllers

* StatusEhouse.class – controllers settings and data storage , updating data (TCP / IP) for ehouse1 controllers (485)

* StatusCommManager.class – controllers settings and data storage , updating data (TCP / IP) for ehouse2 controllers (Ethernet)

* GraphicObject.class – graphic data storage objects

* Visualization.class – drawing graphic objects (lines , Ellipses , rectangles) and handling events related to them

*/

ehouse4java package;

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import javax.swing.event.Changeevent;

import javax.swing.event.ChangeListener;

Ehouse4java public class extends JFrame implements ActionListener , ChangeListener {

/**

* Class responsible for initializing the system status, and create

* The main application window.Implements interfaces that support the event

* Associated with buttons .

*

* Class Responsible for initializing the status of classes and creating

* The main application window.That Implements interfaces support events

* Related to the buttons .

*/

/**

* Visualization object containing currently Displayed view

*/

public visualization Visualization;

// Public visualization Options;

// Public visualization TextEvents;

/**

* Pallete of buttons supporting zooming , shifting and changing

* Displayed view

*/

JButton ZoomPlusButton;

JButton ZoomMinusButton;

JButton LeftShiftButton;

JButton RightShiftButton;

JButton UpButton;

JButton DownButton;

JButton ExitB=null;

JButton Options;

JButton View;

JButton Back;

JButton[]=new JButton ViewsB[MAX_VIEWS_COUNT];

/**

* Panel with all buttons

*/

JPanel ZoomPanel;

/**

* Panel Displayed currently containing visualization

*/

JPanel viewpanel;

/**

* The panel containing a group of buttons used to access controllers states ,

* System schedules etc. .

*/

JPanel optionspanel;

/**

* Oprional scrollpanes

*/

JScrollPane jsp1;

JScrollPane jsp2;

public static int buttonscounter;

public int centerX;

public int CenterY;

public int prevCenterX;

public int prevCenterY;

public int Ycompensation;

prevOffsetX int=0,prevOffsetY=0;

double prevScaleX;

double prevScaleY;

public final double zoomfactor=0.3;

public static String previousoptionsview=” “;

/**

* Creates new form Ehouse4java.Initiates the status of classes and graphic

* Components with main window .

*/

public Ehouse4java() {

super (“EHouse”);

OnCreate();

setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);

/**

* Initiates all graphic components

*/

addComponentToPane (getContentPane());

setSize (400,400);

setLocation (200,0);

setMinimumSize (new Dimension (200,200));

setVisible (true);

prevCenterX=(int) Visualization.getBounds().getCenterX();

prevCenterY=(int) Visualization.getBounds().getCenterY();

}

/**

* Initiates all components dry as graphic panels,buttons,scrollbars, etc. .

*

* @ Param pane

*/

public void addComponentToPane (Container pane) {

optionfirsttime=true;

ExitB=new JButton(“Exit”);

ExitB.setActionCommand(“Exit”);

ExitB.addActionListener(this);

indexView int=0;

ZoomPanel=new JPanel(new FlowLayout());

viewpanel.add(ZoomPanel,BorderLayout.PAGE_END);

ZoomPlusButton=new JButton(“+”);

ZoomPlusButton.setActionCommand(“ZoomPlus”);

ZoomPlusButton.addActionListener(this);

ZoomPanel.add(ZoomPlusButton);

ZoomMinusButton=new JButton(“-“);

ZoomMinusButton.setActionCommand(“ZoomMinus”);

ZoomMinusButton.addActionListener(this);

ZoomPanel.add(ZoomMinusButton);

}

/**

* Initiates and StatusEhouse StatusCommManager classes by loading controllers

* Status

*/

public void OnCreate() {…}

/**

* @ Param args the command line arguments

*/

public static void main (String args[]) {

/*

* Create and display the form

*/

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

Ehouse4java new().setVisible(true);

}

});

}

/**

* Supports events Invoked by clicking on button

*

* @ Param e

*/

@ Override

public void actionPerformed(ActionEvent e) {

switch (e.getActionCommand()) {

case”ZoomPlus”:

prevOffsetX=ehousecommunication.OffsetX;

prevOffsetY=ehousecommunication.Offsets;

ehousecommunication.ScaleX*=(1+zoomfactor); //* 100/zoomleve;

ehousecommunication.ScaleY*=(1+zoomfactor); //* 100/zoomleve;

// Centering the view after rescalling

ehousecommunication.OffsetX+=(int)((Visualization.getBounds().getCenterX()+prevOffsetX)*zoomfactor);

ehousecommunication.Offsets+=(int)((Visualization.getBounds().getCenterY()+prevOffsetY)*zoomfactor)+Ycompensation/(1/(2*zoomfactor));

EhouseTCP.ReadViewFile(ehousecommunication.currentview); // Calculate zoom
Visualization.repaint();

return;

}

}

}