Automatyka Domowa Tworzenie Wizualizacji w formacie Użytkownika

Inteligentny Dom eHouse tworzenie wizualizacji w indywidualnym formacie utworzonym przez użytkownika.
W poprzednich artykułach omówiliśmy tworzenie wizualizacji graficznej i sterowania graficznego dla oprogramowania eHouse na różne platformy softwarowe i sprzętowe oraz przeglądarki internetowe.
Poza tymi standardowymi metodami można utworzyć wizualizacje dla aplikacji zewnętrznych lub przyszłych wersji systemu oraz rozwiązań firm trzecich.
możliwe to jest dzięki wczytywaniu odpowiednich szablonów konfiguracyjnych w których zastępowane są dane dynamiczne parametrami obiektów exportowanych z Corela przy pomocy makr VisualBasic VBA napisanych specjalnie do tworzenia wizualizacji.
Inteligentny Dom eHouse Tworzenie wizualizacji w aplikacji CorelDraw
W tym celu należy w polu wyboru „Extended file for SVG, XML Visualization” wybrać pożądany tryb oraz nacisnąć przycisk 'Generate Extended SVG’.

Dane konfiguracyjne dla każdego trybu znajdują się w katalogu %ehouse%\XML\%nazwa%.* .
%nazwa% – musi znajdować się w pliku „exports.txt”.
komplet konfiguracji znajduje się w plikach
%nazwa%.head – nagłówek pliku wyjściowego
%nazwa%.foot – stopka pliku wyjściowego
%nazwa%.rectangle – szablon pojedynczej figury typu prostokąt
%nazwa%.rrectangle – szablon pojedynczej figury typu prostokąt zaokrąglony
%nazwa%.circle – szablon pojedynczej figury typu koło
%nazwa%.ellipse – szablon pojedynczej figury typu elipsa
%nazwa%.text – szablon pojedynczego napisu
%nazwa%.line – szablon pojedynczej linii

W plikach head i foot mogą znajdować się tylko globalne pola dynamiczne, natomiast w plikach obiektów graficznych wszystkie.

Są to:
Globalne – dynamiczne zmienne do zastąpienia:

  • %ViewName% >>> Nazwa widoku / pliku
  • %TAB% >>> #19 – tabulacja
  • %CR% >>> #13 – Enter CarriageReturn
  • %LN% >>> #10 – LineFeed
  • %SPACE% >>> Spacja
  • %BackGround% >>> Kolor Tła
  • %ImageSizeX% >>> Rozmiar obrazu X w cm
  • %ImageSizeY% >>> Rozmiar obrazu Y w cm
  • %ImageSizeY100% >>> ImageSizeY * 100
  • %ImageSizeX100% >>> ImageSizeX * 100
  • %CHARSET% >>> typ znaków – utf-8

Dynamiczne zmienne dla obiektów graficznych

  • %FigTypeItem% >>> Typ figury / zgodnie z wizualizacją eHouse
  • %X1Item% >>> X1 współrzędna X
  • %XSizeItem% >>> rozmiar w osi X – szerokość
  • %Y1Item% >>> Y1 współrzędna Y
  • %YSizeItem% >>> rozmiar w osi Y – wysokość
  • %X2Item% >>> X2 – współrzędna X drugiego punktu (dla linii)
  • %Y2Item% >>> Y2 – współrzędna Y drugiego punktu (dla linii)
  • %RadiusXItem% >>> Promień skrętu X (elipsa, okrąg) / Zaokrąglenie X (prostokąt)
  • %RadiusYItem% >>> Promień skrętu Y (elipsa, okrąg) / Zaokrąglenie Y (prostokąt)
  • %ColorItem% >>> Kolor linii
  • %FillColorItem% >>> Kolor Wypełnienia
  • %PenWidthItem% >>> grubość linii
  • %SelectionItem% >>> zaznaczenie (future)
  • %OrientationItem% >>> Orientation (future)
  • %DrawSolidItem% >>> parametry linii (ciągła, przerywana, kropkowana)
  • %FontSizeItem% >>> Rozmiar Fontu (dla tekstu)
  • %FontItem% >>> Font (dla tekstu)
  • %LabelTextItem% >>> Text (dla tekstu)
  • %EventNameItem% >>> Nazwa zdarzenia eHouse / opis / nazwa warstwy w Corelu
  • %DirectEventItem% >>> kod zdarzenia bezpośredniego Direct Event eHouse
  • %IdItem% >>> Kod statusu danego elementu
  • %IdCItem% >>> Kod statusu danego elementu
  • %UniqueItem% >>> unikalne ID elementu
  • %CenterXItem% >>> X środka / dla elipsy i koła
  • %CenterYItem% >>> Y środka / dla elipsy i koła
  • %TitleItem% >>> Tytuł
  • %BoldItem% >>> Pogrubione (dla tekstu)
  • %UnderLineItem% >>> podkreślone (dla tekstu)
  • %ItalicItem% >>> kursywa (dla tekstu)
  • %TextOptionsItem% >>> Dodatkowe opcje (dla tekstu)
  • %StyleItem% >>> parametry linii (ciągła, przerywana, kropkowana)

Przykład dla nazwy trybu „custom” znajduje się w plikach „custom.*”:
np:
custom.head

<?xml version=”1.0″ encoding=”%CHARSET%”?>
<ehouse>
<title>Inteligentny Dom eHouse</title>
<description>Visualization 2013 Custom Xml format for third parties application</description>
<references>
<ref value=”http://www.isys.pl/” name=”Inteligentny Dom eHouse – producent” />
<ref value=”http://home-automation.isys.pl/” name=”eHouse Home Automation System – producer and developer Home Page” />
<ref value=”http://inteligentny-dom.ehouse.pro/” name=”Inteligentny Dom eHouse – zrob to sam przyklady, rozwiazania, programowanie, projektowanie” />
<ref value=”http://home-automation.ehouse.pro/” name=”eHouse home automation – do it yourself DIY, Examples, programming, designs, ” />
</references>
<visualization>
<width> %ImageSizeX% </width>
<height> %ImageSizeY% </height>
<xsize> %ImageSizeX100% </xsize>
<ysize> %ImageSizeY100% </ysize>
<units> cm </units>
<script src=’eHouseVisual.js’ language=’JavaScript’></script>
<viewname> %ViewName% </viewname>
<charset> %CHARSET% </charset>
<background> %BackGround% </background>
</visualization>
<objects>

custom.foot

</objects>
<script>
InitializeObjects();
TestEhouse();
</script>
</ehouse>

custom.circle

<circle>
<xcenter> %CenterXItem% </xcenter>
<ycenter> %CenterYItem% </ycenter>
<xradius> %RadiusXItem% </xradius>
<yradius> %RadiusYItem% </yradius>
<outlinewidth> %PenWidthItem% </outlinewidth>
<color> %ColorItem% </color>
<fillcolor> %FillColorItem% </fillcolor>
<directevent> %DirectEventItem% </directevent>
<eventname> %EventNameItem% </eventname>
<statuscode> %IdItem% </statuscode>
<uniqueid> %UniqueItem% </uniqueid>
</circle>

custom.ellipse

<ellipse>
<xcenter> %CenterXItem% </xcenter>
<ycenter> %CenterYItem% </ycenter>
<xradius> %RadiusXItem% </xradius>
<yradius> %RadiusYItem% </yradius>
<outlinewidth> %PenWidthItem% </outlinewidth>
<color> %ColorItem% </color>
<fillcolor> %FillColorItem% </fillcolor>
<directevent> %DirectEventItem% </directevent>
<eventname> %EventNameItem% </eventname>
<statuscode> %IdItem% </statuscode>
<uniqueid> %UniqueItem% </uniqueid>
<title> %TitleItem% </title>
</ellipse>

custom.rectangle

<rectangle>
<x> %X1Item% </x>
<y> %Y1Item% </y>
<width> %XSizeItem% </width>
<height> %YSizeItem% </height>
<color> %ColorItem% </color>
<fillcolor> %FillColorItem% </fillcolor>
<directevent> %DirectEventItem% </directevent>
<eventname> %EventNameItem% </eventname>
<statuscode> %IdItem% </statuscode>
<uniqueid> %UniqueItem% </uniqueid>
<style> %StyleItem% </style>
<title> %TitleItem% </title>
<outlinewidth> %PenWidthItem% </outlinewidth>
</rectangle>

custom.rrectangle

