Changes in Example/positionControl:

 

bugs / requiremens srcfile fix
Comment of some PID_controller.java

Comment of some Methods

 

A set Method for integral value is necessary to optimize control PID_controller.java public void setIntg(short setValue)
Demonstrate the necessity of throw exception if the integral value of PID controller has an overflow. PID_controller.java (intValNew ^ intgVal ) & 0x80000000 ) == 0x80000000 ...
Tuning of values, the normalize range of controller is -20000 to 200000, the actuator has an output range from -10000 to 10000, adaption and limitiation MainController.java if(yOut > 19999)
{ yOut = 19999;
...
... setMotorVoltage((short)(yOut>>1));
But demonstrate a difficult software error so that an exception is thrown in PID_controller MainController.java //pidCtrl1.setIntg(yOut); commented, than exception
Trimming values so that the error occurs MainEmulation.java disturbance1 = 0.9 + 0.5*Math.sin( ...
MainEmulation.c mainEmulation.nAmplificationActuator = 0.45F;
catch the exception also in C MainEmulation.c

TRY{...}_TRY ...

printStackTrace_ExceptionJc(exc, stdout);

Some adaption errors in ExceptionJc ExceptionJc.c

ExceptionJc* exception = &stacktrace->tryObject->exc;
...

exception->backStacktrace = stacktrace;

StacktraceThreadContext.c

StacktraceElementJc moreEntries[100 - ...

context->stacktraceThreadContext.stacktraceBuffer = ...

Known bugs/Requirements:

Changes in the translator Java2C

 

bugs / requiremens srcfile fix
Using ZBNF from Sourceforge org/vishia/ZBNF, util, mainCmd This sources are used as classfile zbnf.zip with sources in zbnf.srcJava.zip in the same revision as download by http://sf.net/projects/ZBNF version 0.8 This are the same files.
The default constructor is not created in headerfile, even though in C-File FirstPass.java write_constructorDeclaration(null, sClassName)
The constructors of embedded classes aren't call ClassData.java final String sType; in VariablesToInit
GenerateClass.java if(itemNewObject!=null){...sPrefix = bEmbeddedStruct ? "$" : "@"; ...variablesToInit.add
SeconcPass.java if(sPrefix.indexOf('$') >=0)
{ ... writeContent.writeClassC("\n { MemC mem"
Using Stacktrace as condition of using throw Java2C/*.java

", ThreadContext_s* _threadContext)" added as last argument to any method,

SecondPass.java class RetGenStatement to detect wether return is the last statement
SecondPass.java gen_statement()

, RetGenStatement retInfo) as last argument

retInfo.lastWasReturn = ...;

SecondPass.java write_constructorDefinition()

write_methodDefinition()

writeContent.writeClassC("\n StacktraceJc stacktrace = { ...

writeContent.writeClassC("\n _threadContext->stacktrace = stacktrace.previous;");

Using of throw to handle fatal exceptions Java2C.zbnf

<?+throwNew> throw new <$?exceptionClass>(<""?text>[,<value>]) ;

instead <?throw?+?> throw <value> ;

   
   
SecondPass.java gen_throwNew(itemStatement, localIdents) defined and used
Test mem.size on ctor, throw if it is fault insufficient. SecondPass.java write_constructorDefinition()

writeContent.writeClassC("\n if(rawMem.size < sizeof(" + sClassName + "))"); ...

A negativ hex number -0x1234 causes an parse exception Java2C.zbnf - 0x<#x?hexNumberNegative> as special alternative
SecondPass.java else if(sSemantic.equals("hexNumberNegative"))

Known bugs/Requirements: