Module not found on path for interface table module - c++

I am getting the following error
Module not found on path 'GPSSim.satellite[0].interfaceTable' defined by par 'GPSSim.satellite[0].wlan[0].interfaceTableModule' -- in module (inet::InterfaceEntry) GPSSim.satellite[0].wlan[0] (id=51), during network initialization
There are a lot of code but i will show the ones that i believe is important. If more code is required do let me know, thanks!
GPSSIM.ned This file is the network file
network GPSSim
{
parameters:
int numOfSats; // Number of satellites
submodules:
satellite[numOfSats]: GPSSatellite {
parameters:
#display("p=505.835,100.085;r=10,,#707070;i=device/satellite_l");
}
}
GPSSatellite.ned
module GPSSatellite extends StandardSatellite
{
submodules:
gpsApp[numGpsApps]: <default("GPSApp")> like IGPSApp { //default("UdpApp")
parameters:
#display("p=100,284,row,60");
}
}
StandardSatellite.ned
module StandardSatellite extends Satellite
{
parameters:
#node; //because of MobilityBase initialization'
#networkNode();
int numRadios = default(1);
**.interfaceTableModule = default(absPath(".interfaceTable"));
//wlan[*].mgmt.typename = default("Ieee80211MgmtAp");
//wlan[*].interfaceTableModule = default(absPath(".interfaceEntry"));
//wlan[*].mgmtType = default("Ieee80211MgmtAdhoc"); // use adhoc management
submodules:
interfaceTable: InterfaceTable {
parameters:
#display("p=407,69");
}
routingTable: Ipv4RoutingTable {
parameters:
#display("p=45,178");
//IPForward = IPForward;
//forwardMulticast = forwardMulticast;
routingFile = routingFile;
}
wlan[numRadios]: <default("Ieee80211Interface")> like IWirelessInterface {
parameters:
#display("p=301.35,379.05;q=queue");
}
ext[numExtInterfaces]: <default("ExtInterface")> like IExternalInterface {
parameters:
#display("p=217,421,row,10;q=txQueue;i=block/ifcard");
}
networkLayer: NetworkLayerNodeBase {
parameters:
#display("p=226.8,198.45;q=queue");
}
lo0: LoopbackInterface {
#display("p=78,406");
}
App: <default("UdpBasicBurst")> like IApp {
#display("p=469.35,198.45");
}
connections allowunconnected:
wlan[0].upperLayerOut --> networkLayer.radioIn[0];
//ext[0].upperLayerOut --> networkLayer.radioIn[0];
//lo0.upperLayerOut --> networkLayer.radioIn[0];
}
When i put the interface table module in the top level network (GPSSim) instead, i don't get this error but instead i get another error where the interface is already registered which the cause is precisely because i did that, since im telling each instance of satellite to use the same interface table.
I dont' know where to go from here. Any help would be greatly appreciated! Thanks in advance.

Try change the line
**.interfaceTableModule = default(absPath(".interfaceTable"));
into:
interfaceTableModule = default("interfaceTable");
Parameter interfaceTableModule should point to the interface table in that node.

Related

Where to make changes in Flora for another FloraNode creation instead of default?

So,there is the implementation of Flora present in omnet++.Now,I have to implement another LoraNode inside the default code.By default there is only one LoraNode available .So, how to create the another node in the default implementation.Can somebody help me out?
[1]: https://i.stack.imgur.com/dMJMU.png
I am talking about loRaNodes[0]part.
The code is-
package flora.LoraNode;
import inet.mobility.static.StationaryMobility;
import inet.networklayer.common.InterfaceTable;
import inet.applications.contract.IApp;
import flora.LoRa.LoRaNic;
module LoRaNode
{
parameters:
int numApps = default(0);
string deploymentType = default("");
double maxGatewayDistance = default(320.0);
double gatewayX = default(320.0);
double gatewayY = default(320.0);
#networkNode();
*.interfaceTableModule = default(absPath(".interfaceTable"));
#display("bgb=297,313;i=device/accesspoint;is=vs");
submodules:
interfaceTable: InterfaceTable {
#display("p=30,26");
}
mobility: StationaryMobility {
#display("p=24,88");
}
LoRaNic: LoRaNic {
#display("p=137,239");
}
app[numApps]: <> like IApp {
parameters:
#display("p=375,76,row,150");
}
connections allowunconnected:
for i=0..numApps-1 {
app[i].socketOut --> LoRaNic.upperLayerIn;
LoRaNic.upperLayerOut --> app[i].socketIn;
}
}
I tried changing the default (0) to defaullt (1) or created another ned file file similar to this one and name it as module loRaNode(2) but nothing happen.

Extracting requierement properties from Capella

