Gtld recorder: различия между версиями
Перейти к навигации
Перейти к поиску
Нет описания правки |
Нет описания правки |
||
| Строка 6: | Строка 6: | ||
gtl.analog_inputs[1] | gtl.analog_inputs[1] | ||
], | ], | ||
"prehistory" : 15.5, | |||
"prehistory" : | |||
} | } | ||
); | ); | ||
recorder.finished.connect( | recorder.finished.connect( | ||
| Строка 25: | Строка 22: | ||
gtl.free(recorder); | gtl.free(recorder); | ||
gtl.diagnostic.stop(); | |||
} | } | ||
); | ); | ||
| Строка 34: | Строка 32: | ||
function diagnose() | function diagnose() | ||
{ | { | ||
gtl.log.info("time", recorder.time()); | |||
if(gtl.diagnostic.time > 8 && !recorder.is_writing()) | |||
{ | |||
if(!recorder.start(10, "no comments", "E:/data/gtl", "record from script")) | |||
gtl.log.error("file", "error writing file"); | |||
} | |||
if(gtl.diagnostic.time > 20) | |||
{ | { | ||
gtl.log.info("diagnostic", "stop"); | gtl.log.info("diagnostic", "stop"); | ||
gtl.free(recorder); | |||
gtl.diagnostic.stop(); | gtl.diagnostic.stop(); | ||
} | } | ||
} | } | ||
</pre> | </pre> | ||
Текущая версия от 14:34, 16 января 2024
let recorder = gtl.add_recorder(
{
"src":[
gtl.analog_inputs[0],
gtl.analog_inputs[1]
],
"prehistory" : 15.5,
}
);
recorder.finished.connect(
function()
{
gtl.log.info("file", "finished");
gtl.free(recorder);
gtl.diagnostic.stop();
}
);
gtl.diagnostic.interval = .1;
function diagnose()
{
gtl.log.info("time", recorder.time());
if(gtl.diagnostic.time > 8 && !recorder.is_writing())
{
if(!recorder.start(10, "no comments", "E:/data/gtl", "record from script"))
gtl.log.error("file", "error writing file");
}
if(gtl.diagnostic.time > 20)
{
gtl.log.info("diagnostic", "stop");
gtl.free(recorder);
gtl.diagnostic.stop();
}
}