Gtld recorder: различия между версиями
Перейти к навигации
Перейти к поиску
(Новая страница: « let recorder = gtl.add_recorder( { "src":[ gtl.analog_inputs[0], gtl.analog_inputs[1] ], "time" : 1, "prehistory" : 0.5, "comment" : "no comments", "dir" : "d:/", "file_name" : "record from script" } ); if(!recorder.is_success()) gtl.diagnostic.stop(); recorder.finished.connect( function() { gtl.log.info("file", "finished"); gtl.free(recorder); gtl.diagnostic.stop(); } ); gtl.diagnostic.interval = .1; fun...») |
Нет описания правки |
||
| (не показано 5 промежуточных версий этого же участника) | |||
| Строка 1: | Строка 1: | ||
<pre> | |||
let recorder = gtl.add_recorder( | let recorder = gtl.add_recorder( | ||
{ | { | ||
| Строка 6: | Строка 6: | ||
gtl.analog_inputs[1] | gtl.analog_inputs[1] | ||
], | ], | ||
"prehistory" : 15.5, | |||
"prehistory" : | |||
} | } | ||
); | ); | ||
recorder.finished.connect( | recorder.finished.connect( | ||
| Строка 26: | Строка 22: | ||
gtl.free(recorder); | gtl.free(recorder); | ||
gtl.diagnostic.stop(); | |||
} | } | ||
); | ); | ||
| Строка 37: | Строка 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> | |||
Текущая версия от 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();
}
}