Bosch Building Technologies

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Is there a BVMS script that stores cameras images without opening every camera manually?

    Rate this article:
    100% helpful (1/1)

    Question

     

    I want to store the field of view of the cameras connected to BVMS. Is there an easy way to achieve this without opening every camera manually?

     

    Answer

     

    The embedded BVMS script engine makes this easy to achieve. The steps below explain how to achieve this and it is included an example script.

     

    How to store a snapshot of all cameras automatically from the Operator Client

    You can use this concept to document the camera positions. The script does not take PTZ camera presets into account, but can be expanded to loop through camera pre-sets as well.

    Create script
    Create a new client scriptlet in the Command Script Editor.

    Central_Support_0-1655218146480.png

     

    Copy and paste in the code below. 

    1

     

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    List<DeviceInfo<Camera>> lc = (List<DeviceInfo<Camera>>)Api.CameraManager.GetCameraInfoList();

    foreach (DeviceInfo<Camera> dc in lc) 

    {

    // Parameters

    // Files are stored in C:\BVMS_Data

    // Existing files are not overwritten! Please clear folder before starting script.

    Camera c = (Camera)dc.Device;

    String strCameraName = Api.DeviceManager.GetName(c);

     

    // Folder BVMS_Data needs to be manually created

    String strFileName = "C:\\BVMS_Data\\" + strCameraName + ".jpg";

     

    // Execution

    ImagePane ip = new ImagePane(1,1);

    Api.ContentManager.DisplayCamera(ip,c);

    // Give system time to open camera

    System.Threading.Thread.Sleep(1500);

    // Store snapshot

    Api.ContentManager.SaveImagePane(ip,strFileName);

    }

     

    The result should be similar to the image below (the scriptlet ID and method name might be different). 

    Central_Support_1-1655218238805.png
     
    Add the new client script to the logical tree. If needed, the access to the script can be removed for operators.

    Central_Support_2-1655218281635.png

     

    Save and activate the configuration. Run the script from the Operator Client and observe it from looping through all camera automatically.

    Central_Support_3-1655218324730.png

     

    The script stores the snapshots in C:\BVMS_data as shown below. The script uses the camera names as filename.

    BVMS script that stores cameras images without opening every camera manually.png

    Version history
    Last update:
    ‎06-14-2022 04:55 PM
    Updated by:
    Labels (6)
    Attachments
    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist