| 109 | } |
| 110 | |
| 111 | void ModelProperty::validate(const ModelProperty& other) const |
| 112 | { |
| 113 | if (_name != other._name) { |
| 114 | throw InvalidProperty("Model names don't match"); |
| 115 | } |
| 116 | if (getDisplayName() != other.getDisplayName()) { |
| 117 | Base::Console().log("Local display name '%s'\n", getDisplayName().toStdString().c_str()); |
| 118 | Base::Console().log("Remote display name '%s'\n", |
| 119 | other.getDisplayName().toStdString().c_str()); |
| 120 | throw InvalidProperty("Model display names don't match"); |
| 121 | } |
| 122 | if (_propertyType != other._propertyType) { |
| 123 | throw InvalidProperty("Model property types don't match"); |
| 124 | } |
| 125 | if (_units != other._units) { |
| 126 | throw InvalidProperty("Model units don't match"); |
| 127 | } |
| 128 | if (_url != other._url) { |
| 129 | throw InvalidProperty("Model URLs don't match"); |
| 130 | } |
| 131 | if (_description != other._description) { |
| 132 | throw InvalidProperty("Model descriptions don't match"); |
| 133 | } |
| 134 | if (_inheritance != other._inheritance) { |
| 135 | throw InvalidProperty("Model inheritance don't match"); |
| 136 | } |
| 137 | |
| 138 | if (_columns.size() != other._columns.size()) { |
| 139 | Base::Console().log("Local property column count %d\n", _columns.size()); |
| 140 | Base::Console().log("Remote property column count %d\n", other._columns.size()); |
| 141 | throw InvalidProperty("Model property column counts don't match"); |
| 142 | } |
| 143 | for (size_t i = 0; i < _columns.size(); i++) { |
| 144 | _columns[i].validate(other._columns[i]); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | TYPESYSTEM_SOURCE(Materials::Model, Base::BaseClass) |
| 149 |
no test coverage detected