Question about using setModel function in SettingsResponse
AnsweredHello. This is Kim Jeong-ho, the developer of SnuaiLab.
I have a question about using setModel function(in SettingsResponse) in engineSettingsModel, deviceAgentSettingsModel Manifest.
I am trying to provide a UI that allows the user to select a model in EngineSetting and dynamically set the model. But it didn't work well. (Settings did not change dynamically.) To check if this is a Manifest problem, I applied it dynamically using setModel in DeviceAgent and it worked well. (I also confirmed that it is noError in getPluginInfo.) Did you intentionally disable the setModel function in Engine?
Photos and source code are shared below.


/*device_agent.cpp*/
Result<const ISettingsResponse*> DeviceAgent::settingsReceived()
{
const auto settingsResponse = new sdk::SettingsResponse();
const std::string settingsModel = settingValue(kEngineApplicationSetting);
if (settingsModel == "a")
{
settingsResponse->setModel(kEngineSettingsModel2);
}
else if (settingsModel == "b")
{
settingsResponse->setModel(kEngineSettingsModel3);
}
return settingsResponse;
}
/*engine.cpp*/
Result<const ISettingsResponse*> Engine::settingsReceived()
{
const auto settingsResponse = new sdk::SettingsResponse();
const std::string settingsModel = settingValue(kEngineApplicationSetting);
if (settingsModel == "a")
{
settingsResponse->setModel(kEngineSettingsModel2);
}
else if (settingsModel == "b")
{
settingsResponse->setModel(kEngineSettingsModel3);
}
/**/
return settingsResponse;
}
/*settings_model.h*/
static const std::string kEngineSettingsModel2 =
/*suppress newline*/ 1 + R"json(
{
"type": "Settings",
"items": [)json"
+ kEngineCommonSettingsModel
+ kEngineApplicationSettingsModel
+ kEngineVdSettingsModel
+ kEngineInferenceSettingsModel
+ R"json(
]
})json";
static const std::string kEngineSettingsModel3 =
/*suppress newline*/ 1 + R"json(
{
"type": "Settings",
"items": [)json"
+ kEngineCommonSettingsModel
+ kEngineApplicationSettingsModel
+ kEnginePdSettingsModel
+ kEngineInferenceSettingsModel
+ R"json(
]
})json";
static const std::string kEngineApplicationSettingsModel = R"json(
{
"type": "ComboBox",
"name": ")json" + kEngineApplicationSetting + R"json(",
"caption": "Application",
"description": "Choose one",
"defaultValue" : "a",
"range": ["a","b"]
},)json";
static const std::string kEnginePdSettingsModel = R"json(
{
"type": "GroupBox",
"caption": "Application Setting",
"items": [
{
"type": "CheckBoxGroup",
"name": ")json" + kPdAttributeSetting + R"json(",
"caption": "Attributes",
"description": "Choose Attributes",
"defaultValue" : ["p1"],
"range": ["p1", "p2", "p3"]
}
]
},
{
"type": "Separator"
},)json";
static const std::string kEngineVdSettingsModel = R"json(
{
"type": "GroupBox",
"caption": "Application Setting",
"items": [
{
"type": "ComboBox",
"name": ")json" + kVdCountrySetting + R"json(",
"caption": "Country",
"description": "Choose one",
"defaultValue" : "korea",
"range": ["korea","japan"]
}
]
},
{
"type": "Separator"
},)json";
-
Specifications
OS : Ubuntu 18.04
CPU : Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
RAM : 32G
VGA : GeForce RTX 2080 SUPER
Nx Client Version : 4.2.0.32836 R4
nxSdkVersion : 4.2.0 R3 / 4.2.0 R4
-
Hello jeongho kim ,
That's a bug. We're fixing it.
Here is the link to a similar case.
https://support.networkoptix.com/hc/en-us/community/posts/1500000559981/comments/1500000743862
JIRA-VMS-22575
JIRA-VMS-230730 -
Thank you for answer.
I have one other question about Engine Settings.
When the Engine Manifest Setting value is defined in the /.config/nx_kit/plugin.ini file, it is not applied immediately even if the server is restarted.
Also, if there is an error in the Engine Manifest or if the plugin.so file is extremely deleted from the bin/plugins folder, the existing Engine Setting Manifest can be checked when the server is restarted.
Is this reading what is stored in the cache? If it does, I'd like to know the path and how to not cache the manifest.0 -
Hi,
When the Engine Manifest Setting value is defined in the /.config/nx_kit/plugin.ini file
The folder name is wrong. It should be
$HOME/.config/nx_ini/Is this reading what is stored in the cache?
The plugin information displayed in the "System Administration" is stored in the database. It is done by intention. In case a plugin has generated metadata stored in the video archive, it has to be possible to identify this metadata.
I'd like to know the path and how to not cache the manifest.
At the moment, the only way to clean this plugin information is deleting the database and configuring the system from the scratch.
0
Please sign in to leave a comment.
Comments
3 comments