I would like to extract the requirements data in capella using m2doc, requirements (SystemFunctionalRequirement) are located in a "RequirementsPkg" package in System analysis, thanks to the "m:RequirementsPkg.eContents().summary" command I managed to retrieve the summary of all requirements but I would like to retrieve the name and the summary of a specific requirement.
Can you help me ?
Thanks in advance
This mechanism is deprecated. You should use the requirement extension.
Starting from the root element, you can use something like:
{ m:system.ownedArchitectures->filter(la::LogicalArchitecture).ownedRequirementPkgs.ownedRequirements.name }
With the requirement extension the easiest way is to create a service:
public List<Requirement> getRequirements(ExtensibleElement element) {
List<Requirement> res = new ArrayList<>();
for (ElementExtension extension : element.getOwnedExtensions()) {
if (extension instanceof Requirement) {
res.add((Requirement) extension);
break;
} else if (extension instanceof CapellaOutgoingRelation) {
res.add(((CapellaOutgoingRelation) extension).getTarget());
}
}
return res;
}
and call it, for instance on a diagram:
{ m:for req | '[LAB] IFE System - All Components, CEs'.representationByName().eAllContents(viewpoint::DRepresentationElement).semanticElements->filter(emde::ExtensibleElement).getRequirements() }
{ m:req.ReqIFLongName }
{ m:endfor }

capturing a certain member of an INET node, SNR specifically in omnetpp

I have defined a network topology in omnet++ along with host parameters.
here is the NED code:
network Basic
{
parameters:
string hostType = default("AODVRouter");
string mediumType = default("APSKScalarRadioMedium");
submodules:
visualizer: <default("IntegratedCanvasVisualizer")> like IIntegratedVisualizer if hasVisualizer() {
#display("p=919.664,62.247997");
}
configurator: IPv4NetworkConfigurator {
#display("p=755.008,62.247997");
}
radioMedium: <mediumType> like IRadioMedium {
#display("p=558.224,62.247997");
}
hostA: <hostType> like INetworkNode {
#display("p=104.416,427.70398");
}
hostB: <hostType> like INetworkNode {
#display("p=664.648,267.064");
}
}
I want to create a module which records the SNR/SINR of each station every time it sends/receives a message.
After a few hours of searching (both googling and manual searching in the INET library implementations).
I did not find how to access it so far from another module (I do not know where the field is actually present not how to access it from another module).
Thanks in advance.

Using Persistent Flash Message Library for ColdFusion

I am trying to use a library for showing Flash Messages https://github.com/elpete/flashmessage But I am having trouble getting it working correctly. The documentation isn't that great and I am new to ColdFusion. I want to have the ability to have persistent error messages across pages. Specifically during checkout so when the user needs to go back or a validation error occurs the message will appear. According to the documentation:
The FlashMessage.cfc needs three parameters to work:
A reference to your flash storage object. This object will need
get(key) and put(key, value) methods. A config object with the
following properties: A unique flashKey name to avoid naming
conflicts. A reference to your containerTemplatePath. This is the view
that surrounds each of the individual messages. It will have
references to a flashMessages array and your messageTemplatePath. A
reference to your messageTemplatePath. This is the view that
represents a single message in FlashMessage. It will have a reference
to a single flash message. The name is chosen by you in your container
template. Create your object with your two parameters and then use it
as normal.
I am getting the error
the function getMessages has an invalid return value , can't cast null value to value of type [array]
I had this script somewhat working at one point but it seems very finicky. I believe it is my implementation of it. I am hoping someone here can help me figure out where I went wrong. Or give me some pointers because I am not sure I am even implementing it correctly.
This is What I have in my testing script:
<cfscript>
alertStorage = createObject("component", 'alert');
config = {
flashKey = "myCustomFlashKey",
containerTemplatePath = "/flashmessage/views/_templates/FlashMessageContainer.cfm",
messageTemplatePath = "/flashmessage/views/_templates/FlashMessage.cfm"
};
flash = new flashmessage.models.FlashMessage(alertStorage, config);
flash.message('blah');
flash.danger('boom');
</cfscript>
And inside of alert.cfc I have:
component {
public any function get(key) {
for(var i = 1; i < ArrayLen(session[key]); i++) {
return session[key][i];
}
}
public any function put(key, value) {
ArrayAppend(session.myCustomFlashKey, value);
return true;
}
public any function exists() {
if(structKeyExists(session,"myCustomFlashKey")) {
return true;
} else {
session.myCustomFlashKey = ArrayNew();
return false;
}
}
}
The Flash Message Component looks like this:
component name="FlashMessage" singleton {
/**
* #flashStorage.inject coldbox:flash
* #config.inject coldbox:setting:flashmessage
*/
public FlashMessage function init(any flashStorage, any config) {
instance.flashKey = arguments.config.flashKey;
singleton.flashStorage = arguments.flashStorage;
instance.containerTemplatePath = arguments.config.containerTemplatePath;
instance.messageTemplatePath = arguments.config.messageTemplatePath;
// Initialize our flash messages to an empty array if it hasn't ever been created
if (! singleton.flashStorage.exists(instance.flashKey)) {
setMessages([]);
}
return this;
}
public void function message(required string text, string type = "default") {
appendMessage({ message: arguments.text, type = arguments.type });
}
public any function onMissingMethod(required string methodName, required struct methodArgs) {
message(methodArgs[1], methodName);
}
public any function render() {
var flashMessages = getMessages();
var flashMessageTemplatePath = instance.messageTemplatePath;
savecontent variable="messagesHTML" {
include "#instance.containerTemplatePath#";
}
setMessages([]);
return messagesHTML;
}
public array function getMessages() {
return singleton.flashStorage.get(instance.flashKey, []);
}
private void function setMessages(required array messages) {
singleton.flashStorage.put(
name = instance.flashKey,
value = arguments.messages
);
}
private void function appendMessage(required struct message) {
var currentMessages = getMessages();
ArrayAppend(currentMessages, arguments.message);
setMessages(currentMessages);
}
}

