Compare commits
2 Commits
872b5e7b3d
...
4df06ee57b
Author | SHA1 | Date | |
---|---|---|---|
4df06ee57b | |||
670780e328 |
6
dependencies/control_system/client/main.cpp
vendored
6
dependencies/control_system/client/main.cpp
vendored
@ -149,8 +149,6 @@ EXTERNC CP_Result CP_GetDemodulatorSettings(TSID sid, demodulator_settings& sett
|
||||
auto resp = clients[sid]->send_get_demodulator_settings(settings_com);
|
||||
if (resp == response_type::error)
|
||||
return ERROR;
|
||||
std::cout << "settings_com.rollof: " << settings_com.rollof << std::endl;
|
||||
std::cout << "settings_com.gain: " << settings_com.gain << std::endl;
|
||||
settings = reinterpret_cast<demodulator_settings&>(settings_com);
|
||||
return OK;
|
||||
}
|
||||
@ -1029,6 +1027,8 @@ EXTERNC CP_Result CP_GetDemodulatorParams(TSID sid, const char *demodulator_para
|
||||
demod_val = getdemodulator_value::type_pack;
|
||||
else if (param_name == "is_pilots")
|
||||
demod_val = getdemodulator_value::is_pilots;
|
||||
else if (param_name == "is_pilots_insert")
|
||||
demod_val = getdemodulator_value::is_pilots_insert;
|
||||
else return ERROR;
|
||||
|
||||
auto resp = clients[sid]->send_get_demodulator_param(demod_val, par_from_server);
|
||||
@ -1079,6 +1079,8 @@ EXTERNC CP_Result CP_DemodulatorParams(TSID sid, const char *demodulator_param,
|
||||
demod_val = demodulator_value::attitude_signals;
|
||||
else if (param_name == "reset_cinc")
|
||||
demod_val = demodulator_value::is_reset_CinC;
|
||||
else if (param_name == "is_pilots_insert")
|
||||
demod_val = demodulator_value::is_pilots_insert;
|
||||
else return ERROR;
|
||||
auto resp = clients[sid]->send_set_demodulator_param(demod_val,value);
|
||||
if (resp == response_type::error)
|
||||
|
@ -715,7 +715,8 @@ response_type system_client::send_get_qos_params(std::string &node, const name_c
|
||||
return result;
|
||||
}
|
||||
|
||||
response_type system_client::send_set_qos_settings_json(const std::string &json_string, bool is_enable){
|
||||
response_type system_client::send_set_qos_settings_json(const std::string &json_string, bool is_enable)
|
||||
{
|
||||
std::scoped_lock lock(cmd_in_progress_mtx);
|
||||
uint32_t curr_id{++cmd_id};
|
||||
cmd_header cmd_qos_header{curr_id, cmd_type::set_qos_settings_json};
|
||||
@ -730,7 +731,8 @@ response_type system_client::send_set_qos_settings_json(const std::string &json_
|
||||
return result;
|
||||
}
|
||||
|
||||
response_type system_client::send_get_qos_settings_json(std::string &json_string, bool &is_enable){
|
||||
response_type system_client::send_get_qos_settings_json(std::string &json_string, bool &is_enable)
|
||||
{
|
||||
std::scoped_lock lock(cmd_in_progress_mtx);
|
||||
uint32_t curr_id{++cmd_id};
|
||||
cmd_header cmd_qos_header{curr_id, cmd_type::get_qos_settings_json};
|
||||
@ -746,6 +748,7 @@ response_type system_client::send_get_qos_settings_json(std::string &json_string
|
||||
json_string = std::any_cast<cmd_qos_settings>(data_from_serv).json_string;
|
||||
is_enable = std::any_cast<cmd_qos_settings>(data_from_serv).is_enable;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,7 @@ struct modulator_settings_com{
|
||||
bool tx_is_on;
|
||||
bool is_cinc;
|
||||
uint32_t modcod_tx;
|
||||
bool qold_seq_is_active;
|
||||
};
|
||||
|
||||
struct modulator_state_com{
|
||||
@ -85,6 +86,7 @@ struct demodulator_settings_com
|
||||
bool is_aru_on;
|
||||
bool is_rvt_iq;
|
||||
double gain;
|
||||
bool qold_seq_is_active;
|
||||
};
|
||||
|
||||
struct demodulator_state_com{
|
||||
@ -110,7 +112,7 @@ struct CinC_state_com{
|
||||
float ratio_signal_signal;
|
||||
bool carrier_lock;
|
||||
int32_t freq_error_offset;
|
||||
uint32_t delay_dpdi;
|
||||
float delay_dpdi;
|
||||
int32_t freq_fine_estimate;
|
||||
uint32_t cnt_bad_lock;
|
||||
};
|
||||
@ -269,7 +271,8 @@ enum class demodulator_value
|
||||
mode_demod = 10,
|
||||
gold_seq = 11,
|
||||
attitude_signals = 12,
|
||||
is_reset_CinC = 13
|
||||
is_reset_CinC = 13,
|
||||
is_pilots_insert = 14
|
||||
};
|
||||
enum class getdemodulator_value
|
||||
{
|
||||
@ -294,7 +297,8 @@ enum class getdemodulator_value
|
||||
freq_fine_estimate = 18,
|
||||
is_reset_CinC = 19,
|
||||
type_pack = 20,
|
||||
is_pilots = 21
|
||||
is_pilots = 21,
|
||||
is_pilots_insert = 22
|
||||
};
|
||||
|
||||
enum class gain_value
|
||||
@ -448,7 +452,7 @@ struct cmd_demodulator_settings
|
||||
{
|
||||
archive(demodulator_settings.baudrate,demodulator_settings.central_freq_in_kGz,
|
||||
demodulator_settings.gain, demodulator_settings.is_aru_on,
|
||||
demodulator_settings.is_rvt_iq, demodulator_settings.rollof);
|
||||
demodulator_settings.is_rvt_iq, demodulator_settings.rollof, demodulator_settings.qold_seq_is_active);
|
||||
}
|
||||
};
|
||||
|
||||
@ -477,7 +481,7 @@ struct cmd_modulator_settings
|
||||
archive(modulator_settings.attenuation,modulator_settings.baudrate, modulator_settings.central_freq_in_kGz,
|
||||
modulator_settings.is_carrier, modulator_settings.is_cinc,
|
||||
modulator_settings.is_save_current_state, modulator_settings.is_test_data,
|
||||
modulator_settings.rollof, modulator_settings.tx_is_on, modulator_settings.modcod_tx);
|
||||
modulator_settings.rollof, modulator_settings.tx_is_on, modulator_settings.modcod_tx, modulator_settings.qold_seq_is_active);
|
||||
}
|
||||
|
||||
};
|
||||
@ -568,6 +572,7 @@ struct cmd_get_acm_param
|
||||
archive(enable, max_attenuation, max_modcod, min_attenuation, min_modcod, snr_treashold, enable_auto_atten, snr_treashold_acm, period_pack);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_qos_settings{
|
||||
std::string json_string;
|
||||
bool is_enable;
|
||||
@ -577,6 +582,7 @@ struct cmd_qos_settings{
|
||||
archive(json_string, is_enable);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_set_qos_settings
|
||||
{
|
||||
std::string node;
|
||||
|
@ -1,76 +0,0 @@
|
||||
#include "include/terminal_api/ControlProtoCInterface.h"
|
||||
#include <iostream>
|
||||
int main()
|
||||
{
|
||||
TSID sid{0};
|
||||
unsigned int access{0};
|
||||
if(CP_Login("admin","pass",&sid,&access) == OK)
|
||||
{
|
||||
std::cout << "Succsec" << std::endl;
|
||||
}
|
||||
CinC_state state_cinc;
|
||||
state_cinc.carrier_lock = false;
|
||||
CP_GetCinCState(sid,state_cinc);
|
||||
std::cout << state_cinc.carrier_lock << std::endl;
|
||||
std::cout << state_cinc.freq_error_offset << std::endl;
|
||||
std::cout << state_cinc.delay_dpdi << std::endl;
|
||||
std::cout << state_cinc.cnt_bad_lock << std::endl;
|
||||
modulator_state modulator;
|
||||
CP_GetModulatorState(sid, modulator);
|
||||
std::cout << modulator.is_pilots << "\n"
|
||||
<< modulator.modcod << "\n"
|
||||
<< modulator.snr_remote << "\n";
|
||||
demodulator_state demodulator;
|
||||
demodulator.dummy_cnt = 11111;
|
||||
CP_GetDemodulatorState(sid, demodulator);
|
||||
std::cout << "end CP_GetDemodulatorState" << std::endl;
|
||||
std::cout << demodulator.is_short << std::endl;
|
||||
std::cout << demodulator.modcod << std::endl;
|
||||
std::cout << "afc_lock: " <<demodulator.locks.afc_lock << std::endl;
|
||||
std::cout << "sym_sync_lock: " <<demodulator.locks.sym_sync_lock << std::endl;
|
||||
std::cout << "freq_lock: " <<demodulator.locks.freq_lock << std::endl;
|
||||
std::cout << "pkt_sync: " << demodulator.locks.pkt_sync << std::endl;
|
||||
modulator_settings setting_modulator;
|
||||
setting_modulator.baudrate = 2000000;
|
||||
setting_modulator.central_freq_in_kGz = 1340000.24;
|
||||
setting_modulator.rollof = 0.25;
|
||||
setting_modulator.tx_is_on = true;
|
||||
setting_modulator.is_test_data = false;
|
||||
setting_modulator.is_save_current_state = true;
|
||||
setting_modulator.is_cinc = false;
|
||||
setting_modulator.is_carrier = true;
|
||||
CP_SetModulatorSettings(sid, setting_modulator);
|
||||
demodulator_settings demodulator_sett;
|
||||
demodulator_sett.baudrate = 1340000;
|
||||
demodulator_sett.central_freq_in_kGz = 2400000.34;
|
||||
demodulator_sett.is_rvt_iq = true;
|
||||
demodulator_sett.is_aru_on = true;
|
||||
demodulator_sett.gain = 13;
|
||||
demodulator_sett.rollof = 0.15;
|
||||
if(CP_SetDemodulatorSettings(sid, demodulator_sett)== OK)
|
||||
{
|
||||
std::cout << "OK SET DEMODULATOR SETTINGS" << std::endl;
|
||||
}
|
||||
demodulator_settings demodulator_settings_;
|
||||
if(CP_GetDemodulatorSettings(sid,demodulator_settings_) == OK)
|
||||
{
|
||||
std::cout << "OK GET DEMODULATOR SETTINGS" << std::endl;
|
||||
std::cout << demodulator_settings_.baudrate << std::endl;
|
||||
std::cout << demodulator_settings_.gain<< std::endl;
|
||||
std::cout << demodulator_settings_.rollof << std::endl;
|
||||
std::cout << demodulator_settings_.is_aru_on << std::endl;
|
||||
std::cout << demodulator_settings_.is_rvt_iq << std::endl;
|
||||
std::cout << demodulator_settings_.central_freq_in_kGz << std::endl;
|
||||
}
|
||||
modulator_settings modulator_settings_;
|
||||
if(CP_GetModulatorSettings(sid,modulator_settings_)== OK)
|
||||
{
|
||||
std::cout << "OK GET MODULATOR SETTINGS" << std::endl;
|
||||
std::cout << modulator_settings_.baudrate << std::endl;
|
||||
std::cout << modulator_settings_.attenuation << std::endl;
|
||||
std::cout << modulator_settings_.central_freq_in_kGz << std::endl;
|
||||
std::cout << modulator_settings_.is_carrier << std::endl;
|
||||
std::cout << modulator_settings_.is_cinc << std::endl;
|
||||
std::cout << modulator_settings_.rollof << std::endl;
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
#ifndef __CONTROL_PROTO_COMMANDS__
|
||||
#define __CONTROL_PROTO_COMMANDS__
|
||||
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@ -116,7 +115,7 @@ struct CinC_state{
|
||||
float ratio_signal_signal;
|
||||
bool carrier_lock;
|
||||
int32_t freq_error_offset;
|
||||
uint32_t delay_dpdi;
|
||||
float delay_dpdi;
|
||||
int32_t freq_fine_estimate;
|
||||
uint32_t cnt_bad_lock;
|
||||
};
|
||||
@ -140,6 +139,7 @@ struct modulator_settings{
|
||||
bool tx_is_on;
|
||||
bool is_cinc;
|
||||
uint32_t modcod_tx;
|
||||
bool qold_seq_is_active;
|
||||
};
|
||||
|
||||
EXTERNC CP_Result CP_SetModulatorSettings(TSID sid, modulator_settings& settings);
|
||||
@ -153,6 +153,7 @@ struct demodulator_settings
|
||||
bool is_aru_on;
|
||||
bool is_rvt_iq;
|
||||
double gain;
|
||||
bool qold_seq_is_active;
|
||||
};
|
||||
|
||||
EXTERNC CP_Result CP_SetDemodulatorSettings(TSID sid, demodulator_settings& settings);
|
||||
|
@ -778,7 +778,7 @@ std::string api_driver::ApiDriver::loadTerminalState() const {
|
||||
result << ",\"cinc.correlatorFails\":" << cinc.cnt_bad_lock;
|
||||
result << ",\"cinc.freqErr\":" << cinc.freq_error_offset;
|
||||
result << ",\"cinc.freqErrAcc\":" << cinc.freq_fine_estimate;
|
||||
result << ",\"cinc.channelDelay\":" << cinc.delay_dpdi;
|
||||
result << ",\"cinc.channelDelay\":"; writeDouble(result, cinc.delay_dpdi, 1);
|
||||
} else {
|
||||
result << R"(,"cinc.correlator":null)";
|
||||
}
|
||||
@ -826,6 +826,7 @@ std::string api_driver::ApiDriver::loadSettings() const {
|
||||
result << ",\"general.isTestInputData\":" << boolAsStr(modSettings.is_test_data);
|
||||
result << ",\n\"tx.attenuation\":"; writeDouble(result, modSettings.attenuation);
|
||||
result << ",\"tx.rolloff\":" << static_cast<int>(modSettings.rollof * 100);
|
||||
result << ",\"tx.goldan\":" << static_cast<int>(modSettings.qold_seq_is_active);
|
||||
result << ",\"tx.cymRate\":" << modSettings.baudrate;
|
||||
result << ",\"tx.centerFreq\":"; writeDouble(result, modSettings.central_freq_in_kGz, 3);
|
||||
result << ",\"dvbs2.frameSizeNormal\":" << boolAsStr(!(modSettings.modcod_tx & 2));
|
||||
@ -847,6 +848,7 @@ std::string api_driver::ApiDriver::loadSettings() const {
|
||||
result << ",\"rx.manualGain\":"; writeDouble(result, demodSettings.gain);
|
||||
result << ",\"rx.spectrumInversion\":" << boolAsStr(demodSettings.is_rvt_iq);
|
||||
result << ",\"rx.rolloff\":" << static_cast<int>(demodSettings.rollof * 100);
|
||||
result << ",\"rx.goldan\":" << static_cast<int>(demodSettings.qold_seq_is_active);
|
||||
result << ",\"rx.cymRate\":" << demodSettings.baudrate;
|
||||
result << ",\"rx.centerFreq\":"; writeDouble(result, demodSettings.central_freq_in_kGz);
|
||||
|
||||
@ -943,6 +945,7 @@ void api_driver::ApiDriver::setRxTxSettings(boost::property_tree::ptree &pt) {
|
||||
mod.is_test_data = pt.get<bool>(json_path("general.isTestInputData", '/'));
|
||||
mod.attenuation = pt.get<double>(json_path("tx.attenuation", '/'));
|
||||
mod.rollof = pt.get<double>(json_path("tx.rolloff", '/')) / 100.0;
|
||||
mod.qold_seq_is_active = pt.get<int>(json_path("tx.goldan", '/'));
|
||||
mod.baudrate = pt.get<uint32_t>(json_path("tx.cymRate", '/'));
|
||||
mod.central_freq_in_kGz = pt.get<double>(json_path("tx.centerFreq", '/'));
|
||||
|
||||
@ -959,6 +962,7 @@ void api_driver::ApiDriver::setRxTxSettings(boost::property_tree::ptree &pt) {
|
||||
// демодулятор
|
||||
#ifdef MODEM_IS_SCPC
|
||||
tmp = pt.get<std::string>(json_path("rx.gainMode", '/'));
|
||||
demod.qold_seq_is_active = pt.get<int>(json_path("rx.goldan", '/'));
|
||||
#else
|
||||
auto tmp = pt.get<std::string>(json_path("rx.gainMode", '/'));
|
||||
#endif
|
||||
|
@ -189,6 +189,13 @@
|
||||
<span>Ослабление, дБ</span>
|
||||
<input v-model="param.tx.attenuation" type="number" step="0.01"/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Последовательность Голда</span>
|
||||
<select v-model="param.tx.goldan">
|
||||
<option :value="0">0</option>
|
||||
<option :value="1">1</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="settings-set-container">
|
||||
@ -335,6 +342,13 @@
|
||||
<option :value="25">0.25</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span>Последовательность Голда</span>
|
||||
<select v-model="param.rx.goldan">
|
||||
<option :value="0">0</option>
|
||||
<option :value="1">1</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<button class="action-button" @click="settingsSubmitRxTx()">Сохранить <span class="submit-spinner" v-show="submitStatus.rxTx"></span></button>
|
||||
@ -865,6 +879,7 @@
|
||||
rolloff: Number,
|
||||
cymRate: Number,
|
||||
centerFreq: Number,
|
||||
goldan: 0,
|
||||
},
|
||||
dvbs2: {
|
||||
mode: null, // ccm/acm
|
||||
@ -898,6 +913,7 @@
|
||||
rolloff: 0,
|
||||
cymRate: 100000,
|
||||
centerFreq: 1200000.0,
|
||||
goldan: 0,
|
||||
},
|
||||
|
||||
cinc: {
|
||||
@ -1076,6 +1092,7 @@
|
||||
"general.isTestInputData": this.param.general.isTestInputData,
|
||||
"tx.attenuation": this.param.tx.attenuation,
|
||||
"tx.rolloff": this.param.tx.rolloff,
|
||||
"tx.goldan": this.param.tx.goldan,
|
||||
"tx.cymRate": this.param.tx.cymRate,
|
||||
"tx.centerFreq": this.param.tx.centerFreq,
|
||||
"dvbs2.isAcm": this.param.dvbs2.mode === 'acm',
|
||||
@ -1093,6 +1110,7 @@
|
||||
"rx.manualGain": this.param.rx.manualGain,
|
||||
"rx.spectrumInversion": this.param.rx.spectrumInversion,
|
||||
"rx.rolloff": this.param.rx.rolloff,
|
||||
"rx.goldan": this.param.rx.goldan,
|
||||
"rx.cymRate": this.param.rx.cymRate,
|
||||
"rx.centerFreq": this.param.rx.centerFreq
|
||||
}
|
||||
@ -1396,6 +1414,7 @@
|
||||
|
||||
this.param.tx.attenuation = vals["settings"]["tx.attenuation"]
|
||||
this.param.tx.rolloff = vals["settings"]["tx.rolloff"]
|
||||
this.param.tx.goldan = vals["settings"]["tx.goldan"]
|
||||
this.param.tx.cymRate = vals["settings"]["tx.cymRate"]
|
||||
this.param.tx.centerFreq = vals["settings"]["tx.centerFreq"]
|
||||
|
||||
@ -1425,6 +1444,7 @@
|
||||
this.param.rx.manualGain = vals["settings"]["rx.manualGain"]
|
||||
this.param.rx.spectrumInversion = vals["settings"]["rx.spectrumInversion"]
|
||||
this.param.rx.rolloff = vals["settings"]["rx.rolloff"]
|
||||
this.param.rx.goldan = vals["settings"]["rx.goldan"]
|
||||
this.param.rx.cymRate = vals["settings"]["rx.cymRate"]
|
||||
this.param.rx.centerFreq = vals["settings"]["rx.centerFreq"]
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user