bitfocus / companion-module-rationalacoustics-smaart3

MIT License
0 stars 2 forks source link

Capture Request #3

Open NoiseMaker32 opened 1 year ago

NoiseMaker32 commented 1 year ago

Hi @murphytodd4 , Awesome work on the module its great!

Is it possible to add a capture trace action on the Smaart V3 API

Ideally where we can target a specific measurement and give it a specific name.

Thank YOU!

NoiseMaker32 commented 1 year ago

ACTIONS

        ‘captureTrace’:{
            label: ‘Capture Current Trace’,
            options: [
                {
                    type: 'textinput',
                    label: 'Trace Name',
                    id: ‘traceName'
                }
            ],
            callback: (action) =>{
                this.captureTrace(traceName);
                }
        ‘renameTrace’:{
            label:’Rename Trace’,
            options: [
                {
                    type: 'textinput',
                    label: 'Trace Name',
                    id: ‘traceName'
                }
                {
                    type: 'textinput',
                    label: 'Trace File Path’,
                    id: ‘tracePath
                }

            ],
            callback: (action) =>{
                this.renameTrace(action.options.traceName + action.options.tracePath);
                }

        }

Call backs

captureTrace(traceName) {
    let payload = {     
         "sequenceNumber":42,
            "action":"capture",
         "target": {
    "measurementName": traceName
}
    };
    console.log(payload);
    this.sendData(payload);
}

renameTrace(traceName + tracePath) {
    let payload = {     
"sequenceNumber":42,
"action":"set",
"target": {
    "traceFilePath”:tracePath
},
"properties": [
    { "name": traceName }
]
};
    console.log(payload);
    this.sendData(payload);
}