=======================  java =====================

  ,      java    1.6    . 
         com- javax.comm,    :

 :

1.  javacomm20-win32.zip
   : javax.comm/javacomm20-win32.zip

2.     jre: (,   java)
    c:\Program Files\Java\jdk1.6.0_12\jre

 javacomm20-win32.zip\commapi\comm.jar  <JRE>\lib\ext 
 javacomm20-win32.zip\commapi\javax.comm.properties  <JRE>\lib
 javacomm20-win32.zip\commapi\win32com.dll  <JRE>\bin



=========================   =======================

1.  dist -    ,           
2.  bin -  
3.  html -  JS,     .   test.html     test.js
4.  lib -    
5.  manifests - -   jar
6.  src -  
7. create.bat -   jar-


=========================    ======================

   start.bat  start.sh (     )    dist. 
       COM-port    , COM-port   
 , COM-    xdevice  http-port     .
 ,   ,     http-  JS           
 .  JS    cashmachine.js    html.   URL    
,   cashmachineURL = 'http://localhost:8011/'; 


==========================   =========================

---- 1.     ----

  jv-:
http://localhost:8011/cashmachine -  GET-  
http://localhost:8011/cashmachine?enable=true -   
http://localhost:8011/cashmachine?enable=false -    

        JSON:
{
	isWorking: true || false,
	isEnabled: true || false,
	event: ["banknote" || "started" || "stopped" || "error" ||"cassetInserted"],
	eventValue: [banknoteNominal || "errorCode"]
}

   JS     java-    .        
 JS   ,      :

1.    , eventType -  , eventValue -  
function handleCashmachineEvent(eventType, eventValue) {
}

2.   ,   isWork  isEnable
function handleCashmachineStateChanged(isWork, isEnable) {
}

---- 2.     ----

1.    : printerCheck()

http://host:port/printer?cmd=getstatus - GET-   (     )

            :
function handlePrinterEvent(isWork, isPaperEnd) {
}

2.     : printerAppendText(text, mode)

http://host:port/printer?cmd=append&text=&mode=(uibxys) -    

       text      mode (  
,   ).      utf-8
 * 		u - underline
 * 		i - inverse
 * 		b - bold
 * 		x - double X size
 * 		y - double Y size
 * 		s - second font

3.    ,  : printerPrint()
http://host:port/printer?cmd=print -   ,  

4.   ,  : printerCut()
http://host:port/printer?cmd=cut -  ,  

        java    ,   
  ,  30-50 ms,     .

---- 3.    xdevice ----

1.   (/): function xdevice(houseCode, deviceCode, func)
http://host:port/xdevice?cmd=[on|off]]&housecode=A&devicecode=1
