@@ -138,3 +138,43 @@ void CAR::setAffectedChannelState (int channel, bool newState)
138138 m_affectedChannels.add (channel);
139139}
140140
141+ void CAR::saveCustomChannelParametersToXml (XmlElement* channelElement,
142+ int channelNumber, InfoObjectCommon::InfoObjectType channelType)
143+ {
144+ if (channelType == InfoObjectCommon::DATA_CHANNEL)
145+ {
146+ XmlElement* groupState = channelElement->createNewChildElement (" GROUPSTATE" );
147+
148+ const Array<int >& referenceChannels = getReferenceChannels ();
149+ bool isReferenceChannel = referenceChannels.contains (channelNumber);
150+ groupState->setAttribute (" reference" , isReferenceChannel);
151+
152+ const Array<int >& affectedChannels = getAffectedChannels ();
153+ bool isAffectedChannel = affectedChannels.contains (channelNumber);
154+ groupState->setAttribute (" affected" , isAffectedChannel);
155+ }
156+ }
157+
158+ void CAR::loadCustomChannelParametersFromXml (XmlElement* channelElement,
159+ InfoObjectCommon::InfoObjectType channelType)
160+ {
161+ if (channelType == InfoObjectCommon::DATA_CHANNEL)
162+ {
163+ int channelNumber = channelElement->getIntAttribute (" number" );
164+
165+ forEachXmlChildElementWithTagName (*channelElement, groupState, " GROUPSTATE" )
166+ {
167+ if (groupState->hasAttribute (" reference" ))
168+ {
169+ bool isReferenceChannel = groupState->getBoolAttribute (" reference" );
170+ setReferenceChannelState (channelNumber, isReferenceChannel);
171+ }
172+
173+ if (groupState->hasAttribute (" affected" ))
174+ {
175+ bool isAffectedChannel = groupState->getBoolAttribute (" affected" );
176+ setAffectedChannelState (channelNumber, isAffectedChannel);
177+ }
178+ }
179+ }
180+ }
0 commit comments