Browse Source

V3.2

master
zhaohe 1 year ago
parent
commit
ceb3c26ea5
  1. 7
      include/ixsync.hpp
  2. 2
      include/xsync_v2.hpp
  3. 2
      include/xsync_v2_sig_type.hpp
  4. 2
      src/xsync_v2.cpp
  5. 11
      src/xsync_v2_sig_type.cpp

7
include/ixsync.hpp

@ -348,10 +348,9 @@ class IXsync {
*
*/
virtual xs_error_code_t TTLOutputModule1_setSrcSigType(SignalType_t source) = 0;
virtual xs_error_code_t TTLOutputModule1_getSrcSigType(SignalType_t &source) = 0;
virtual xs_error_code_t TTLOutputModule1_setFreqDivision(uint32_t div) = 0;
virtual xs_error_code_t TTLOutputModule_setSrcSigType(int index, SignalType_t source) = 0;
virtual xs_error_code_t TTLOutputModule_getSrcSigType(int index, SignalType_t &source) = 0;
virtual xs_error_code_t TTLOutputModule_setFreqDivision(int index, uint32_t div) = 0;
virtual xs_error_code_t TTLOutputModule_getFreqDivision(int index, uint32_t &div) = 0;
virtual xs_error_code_t TTLOutputModule_setFreqMultiplication(int index, uint32_t multi) = 0;
virtual xs_error_code_t TTLOutputModule_getFreqMultiplication(int index, uint32_t &multi) = 0;

2
include/xsync_v2.hpp

@ -16,7 +16,7 @@
#include "i_xsync_udp.hpp"
#include "ixsync.hpp"
#define VERSION(main, sub, fix) (main << 16 | sub << 8 | fix << 0)
#define PC_VERSION VERSION(3, 1, 0)
#define PC_VERSION VERSION(3, 2, 0)
namespace xsync {
using namespace std;

2
include/xsync_v2_sig_type.hpp

@ -51,6 +51,8 @@ typedef struct {
string XsyncTimecodeToStr(XsyncTimecode_t timecode);
XsyncTimecode_t Str2XsyncTimecode(string timecode);
void Str2XsyncTimecode(string timecode, XsyncTimecode_t &code) ;
/*******************************************************************************
* GENLOCK *

2
src/xsync_v2.cpp

@ -393,7 +393,7 @@ class Xsync : public IXsync {
virtual xs_error_code_t SysTimecode_readCode(XsyncTimecode_t &timecode) override { return readtimecode(reg::sys_timecode_data0, reg::sys_timecode_data1, timecode); }
virtual xs_error_code_t RecordSigGenerator_setContrlMode(ControlMode_t mode) override {
if (mode != CONTROLMODE_MANUAL_TRIGGER && mode != CONTROLMODE_TIMECODE_TRIGGER && mode != CONTROLMODE_EXTERNALTTL_TRIGGER) {
if (mode != CONTROLMODE_MANUAL_TRIGGER && mode != CONTROLMODE_TIMECODE_TRIGGER && mode != CONTROLMODE_EXTERNALTTL_TRIGGER && mode != CONTROLMODE_EXTERNALTTL_EDGE_TRIGGER) {
return kxs_ec_param_error;
}
return reg_write(reg::record_sig_gen_ctrl_control_mode, mode);

11
src/xsync_v2_sig_type.cpp

@ -41,13 +41,18 @@ string XsyncTimecodeToStr(XsyncTimecode_t timecode) {
return string(buf);
}
XsyncTimecode_t Str2XsyncTimecode(string timecode) {
XsyncTimecode_t ret;
char buf[128] = {0};
XsyncTimecode_t ret = {0};
char buf[256] = {0};
strncpy(buf, timecode.c_str(), 127);
sscanf(buf, "%02d:%02d:%02d:%02d", &ret.hour, &ret.minute, &ret.second, &ret.frame);
return ret;
}
void Str2XsyncTimecode(string timecode, XsyncTimecode_t &code) {
char buf[256] = {0};
strncpy(buf, timecode.c_str(), 127);
sscanf(buf, "%02d:%02d:%02d:%02d", &code.hour, &code.minute, &code.second, &code.frame);
}
/*******************************************************************************
* GENLOCK *
*******************************************************************************/
@ -132,7 +137,7 @@ list<string> SignalTypeStrSet() {
/*******************************************************************************
* *
*******************************************************************************/
static map<string, ControlMode_t> ControlModeMap = { //
static map<string, ControlMode_t> ControlModeMap = { //
{"ALWAYS_START", CONTROLMODE_ALWAYS_START}, //
{"MANUAL_TRIGGER", CONTROLMODE_MANUAL_TRIGGER}, //
{"TIMECODE_TRIGGER", CONTROLMODE_TIMECODE_TRIGGER}, //

Loading…
Cancel
Save