Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

trying to add SPI RAM as C++ component

2 posters

Go down  Message [Page 1 of 1]

1trying to add SPI RAM as C++ component Empty trying to add SPI RAM as C++ component Fri Apr 16, 2021 2:36 pm

SuperUserNameMan



Hello,

I'm trying to add a SPI RAM chip to simulide.

To familiarize myself with the source code, I just created a clone of `I2Cram.cpp/.h` that I called `SPI_ram.cpp/.h` and renamed the `I2CRam` class to `SPIram`, etc.

I also updated `itemlibrary.cpp`.

Then I executed `qmake` and `make -j$(nproc)`.

It compiled and executed fine, but I can't find my new SPI RAM chip into the components list panel.

The `moc_spi_ram.cpp` is generated.
`spi_ram.o` is also there.

Is there something I'm missing ?
Do I have to cleanup the previous compilation before adding a new component ?

Code:

LibraryItem* SPIram::libraryItem()
{
    return new LibraryItem(
        tr( "SPI Ram" ),
        tr( "Logic/Memory" ),
        "2to3.png",
        "I2CRam", // <-- tried with SPIram too : no success
        SPIram::construct );
}

arcachofo

arcachofo

Is there something I'm missing ?
I think you did all the steps correctly.
The only missing step is update translations (see below).

It compiled and executed fine, but I can't find my new SPI RAM chip into the components list panel.
Which language are you using?
Is the component there if you set language to english (needs restart)?
In any case you need to update translations:
Go to build_XX and run:

lupdate SimulIDE_Build.pro

Build the project again and see if the component is there.


Do I have to cleanup the previous compilation before adding a new component ?
You don't need.
If you were removing somethig it would be good a cleanup, but not for adding.
You just need to run qmake for the files to be included in the project.


The correct way to create LibraryItem:
Code:
LibraryItem* SPIram::libraryItem()
{
    return new LibraryItem(
        tr( "SPI Ram" ),
        tr( "Logic/Memory" ),
        "2to3.png",
        "SPIRam",
        SPIram::construct );
}

SuperUserNameMan likes this post

SuperUserNameMan



Which language are you using?
Is the component there if you set language to english (needs restart)?
In any case you need to update translations:
Go to build_XX and run:

lupdate SimulIDE_Build.pro

Build the project again and see if the component is there.

You are very correct. This is the solution :-D
Thank you !

arcachofo likes this post

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum