TriggerEvent tests working

This commit is contained in:
Ralph Wessel
2024-08-29 23:29:50 +01:00
parent cf3aa86ee4
commit 9a8087b180
3 changed files with 2 additions and 10 deletions
@@ -12,13 +12,11 @@ namespace {
///Serialisation fields
enum FieldIndex {
arg0,
darkTheme,
};
///Serialisation field IDs
static std::array fieldID = {
Identity{"0"},
Identity{"darkTheme"},
};
@@ -33,9 +31,6 @@ namespace {
--------------------------------------------------------------------*/
bool ConnectorConfig::fillInventory(Inventory& inventory) const {
using enum Entry::Type;
//When used as an argument template, this wrapper is expected to be first in the list
if (isArgumentTemplate())
inventory.merge({ fieldID[arg0], arg0, element, true, &typeid(ConnectorConfig) });
inventory.merge(Inventory{
{
{ fieldID[darkTheme], darkTheme, element },
@@ -57,9 +52,6 @@ Cargo::Unique ConnectorConfig::getCargo(const Inventory::Item& item) const {
return nullptr;
using namespace active::serialise;
switch (item.index) {
case arg0:
//This structure is the first argument
return std::make_unique<PackageWrap>(*this);
case darkTheme:
return std::make_unique<ValueWrap<bool>>(isDarkTheme);
default:
@@ -9,7 +9,7 @@ namespace connector::interfac::browser::bridge {
/*!
Configuration settings class
*/
class ConnectorConfig : public active::serialise::Package, virtual public speckle::interfac::browser::bridge::ArgumentBase {
class ConnectorConfig : public active::serialise::Package {
public:
// MARK: - Types
@@ -141,7 +141,7 @@ std::unique_ptr<BridgeArgument> BridgeArgumentWrap::makeArgument(const String& m
if (args.size() != result->parameterCount())
throw Exception{"Function called with wrong number of parameters"};
String unifiedArgument;
if (dynamic_cast<Package*>(result) != nullptr) {
if ((args.size() > 1) && dynamic_cast<Package*>(result) != nullptr) {
//Unify the argument strings into a single JSON argument
unifiedArgument = "{";
int32_t argIndex = 0;