Skip to main content

vorto tango

·102 words·1 min
WFUing
Author
WFUing
A graduate who loves coding.

CameraDevice.infomodel

namespace com.example.devices
version 1.0.0
displayname "Camera Device"
description "Model for a simple camera device that can take pictures and notify status changes."

using com.example.devices;CameraDevice;1.0.0

infomodel CameraDevice {

    functionblocks {
        status as CameraStatus
    }
    
    events {
        CameraStatusChanged: status
    }
}

CameraStatus.fbmodel

namespace com.example.devices
version 1.0.0
displayname "Camera Status"
description "Function block model for camera status and actions."

functionblock CameraStatus {

    status {
        Mandatory cameraStatus as string "The current status of the camera."
    }

    operations {
        TakePicture()
        Stop()
    }

    events {
        CameraStatusChanged(eventData: string) "Notifies when the camera status changes."
    }
    
    configuration {
        image_path as string "Path to save images." default "/tmp/output.png"
    }
}