Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/GDTFManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5803,6 +5803,7 @@ GdtfDmxChannel* GdtfDmxLogicalChannel::GetParentDMXChannel() const
GdtfDmxChannelFunction::GdtfDmxChannelFunction(GdtfDmxLogicalChannel* parent)
{
fDefaultValue = 0;
fDefaultValueNone = true;
fAdressStart = 0;
fPhysicalStart = 0;
fPhysicalEnd = 1;
Expand Down Expand Up @@ -5837,6 +5838,7 @@ GdtfDmxChannelFunction::GdtfDmxChannelFunction(const TXString& name, GdtfDmxLogi
{
fName = name;
fDefaultValue = 0;
fDefaultValueNone = true;
fAdressStart = 0;
fPhysicalStart = 0;
fPhysicalEnd = 1;
Expand Down Expand Up @@ -5897,6 +5899,7 @@ void GdtfDmxChannelFunction::SetOriginalAttribute(const TXString &attribute)
void GdtfDmxChannelFunction::SetDefaultValue(DmxValue defaultValue)
{
fDefaultValue = defaultValue;
fDefaultValueNone = false;
}

void GdtfDmxChannelFunction::SetStartAddress(DmxValue address)
Expand Down Expand Up @@ -5950,7 +5953,7 @@ void GdtfDmxChannelFunction::OnPrintToFile(IXMLFileNodePtr pNode)
// Print node attributes
pNode->SetNodeAttributeValue(XML_GDTF_DMXChannelFuntionName, fName);

pNode->SetNodeAttributeValue(XML_GDTF_DMXChannelFuntionDefault, GdtfConverter::ConvertDMXValue(fDefaultValue, chanelReso));
pNode->SetNodeAttributeValue(XML_GDTF_DMXChannelFuntionDefault, GdtfConverter::ConvertDMXValue(fDefaultValue, chanelReso, fDefaultValueNone));
pNode->SetNodeAttributeValue(XML_GDTF_DMXChannelFuntionDMXFrom, GdtfConverter::ConvertDMXValue(fAdressStart, chanelReso));
pNode->SetNodeAttributeValue(XML_GDTF_DMXChannelFuntionPhysicalFrom, GdtfConverter::ConvertDouble(fPhysicalStart));
pNode->SetNodeAttributeValue(XML_GDTF_DMXChannelFuntionPhysicalTo, GdtfConverter::ConvertDouble(fPhysicalEnd));
Expand Down Expand Up @@ -6077,7 +6080,9 @@ void GdtfDmxChannelFunction::OnReadFromNode(const IXMLFileNodePtr& pNode)

pNode->GetNodeAttributeValue(XML_GDTF_DMXChannelFuntionName, fName);
pNode->GetNodeAttributeValue(XML_GDTF_DMXChannelFuntionOriginalAttribute, fOrignalAttribute);
TXString defaultValue; pNode->GetNodeAttributeValue(XML_GDTF_DMXChannelFuntionDefault, defaultValue); GdtfConverter::ConvertDMXValue(defaultValue, pNode, channelReso,fDefaultValue);
TXString defaultValue;
if(VCOM_SUCCEEDED(pNode->GetNodeAttributeValue(XML_GDTF_DMXChannelFuntionDefault, defaultValue)))
GdtfConverter::ConvertDMXValue(defaultValue, pNode, channelReso, fDefaultValue, fDefaultValueNone);
TXString dmxFrom; pNode->GetNodeAttributeValue(XML_GDTF_DMXChannelFuntionDMXFrom, dmxFrom); GdtfConverter::ConvertDMXValue(dmxFrom, pNode, channelReso,fAdressStart);
TXString physFrom; pNode->GetNodeAttributeValue(XML_GDTF_DMXChannelFuntionPhysicalFrom, physFrom); GdtfConverter::ConvertDouble(physFrom, pNode, fPhysicalStart);
TXString physTo; pNode->GetNodeAttributeValue(XML_GDTF_DMXChannelFuntionPhysicalTo, physTo); GdtfConverter::ConvertDouble(physTo, pNode, fPhysicalEnd);
Expand Down Expand Up @@ -6250,6 +6255,11 @@ DmxValue GdtfDmxChannelFunction::GetDefaultValue() const
return fDefaultValue;
}

bool GdtfDmxChannelFunction::HasDefaultValue() const
{
return !fDefaultValueNone;
}

DmxValue GdtfDmxChannelFunction::GetStartAdress() const
{
return fAdressStart;
Expand Down
2 changes: 2 additions & 0 deletions src/GDTFManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,7 @@ namespace SceneData
GdtfAttribute* fAttribute;
TXString fOrignalAttribute;
DmxValue fDefaultValue;
bool fDefaultValueNone;
DmxValue fAdressStart;
double fPhysicalStart;
double fPhysicalEnd;
Expand Down Expand Up @@ -1676,6 +1677,7 @@ namespace SceneData
GdtfAttribute* GetAttribute();
const TXString& GetOriginalAttribute();
DmxValue GetDefaultValue() const;
bool HasDefaultValue() const;
DmxValue GetStartAdress() const;
DmxValue GetEndAdress() const;
double GetPhysicalStart() const;
Expand Down
10 changes: 10 additions & 0 deletions src/Implementation/CGdtfDmxChannelFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfDmxChannelFunctionImpl::GetDefaul
return kVCOMError_NoError;
}

VectorworksMVR::VCOMError VectorworksMVR::CGdtfDmxChannelFunctionImpl::HasDefaultValue(bool &defaultValue)
{
// Check Pointer
if ( ! fFunction) { return kVCOMError_NotInitialized; }

defaultValue = fFunction->HasDefaultValue();

return kVCOMError_NoError;
}

VectorworksMVR::VCOMError VectorworksMVR::CGdtfDmxChannelFunctionImpl::GetStartAddress(DmxValue& address)
{
// Check Pointer
Expand Down
1 change: 1 addition & 0 deletions src/Implementation/CGdtfDmxChannelFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace VectorworksMVR
virtual VCOMError VCOM_CALLTYPE GetAttribute(IGdtfAttribute** attribute);
virtual MvrString VCOM_CALLTYPE GetOriginalAttribute();
virtual VCOMError VCOM_CALLTYPE GetDefaultValue(DmxValue& defaultValue);
virtual VCOMError VCOM_CALLTYPE HasDefaultValue(bool& defaultValue);
virtual VCOMError VCOM_CALLTYPE GetStartAddress(DmxValue& address);
virtual VCOMError VCOM_CALLTYPE GetEndAddress(DmxValue& address);
virtual VCOMError VCOM_CALLTYPE GetPhysicalStart(double& start);
Expand Down
2 changes: 2 additions & 0 deletions src/Include/IMediaRessourceVectorInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,8 @@ namespace VectorworksMVR
virtual VCOMError VCOM_CALLTYPE GetDmxSubChannelSetCount(size_t& count) = 0;
virtual VCOMError VCOM_CALLTYPE GetDmxSubChannelSetAt(size_t at, IGdtfDmxSubChannelSet** subChannelSet) = 0;
virtual VCOMError VCOM_CALLTYPE CreateDmxSubChannelSet(MvrString name, IGdtfSubPhysicalUnit* subPhysicalUnit, IGdtfDmxSubChannelSet** subChannelSet) = 0;

virtual VCOMError VCOM_CALLTYPE HasDefaultValue(bool& defaultValue) = 0;
};
typedef VCOMPtr<IGdtfDmxChannelFunction> IGdtfDmxChannelFunctionPtr;

Expand Down