@@ -33,6 +33,12 @@ std::string Config::paramsJson()
3333 for (const auto ¶m : channelParams)
3434 arr << " channels." + std::string{channelName} + " ."
3535 + std::string{param};
36+
37+ if (channelName == " x" || channelName == " y" )
38+ for (const auto ¶m :
39+ getAccessorNames<AxisChannelProperties>())
40+ arr << " channels." + std::string{channelName} + " ."
41+ + std::string{param};
3642 }
3743 return res;
3844}
@@ -83,35 +89,39 @@ void Config::setChannelParam(const std::string &path,
8389
8490 if (property == " set" ) {
8591 if (parts.size () == 3 ) {
86- channel.reset () ;
92+ channel.set = {} ;
8793 options.markersInfo .clear ();
8894 return ;
8995 }
9096
91- if ( auto &listParser = ChannelSeriesList::Parser::instance ();
92- parts.size () == 4 ) {
97+ auto &listParser = ChannelSeriesList::Parser::instance ();
98+ if ( parts.size () == 4 ) {
9399 if (parts[3 ] == " begin" ) {
94- if (parts[2 ] == " set" ) channel.reset ();
95-
100+ if (parts[2 ] == " set" ) channel.set = {};
96101 options.markersInfo .clear ();
97102 listParser.table = &table.get ();
98103 listParser.channels .resize (std::stoull (value));
99104 return ;
100105 }
101-
102106 listParser.current = std::nullopt ;
103- listParser.path = parts;
104107 }
105- else {
108+ else
106109 listParser.current = std::stoull (parts.at (3 ));
107- listParser.path = parts;
108- }
110+ listParser.path = parts;
109111 }
110112
111113 if (property == " range" ) property += " ." + parts.at (3 );
112114
113115 if (auto &&accessor = getAccessor<Channel>(property).set )
114116 accessor (channel, value);
117+ else if (auto &&axisAccessor =
118+ getAccessor<AxisChannelProperties>(property).set ;
119+ (channelId == AxisId::x || channelId == AxisId::y)
120+ && axisAccessor)
121+ axisAccessor (
122+ options.getChannels ().axisPropsAt (
123+ channelId == AxisId::x ? AxisId::x : AxisId::y),
124+ value);
115125 else
116126 throw std::logic_error (
117127 path + " /" + value
@@ -130,6 +140,11 @@ std::string Config::getChannelParam(const std::string &path) const
130140
131141 if (auto &&accessor = getAccessor<Channel>(property).get )
132142 return accessor (channel);
143+ if (auto &&axisAccessor =
144+ getAccessor<AxisChannelProperties>(property).get ;
145+ (id == AxisId::x || id == AxisId::y) && axisAccessor)
146+ return axisAccessor (options.get ().getChannels ().axisPropsAt (
147+ id == AxisId::x ? AxisId::x : AxisId::y));
133148
134149 throw std::logic_error (path + " : invalid channel parameter" );
135150}
0 commit comments