Study of the BlackBox Component Builder

Usage of the framework, compiler and tools

Re: Study of the BlackBox Component Builder

Postby Ivan Denisov » Wed Aug 25, 2021 4:15 am

Marcel Kollenaar wrote:Now I'm extending my code with this Services.DoLater concept to understand it.

BlackBox runtime providing cooperative multitask balancer in one thread.
You can add tasks with Services.DoLater
There are three options for the second argument:
- Services.immediately (doing task in execution flow of procedure)
- Services.now (doing task as soon as possible, then BlackBox free from over tasks)
- Services.Ticks() + timeMs (doing after some time)
User avatar
Ivan Denisov
 
Posts: 338
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Study of the BlackBox Component Builder

Postby Marcel Kollenaar » Wed Aug 25, 2021 7:41 am

Thank you for the information.

V24
I tried to extend my code but in the end I had to use the same structure with a separate "PROCEDURE (a: Action) Do;" that runs the receiver code. I thought I could accomplish that within 1 procedure. So actually the code looks a lot at your code. The result is what I expected. It runs smooth and is rock-solid. I tested it in a long run and it kept receiving the bitstream. The only thing that happened is that my computer fell asleep and that produced an error Trap after I activated the system. So maybe that the power and sleep setting must be disabled or that it can check that the system signals a sleep cycle and stop the serial communication. When the system is asleep the Arduino keeps sending and BBCP misses data. For me this is not a problem.

POINTER TO ABSTRACT RECORD
I looked at the code behind all this "POINTER TO ABSTRACT RECORD" and first I read the parts in the book of J. Stanley Warford, page 184. He's telling about using the factory technique. The problem is you're actually creating a class but BBCP doesn't call that a class, here "factory" is "directories" a confusing term for me. A directory for me is a folder (new name) on a harddrive. I have to practice with this concept. I know the concept of classes and creating objects in runtime but I have to get used to the BBCP terminology and the way it is written. It can do OOP but for a reason unknown the wordt "Class" is not embraced.
The ABSTRACT record attribute confuses me. The Language Report says "A record type marked as ABSTRACT cannot be instantiated. No variables or fields of such a type can ever exist. Abstract types are only used as base types for other record types (see below)." The 3th sentence I don't understand, why should you use ABSTRACT when you are not able to instantiate it. Actually you do but later in the code with NEW.
User avatar
Marcel Kollenaar
 
Posts: 15
Joined: Mon Jul 26, 2021 1:33 pm
Location: Enschede, The Netherlands

Re: Study of the BlackBox Component Builder

Postby cfbsoftware » Wed Aug 25, 2021 11:17 am

As well as Warford's book I recommend you read:

Object-Oriented Programming in Oberon-2
Hanspeter Mössenböck

https://ssw.jku.at/Research/Books/Oberon2.pdf

In this book, O-O terminology like Classes, Objects, Messages, Methods etc. are correlated with the conventional programming terms. The author notes:

" These terms were introduced in Smalltalk, one of the first objectoriented languages, and have gained widespread acceptance
despite the fact that (apart from subtle differences) conventional terminology would have sufficed."

The "What's New" document accessible from BlackBox Help > Contents > Component Pascal states "Except for some minor points, Component Pascal is a superset of Oberon-2." and provides a good overview of the new attributes ABSTRACT, LIMITED and EXTENSIBLE
cfbsoftware
 
Posts: 47
Joined: Wed Sep 18, 2013 10:06 pm

Re: Study of the BlackBox Component Builder

Postby Marcel Kollenaar » Wed Aug 25, 2021 11:36 am

cfbsoftware wrote:As well as Warford's book I recommend you read:

Object-Oriented Programming in Oberon-2
Hanspeter Mössenböck


Thank you Chris.

PS. Read your article about Astrobe in the Elektor Embedded Guide of 2010.

[Edit: The book of Hanspeter Mössenböck is good!]
User avatar
Marcel Kollenaar
 
Posts: 15
Joined: Mon Jul 26, 2021 1:33 pm
Location: Enschede, The Netherlands

Previous

Return to Common questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron