Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: c0de1ee4394c547364130c97b1c358ce33b0bb0a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*******************************************************************************
 * Copyright (c) 2012 Juergen Haug
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * CONTRIBUTORS:
 * 		Juergen Haug
 * 
 *******************************************************************************/

package org.eclipse.etrice.generator.base;

import java.util.List;

import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.etrice.core.genmodel.etricegen.ActorInstance;
import org.eclipse.etrice.core.genmodel.etricegen.InterfaceItemInstance;
import org.eclipse.etrice.core.genmodel.etricegen.SubSystemInstance;
import org.eclipse.etrice.core.genmodel.fsm.ILogger;
import org.eclipse.etrice.core.room.ActorClass;
import org.eclipse.etrice.core.room.Attribute;
import org.eclipse.etrice.core.room.PortClass;
import org.eclipse.etrice.core.room.ProtocolClass;

/**
 * A general interface used by the generator for data configuration.
 * 
 * @author Juergen Haug
 */
public interface IDataConfiguration {
	
	/**
	 * This general setup has to be called once per generator call.
	 */
	public void doSetup();
	
	/**
	 * @param resource a {@link ResourceSet}
	 * @param logger the {@link ILogger}
	 * @return <code>true</code> if all configurations found in the resources
	 * could successfully be read and validated
	 */
	public boolean setResources(ResourceSet resource, ILogger logger);
	
	// static configuration
	
	/**
	 * Static configuration for a (nested) attribute of an {@link ActorClass}
	 * 
	 * @param actor the {@link ActorClass}
	 * @param path a list (interpreted as path) of {@link Attribute}s
	 * @return the configuration value as string
	 */
	public String getAttrClassConfigValue(ActorClass actor, List<Attribute> path);

	/**
	 * Static configuration for a (nested) attribute of an {@link ProtocolClass}
	 * 
	 * @param pc the {@link ProtocolClass}
	 * @param regular a flag distinguishing between regular and conjugate {@link PortClass}
	 * 		of this protocol
	 * @param path a list (interpreted as path) of {@link Attribute}s
	 * @return the configuration value as string
	 */
	public String getAttrClassConfigValue(ProtocolClass pc, boolean regular, List<Attribute> path);
	
	/**
	 * Static configuration for the minimum value of a (nested) attribute of an {@link ActorClass}
	 * 
	 * @param actor the {@link ActorClass}
	 * @param path a list (interpreted as path) of {@link Attribute}s
	 * @return the configuration value as string
	 */
	public String getAttrClassConfigMinValue(ActorClass actor, List<Attribute> path);
	
	/**
	 * Static configuration for the maximum value of a (nested) attribute of an {@link ActorClass}
	 * 
	 * @param actor the {@link ActorClass}
	 * @param path a list (interpreted as path) of {@link Attribute}s
	 * @return the configuration value as string
	 */
	public String getAttrClassConfigMaxValue(ActorClass actor, List<Attribute> path);
	
	/**
	 * Static configuration for a (nested) attribute of an {@link ActorInstance}
	 * 
	 * @param ai the {@link ActorInstance}
	 * @param path a list (interpreted as path) of {@link Attribute}s
	 * @return the configuration value as string
	 */
	public String getAttrInstanceConfigValue(ActorInstance ai, List<Attribute> path);
	public String getAttrInstanceConfigValue(InterfaceItemInstance item, List<Attribute> path);
	
	
	// dynamic configuration
	
	/**
	 * Dynamic configuration of the user code 1 of a {@link SubSystemInstance}
	 * @param subsystem the {@link SubSystemInstance}
	 * @return the configured value
	 */
	public String getUserCode1(SubSystemInstance subsystem);
	
	/**
	 * Dynamic configuration of the user code 2 of a {@link SubSystemInstance}
	 * @param subsystem the {@link SubSystemInstance}
	 * @return the configured value
	 */
	public String getUserCode2(SubSystemInstance subsystem);
	
	/**
	 * Dynamic configuration of the polling timer of a {@link SubSystemInstance}
	 * @param subsystem the {@link SubSystemInstance}
	 * @return the configured value
	 */
	public long getPollingTimerUser(SubSystemInstance subsystem);
	
	/**
	 * @param subsystem the {@link SubSystemInstance}
	 * @return <code>true</code> if dynamic configuration has been configured
	 */
	public boolean hasVariableService(SubSystemInstance subsystem);
	
	/**
	 * @param ai an {@link ActorInstance}
	 * @return a list of {@link Attribute}s that are configured for
	 * 		dynamic read access
	 */
	public List<Attribute> getDynConfigReadAttributes(ActorInstance ai);
	
	/**
	 * @param ai an {@link ActorInstance}
	 * @return a list of {@link Attribute}s that are configured for
	 * 		dynamic write access
	 */
	public List<Attribute> getDynConfigWriteAttributes(ActorInstance ai);
	
	/**
	 * @param actor an {@link ActorClass}
	 * @return a list of {@link Attribute}s that are configured for
	 * 		dynamic read access
	 */
	public List<Attribute> getDynConfigReadAttributes(ActorClass actor);
	
	/**
	 * @param actor an {@link ActorClass}
	 * @return a list of {@link Attribute}s that are configured for
	 * 		dynamic write access
	 */
	public List<Attribute> getDynConfigWriteAttributes(ActorClass actor);
	
}

Back to the top