Lukáš Jiřiště [Fri, 20 Dec 2024 17:59:53 +0000 (18:59 +0100)]
Fix merge_nodes not transferring "gate mosfets"
Because mosfets were not listed in their gate nodes, they were bot
transferred during node merge.
This is fixed by adding a vector to node, that saves all mosfets
connected through gate.
The connected vector of node was not used, as the "gate mosfets" would
have to be filtered in simulation.
Lukáš Jiřiště [Fri, 20 Dec 2024 17:02:57 +0000 (18:02 +0100)]
Add some node graphics
When adding MOSFETs in the schema mode, a node is spawned for each of
the terminal. It is also bound and the terminal "position" is used for
its single segment.
I am not satisfied with how the position and symbol of this terminal
segment is obtained, but I cannot think about a more elegant way at this
time.
Lukáš Jiřiště [Wed, 18 Dec 2024 12:22:10 +0000 (13:22 +0100)]
Fix connect command
The problem was in the merge_nodes function, where a level of
indirection was missed - the vector connected (mosfets) of a node holds
pointers to mosfets, hence the ft_vec_access return t_mosfet**.
Lukáš Jiřiště [Wed, 18 Dec 2024 12:14:36 +0000 (13:14 +0100)]
Update Libft, switch to using IDs for objects
The ft_vec_find functions were updated, which necessitated some changes
in the code.
So now the nodes and MOSFETs use unique IDs instead of just their index
in the main vectors. Some hardening was done while switching.
Some minor bugs might also be present in this commit.
Lukáš Jiřiště [Sun, 15 Dec 2024 17:57:20 +0000 (18:57 +0100)]
Swap functionality of p- and n-channel FETs
I probably got confused when assigning the functionality.
We can be generous and say I'm switching the MOSFETS from depletion mode
to enhancement mode.
Lukáš Jiřiště [Sun, 15 Dec 2024 07:20:33 +0000 (08:20 +0100)]
Use ncurses library
Every printing function had to be replaced.
Color is handled differently.
A function was commented out, because I did not want to think about how
to integrate it now.
Lukáš Jiřiště [Fri, 16 Feb 2024 23:13:44 +0000 (00:13 +0100)]
Update Libft and use its feature to clean after gnl
Function get_next_line does not free all memory when reading from stdin
when it doesn't contain end of file. The new version of Libft makes it
possible to free the memory.
Lukáš Jiřiště [Fri, 16 Feb 2024 16:34:45 +0000 (17:34 +0100)]
Revert "Change t_mosfet to remember node id instead of ptr"
This reverts commit d03a1205f99244550c784b4c8c2694ae643f0278.
The commit was not thought through as it should. In addition it contains
some minor changes that should be recommited - that's why I should do
small commits that tend to a single problem/feature.
Lukáš Jiřiště [Sun, 4 Feb 2024 13:01:48 +0000 (14:01 +0100)]
Change t_mosfet to remember node id instead of ptr
This prevents looking for node id when drawing.
Some changes were present when I started this change. I can't really
tell, what they were, but from the diffs it looks like just 2 or 3 minor
cosmetic changes. Sorry.
Lukáš Jiřiště [Sun, 14 Jan 2024 16:42:57 +0000 (17:42 +0100)]
Add Libft/Makefile as dependency for %.c compilation
Add Libft/Makefile as an order-only-prerequisite for %.c files so that
after cloning the repository the Libft submodule is downloaded. This is
needed because without the Libft headers some files cannot be compiled.
Lukáš Jiřiště [Sun, 14 Jan 2024 16:34:41 +0000 (17:34 +0100)]
Add basic commands and refactor the code
Implement parsing of basic commands (help, next, add...)
-Mostly (?) as wrapper around function from previous commit
-It should be possible to do it in a much better way
Give the project some structure
-split main.c
-create src and inc directories
Lukáš Jiřiště [Sat, 13 Jan 2024 11:57:51 +0000 (12:57 +0100)]
Add TODO text file
The TODO list is quite short and not detailed. But better have it when it
is not needed yet than not have it when ideas are abundant. The
maintanance of TODO is so low it is worth adding.
Lukáš Jiřiště [Sat, 13 Jan 2024 10:55:36 +0000 (11:55 +0100)]
Start this project for simulating FET based logic
Add a small project capable(?) of simulating FET logic. Implement basic
structs and logic for the simulation.
Implement depicting of the simulation state.
Add submodule Libft for use in place of (most of) standard library.
- I develop this project for other reasons.
- This is an added challenge for learning's sake.
Add basics of project management (Makefile, .gitignore).