FET_sim.git
11 months agoAdd help for connect, make help more consistent
Lukáš Jiřiště [Sun, 15 Dec 2024 15:46:39 +0000 (16:46 +0100)]
Add help for connect, make help more consistent

11 months agoFix missing newline
Lukáš Jiřiště [Sun, 15 Dec 2024 15:14:41 +0000 (16:14 +0100)]
Fix missing newline

11 months agoGroup WINDOW* to a struct, add border
Lukáš Jiřiště [Sun, 15 Dec 2024 15:07:52 +0000 (16:07 +0100)]
Group WINDOW* to a struct, add border

The structure makes manipulation of windows easier.

11 months agoUse 2 windows
Lukáš Jiřiště [Sun, 15 Dec 2024 14:52:03 +0000 (15:52 +0100)]
Use 2 windows

One is used for the commands and the second one will be used for ASCII
representation of the circuitry.

11 months agoChange the default colors to the terminal default.
Lukáš Jiřiště [Sun, 15 Dec 2024 14:01:49 +0000 (15:01 +0100)]
Change the default colors to the terminal default.

11 months agoAdd connect command
Lukáš Jiřiště [Sun, 15 Dec 2024 13:20:09 +0000 (14:20 +0100)]
Add connect command

This makes wiring up mosfets together noticeably easier.
The bind and addnode commands may be rendered somewhat useless by this.

11 months agoHarden find_connected against nullptr
Lukáš Jiřiště [Sun, 15 Dec 2024 13:19:36 +0000 (14:19 +0100)]
Harden find_connected against nullptr

11 months agoUse ncurses library
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.

11 months agoUpdate Libft and Makefile
Lukáš Jiřiště [Sun, 15 Dec 2024 07:30:30 +0000 (08:30 +0100)]
Update Libft and Makefile

21 months agoImplement alternate screen usage
Lukáš Jiřiště [Sat, 2 Mar 2024 18:33:30 +0000 (19:33 +0100)]
Implement alternate screen usage

This is an entry point to possible "graphics".

21 months agoRefactor cleanup from main function.
Lukáš Jiřiště [Wed, 21 Feb 2024 21:25:57 +0000 (22:25 +0100)]
Refactor cleanup from main function.

21 months agoAdd indications for opening and closing FETs
Lukáš Jiřiště [Mon, 19 Feb 2024 22:12:48 +0000 (23:12 +0100)]
Add indications for opening and closing FETs

21 months agoAdd samples of logic gates
Lukáš Jiřiště [Mon, 19 Feb 2024 21:40:29 +0000 (22:40 +0100)]
Add samples of logic gates

21 months agoAdd visualization of whether a FET is opened or not
Lukáš Jiřiště [Mon, 19 Feb 2024 21:39:38 +0000 (22:39 +0100)]
Add visualization of whether a FET is opened or not

21 months agoFix a leak caused by repeating command by no input
Lukáš Jiřiště [Mon, 19 Feb 2024 21:02:17 +0000 (22:02 +0100)]
Fix a leak caused by repeating command by no input

When no command is given, the previous action happens. But this action
did not clean the input string "\n", which caused a leak.

21 months agoMake FET_sim able to take input from a file
Lukáš Jiřiště [Mon, 19 Feb 2024 20:59:04 +0000 (21:59 +0100)]
Make FET_sim able to take input from a file

The first argument is taken as a filename which FET_sim reads as it
would read standard input. After EOF it switches to STDIN input.

21 months agoRemove usage of function like macro VEC_INIT
Lukáš Jiřiště [Mon, 19 Feb 2024 20:51:15 +0000 (21:51 +0100)]
Remove usage of function like macro VEC_INIT

The macro has been removed from Libft because it has to conform to the
42 Norm, which forbids function like macros.

21 months agoUpdate Libft and use its feature to clean after gnl
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.

21 months agoUpdate TODO
Lukáš Jiřiště [Fri, 16 Feb 2024 23:13:19 +0000 (00:13 +0100)]
Update TODO

21 months agoPatch text formatting.
Lukáš Jiřiště [Fri, 16 Feb 2024 22:21:53 +0000 (23:21 +0100)]
Patch text formatting.

21 months agoRepair addfet argument count enforcing.
Lukáš Jiřiště [Fri, 16 Feb 2024 22:20:24 +0000 (23:20 +0100)]
Repair addfet argument count enforcing.

21 months agoAdd ID to t_node so that it can be drawn easily.
Lukáš Jiřiště [Fri, 16 Feb 2024 22:00:58 +0000 (23:00 +0100)]
Add ID to t_node so that it can be drawn easily.

21 months agoPatch seg fault when simulating FET with NULL on gate
Lukáš Jiřiště [Fri, 16 Feb 2024 21:58:23 +0000 (22:58 +0100)]
Patch seg fault when simulating FET with NULL on gate

FETs with no connection on gate now default to closed.

21 months agoChange some text to better fit my taste
Lukáš Jiřiště [Fri, 16 Feb 2024 19:59:00 +0000 (20:59 +0100)]
Change some text to better fit my taste

21 months agoRevert "Change t_mosfet to remember node id instead of ptr"
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.

22 months agoChange t_mosfet to remember node id instead of ptr
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.

22 months agoAdd Libft/Makefile as dependency for %.c compilation
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.

22 months agoAdd basic commands and refactor the code
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

22 months agoAdd TODO text file
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.

22 months agoStart this project for simulating FET based logic
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).