Scopes not created from a template cannot have FilterParameters Error

I am trying to build on the "WebSharingAppDemo-SqlProviderEndToEnd" msdn sample application to build out a custom MSF implementation. As part of that I added parameterized filters to the provisioning. I have been referencing http://jtabadero.wordpress.com/2010/09/02/sync-framework-provisioning/ for some idea of how to do this. Now that I have that in place, when I re-initialize the "peer1" database and try to provision it initially I now get an error:
Scopes not created from a template cannot have FilterParameters.
Parameter '#my_param_name' was found on Table '[my_table_name]'.
Please ensure that no FilterParameters are being defined on a scope
that is not created from a template.
The only guess I have as to what a "template" is, is the provisioning templates that the Sync Toolkit's tools can work with, but I don't think that applies in the scenario I'm working with.
I have been unable to find anything that would indicate what I should do to fix this. So how can I get past this error but still provision my database with parameterized filters?
The below code is what I'm using to build the filtering into the provisioning (SqlSyncScopeProvisioning) object.
private void AddFiltersToProvisioning(IEnumerable<TableInfo> tables)
{
IEnumerable<FilterColumn> filters = this.GetFilterColumnInfo();
foreach (TableInfo tblInfo in tables)
{
this.AddFiltersForTable(tblInfo, filters);
}
}
private void AddFiltersForTable(TableInfo tblInfo, IEnumerable<FilterColumn> filters)
{
IEnumerable<FilterColumn> tblFilters;
tblFilters = filters.Where(x => x.FilterLevelID == tblInfo.FilterLevelID);
if (tblFilters != null && tblFilters.Count() > 0)
{
var tblDef = this.GetTableColumns(tblInfo.TableName);
StringBuilder filterClause = new StringBuilder();
foreach (FilterColumn column in tblFilters)
{
this.AddColumnFilter(tblDef, column.ColumnName, filterClause);
}
this.Provisioning.Tables[tblInfo.TableName].FilterClause = filterClause.ToString();
}
}
private void AddColumnFilter(IEnumerable<TableColumnInfo> tblDef, string columnName, StringBuilder filterClause)
{
TableColumnInfo columnInfo;
columnInfo = tblDef.FirstOrDefault(x => x.ColumnName.Equals(columnName, StringComparison.CurrentCultureIgnoreCase));
if (columnInfo != null)
{
this.FlagColumnForFiltering(columnInfo.TableName, columnInfo.ColumnName);
this.BuildFilterClause(filterClause, columnInfo.ColumnName);
this.AddParamter(columnInfo);
}
}
private void FlagColumnForFiltering(string tableName, string columnName)
{
this.Provisioning.Tables[tableName].AddFilterColumn(columnName);
}
private void BuildFilterClause(StringBuilder filterClause, string columnName)
{
if (filterClause.Length > 0)
{
filterClause.Append(" AND ");
}
filterClause.AppendFormat("[base].[{0}] = #{0}", columnName);
}
private void AddParamter(TableColumnInfo columnInfo)
{
SqlParameter parameter = new SqlParameter("#" + columnInfo.ColumnName, columnInfo.GetSqlDataType());
if (columnInfo.DataTypeLength > 0)
{
parameter.Size = columnInfo.DataTypeLength;
}
this.Provisioning.Tables[columnInfo.TableName].FilterParameters.Add(parameter);
}
i guess the error is self-explanatory.
the FilterParameters can only be set if the scope inherits from a filter template. you cannot set the FilterParameters for a normal scope, only FilterClause.
Using parameter-based filters is a two step process: Defining the filter/scope template and creating a scope based on a template.
I suggest you re-read the blog entry again and jump to the section Parameter-based Filters.