User Tools

Site Tools


dev:element_tutorial

This is an old revision of the document!


Creating an MFM Element

You will need to have the MFM ready to build from source to do this. Follow the instructions at Cloning from Github if you have not done so yet.

This tutorial highlights making a density regulating element which regulates nearby density based on some configurable parameters.

Copy the Element Template

First, copy:

MFMv2/src/elements/include/Element_Template.h

to

MFMv2/src/elements/include/Element_Creg.h

Create the C++ Compilation file

In order for the compiler to be able to create a compiled version of this Element, you will need to create a small C++ file which associates with it. Create the file:

MFMv2/src/elements/src/Element_Creg.h

Add the line:

#include "Element_Creg.h"

to the top. This compiles the header in its entirety.

Renaming

Many things in the template need to be renamed to reflect the new Element. There are comments throughout the C++ template labeled:

<<TEMPLATE>>
dev/element_tutorial.1409771968.txt.gz · Last modified: 2014/09/03 19:19 by tsmall1