Programming Guide (JScript)



Yüklə 6,96 Mb.
Pdf görüntüsü
səhifə10/22
tarix07.11.2018
ölçüsü6,96 Mb.
#78683
1   ...   6   7   8   9   10   11   12   13   ...   22

30
1.  
1.  
2.  
    IsAvailableObject('S-UYUTOVA','CAM','1', i);
    DebugLogString("right "+i+" = "+result);
}
The GetUserId method
The GetUserId method returns the identifier of the current 
 Software System user.
Intellect
Method call syntax:
function  GetUserId (cmp : String) : String
Method arguments:
cmp - required. Specifies the name of the computer on which the 
 Software System is installed.  Allowed values: values of String type that satisfy the requirements for 
Intellect
computers' network names; the set of values is restricted to the names of computers registered in the system.
For example: To display the identifier of the current user of the 
 Software System, which has been installed on a computer named 'WS3':
Intellect 
DebugLogString(GetUserId("WS3"));
The GetEventDescription method
The GetEventDescription method is in use for receiving the object description on free language.
Syntax of method invocation:
function  GetEventDescription (obj_type : String, event : String)
Method arguments:
obj_type – required argument. Specifies type of system object description of which is required to get.
event – required argument. Specifies the name of object description of which is required to get.


31
1.  
2.  
3.  
Example. Display messages about receiving of events for camera 1 on the free language in the Debug window.
if (Event.SourceType == "CAM"&& Event.SourceId == "1")
{
        var str = GetEventDescription("CAM", Event.Action);
        DebugLogString(str);
}
The GetObjectIdByParam method
The GetObjectIdByParam method allows receiving of object ID at which some parameter is equal to the specified value. The first found object ID is receiving if there are several such 
objects. The null is receiving if such objects are not found
Syntax of method invocation:
function GetObjectIdByParam (obj_type : String, obj_param : String, param_value : String)
Method arguments:
obj_type – required argument. Specifies type of system object, ID of which is required to get.
obj_param - required argument. Specifies the name of parameter in database on value of which the object is to be found.
param_value – required argument. Specifies the required value of object parameter.
Example. Find cameras from which black-and-white image is receiving and set the 
 parameter equals to 1 for them.
Color
if (Event.SourceType == "MACRO" && Event.SourceId== "1" && Event.Action == "RUN")
 
{
  var id = GetObjectIdByParam("CAM","color","0"); //receiving the first object ID
  while (id){ //while exist the Camera objects from which black-and-white image is receiving
     SetObjectParam ("CAM", id, "color", "1"); //change the Color parameter for found object
     id = GetObjectIdByParam("CAM","color","0"); //receiving the next object ID
  }
}
The SaveToFile method


32
1.  
2.  
3.  
1.  
2.  
SaveToFile method is in use to save in file the frame from camera receiving in the data parameter of FRAME_SENT event.
Syntax of method invocation:
function  SaveToFile (path: String,  data: String,  param : Boolean)
 
Saving of frame is also can be performed using the GET_FRAME reaction of the CAM object. It is required to specify the path for saving file with frame in the path parameter of this 
reaction. FRAME_SENT event is created in the system if the GET_FRAME reaction has not got the path parameter. In the data parameter of the FRAME_SENT event the video image 
frame which is to be saved using the SaveToFile method is stored.
The reaction allows exporting of video image frame even if the camera is not displaying in the Monitor window.
Method argument:
path – mandatory argument. Specifies the full path to save the file with frame.
data – mandatory argument. Specifies data to save in file.
param – mandatory argument. Defines necessity of conversion from base 64 format before saving. Possible parameter values:
true – decode from base64 before saving;
false – save string without conversion.
Time of frame saving depends on the anchor frames frequency. The higher the anchor frames frequency, the less time.
Example. Save the frame receiving from Camera 1 in the test.jpg file on the D disk:
if (Event.SourceType == "CAM" && Event.SourceId == "1" && Event.Action == "FRAME_SENT")
  {
    SaveToFile("D:\\test.jpg",Event.GetParam("data"),true);
  }
The GetLinkedObjects method
The GetLinkedObjects method is used to get list of objects linked to the specified camera using the Objects connection object ( see the Administrator's Guide, Connection of objects 
with cameras section)
Method call syntax:
function  GetLinkedObjects(type1 : string, id : string, type2 : string)


33
1.  
2.  
3.  
1.  
2.  
3.  
Method argument:
type1 – the type of object for which linked objects are to be returned.
id – identification number of object for which linked objects are to be returned.
type2 – the type of linked objects which are to be returned. If empty string is sent then linked objects of all types will be returned.
Example.
The 
 object is configured the following way:
Objects connection
 
Display in debug window the list of objects linked with the camera 1.
 
if (Event.SourceType == "MACRO")
{
    
varmsgstr = GetLinkedObjects("CAM","1","MACRO")
    
DebugLogString("Linked objects  " + msgstr);
}
 
As a result the "Linked objects MACRO:1" message will be displayed in the script debug window.
The WriteIni method
The WriteIni method is used for writing the string variable to ini-file.
Method call syntax:
function WriteIni(varName: String, varValue: String, path: String)
Method argument:
varName – required argument.  Sets name  of variable for saving in the file.
varValue – required argument.  Sets value of t variable.


Yüklə 6,96 Mb.

Dostları ilə paylaş:
1   ...   6   7   8   9   10   11   12   13   ...   22




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə