diff --git a/.github/workflows/Pharo12CI.yml b/.github/workflows/Pharo12CI.yml index 7d768024..cceb5a95 100644 --- a/.github/workflows/Pharo12CI.yml +++ b/.github/workflows/Pharo12CI.yml @@ -9,8 +9,6 @@ on: - 'main' pull_request: types: [assigned, opened, synchronize, reopened] - schedule: - - cron: '0 12 * * 0' jobs: build: diff --git a/README.md b/README.md index 51d4c9a1..240bda4c 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,26 @@ This menu provides `metrics` to have statistics on the Molecule code in selected This menu provides actions and tools depending on the selected classes. With this menu you can force to `define` a Component, specially if you have deactivated the Molecule dynamic update or if you have a bug when a Component contract changed. +### See Component implementations +![contextual menu see component implementations](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a4221985-0578-4e95-a133-831548e0f5ef) \ +When right-clicking a Trait that uses the `MolComponentType` Trait, a new option appears in the `Molecule` sub-menu (as shown above): + +![see component implementations github](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/68a94948-d6a0-4dce-9c67-2d1974b78fdf) \ +Clicking this option opens this window, showing all the Component implementations of a Type Trait. \ +The title of the window indicates the name of the Type Trait. \ +Clicking an implementation activates the Browse button, which is used to open it in the **System Browser** of Pharo (double-clicking also works). \ +Typing in the filtering list (above the two window buttons) filters the implementations' list. + +### See Component users +![contextual menu see component users](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/8a9aaa63-33f8-46ea-a638-fc896fc2a60c) \ +When right-clicking a interface (that is, a Trait that uses the `MolComponentEvents`, `MolComponentParameters` or `MolComponentServices` Traits), a new option appears in the `Molecule` sub-menu (as shown above): + +![See component users github](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/682f388b-78a6-41d4-a3c4-2377fb7e9cf5) \ +The title of the window indicates the name of the Type Trait as well as the type of interfaces it is about (events, parameters or services). \ +In columns are shown the Type Trait requiring and offering this interface. \ +Clicking a Type Trait activates the Browse button, which is used to open it in the **System Browser** of Pharo (double-clicking also works). \ +Typing in a filtering list (below the columns) filters the relevant Type Traits' list. + ## Using Components ### Start and stop method diff --git a/documentation/Create and connect Components.md b/documentation/Create and connect Components.md index b5594ad5..40d49767 100644 --- a/documentation/Create and connect Components.md +++ b/documentation/Create and connect Components.md @@ -5,14 +5,14 @@ They're directly linked, in the sense that a change detected in the first Compon ![gps molecule without figure](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a949d2f8-c460-40be-985d-273881e5b3da) \ GPS (Global Positioning System) is the american subsystem of GNSS (Global Navigation Satellite Systems). -The complete GNSS example is present in the **Molecule-Examples** package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ +The complete GNSS example is present in the [Molecule-Examples](https://github.com/OpenSmock/Molecule/tree/main/src/Molecule-Examples) package, but if it's your first time using Molecule, you should follow this tutorial step-by-step in order to understand how Molecule works. \ A graphical form of the example is available in the [Molecule-Geographical-Position-Example](https://github.com/OpenSmock/Molecule-Geographical-Position-Example) repository. # Contents [STATIC PART: declaration](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#static-part-declaration) * [Define Component Types](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-component-types) - [Adding Component contract with a Component Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#adding-component-contract-with-a-component-type) - + [Define first Component Type MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-first-component-type-molgnssdata) + + [Define the first Component Type MolGNSSData](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-first-component-type-molgnssdata) + [Define the second Component Type MolGNSSMap](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-the-second-component-type-molgnssmap) * [Define Services and Events](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#define-services-and-events) * [Create a Component implementation of a Type](https://github.com/OpenSmock/Molecule/blob/documentation/documentation/Create%20and%20connect%20Components.md#create-a-component-implementation-of-a-type) @@ -100,8 +100,8 @@ This Event trait produces the `currentPositionChanged: aGeoPosition` Event ## Create a Component implementation of a Type There are two ways to create a new Molecule Component : -- Create a new Component from scratch : write a new Class inheriting from the Component hierarchy -- Re-using an existing Class : augmenting that class with Component behavior +- Create a new Component from scratch: write a new Class inheriting from the Component hierarchy +- Re-using an existing Class: augmenting that class with Component behavior ### Create a new Component from scratch To develop a new Component from scratch, a class needs to be created that must subclass the `MolAbstractComponentImpl` abstract Class. @@ -118,7 +118,7 @@ We must use the Molecule Component interface `MolComponentImpl`, which is a Trai For this tutorial, the GNSS needs to send its geographical data to the Map. \ In order to do that, its contract needs to be redefined to indicate which Services and Events are produced and provided by it. ![implementation contrat molecule](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/a9c14388-0abe-4f09-8ac5-578054f98ad1) \ -Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser**, accessible through the **Browse** tab of Pharo, click on the radio button located left to the Class side text, which is located in the middle of the **System Browser** window). \ +Redefining a Component's contract is done on the **Class side** of Pharo (in the **System Browser** which is accessible through the **Browse** tab of Pharo, click on the radio button located left to the Class side text which is located in the middle of the **System Browser** window). \ ![system browser red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/7fa84d1d-45b4-4fe1-b524-6193fc7d6fec) ![class side red](https://github.com/Eliott-Guevel/Molecule-various-fixes/assets/76944457/7b189b8a-1552-46df-a69d-44f78bb73848) @@ -181,7 +181,7 @@ MolGNSSDataImpl>>increaseAccuracy self accuracy: nextAccuracy ] ``` -Then, override the `getAccuracyRadiusInMeters` Service (which will simply return `accuracy`). The override is done since the `getAccuracyRadiusInMeters` Service is declared in the `providedComponentServices` part of `MolGNSSData`'s contract. And since `MolGNSSDataImpl` is an implemmentation of `MolGNSSData`, the `getAccuracyRadiusInMeters` is implemented here. +Then, override the `getAccuracyRadiusInMeters` Service (which will simply return `accuracy`). The override is done since the `getAccuracyRadiusInMeters` Service is declared in the `providedComponentServices` part of `MolGNSSData`'s contract. And since `MolGNSSDataImpl` is an implementation of `MolGNSSData`, the `getAccuracyRadiusInMeters` is implemented here. ```smalltalk MolGNSSDataImpl>>getAccuracyRadiusInMeters "Get and return the accuracy of the GNSS depending quality of signal and quantity of connected satellites" @@ -229,9 +229,9 @@ To quickly detail this method, we first need to examine `getMolGNSSDataEventsNot To return to `componentActivate`, after every 50 milliseconds, a random geographical position is generated which is sent through the `currentPositionChanged: aGeoPosition` Event. Generated methods take the following forms: -- get[componentName]EventsNotifier -- get[componentName]EventsSubscriber -- get[componentName]ServicesProvider +- `get[componentName]EventsNotifier` +- `get[componentName]EventsSubscriber` +- `get[componentName]ServicesProvider` There is no need to manually type them. @@ -247,7 +247,7 @@ MolGNSSDataImpl>>componentPassivate ``` ## Create the Component implementation for MolGNSSMap -Same way as `MolGNSSDataImpl`, we can move on to create the Map Component, being `MolGNSSMapImpl`. This component uses the `MolGNSSMap` Trait, used to define the Component's contract, as well as the `MolGNSSDataEvents` interface, which needs to be specified in order for the Component to consume its Service. +Same way as `MolGNSSDataImpl`, we can move on to create the Map Component, being `MolGNSSMapImpl`. This component uses the `MolGNSSMap` Trait, used to define the Component's contract, as well as the `MolGNSSDataEvents` interface which needs to be specified in order for the Component to consume its Service. ```smalltalk MolAbstractComponentImpl subclass: #MolGNSSMapImpl uses: MolGNSSMap + MolGNSSDataEvents @@ -338,7 +338,7 @@ The Pharo **Transcript** (also located in the **Browse** tab of Pharo) will star ### Starting a Component with a name It's also possible to create a component with a name by using the `MolComponentImpl class>>start: #[name]` method. -This will be useful for [Producers](https://github.com/OpenSmock/Molecule/blob/main/documentation/Creating%20Producers.md), which determine which component of a given Type A receives events from which component of a given Type B, if multiple components of the same Type exist. +This will be useful for [Producers](https://github.com/OpenSmock/Molecule/blob/main/documentation/Creating%20Producers.md), which determine which component of a given Type A receives events from which component of a given Type B if multiple components of the same Type exist. ## Stopping a Component Components are stopped using the `MolComponentImpl class>>stop` instruction. \ diff --git a/documentation/Producers.md b/documentation/Producers.md index 50b63e4e..8da97a80 100644 --- a/documentation/Producers.md +++ b/documentation/Producers.md @@ -1,8 +1,8 @@ # Producers -Producers are used to specify the sender of the Events created by components. -Producers are created using the following syntax: -`self forEvents: [componentName]Events useProducer: #[instanceName]` -with [instanceName] being the name you chose for starting a component (see [Create and connect Components](https://github.com/OpenSmock/Molecule/blob/main/documentation/Create%20and%20connect%20Components)), `default` if no name was used. +Producers are used to specify the sender of the Events created by components. \ +Producers are created using the following syntax: \ +`self forEvents: [componentName]Events useProducer: #[instanceName]` \ +with [instanceName] being the name you chose for starting a component (see [Create and connect Components](https://github.com/OpenSmock/Molecule/blob/main/documentation/Create%20and%20connect%20Components)), `default` if no name was used. \ Producers are created in the `componentInitialize` method. For multiple Producers (multiple named launched components of the same Type), the syntax is diff --git a/documentation/Table of contents.md b/documentation/Table of contents.md index c3ae27b1..b1dd2400 100644 --- a/documentation/Table of contents.md +++ b/documentation/Table of contents.md @@ -4,11 +4,10 @@ Welcome to the Molecule wiki! [Principles](https://github.com/OpenSmock/Molecule/blob/main/documentation/Principles.md) # Tutorials -Step-by-step example describing an example between two Components interacting: - +## Step-by-step example describing two Components interacting between one another [Create and connect Components](https://github.com/OpenSmock/Molecule/blob/main/documentation/Create%20and%20connect%20Components.md) -Other tutorials focused on one specific part of Molecule: +## Other tutorials focused on one specific part of Molecule [Connecting two Components](https://github.com/OpenSmock/Molecule/blob/main/documentation/Connecting%20two%20Components.md) diff --git a/documentation/Tests.md b/documentation/Tests.md index baa54b9d..1456ae42 100644 --- a/documentation/Tests.md +++ b/documentation/Tests.md @@ -1,5 +1,5 @@ # Tests -To create quick tests for your Components, you can create a package named [yourPackageName]-Examples or [yourPackageName]-Tests, then create an Object subclass named [yourPackageName]Examples, +To create quick tests for your Components, you can create a package named `[yourPackageName]-Examples` or `[yourPackageName]-Tests`, then create an Object subclass named `[yourPackageName]Examples`, ```smalltalk Object subclass: #MolGPS-Examples instanceVariableNames: '' @@ -7,7 +7,7 @@ Object subclass: #MolGPS-Examples package: 'Molecule-Tutorial' ``` then display the **Class side** of this class. -This then allows the creation of methods for different test cases. +This allows the creation of methods for different test cases. One practical thing is putting a `