<roundrectangle>
<x> %X1Item% </x>
<y> %Y1Item% </y>
<xroundness> %RadiusXItem% </xroundness>
<yroundness> %RadiusXItem% </yroundness>
<width> %XSizeItem% </width>
<height> %YSizeItem% </height>
<color> %ColorItem% </color>
<fillcolor> %FillColorItem% </fillcolor>
<directevent> %DirectEventItem% </directevent>
<eventname> %EventNameItem% </eventname>
<statuscode> %IdItem% </statuscode>
<uniqueid> %UniqueItem% </uniqueid>
<style> %StyleItem% </style>
<title> %TitleItem% </title>
<outlinewidth> %PenWidthItem% </outlinewidth>
</roundrectangle>

custom.line

<line>
<x1> %X1Item% </x1>
<y1> %Y1Item% </y1>
<x2> %X1Item% </x2>
<y2> %Y1Item% </y2>
<outlinewidth> %PenWidthItem% </outlinewidth>
<color> %ColorItem% </color>
<fillcolor> %FillColorItem% </fillcolor>
<directevent> %DirectEventItem% </directevent>
<eventname> %EventNameItem% </eventname>
<statuscode> %IdItem% </statuscode>
<uniqueid> %UniqueItem% </uniqueid>
<style> %StyleItem% </style>
<title> %TitleItem% </title>
</line>

custom.text

<text>
<x> %X1Item% </x>
<y> %Y1Item% </y>
<label> %LabelTextItem% </label>
<font-size> %FontSizeItem% </font-size>
<font> %FontItem% </font>
<outlinewidth> %PenWidthItem% </outlinewidth>
<color> %ColorItem% </color>
<fillcolor> %FillColorItem% </fillcolor>
<directevent> %DirectEventItem% </directevent>
<eventname> %EventNameItem% </eventname>
<statuscode> %IdItem% </statuscode>
<uniqueid> %UniqueItem% </uniqueid>
<bold> %BoldItem% </bold>
<underline> %UnderLineItem% </underline>
<italic> %ItalicItem% </italic>
<options> %TextOptionsItem% </options>
<title> %TitleItem% </title>
</text>

Fragment pliku wyjściowego oparty na powyższym przykładzie:

parter.custom

<?xml version=”1.0″ encoding=”utf-8″?>
<ehouse>
<title>Inteligentny Dom eHouse</title>
<description>Visualization 2013 Custom Xml format for third parties application</description>
<references>
<ref value=”http://www.isys.pl/” name=”Inteligentny Dom eHouse – producent” />
<ref value=”http://home-automation.isys.pl/” name=”eHouse Home Automation System – producer and developer Home Page” />
<ref value=”http://inteligentny-dom.ehouse.pro/” name=”Inteligentny Dom eHouse – zrob to sam przyklady, rozwiazania, programowanie, projektowanie” />
<ref value=”http://home-automation.ehouse.pro/” name=”eHouse home automation – do it yourself DIY, Examples, programming, designs, ” />
</references>
<visualization>
<width> 32 </width>
<height> 18 </height>
<xsize> 3200 </xsize>
<ysize> 1800 </ysize>
<units> cm </units>
<script src=’eHouseVisual.js’ language=’JavaScript’></script>
<viewname> parter </viewname>
<charset> utf-8 </charset>
<background> #000000 </background>
</visualization>
<objects>

<ellipse>
<xcenter> 27.373 </xcenter>
<ycenter> 15.028 </ycenter>
<xradius> 0.533 </xradius>
<yradius> 0.533 </yradius>
<outlinewidth> 0.01 </outlinewidth>
<color> #DA251D </color>
<fillcolor> #E77817 </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Zabezpieczenia – (Warning) </eventname>
<statuscode> 00FE7B6000 </statuscode>
<uniqueid> 1 </uniqueid>
<title> Zabezpieczenia – (Warning) </title>
</ellipse>
<ellipse>
<xcenter> 25.687 </xcenter>
<ycenter> 15.124 </ycenter>
<xradius> 0.533 </xradius>
<yradius> 0.533 </yradius>
<outlinewidth> 0.01 </outlinewidth>
<color> #DA251D </color>
<fillcolor> #DA251D </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Zabezpieczenia – (Alarm) </eventname>
<statuscode> 00FE7D6000 </statuscode>
<uniqueid> 2 </uniqueid>
<title> Zabezpieczenia – (Alarm) </title>
</ellipse>
<text>
<x> 7.578 </x>
<y> 12.649 </y>
<label> Robert Okno Kon. </label>
<font-size> 0.194 </font-size>
<font> Arial </font>
<outlinewidth> 0.01 </outlinewidth>
<color> #00923F </color>
<fillcolor> #00923F </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Active – Robert K (1) </eventname>
<statuscode> 00FE7A1A01 </statuscode>
<uniqueid> 3 </uniqueid>
<bold>  </bold>
<underline>  </underline>
<italic>  </italic>
<options>  </options>
<title> Active – Robert K (1) </title>
</text>
<rectangle>
<x> 7.422 </x>
<y> 12.52 </y>
<width> 0.139 </width>
<height> 0.121 </height>
<color> #1F1A17 </color>
<fillcolor> #FFF500 </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Warning – Robert K (1) </eventname>
<statuscode> 00FE7B1A01 </statuscode>
<uniqueid> 4 </uniqueid>
<style> 0 </style>
<title> Warning – Robert K (1) </title>
<outlinewidth> 0.01 </outlinewidth>
</rectangle>
<rectangle>
<x> 7.285 </x>
<y> 12.52 </y>
<width> 0.139 </width>
<height> 0.121 </height>
<color> #1F1A17 </color>
<fillcolor> #DA251D </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Alarm – Robert K (1) </eventname>
<statuscode> 00FE7D1A01 </statuscode>
<uniqueid> 5 </uniqueid>
<style> 0 </style>
<title> Alarm – Robert K (1) </title>
<outlinewidth> 0.01 </outlinewidth>
</rectangle>
<text>
<x> 7.578 </x>
<y> 12.482 </y>
<label> Zuzia Okno Kon. </label>
<font-size> 0.194 </font-size>
<font> Arial </font>
<outlinewidth> 0.01 </outlinewidth>
<color> #00923F </color>
<fillcolor> #00923F </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Active – Zuzia K (1) </eventname>
<statuscode> 00FE7A1901 </statuscode>
<uniqueid> 6 </uniqueid>
<bold>  </bold>
<underline>  </underline>
<italic>  </italic>
<options>  </options>
<title> Active – Zuzia K (1) </title>
</text>
<rectangle>
<x> 7.422 </x>
<y> 12.353 </y>
<width> 0.139 </width>
<height> 0.121 </height>
<color> #1F1A17 </color>
<fillcolor> #FFF500 </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Warning – Zuzia K (1) </eventname>
<statuscode> 00FE7B1901 </statuscode>
<uniqueid> 7 </uniqueid>
<style> 0 </style>
<title> Warning – Zuzia K (1) </title>
<outlinewidth> 0.01 </outlinewidth>
</rectangle>
<rectangle>
<x> 7.285 </x>
<y> 12.353 </y>
<width> 0.139 </width>
<height> 0.121 </height>
<color> #1F1A17 </color>
<fillcolor> #DA251D </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Alarm – Zuzia K (1) </eventname>
<statuscode> 00FE7D1901 </statuscode>
<uniqueid> 8 </uniqueid>
<style> 0 </style>
<title> Alarm – Zuzia K (1) </title>
<outlinewidth> 0.01 </outlinewidth>
</rectangle>
<text>
<x> 7.578 </x>
<y> 12.322 </y>
<label> Zuzia PIR </label>
<font-size> 0.194 </font-size>
<font> Arial </font>
<outlinewidth> 0.01 </outlinewidth>
<color> #00923F </color>
<fillcolor> #00923F </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Active – Zuzia PIR (1) </eventname>
<statuscode> 00FE7A1801 </statuscode>
<uniqueid> 9 </uniqueid>
<bold>  </bold>
<underline>  </underline>
<italic>  </italic>
<options>  </options>
<title> Active – Zuzia PIR (1) </title>
</text>
<rectangle>
<x> 7.422 </x>
<y> 12.193 </y>
<width> 0.139 </width>
<height> 0.121 </height>
<color> #1F1A17 </color>
<fillcolor> #FFF500 </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Warning – Zuzia PIR (1) </eventname>
<statuscode> 00FE7B1801 </statuscode>
<uniqueid> 10 </uniqueid>
<style> 0 </style>
<title> Warning – Zuzia PIR (1) </title>
<outlinewidth> 0.01 </outlinewidth>
</rectangle>
<rectangle>
<x> 7.285 </x>
<y> 12.193 </y>
<width> 0.139 </width>
<height> 0.121 </height>
<color> #1F1A17 </color>
<fillcolor> #DA251D </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Alarm – Zuzia PIR (1) </eventname>
<statuscode> 00FE7D1801 </statuscode>
<uniqueid> 11 </uniqueid>
<style> 0 </style>
<title> Alarm – Zuzia PIR (1) </title>
<outlinewidth> 0.01 </outlinewidth>
</rectangle>
<text>
<x> 7.578 </x>
<y> 12.199 </y>
<label> Sypialnia PIR </label>
<font-size> 0.194 </font-size>
<font> Arial </font>
<outlinewidth> 0.01 </outlinewidth>
<color> #00923F </color>
<fillcolor> #00923F </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Active – Sypialnia PIR (1) </eventname>
<statuscode> 00FE7A1701 </statuscode>
<uniqueid> 12 </uniqueid>
<bold>  </bold>
<underline>  </underline>
<italic>  </italic>
<options>  </options>
<title> Active – Sypialnia PIR (1) </title>
</text>
<rectangle>
<x> 7.422 </x>
<y> 12.033 </y>
<width> 0.139 </width>
<height> 0.121 </height>
<color> #1F1A17 </color>
<fillcolor> #FFF500 </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Warning – Sypialnia PIR (1) </eventname>
<statuscode> 00FE7B1701 </statuscode>
<uniqueid> 13 </uniqueid>
<style> 0 </style>
<title> Warning – Sypialnia PIR (1) </title>
<outlinewidth> 0.01 </outlinewidth>
</rectangle>
<rectangle>
<x> 7.285 </x>
<y> 12.033 </y>
<width> 0.139 </width>
<height> 0.121 </height>
<color> #1F1A17 </color>
<fillcolor> #DA251D </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Alarm – Sypialnia PIR (1) </eventname>
<statuscode> 00FE7D1701 </statuscode>
<uniqueid> 14 </uniqueid>
<style> 0 </style>
<title> Alarm – Sypialnia PIR (1) </title>
<outlinewidth> 0.01 </outlinewidth>
</rectangle>
<text>
<x> 7.578 </x>
<y> 12.002 </y>
<label> Czarek Okno Kon. </label>
<font-size> 0.194 </font-size>
<font> Arial </font>
<outlinewidth> 0.01 </outlinewidth>
<color> #00923F </color>
<fillcolor> #00923F </fillcolor>
<directevent> 00fe6300000000000000 </directevent>
<eventname> Active – Czarek K (1) </eventname>
<statuscode> 00FE7A1601 </statuscode>
<uniqueid> 15 </uniqueid>
<bold>  </bold>
<underline>  </underline>
<italic>  </italic>
<options>  </options>
<title> Active – Czarek K (1) </title>
</text>
<line>
<x1> 27.448 </x1>
<y1> 3.847 </y1>
<x2> 27.448 </x2>
<y2> 3.847 </y2>
<outlinewidth> 0.133 </outlinewidth>
<color> #DD137B </color>
<fillcolor> #F7C5B4 </fillcolor>
<directevent> 00000000000000000000 </directevent>
<eventname> Parter </eventname>
<statuscode>  </statuscode>
<uniqueid> 618 </uniqueid>
<style> 0 </style>
<title> Parter </title>
</line>
<line>
<x1> 31.597 </x1>
<y1> 3.86 </y1>
<x2> 31.597 </x2>
<y2> 3.86 </y2>
<outlinewidth> 0.133 </outlinewidth>
<color> #DD137B </color>
<fillcolor> #F7C5B4 </fillcolor>
<directevent> 00000000000000000000 </directevent>
<eventname> Parter </eventname>
<statuscode>  </statuscode>
<uniqueid> 619 </uniqueid>
<style> 0 </style>
<title> Parter </title>
</line>
<line>
<x1> 31.597 </x1>
<y1> 13.639 </y1>
<x2> 31.597 </x2>
<y2> 13.639 </y2>
<outlinewidth> 0.133 </outlinewidth>
<color> #DD137B </color>
<fillcolor> #F7C5B4 </fillcolor>
<directevent> 00000000000000000000 </directevent>
<eventname> Parter </eventname>
<statuscode>  </statuscode>
<uniqueid> 620 </uniqueid>
<style> 0 </style>
<title> Parter </title>
</line>

</objects>
<script>
InitializeObjects();
TestEhouse();
</script>
</ehouse>

Więcej informacji:

inteligentny dom eHouse – wizualizacja screenshooty różnych metod wizualizacji z aplikacji systemu eHouse oraz przeglądarki WWW
inteligentny dom eHouse – tworzenie wizualizacji CorelDraw – Indywidualne tworzenie wizualizacji na podstawie projektu architektonicznego
inteligentny dom eHouse – wizualizacja i sterowanie graficzne