Commit 15a84fe9 authored by Dominique Marcadet's avatar Dominique Marcadet

Merge branch '26-logcontrol-refers-to-a-log' into 'master'

Resolve "LogControl refers to a Log"

Closes #26

See merge request RiseClipseGroup/RiseClipseMetamodel_SCL2003!23
parents 1f363b91 44d5da31
......@@ -1049,3 +1049,5 @@ _UI_McSecurity_encryption_feature = Encryption
_UI_GSESettings_kdaParticipant_feature = Kda Participant
_UI_ConnectivityNode_ReferredByTerminal_feature = Referred By Terminal
_UI_Terminal_RefersToConnectivityNode_feature = Refers To Connectivity Node
_UI_Log_ReferredByLogControl_feature = Referred By Log Control
_UI_LogControl_RefersToLog_feature = Refers To Log
......@@ -68,6 +68,7 @@ public class LogControlItemProvider extends ControlWithTriggerOptItemProvider {
addPrefixPropertyDescriptor(object);
addReasonCodePropertyDescriptor(object);
addRefersToAnyLNPropertyDescriptor(object);
addRefersToLogPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
......@@ -270,6 +271,28 @@ public class LogControlItemProvider extends ControlWithTriggerOptItemProvider {
null));
}
/**
* This adds a property descriptor for the Refers To Log feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addRefersToLogPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_LogControl_RefersToLog_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_LogControl_RefersToLog_feature", "_UI_LogControl_type"),
SclPackage.eINSTANCE.getLogControl_RefersToLog(),
true,
false,
true,
null,
null,
null));
}
/**
* This returns LogControl.gif.
* <!-- begin-user-doc -->
......
......@@ -60,6 +60,7 @@ public class LogItemProvider extends UnNamingItemProvider {
super.getPropertyDescriptors(object);
addNamePropertyDescriptor(object);
addReferredByLogControlPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
......@@ -86,6 +87,28 @@ public class LogItemProvider extends UnNamingItemProvider {
null));
}
/**
* This adds a property descriptor for the Referred By Log Control feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addReferredByLogControlPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Log_ReferredByLogControl_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_Log_ReferredByLogControl_feature", "_UI_Log_type"),
SclPackage.eINSTANCE.getLog_ReferredByLogControl(),
true,
false,
true,
null,
null,
null));
}
/**
* This returns Log.gif.
* <!-- begin-user-doc -->
......
......@@ -1192,6 +1192,9 @@
eOpposite="#//AnyLN/Log"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="ReferredByLogControl" ordered="false"
upperBound="-1" eType="#//LogControl" transient="true" unsettable="true" resolveProxies="false"
eOpposite="#//LogControl/RefersToLog"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LogControl" eSuperTypes="#//ControlWithTriggerOpt">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="bufTime" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EIntegerObject"
......@@ -1216,6 +1219,8 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="RefersToAnyLN" ordered="false"
eType="#//AnyLN" transient="true" unsettable="true" resolveProxies="false"
eOpposite="#//AnyLN/ReferredByLogControl"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="RefersToLog" ordered="false"
eType="#//Log" transient="true" unsettable="true" resolveProxies="false" eOpposite="#//Log/ReferredByLogControl"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="LogSettings" eSuperTypes="#//ServiceSettings">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="intgPd" eType="#//ServiceSettingsEnum"
......
......@@ -658,6 +658,7 @@
<genClasses ecoreClass="SCL.ecore#//Log">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference SCL.ecore#//Log/AnyLN"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//Log/name"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SCL.ecore#//Log/ReferredByLogControl"/>
</genClasses>
<genClasses ecoreClass="SCL.ecore#//LogControl">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//LogControl/bufTime"/>
......@@ -670,6 +671,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//LogControl/reasonCode"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference SCL.ecore#//LogControl/AnyLN"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SCL.ecore#//LogControl/RefersToAnyLN"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference SCL.ecore#//LogControl/RefersToLog"/>
</genClasses>
<genClasses ecoreClass="SCL.ecore#//LogSettings">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute SCL.ecore#//LogSettings/intgPd"/>
......
......@@ -18,6 +18,8 @@
*/
package fr.centralesupelec.edf.riseclipse.iec61850.scl;
import org.eclipse.emf.common.util.EList;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Log</b></em>'.
......@@ -29,6 +31,7 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl;
* <ul>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.Log#getAnyLN <em>Any LN</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.Log#getName <em>Name</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.Log#getReferredByLogControl <em>Referred By Log Control</em>}</li>
* </ul>
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getLog()
......@@ -117,4 +120,45 @@ public interface Log extends UnNaming {
*/
boolean isSetName();
/**
* Returns the value of the '<em><b>Referred By Log Control</b></em>' reference list.
* The list contents are of type {@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl}.
* It is bidirectional and its opposite is '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getRefersToLog <em>Refers To Log</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Referred By Log Control</em>' reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Referred By Log Control</em>' reference list.
* @see #isSetReferredByLogControl()
* @see #unsetReferredByLogControl()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getLog_ReferredByLogControl()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getRefersToLog
* @model opposite="RefersToLog" resolveProxies="false" unsettable="true" transient="true" ordered="false"
* @generated
*/
EList<LogControl> getReferredByLogControl();
/**
* Unsets the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.Log#getReferredByLogControl <em>Referred By Log Control</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetReferredByLogControl()
* @see #getReferredByLogControl()
* @generated
*/
void unsetReferredByLogControl();
/**
* Returns whether the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.Log#getReferredByLogControl <em>Referred By Log Control</em>}' reference list is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Referred By Log Control</em>' reference list is set.
* @see #unsetReferredByLogControl()
* @see #getReferredByLogControl()
* @generated
*/
boolean isSetReferredByLogControl();
} // Log
......@@ -37,6 +37,7 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl;
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getReasonCode <em>Reason Code</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getAnyLN <em>Any LN</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getRefersToAnyLN <em>Refers To Any LN</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getRefersToLog <em>Refers To Log</em>}</li>
* </ul>
*
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getLogControl()
......@@ -556,4 +557,59 @@ public interface LogControl extends ControlWithTriggerOpt {
*/
boolean isSetRefersToAnyLN();
/**
* Returns the value of the '<em><b>Refers To Log</b></em>' reference.
* It is bidirectional and its opposite is '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.Log#getReferredByLogControl <em>Referred By Log Control</em>}'.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Refers To Log</em>' reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Refers To Log</em>' reference.
* @see #isSetRefersToLog()
* @see #unsetRefersToLog()
* @see #setRefersToLog(Log)
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage#getLogControl_RefersToLog()
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.Log#getReferredByLogControl
* @model opposite="ReferredByLogControl" resolveProxies="false" unsettable="true" transient="true" ordered="false"
* @generated
*/
Log getRefersToLog();
/**
* Sets the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getRefersToLog <em>Refers To Log</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Refers To Log</em>' reference.
* @see #isSetRefersToLog()
* @see #unsetRefersToLog()
* @see #getRefersToLog()
* @generated
*/
void setRefersToLog(Log value);
/**
* Unsets the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getRefersToLog <em>Refers To Log</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isSetRefersToLog()
* @see #getRefersToLog()
* @see #setRefersToLog(Log)
* @generated
*/
void unsetRefersToLog();
/**
* Returns whether the value of the '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getRefersToLog <em>Refers To Log</em>}' reference is set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return whether the value of the '<em>Refers To Log</em>' reference is set.
* @see #unsetRefersToLog()
* @see #getRefersToLog()
* @see #setRefersToLog(Log)
* @generated
*/
boolean isSetRefersToLog();
} // LogControl
......@@ -11280,6 +11280,15 @@ public interface SclPackage extends EPackage {
*/
int LOG__NAME = UN_NAMING_FEATURE_COUNT + 1;
/**
* The feature id for the '<em><b>Referred By Log Control</b></em>' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int LOG__REFERRED_BY_LOG_CONTROL = UN_NAMING_FEATURE_COUNT + 2;
/**
* The number of structural features of the '<em>Log</em>' class.
* <!-- begin-user-doc -->
......@@ -11287,7 +11296,7 @@ public interface SclPackage extends EPackage {
* @generated
* @ordered
*/
int LOG_FEATURE_COUNT = UN_NAMING_FEATURE_COUNT + 2;
int LOG_FEATURE_COUNT = UN_NAMING_FEATURE_COUNT + 3;
/**
* The number of operations of the '<em>Log</em>' class.
......@@ -11487,6 +11496,15 @@ public interface SclPackage extends EPackage {
*/
int LOG_CONTROL__REFERS_TO_ANY_LN = CONTROL_WITH_TRIGGER_OPT_FEATURE_COUNT + 9;
/**
* The feature id for the '<em><b>Refers To Log</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int LOG_CONTROL__REFERS_TO_LOG = CONTROL_WITH_TRIGGER_OPT_FEATURE_COUNT + 10;
/**
* The number of structural features of the '<em>Log Control</em>' class.
* <!-- begin-user-doc -->
......@@ -11494,7 +11512,7 @@ public interface SclPackage extends EPackage {
* @generated
* @ordered
*/
int LOG_CONTROL_FEATURE_COUNT = CONTROL_WITH_TRIGGER_OPT_FEATURE_COUNT + 10;
int LOG_CONTROL_FEATURE_COUNT = CONTROL_WITH_TRIGGER_OPT_FEATURE_COUNT + 11;
/**
* The number of operations of the '<em>Log Control</em>' class.
......@@ -23405,6 +23423,17 @@ public interface SclPackage extends EPackage {
*/
EAttribute getLog_Name();
/**
* Returns the meta object for the reference list '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.Log#getReferredByLogControl <em>Referred By Log Control</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference list '<em>Referred By Log Control</em>'.
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.Log#getReferredByLogControl()
* @see #getLog()
* @generated
*/
EReference getLog_ReferredByLogControl();
/**
* Returns the meta object for class '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl <em>Log Control</em>}'.
* <!-- begin-user-doc -->
......@@ -23525,6 +23554,17 @@ public interface SclPackage extends EPackage {
*/
EReference getLogControl_RefersToAnyLN();
/**
* Returns the meta object for the reference '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getRefersToLog <em>Refers To Log</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Refers To Log</em>'.
* @see fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl#getRefersToLog()
* @see #getLogControl()
* @generated
*/
EReference getLogControl_RefersToLog();
/**
* Returns the meta object for class '{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.LogSettings <em>Log Settings</em>}'.
* <!-- begin-user-doc -->
......
......@@ -24,6 +24,7 @@ import fr.centralesupelec.edf.riseclipse.iec61850.scl.AnyLN;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.IED;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.LDevice;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.LN;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.Log;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.LogControl;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.SclPackage;
import fr.centralesupelec.edf.riseclipse.iec61850.scl.util.SclSwitch;
......@@ -55,6 +56,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LogControlImpl#getReasonCode <em>Reason Code</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LogControlImpl#getAnyLN <em>Any LN</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LogControlImpl#getRefersToAnyLN <em>Refers To Any LN</em>}</li>
* <li>{@link fr.centralesupelec.edf.riseclipse.iec61850.scl.impl.LogControlImpl#getRefersToLog <em>Refers To Log</em>}</li>
* </ul>
*
* @generated
......@@ -311,6 +313,25 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
*/
protected boolean refersToAnyLNESet;
/**
* The cached value of the '{@link #getRefersToLog() <em>Refers To Log</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getRefersToLog()
* @generated
* @ordered
*/
protected Log refersToLog;
/**
* This is true if the Refers To Log reference has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean refersToLogESet;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -834,6 +855,101 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
return refersToAnyLNESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Log getRefersToLog() {
return refersToLog;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetRefersToLog(Log newRefersToLog, NotificationChain msgs) {
Log oldRefersToLog = refersToLog;
refersToLog = newRefersToLog;
boolean oldRefersToLogESet = refersToLogESet;
refersToLogESet = true;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, SclPackage.LOG_CONTROL__REFERS_TO_LOG, oldRefersToLog, newRefersToLog, !oldRefersToLogESet);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setRefersToLog(Log newRefersToLog) {
if (newRefersToLog != refersToLog) {
NotificationChain msgs = null;
if (refersToLog != null)
msgs = ((InternalEObject)refersToLog).eInverseRemove(this, SclPackage.LOG__REFERRED_BY_LOG_CONTROL, Log.class, msgs);
if (newRefersToLog != null)
msgs = ((InternalEObject)newRefersToLog).eInverseAdd(this, SclPackage.LOG__REFERRED_BY_LOG_CONTROL, Log.class, msgs);
msgs = basicSetRefersToLog(newRefersToLog, msgs);
if (msgs != null) msgs.dispatch();
}
else {
boolean oldRefersToLogESet = refersToLogESet;
refersToLogESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SclPackage.LOG_CONTROL__REFERS_TO_LOG, newRefersToLog, newRefersToLog, !oldRefersToLogESet));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicUnsetRefersToLog(NotificationChain msgs) {
Log oldRefersToLog = refersToLog;
refersToLog = null;
boolean oldRefersToLogESet = refersToLogESet;
refersToLogESet = false;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.UNSET, SclPackage.LOG_CONTROL__REFERS_TO_LOG, oldRefersToLog, null, oldRefersToLogESet);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetRefersToLog() {
if (refersToLog != null) {
NotificationChain msgs = null;
msgs = ((InternalEObject)refersToLog).eInverseRemove(this, SclPackage.LOG__REFERRED_BY_LOG_CONTROL, Log.class, msgs);
msgs = basicUnsetRefersToLog(msgs);
if (msgs != null) msgs.dispatch();
}
else {
boolean oldRefersToLogESet = refersToLogESet;
refersToLogESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, SclPackage.LOG_CONTROL__REFERS_TO_LOG, null, null, oldRefersToLogESet));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetRefersToLog() {
return refersToLogESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
......@@ -850,6 +966,10 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
if (refersToAnyLN != null)
msgs = ((InternalEObject)refersToAnyLN).eInverseRemove(this, SclPackage.ANY_LN__REFERRED_BY_LOG_CONTROL, AnyLN.class, msgs);
return basicSetRefersToAnyLN((AnyLN)otherEnd, msgs);
case SclPackage.LOG_CONTROL__REFERS_TO_LOG:
if (refersToLog != null)
msgs = ((InternalEObject)refersToLog).eInverseRemove(this, SclPackage.LOG__REFERRED_BY_LOG_CONTROL, Log.class, msgs);
return basicSetRefersToLog((Log)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
......@@ -866,6 +986,8 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
return basicSetAnyLN(null, msgs);
case SclPackage.LOG_CONTROL__REFERS_TO_ANY_LN:
return basicUnsetRefersToAnyLN(msgs);
case SclPackage.LOG_CONTROL__REFERS_TO_LOG:
return basicUnsetRefersToLog(msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
......@@ -912,6 +1034,8 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
return getAnyLN();
case SclPackage.LOG_CONTROL__REFERS_TO_ANY_LN:
return getRefersToAnyLN();
case SclPackage.LOG_CONTROL__REFERS_TO_LOG:
return getRefersToLog();
}
return super.eGet(featureID, resolve, coreType);
}
......@@ -954,6 +1078,9 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
case SclPackage.LOG_CONTROL__REFERS_TO_ANY_LN:
setRefersToAnyLN((AnyLN)newValue);
return;
case SclPackage.LOG_CONTROL__REFERS_TO_LOG:
setRefersToLog((Log)newValue);
return;
}
super.eSet(featureID, newValue);
}
......@@ -996,6 +1123,9 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
case SclPackage.LOG_CONTROL__REFERS_TO_ANY_LN:
unsetRefersToAnyLN();
return;
case SclPackage.LOG_CONTROL__REFERS_TO_LOG:
unsetRefersToLog();
return;
}
super.eUnset(featureID);
}
......@@ -1028,6 +1158,8 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
return getAnyLN() != null;
case SclPackage.LOG_CONTROL__REFERS_TO_ANY_LN:
return isSetRefersToAnyLN();
case SclPackage.LOG_CONTROL__REFERS_TO_LOG:
return isSetRefersToLog();
}
return super.eIsSet(featureID);
}
......@@ -1067,12 +1199,43 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
// see Issue #13
super.doResolveLinks();
if( getAnyLN() == null ) return;
if( getLogName() != null ) {
SclSwitch< Boolean > s1 = new SclSwitch< Boolean >() {
@Override
public Boolean caseLog( Log object ) {
return getLogName().equals( object.getName() );
}
@Override
public Boolean defaultCase( EObject object ) {
return false;
}
};
List< Log > res1 = shallowSearchObjects( getAnyLN().getLog(), s1 );
String mess1 = "Log( name = " + getLogName() + " ) for LogControl on line "
+ getLineNumber() + " )";
if( res1.isEmpty() ) {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess1 );
return;
}
if( res1.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess1 );
return;
}
//AbstractRiseClipseConsole.getConsole().info( "found " + mess1 );
setRefersToLog( res1.get( 0 ));
}
if( getLnClass() == null ) return;
if( getAnyLN() == null ) return;
LDevice lDevice = getAnyLN().getLDevice();
if( lDevice == null ) return;
IED ied = lDevice.getIED();
if( ied == null ) return;
// The following is copy/paste from ClientLN (with modification)
// TODO: factor out ?
......@@ -1081,7 +1244,7 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
if( getLdInst() != null && ! getLdInst().isEmpty() ) {
// find inside an LDevice with
// LDevice.name == LogControl.ldInst
SclSwitch< Boolean > s1 = new SclSwitch< Boolean >() {
SclSwitch< Boolean > s2 = new SclSwitch< Boolean >() {
@Override
public Boolean caseLDevice( LDevice object ) {
......@@ -1095,19 +1258,19 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
};
List< LDevice > res1 = deepSearchObjects( ied.getAccessPoint(), s1 );
String mess1 = "LDevice( inst = " + getLdInst() + " ) for LogControl on line " + getLineNumber()
List< LDevice > res2 = deepSearchObjects( ied.getAccessPoint(), s2 );
String mess2 = "LDevice( inst = " + getLdInst() + " ) for LogControl on line " + getLineNumber()
+ " ( in ied = " + ied.getName() + " )";
if( res1.isEmpty() ) {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess1 );
if( res2.isEmpty() ) {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess2 );
return;
}
if( res1.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess1 );
if( res2.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess2 );
return;
}
//AbstractRiseClipseConsole.getConsole().info( "found " + mess2 );
lDevice = res1.get( 0 );
lDevice = res2.get( 0 );
}
if( "LLN0".equals( getLnClass() ) ) {
......@@ -1127,7 +1290,7 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
// LN.lnClass == LogControl.lnClass
// LN.prefix == LogControl.prefix
// LN.inst == LogControl.lnInst
SclSwitch< Boolean > s2 = new SclSwitch< Boolean >() {
SclSwitch< Boolean > s3 = new SclSwitch< Boolean >() {
@Override
public Boolean caseLN( LN object ) {
......@@ -1145,19 +1308,19 @@ public class LogControlImpl extends ControlWithTriggerOptImpl implements LogCont
};
List< LN > res2 = shallowSearchObjects( lDevice.getLN(), s2 );
String mess2 = "LN( lnClass = " + getLnClass() + ", inst = " + getLnInst() + " ) for LogControl on line "
List< LN > res3 = shallowSearchObjects( lDevice.getLN(), s3 );
String mess3 = "LN( lnClass = " + getLnClass() + ", inst = " + getLnInst() + " ) for LogControl on line "
+ getLineNumber() + " ( in ied = " + ied.getName() + " )";
if( res2.isEmpty() ) {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess2 );
if( res3.isEmpty() ) {
AbstractRiseClipseConsole.getConsole().error( "cannot find " + mess3 );
return;
}
if( res2.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess2 );
if( res3.size() > 1 ) {
AbstractRiseClipseConsole.getConsole().error( "found several " + mess3 );
return;
}
//AbstractRiseClipseConsole.getConsole().info( "found " + mess3 );
setRefersToAnyLN( res2.get( 0 ));
setRefersToAnyLN( res3.get( 0 ));
}
}
......
......@@ -20,14 +20,19 @@ package fr.centralesupelec.edf.riseclipse.iec61850.scl.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;