Add files via upload

fisiere electron
This commit is contained in:
Cerbu Andrei Mihnea
2022-06-05 14:20:43 +03:00
committed by GitHub
parent eee04d2e45
commit 26aae27835
30 changed files with 6354 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="ELECTRONAT" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin/Debug/ELECTRONAT" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-g" />
</Compiler>
</Target>
<Target title="Release">
<Option output="bin/Release/ELECTRONAT" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="1" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
</Compiler>
<Linker>
<Add option="-s" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add option="-fexceptions" />
</Compiler>
<Unit filename="change_color_panel.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="choose_from_two_options.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="drawing_components.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="edit_component_value.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="functii_auxiliare.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="main.cpp" />
<Unit filename="menu_selection.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="messages_panels_main_menu.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="new_project_name_reading_window.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="open_save.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="stare_table.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="startup_page.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="workplace_page.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="zoom_rotate_fader_workplace.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Extensions>
<lib_finder disable_auto="1" />
</Extensions>
</Project>
</CodeBlocks_project_file>
+791
View File
@@ -0,0 +1,791 @@
# depslib dependency file v1.0
1638483771 source:c:\mingw\bin\electronuaic\electron\electronat\main.cpp
<iostream>
<graphics.h>
<string.h>
<winuser.h>
"startup_page.h"
"workplace_page.h"
"menu_selection.h"
"stare_table.h"
"new_project_name_reading_window.h"
1642197535 source:d:\electron\electronat\main.cpp
<iostream>
<graphics.h>
<string.h>
<winuser.h>
<sys/types.h>
<sys/stat.h>
<unistd.h>
<filesystem>
"startup_page.h"
"workplace_page.h"
"menu_selection.h"
"stare_table.h"
"new_project_name_reading_window.h"
"drawing_components.h"
"messages_panels_main_menu.h"
"open_save.h"
"change_color_panel.h"
"messages_log_panel.h"
"edit_component_value.h"
"zoom_rotate_fader_workplace.h"
"choose_from_two_options.h"
"functii_auxiliare.h"
1637875934 d:\electron\electronat\workbench.h
1637885026 d:\electron\electronat\frontpage\frontpage.h
1637920586 c:\mingw\bin\electronuaic\electron\electronat\frontpage\frontpage.h
1637922089 c:\mingw\bin\electronuaic\electron\electronat\resistor.h
1637922469 c:\mingw\bin\electronuaic\electron\electronat\capacitor.h
1637922674 c:\mingw\bin\electronuaic\electron\electronat\fuse.h
1637923114 c:\mingw\bin\electronuaic\electron\electronat\dioda.h
1637954017 c:\mingw\bin\electronuaic\electron\electronat\bulb.h
1637954299 c:\mingw\bin\electronuaic\electron\electronat\ampermeter.h
1638484982 c:\mingw\bin\electronuaic\electron\electronat\components.h
"workplace_page.h"
1638033748 c:\mingw\bin\electronuaic\electron\electronat\startpage.h
<iostream>
<algorithm>
1638311561 c:\mingw\bin\electronuaic\electron\electronat\startup_page.h
1638210614 c:\mingw\bin\electronuaic\electron\electronat\menubar.h
1641654066 source:g:\electron\electronat\main.cpp
<iostream>
<graphics.h>
<string.h>
<winuser.h>
<sys/types.h>
<sys/stat.h>
<unistd.h>
<filesystem>
"startup_page.h"
"workplace_page.h"
"menu_selection.h"
"stare_table.h"
"new_project_name_reading_window.h"
"drawing_components.h"
"messages_panels_main_menu.h"
"open_save.h"
"change_color_panel.h"
"messages_log_panel.h"
"edit_component_value.h"
"zoom_rotate_fader_workplace.h"
1640635416 g:\electron\electronat\components.h
"workplace_page.h"
1638226333 g:\electron\electronat\menubar.h
1640848827 g:\electron\electronat\startup_page.h
1638261682 g:\electron\electronat\menu_bar.h
"components.h"
1641653516 g:\electron\electronat\menu_selection.h
1641654680 g:\electron\electronat\workplace_page.h
"drawing_components.h"
"stare_table.h"
"zoom_rotate_fader_workplace.h"
1638311561 c:\mingw\bin\electronuaic\electron\electronat\workplace_page.h
"components.h"
1638311561 c:\mingw\bin\electronuaic\electron\electronat\menu_selection.h
"change_color_panel.h"
1638483474 c:\mingw\bin\electronuaic\electron\electronat\stare_table.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
1641651956 g:\electron\electronat\stare_table.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
<bits/stdc++.h>
"drawing_components.h"
1641593021 g:\electron\electronat\change_color_panel.h
"startup_page.h"
"workplace_page.h"
1638311561 c:\mingw\bin\electronuaic\electron\electronat\change_color_panel.h
"startup_page.h"
"workplace_page.h"
1641651290 g:\electron\electronat\new_project_name_reading_window.h
<winuser.h>
1638483138 c:\mingw\bin\electronuaic\electron\electronat\new_project_name_reading_window.h
1640795315 source:d:\electronuaic\electron\electronat\main.cpp
<iostream>
<graphics.h>
<string.h>
<winuser.h>
<sys/types.h>
<sys/stat.h>
<unistd.h>
<filesystem>
"startup_page.h"
"workplace_page.h"
"menu_selection.h"
"stare_table.h"
"new_project_name_reading_window.h"
"drawing_components.h"
"messages_panels_main_menu.h"
"open_save.h"
1638907797 d:\electronuaic\electron\electronat\startup_page.h
1640795062 d:\electronuaic\electron\electronat\workplace_page.h
"components.h"
"stare_table.h"
1639340903 d:\electronuaic\electron\electronat\components.h
"workplace_page.h"
1640640597 d:\electronuaic\electron\electronat\menu_selection.h
"change_color_panel.h"
1638311561 d:\electronuaic\electron\electronat\change_color_panel.h
"startup_page.h"
"workplace_page.h"
1640797610 d:\electronuaic\electron\electronat\stare_table.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
<bits/stdc++.h>
"drawing_components.h"
1638920570 d:\electronuaic\electron\electronat\new_project_name_reading_window.h
<winuser.h>
1638545034 d:\electronuaic\electron\electronat\table_status.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
1639527949 d:\electronuaic\electron\electronat\drawing_components.h
1638739266 g:\electron\electronat\table_status.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
1641593021 g:\electron\electronat\drawing_components.h
<graphics.h>
<windows.h>
<cmath>
<math.h>
1642197256 d:\electron\electronat\startup_page.h
"open_save.h"
"functii_auxiliare.h"
1642198066 d:\electron\electronat\workplace_page.h
"drawing_components.h"
"stare_table.h"
"zoom_rotate_fader_workplace.h"
"functii_auxiliare.h"
1638739266 d:\electron\electronat\components.h
"workplace_page.h"
1642186267 d:\electron\electronat\menu_selection.h
1642186306 d:\electron\electronat\change_color_panel.h
"startup_page.h"
"workplace_page.h"
1638739266 d:\electron\electronat\table_status.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
1642186244 d:\electron\electronat\new_project_name_reading_window.h
<winuser.h>
1642186294 d:\electron\electronat\drawing_components.h
<graphics.h>
<windows.h>
<cmath>
<math.h>
1638913473 g:\electron\electronat\error_panels_main_menu.h
<windows.h>
1641655289 g:\electron\electronat\messages_panels_main_menu.h
<windows.h>
1638922837 d:\electronuaic\electron\electronat\messages_panels_main_menu.h
<windows.h>
1640165519 d:\electronuaic\electron\electronat\open_save.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
"drawing_components.h"
1641419126 g:\electron\electronat\open_save.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
"drawing_components.h"
1641593333 g:\electron\electronat\messages_log_panel.h
1641651232 g:\electron\electronat\edit_component_value.h
<winuser.h>
1641593021 g:\electron\electronat\zoom_rotate_fader_workplace.h
1642197415 d:\electron\electronat\stare_table.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
<bits/stdc++.h>
"drawing_components.h"
"functii_auxiliare.h"
1641659499 d:\electron\electronat\messages_log_panel.h
1641721335 d:\electron\electronat\zoom_rotate_fader_workplace.h
1642186249 d:\electron\electronat\messages_panels_main_menu.h
<windows.h>
1642190639 d:\electron\electronat\open_save.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
"drawing_components.h"
"stare_table.h"
1642186279 d:\electron\electronat\edit_component_value.h
<winuser.h>
1642186299 d:\electron\electronat\choose_from_two_options.h
1642188519 source:c:\users\user\downloads\electronat\main.cpp
<iostream>
<graphics.h>
<string.h>
<winuser.h>
<sys/types.h>
<sys/stat.h>
<unistd.h>
<filesystem>
"startup_page.h"
"workplace_page.h"
"menu_selection.h"
"stare_table.h"
"new_project_name_reading_window.h"
"drawing_components.h"
"messages_panels_main_menu.h"
"open_save.h"
"change_color_panel.h"
"messages_log_panel.h"
"edit_component_value.h"
"zoom_rotate_fader_workplace.h"
"choose_from_two_options.h"
1642188654 c:\users\user\downloads\electronat\startup_page.h
"open_save.h"
1642189610 c:\users\user\downloads\electronat\open_save.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
"drawing_components.h"
"stare_table.h"
1642186294 c:\users\user\downloads\electronat\drawing_components.h
<graphics.h>
<windows.h>
<cmath>
<math.h>
1642189959 c:\users\user\downloads\electronat\stare_table.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
<bits/stdc++.h>
"drawing_components.h"
1642188698 c:\users\user\downloads\electronat\workplace_page.h
"drawing_components.h"
"stare_table.h"
"zoom_rotate_fader_workplace.h"
1641721335 c:\users\user\downloads\electronat\zoom_rotate_fader_workplace.h
1642186267 c:\users\user\downloads\electronat\menu_selection.h
1642186244 c:\users\user\downloads\electronat\new_project_name_reading_window.h
<winuser.h>
1642186249 c:\users\user\downloads\electronat\messages_panels_main_menu.h
<windows.h>
1642186306 c:\users\user\downloads\electronat\change_color_panel.h
"startup_page.h"
"workplace_page.h"
1641659499 c:\users\user\downloads\electronat\messages_log_panel.h
1642186279 c:\users\user\downloads\electronat\edit_component_value.h
<winuser.h>
1642186299 c:\users\user\downloads\electronat\choose_from_two_options.h
1642191142 source:c:\users\user\desktop\electronat\main.cpp
<iostream>
<graphics.h>
<string.h>
<winuser.h>
<sys/types.h>
<sys/stat.h>
<unistd.h>
<filesystem>
"startup_page.h"
"workplace_page.h"
"menu_selection.h"
"stare_table.h"
"new_project_name_reading_window.h"
"drawing_components.h"
"messages_panels_main_menu.h"
"open_save.h"
"change_color_panel.h"
"messages_log_panel.h"
"edit_component_value.h"
"zoom_rotate_fader_workplace.h"
"choose_from_two_options.h"
"functii_auxiliare.h"
1642191154 c:\users\user\desktop\electronat\startup_page.h
"open_save.h"
"functii_auxiliare.h"
1642190639 c:\users\user\desktop\electronat\open_save.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
"drawing_components.h"
"stare_table.h"
1642186294 c:\users\user\desktop\electronat\drawing_components.h
<graphics.h>
<windows.h>
<cmath>
<math.h>
1642191150 c:\users\user\desktop\electronat\stare_table.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
<bits/stdc++.h>
"drawing_components.h"
"functii_auxiliare.h"
1642191162 c:\users\user\desktop\electronat\workplace_page.h
"drawing_components.h"
"stare_table.h"
"zoom_rotate_fader_workplace.h"
"functii_auxiliare.h"
1641721335 c:\users\user\desktop\electronat\zoom_rotate_fader_workplace.h
1642186267 c:\users\user\desktop\electronat\menu_selection.h
1642186244 c:\users\user\desktop\electronat\new_project_name_reading_window.h
<winuser.h>
1642186249 c:\users\user\desktop\electronat\messages_panels_main_menu.h
<windows.h>
1642186306 c:\users\user\desktop\electronat\change_color_panel.h
"startup_page.h"
"workplace_page.h"
1641659499 c:\users\user\desktop\electronat\messages_log_panel.h
1642186279 c:\users\user\desktop\electronat\edit_component_value.h
<winuser.h>
1642186299 c:\users\user\desktop\electronat\choose_from_two_options.h
1642191187 c:\users\user\desktop\electronat\functii_auxiliare.h
1642197535 source:c:\users\andre\desktop\electronat\main.cpp
<iostream>
<graphics.h>
<string.h>
<winuser.h>
<sys/types.h>
<sys/stat.h>
<unistd.h>
<filesystem>
"startup_page.h"
"workplace_page.h"
"menu_selection.h"
"stare_table.h"
"new_project_name_reading_window.h"
"drawing_components.h"
"messages_panels_main_menu.h"
"open_save.h"
"change_color_panel.h"
"messages_log_panel.h"
"edit_component_value.h"
"zoom_rotate_fader_workplace.h"
"choose_from_two_options.h"
"functii_auxiliare.h"
1642197256 c:\users\andre\desktop\electronat\startup_page.h
"open_save.h"
"functii_auxiliare.h"
1642190639 c:\users\andre\desktop\electronat\open_save.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
"drawing_components.h"
"stare_table.h"
1642186294 c:\users\andre\desktop\electronat\drawing_components.h
<graphics.h>
<windows.h>
<cmath>
<math.h>
1642197415 c:\users\andre\desktop\electronat\stare_table.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
<bits/stdc++.h>
"drawing_components.h"
"functii_auxiliare.h"
1642197769 c:\users\andre\desktop\electronat\functii_auxiliare.h
1642198066 c:\users\andre\desktop\electronat\workplace_page.h
"drawing_components.h"
"stare_table.h"
"zoom_rotate_fader_workplace.h"
"functii_auxiliare.h"
1641721335 c:\users\andre\desktop\electronat\zoom_rotate_fader_workplace.h
1642186267 c:\users\andre\desktop\electronat\menu_selection.h
1642186244 c:\users\andre\desktop\electronat\new_project_name_reading_window.h
<winuser.h>
1642186249 c:\users\andre\desktop\electronat\messages_panels_main_menu.h
<windows.h>
1642186306 c:\users\andre\desktop\electronat\change_color_panel.h
"startup_page.h"
"workplace_page.h"
1641659499 c:\users\andre\desktop\electronat\messages_log_panel.h
1642186279 c:\users\andre\desktop\electronat\edit_component_value.h
<winuser.h>
1642186299 c:\users\andre\desktop\electronat\choose_from_two_options.h
1642197535 source:c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\main.cpp
<iostream>
<graphics.h>
<string.h>
<winuser.h>
<sys/types.h>
<sys/stat.h>
<unistd.h>
<filesystem>
"startup_page.h"
"workplace_page.h"
"menu_selection.h"
"stare_table.h"
"new_project_name_reading_window.h"
"drawing_components.h"
"messages_panels_main_menu.h"
"open_save.h"
"change_color_panel.h"
"messages_log_panel.h"
"edit_component_value.h"
"zoom_rotate_fader_workplace.h"
"choose_from_two_options.h"
"functii_auxiliare.h"
1642197256 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\startup_page.h
"open_save.h"
"functii_auxiliare.h"
1642190639 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\open_save.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
"drawing_components.h"
"stare_table.h"
1642186294 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\drawing_components.h
<graphics.h>
<windows.h>
<cmath>
<math.h>
1642197415 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\stare_table.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
<bits/stdc++.h>
"drawing_components.h"
"functii_auxiliare.h"
1642197769 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\functii_auxiliare.h
1642197028 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\workplace_page.h
"drawing_components.h"
"stare_table.h"
"zoom_rotate_fader_workplace.h"
"functii_auxiliare.h"
1641721335 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\zoom_rotate_fader_workplace.h
1642186267 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\menu_selection.h
1642186244 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\new_project_name_reading_window.h
<winuser.h>
1642186249 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\messages_panels_main_menu.h
<windows.h>
1642186306 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\change_color_panel.h
"startup_page.h"
"workplace_page.h"
1641659499 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\messages_log_panel.h
1642186279 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\edit_component_value.h
<winuser.h>
1642186299 c:\users\user\downloads\1e2_tudorilade_cerbuandreimihnea (1)\electronat\choose_from_two_options.h
1642197769 d:\electron\electronat\functii_auxiliare.h
1642201135 source:c:\users\andrei - mihnea\desktop\electronat\main.cpp
<iostream>
<graphics.h>
<string.h>
<winuser.h>
<sys/types.h>
<sys/stat.h>
<unistd.h>
<filesystem>
"startup_page.h"
"workplace_page.h"
"menu_selection.h"
"stare_table.h"
"new_project_name_reading_window.h"
"drawing_components.h"
"messages_panels_main_menu.h"
"open_save.h"
"change_color_panel.h"
"messages_log_panel.h"
"edit_component_value.h"
"zoom_rotate_fader_workplace.h"
"choose_from_two_options.h"
"functii_auxiliare.h"
1642200856 c:\users\andrei - mihnea\desktop\electronat\startup_page.h
"open_save.h"
"functii_auxiliare.h"
1642194239 c:\users\andrei - mihnea\desktop\electronat\open_save.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
"drawing_components.h"
"stare_table.h"
1642189894 c:\users\andrei - mihnea\desktop\electronat\drawing_components.h
<graphics.h>
<windows.h>
<cmath>
<math.h>
1642201015 c:\users\andrei - mihnea\desktop\electronat\stare_table.h
<vector>
<stack>
<conio.h>
<sys/types.h>
<sys/stat.h>
<stdio.h>
<stdlib.h>
<unistd.h>
<filesystem>
<bits/stdc++.h>
"drawing_components.h"
"functii_auxiliare.h"
1642201369 c:\users\andrei - mihnea\desktop\electronat\functii_auxiliare.h
1642201666 c:\users\andrei - mihnea\desktop\electronat\workplace_page.h
"drawing_components.h"
"stare_table.h"
"zoom_rotate_fader_workplace.h"
"functii_auxiliare.h"
1641724935 c:\users\andrei - mihnea\desktop\electronat\zoom_rotate_fader_workplace.h
1642189867 c:\users\andrei - mihnea\desktop\electronat\menu_selection.h
1642189844 c:\users\andrei - mihnea\desktop\electronat\new_project_name_reading_window.h
<winuser.h>
1642189849 c:\users\andrei - mihnea\desktop\electronat\messages_panels_main_menu.h
<windows.h>
1642189906 c:\users\andrei - mihnea\desktop\electronat\change_color_panel.h
"startup_page.h"
"workplace_page.h"
1641663099 c:\users\andrei - mihnea\desktop\electronat\messages_log_panel.h
1642189879 c:\users\andrei - mihnea\desktop\electronat\edit_component_value.h
<winuser.h>
1642189899 c:\users\andrei - mihnea\desktop\electronat\choose_from_two_options.h
+75
View File
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Debug" />
<File name="workplace_page.h" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="-2" zoom_2="0">
<Cursor>
<Cursor1 position="11205" topLine="208" />
</Cursor>
</File>
<File name="choose_from_two_options.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="-2" zoom_2="0">
<Cursor>
<Cursor1 position="115" topLine="0" />
</Cursor>
</File>
<File name="edit_component_value.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="206" topLine="257" />
</Cursor>
</File>
<File name="startup_page.h" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="-2" zoom_2="0">
<Cursor>
<Cursor1 position="122" topLine="0" />
</Cursor>
</File>
<File name="open_save.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="-2" zoom_2="0">
<Cursor>
<Cursor1 position="410" topLine="29" />
</Cursor>
</File>
<File name="messages_panels_main_menu.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="135" topLine="16" />
</Cursor>
</File>
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="-1" zoom_2="0">
<Cursor>
<Cursor1 position="1041" topLine="30" />
</Cursor>
</File>
<File name="new_project_name_reading_window.h" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="-2" zoom_2="0">
<Cursor>
<Cursor1 position="201" topLine="0" />
</Cursor>
</File>
<File name="functii_auxiliare.h" open="1" top="0" tabpos="14" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="471" topLine="0" />
</Cursor>
</File>
<File name="change_color_panel.h" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="7608" topLine="0" />
</Cursor>
</File>
<File name="menu_selection.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="-1" zoom_2="0">
<Cursor>
<Cursor1 position="4573" topLine="73" />
</Cursor>
</File>
<File name="zoom_rotate_fader_workplace.h" open="1" top="0" tabpos="13" split="0" active="1" splitpos="0" zoom_1="-3" zoom_2="0">
<Cursor>
<Cursor1 position="3473" topLine="21" />
</Cursor>
</File>
<File name="drawing_components.h" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="-1" zoom_2="0">
<Cursor>
<Cursor1 position="211" topLine="0" />
</Cursor>
</File>
<File name="stare_table.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="-2" zoom_2="0">
<Cursor>
<Cursor1 position="358" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>
Binary file not shown.
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 700 KiB

+251
View File
@@ -0,0 +1,251 @@
#ifndef CHANGE_COLOR_PANEL_H_INCLUDED
#define CHANGE_COLOR_PANEL_H_INCLUDED
#include "startup_page.h"
#include "workplace_page.h"
//Andrei CERBU pana jos
void change_color_icon_startup_page(int var, int W, int H, int R)
{
switch(var)
{
case 1:
setlinestyle(SOLID_LINE,0,7);
setcolor(RED);
rectangle(W/6,H/4,W/6+R*H/6,H/4+R*H/6);
break;
case 2:
setlinestyle(SOLID_LINE,0,7);
setcolor(RED);
rectangle(W/3,H/4,W/3+R*H/6,H/4+R*H/6);
break;
case 3:
setlinestyle(SOLID_LINE,0,7);
setcolor(RED);
rectangle(W/6,3*H/4-R*H/6,W/6+R*H/6,3*H/4);
break;
case 4:
setlinestyle(SOLID_LINE,0,7);
setcolor(RED);
rectangle(W/3,3*H/4-R*H/6,W/3+R*H/6,3*H/4);
break;
case 0:
setcolor(WHITE);
create_panels_startup_page(W,H,R);
break;
}
}
void change_color_icon_top_menu_workplace_page(int W, int H, int R, int val){
int width_rectangle = W/12;
int height_rectangle = H/24;
switch(val){
case 1:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle(3*width_rectangle*R,0,4*width_rectangle*R, height_rectangle*R);
break;
case 2:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle(4*width_rectangle*R,0,5*width_rectangle*R, height_rectangle*R);
break;
case 3:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle(5*width_rectangle*R,0,6*width_rectangle*R, height_rectangle*R);
break;
case 4:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle(6*width_rectangle*R,0,7*width_rectangle*R, height_rectangle*R);
break;
case 5:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle(7*width_rectangle*R,0,8*width_rectangle*R, height_rectangle*R);
break;
case 6:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle(8*width_rectangle*R,0,9*width_rectangle*R, height_rectangle*R);
break;
case 0:
setlinestyle(SOLID_LINE,0,3);
setcolor(WHITE);
create_top_menu_workplace(W,H,R,W/12,H/24);
break;
}
}
void change_color_icon_left_menu_workplace_page(int W, int H, int R, int val){
int width_rectangle = W/9;
int height_rectangle = H/16;
switch(val){
case 1:
setlinestyle(SOLID_LINE,0,2);
setcolor(RED);
rectangle(0,(height_rectangle*3)*R,width_rectangle*R,(height_rectangle*4)*R);
break;
case 2:
setlinestyle(SOLID_LINE,0,2);
setcolor(RED);
rectangle(0,(height_rectangle*4)*R,width_rectangle*R,(height_rectangle*5)*R);
break;
case 3:
setlinestyle(SOLID_LINE,0,2);
setcolor(RED);
rectangle(0,(height_rectangle*5)*R,width_rectangle*R,(height_rectangle*6)*R);
break;
case 4:
setlinestyle(SOLID_LINE,0,2);
setcolor(RED);
rectangle(0,(height_rectangle*6)*R,width_rectangle*R,(height_rectangle*7)*R);
break;
case 5:
setlinestyle(SOLID_LINE,0,2);
setcolor(RED);
rectangle(0,(height_rectangle*7)*R,width_rectangle*R,(height_rectangle*8)*R);
break;
case 6:
setlinestyle(SOLID_LINE,0,2);
setcolor(RED);
rectangle(0,(height_rectangle*8)*R,width_rectangle*R,(height_rectangle*9)*R);
break;
case 7:
setlinestyle(SOLID_LINE,0,2);
setcolor(RED);
rectangle(0,(height_rectangle*9)*R,width_rectangle*R,(height_rectangle*10)*R);
break;
case 8:
setlinestyle(SOLID_LINE,0,2);
setcolor(RED);
rectangle(0,(height_rectangle*10)*R,width_rectangle*R,(height_rectangle*11)*R);
break;
case 9:
setlinestyle(SOLID_LINE,0,2);
setcolor(RED);
rectangle(0,(height_rectangle*11)*R,width_rectangle*R,(height_rectangle*12)*R);
break;
case 0:
setlinestyle(SOLID_LINE,0,3);
setcolor(WHITE);
create_left_menu_workplace(W,H,R,W/9,H/16);
break;
}
}
void change_color_icon_right_menu_workplace_page(int W, int H, int R, int val){
int width_rectangle = W/9;
int height_rectangle = H/16;
switch(val){
case 1:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle((W-width_rectangle)*R,2*height_rectangle*R,W,3*height_rectangle*R);
break;
case 2:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle((W-width_rectangle)*R,3*height_rectangle*R,W,4*height_rectangle*R);
break;
case 3:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle((W-width_rectangle)*R,4*height_rectangle*R,W,5*height_rectangle*R);
break;
case 4:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle((W-width_rectangle)*R,5*height_rectangle*R,W,6*height_rectangle*R);
break;
case 5:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle((W-width_rectangle)*R,6*height_rectangle*R,W,7*height_rectangle*R);
break;
case 6:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle((W-width_rectangle)*R,7*height_rectangle*R,W,8*height_rectangle*R);
break;
case 0:
setlinestyle(SOLID_LINE,0,3);
setcolor(WHITE);
create_right_menu_workplace(W,H,R,W/9,H/16);
break;
}
}
void change_color_icon_undo_redu_menu_workplace_page(int W, int H, int R, int val){
int width_rectangle = W/18;
int height_rectangle = H/16;
switch(val){
case 1:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle(2*width_rectangle/9,14.2*height_rectangle*R,width_rectangle,15*height_rectangle*R);
break;
case 2:
setlinestyle(SOLID_LINE,0,3);
setcolor(RED);
rectangle(width_rectangle,14.2*height_rectangle*R,16*width_rectangle/9,15*height_rectangle*R);
break;
case 0:
setlinestyle(SOLID_LINE,0,3);
setcolor(WHITE);
create_undo_redo_menu_workplace(W,H,R,W/18,H/16);
break;
}
}
void change_color_icon_drawing_line_type_menu_workplace(int W, int H, int R, int val, int condition){
int width_rectangle = W/10;
int height_rectangle = H/22;
switch(val){
case 1:
setlinestyle(SOLID_LINE,0,1);
setcolor(RED);
rectangle((W-width_rectangle)*R,(height_rectangle*11.1)*R,W-width_rectangle/9,(height_rectangle*12.1)*R);
break;
case 4:
setlinestyle(SOLID_LINE,0,1);
setcolor(RED);
rectangle((W-width_rectangle)*R,(height_rectangle*12.1)*R,W-width_rectangle/9,(height_rectangle*13.1)*R);
break;
case 2:
setlinestyle(SOLID_LINE,0,1);
setcolor(RED);
rectangle((W-width_rectangle)*R,(height_rectangle*13.1)*R,W-width_rectangle/9,(height_rectangle*14.1)*R);
break;
case 3:
setlinestyle(SOLID_LINE,0,1);
setcolor(RED);
rectangle((W-width_rectangle)*R,(height_rectangle*14.1)*R,W-width_rectangle/9,(height_rectangle*15.1)*R);
break;
case 0:
if(!condition){
setlinestyle(SOLID_LINE,0,1);
setcolor(WHITE);
create_drawing_line_type_menu_workplace(W,H,R,W/10,H/22,WHITE);
}
break;
}
}
void change_color_icon_zoom_rotate_menu_workplace_page(int W, int H, int R, int width_rectangle, int height_rectangle, int color){
setcolor(color);
setlinestyle(SOLID_LINE,0,2);
rectangle((W-width_rectangle)*R,(height_rectangle*16.1)*R,(W-width_rectangle)*R+4*W/225*2,(height_rectangle*20.1)*R);
rectangle((W-width_rectangle)*R+4*W/225*3,(height_rectangle*16.1)*R,(W-width_rectangle)*R+4*W/225*5,(height_rectangle*20.1)*R);
}
#endif // CHANGE_COLOR_PANEL_H_INCLUDED
+158
View File
@@ -0,0 +1,158 @@
#ifndef CHOOSE_FROM_TWO_OPTIONS_H_INCLUDED
#define CHOOSE_FROM_TWO_OPTIONS_H_INCLUDED
//Andrei CERBU pana jos
void print_text_on_choose_from_two_options_page(int W, int H, int R, int width_rectangle, int height_rectangle, int rect_w, int rect_h, char* str){
int text_w=textwidth(str);
int text_h=textheight(str);
float x=(width_rectangle+(rect_w-text_w)/2);
float y=(height_rectangle+(rect_h-text_h)/2);
outtextxy(x,y,str);
}
void draw_pannels_choose_from_two_options_menu(int W, int H, int R){
setlinestyle(SOLID_LINE,0,1);
setcolor(WHITE);
int width_rectangle;
int height_rectangle;
width_rectangle=W/4;
height_rectangle=H/2;
rectangle(width_rectangle-W/5,height_rectangle-H/8,width_rectangle+W/5,height_rectangle+H/8);//latest project
width_rectangle=3*W/4;
height_rectangle=H/2;
rectangle(width_rectangle-W/5,height_rectangle-H/8,width_rectangle+W/5,height_rectangle+H/8);//new project
width_rectangle=W-3*W/32;
height_rectangle=H/10;
rectangle(width_rectangle-3*W/40,height_rectangle-2*H/30,width_rectangle+3*W/40,height_rectangle+2*H/30);//back
}
void put_text_on_choose_from_two_options_menu(int W, int H, int R){
int font;
int width_rectangle;
int height_rectangle;
if(W*4<=1920)
font=1;
else font=2;
settextstyle(COMPLEX_FONT,0,font);
width_rectangle=W/4;
height_rectangle=H/2;
print_text_on_choose_from_two_options_page(W,H,R,width_rectangle-W/5,height_rectangle-H/8,2*W/5,H/4,"Last Project");
width_rectangle=3*W/4;
height_rectangle=H/2;
print_text_on_choose_from_two_options_page(W,H,R,width_rectangle-W/5,height_rectangle-H/8,2*W/5,H/4,"New Project");
width_rectangle=W-3*W/32;
height_rectangle=H/10;
print_text_on_choose_from_two_options_page(W,H,R,width_rectangle-3*W/40,height_rectangle-2*H/30,3*W/20,2*H/15,"Back");
}
void change_color_to_choose_from_two_options_menu(int W, int H, int R, int val){
int width_rectangle;
int height_rectangle;
switch(val){
case 1:
setlinestyle(SOLID_LINE,0,1);
setcolor(RED);
width_rectangle=W/4;
height_rectangle=H/2;
rectangle(width_rectangle-W/5,height_rectangle-H/8,width_rectangle+W/5,height_rectangle+H/8);//latest project
break;
case 2:
setlinestyle(SOLID_LINE,0,1);
setcolor(RED);
width_rectangle=3*W/4;
height_rectangle=H/2;
rectangle(width_rectangle-W/5,height_rectangle-H/8,width_rectangle+W/5,height_rectangle+H/8);//new project
break;
case 3:
setlinestyle(SOLID_LINE,0,1);
setcolor(RED);
width_rectangle=W-3*W/32;
height_rectangle=H/10;
rectangle(width_rectangle-3*W/40,height_rectangle-2*H/30,width_rectangle+3*W/40,height_rectangle+2*H/30);//back
break;
case 0:
draw_pannels_choose_from_two_options_menu(W,H,R);
break;
}
}
int menu_selection_choose_from_two_options(int W, int H, int R, int x, int y){
int width_rectangle;
int height_rectangle;
width_rectangle=W/4;
height_rectangle=H/2;
if(x>width_rectangle-W/5&&x<width_rectangle+W/5&&y>height_rectangle-H/8&&y<height_rectangle+H/8)
return 1;
width_rectangle=3*W/4;
height_rectangle=H/2;
if(x>width_rectangle-W/5&&x<width_rectangle+W/5&&y>height_rectangle-H/8&&y<height_rectangle+H/8)
return 2;
width_rectangle=W-3*W/32;
height_rectangle=H/10;
if(x>width_rectangle-3*W/40&&x<width_rectangle+3*W/40&&y>height_rectangle-2*H/30&&y<height_rectangle+2*H/30)
return 3;
return 0;
}
int choose_from_two_options(int W, int H, float R){
POINT cursorPos;
int panel=initwindow(W,H,"Choose",W,H,false,false);
draw_pannels_choose_from_two_options_menu(W,H,R);
put_text_on_choose_from_two_options_menu(W,H,R);
do{
GetCursorPos(&cursorPos);
ScreenToClient(GetForegroundWindow(),&cursorPos);
change_color_to_choose_from_two_options_menu(W,H,R,menu_selection_choose_from_two_options(W,H,R,cursorPos.x,cursorPos.y));
if(ismouseclick(WM_LBUTTONDOWN)){
if(menu_selection_choose_from_two_options(W,H,R,cursorPos.x,cursorPos.y)){
closegraph(panel);
return menu_selection_choose_from_two_options(W,H,R,cursorPos.x,cursorPos.y);
}
else clearmouseclick(WM_LBUTTONDOWN);
}
}
while(true);
}
#endif // CHOOSE_FROM_TWO_OPTIONS_H_INCLUDED
+789
View File
@@ -0,0 +1,789 @@
#ifndef DRAWING_COMPONENTS_H_INCLUDED
#define DRAWING_COMPONENTS_H_INCLUDED
#include <graphics.h>
#include <windows.h>
#include <cmath>
#include <math.h>
using namespace std;
//Andrei CERBU pana jos
struct coordonate
{
float x, y;
};
typedef struct dreptunghi
{
coordonate TL, TR, BR, BL;
} drepunghi;
typedef struct componenta
{
int line_width=0;
int branch;
float points[8];
};
struct dreptunghi create_struct_rectangle(float w1, float w2, float h1, float h2)
{
dreptunghi D;
D.TL.x=w1,D.TL.y=h1;
D.TR.x=w2,D.TR.y=h1;
D.BL.x=w1,D.BL.y=h2;
D.BR.x=w2,D.BR.y=h2;
return D;
}
struct dreptunghi translate_rectangle(drepunghi D, coordonate C)
{
D.TL.x-=C.x,D.TL.y-=C.y;
D.TR.x-=C.x,D.TR.y-=C.y;
D.BR.x-=C.x,D.BR.y-=C.y;
D.BL.x-=C.x,D.BL.y-=C.y;
return D;
}
struct coordonate determine_points(float pointX, float pointY, float beta)
{
coordonate C;
C.x=cos(beta)*pointX-sin(beta)*pointY;
C.y=sin(beta)*pointX+cos(beta)*pointY;
return C;
}
struct componenta RotateRectangle(coordonate C, drepunghi D, int angle, int branch)
{
componenta CMP;
if(branch<=2) //componenta care trebuie sa se invarta
{
double beta=-(double)(angle%360)*M_PI/180.0;
D.TL=determine_points(D.TL.x,D.TL.y,beta);
D.TR=determine_points(D.TR.x,D.TR.y,beta);
D.BR=determine_points(D.BR.x,D.BR.y,beta);
D.BL=determine_points(D.BL.x,D.BL.y,beta);
if(branch==1)
{
float point[8]=
{
(D.TL.x+C.x),(D.TL.y+C.y),
(D.TR.x+C.x),(D.TR.y+C.y),
(D.BR.x+C.x),(D.BR.y+C.y),
(D.BL.x+C.x),(D.BL.y+C.y)
};
for(int i=0; i<8; i++)
CMP.points[i]=point[i];
}
else if(branch==2)
{
CMP.points[0]=D.TL.x+C.x;
CMP.points[1]=D.TL.y+C.y;
CMP.points[2]=D.BR.x+C.x;
CMP.points[3]=D.BR.y+C.y;
}
}
if(branch==3) /*componenta care nu trebuie sa se invarta*/
{
CMP.points[0]=D.TL.x;
CMP.points[1]=D.TL.y;
CMP.points[2]=D.BR.x;
CMP.points[3]=D.BR.y;
}
if(branch==4) /*cerc*/
{
CMP.points[0]=D.TL.x;
CMP.points[1]=D.TL.y;
CMP.points[2]=D.TR.x;
}
CMP.branch=branch;
return CMP;
}
void construct_resistor(int W, int H, float R, int X, int Y, int angle, float zoom, struct componenta CMP[])
{
int width = W/8, height = H/4;
float w1, w2, h1, h2, w, h;
dreptunghi D;
coordonate C;
C.x=X, C.y=Y;
//chenar
w1=-(width*4-width/1.7)*R*zoom+X, w2=(width*4-width/1.7)*R*zoom+X,
h1=-(height*2-height/2.7)*R*zoom+Y, h2=(height*2-height/2.7)*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[1]=RotateRectangle(C,D,angle,1);
//conector stanga
w1=-3.3*width*R*zoom+X, w2=-3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[2]=RotateRectangle(C,D,angle,1);
//conector drept
w1=3*width*R*zoom+X, w2=3.3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[3]=RotateRectangle(C,D,angle,1);
//corp
w1=-3*width/2*R*zoom+X, w2=3*width/2*R*zoom+X,
h1=-height*R*zoom+Y, h2=height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[4]=RotateRectangle(C,D,angle,1);
//linie stanga
w1=-3*width*R*zoom+X, w2=-3*width/2*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[5]=RotateRectangle(C,D,angle,1);
//linie dreapta
w1=3*width/2*R*zoom+X, w2=3*width*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[6]=RotateRectangle(C,D,angle,1);
}
void construct_fuse(int W, int H, float R, int X, int Y, int angle, float zoom, struct componenta CMP[])
{
int width = W/8, height = H/4;
float w1, w2, h1, h2, w, h;
dreptunghi D;
coordonate C;
C.x=X, C.y=Y;
//chenar
w1=-(width*4-width/1.7)*R*zoom+X, w2=(width*4-width/1.7)*R*zoom+X,
h1=-(height*2-height/2.7)*R*zoom+Y, h2=(height*2-height/2.7)*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[1]=RotateRectangle(C,D,angle,1);
//conector stanga
w1=-3.3*width*R*zoom+X, w2=-3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[2]=RotateRectangle(C,D,angle,1);
//conector drept
w1=3*width*R*zoom+X, w2=3.3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[3]=RotateRectangle(C,D,angle,1);
//corp
w1=-3*width/2*R*zoom+X, w2=3*width/2*R*zoom+X,
h1=-height*R*zoom+Y, h2=height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[4]=RotateRectangle(C,D,angle,1);
//linie
w1=-3*width*R*zoom+X, w2=3*width*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[5]=RotateRectangle(C,D,angle,1);
}
void construct_electrical_cell(int W, int H, float R, int X, int Y, int angle, float zoom, struct componenta CMP[])
{
int width = W/8, height = H/4;
float w1, w2, h1, h2, w, h;
dreptunghi D;
coordonate C;
C.x=X, C.y=Y;
//chenar
w1=-(width*4-width/1.7)*R*zoom+X, w2=(width*4-width/1.7)*R*zoom+X,
h1=-(height*2-height/2.7)*R*zoom+Y, h2=(height*2-height/2.7)*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[1]=RotateRectangle(C,D,angle,1);
//conector stanga
w1=-3.3*width*R*zoom+X, w2=-3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[2]=RotateRectangle(C,D,angle,1);
//conector drept
w1=3*width*R*zoom+X, w2=3.3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[3]=RotateRectangle(C,D,angle,1);
//borna minus
w1=-width/4*R*zoom+X, w2=-width/4*R*zoom+X,
h1=-4*height/3*R*zoom+Y, h2=4*height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[4]=RotateRectangle(C,D,angle,1);
//borna plus
w1=width/4*R*zoom+X, w2=width/4*R*zoom+X,
h1=-15*height/8*R*zoom+Y, h2=15*height/8*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[5]=RotateRectangle(C,D,angle,1);
//linie stanga
w1=-3*width*R*zoom+X, w2=-width/4*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[6]=RotateRectangle(C,D,angle,1);
//linie dreapta
w1=width/4*R*zoom+X, w2=3*width*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[7]=RotateRectangle(C,D,angle,1);
}
void construct_dioda(int W, int H, float R, int X, int Y, int angle, float zoom, struct componenta CMP[])
{
int width = W/8, height = H/4;
float w1, w2, h1, h2, w, h;
dreptunghi D;
coordonate C;
C.x=X, C.y=Y;
//chenar
w1=-(width*4-width/1.7)*R*zoom+X, w2=(width*4-width/1.7)*R*zoom+X,
h1=-(height*2-height/2.7)*R*zoom+Y, h2=(height*2-height/2.7)*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[1]=RotateRectangle(C,D,angle,1);
//conector stanga
w1=-3.3*width*R*zoom+X, w2=-3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[2]=RotateRectangle(C,D,angle,1);
//conector drept
w1=3*width*R*zoom+X, w2=3.3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[3]=RotateRectangle(C,D,angle,1);
//linie blocaj
w1=width*R*zoom+X, w2=width*R*zoom+X,
h1=-height*R*zoom+Y, h2=height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[4]=RotateRectangle(C,D,angle,1);
//linie stanga
w1=-3*width*R*zoom+X, w2=-width*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[5]=RotateRectangle(C,D,angle,1);
//linie dreapta
w1=width*R*zoom+X, w2=3*width*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[6]=RotateRectangle(C,D,angle,1);
///TRIUNGHI
//baza
w1=-width*R*zoom+X, w2=-width*R*zoom+X,
h1=-height*R*zoom+Y, h2=height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[7]=RotateRectangle(C,D,angle,1);
//latura sus->jos
w1=-width*R*zoom+X, w2=width*R*zoom+X,
h1=-height*R*zoom+Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[8]=RotateRectangle(C,D,angle,2);
//latura jos->sus
w1=-width*R*zoom+X, w2=width*R*zoom+X,
h1=height*R*zoom+Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[9]=RotateRectangle(C,D,angle,2);
}
void construct_ampermeter(int W, int H, float R, int X, int Y, int angle, float zoom, struct componenta CMP[])
{
int width = W/8, height = H/4;
float w1, w2, h1, h2, w, h;
dreptunghi D;
coordonate C;
C.x=X, C.y=Y;
//chenar
w1=-(width*4-width/1.7)*R*zoom+X, w2=(width*4-width/1.7)*R*zoom+X,
h1=-(height*2-height/2.7)*R*zoom+Y, h2=(height*2-height/2.7)*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[1]=RotateRectangle(C,D,angle,1);
//conector stanga
w1=-3.3*width*R*zoom+X, w2=-3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[2]=RotateRectangle(C,D,angle,1);
//conector dreapta
w1=3*width*R*zoom+X, w2=3.3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[3]=RotateRectangle(C,D,angle,1);
//linie stanga
w1=-3*width*R*zoom+X, w2=-width*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[4]=RotateRectangle(C,D,angle,1);
//linie dreapta
w1=width*R*zoom+X, w2=3*width*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[5]=RotateRectangle(C,D,angle,1);
///litera A
//talpa dreapta
w1=width/3*R*zoom+X, w2=39*width/84*R*zoom+X,
h1=height/3*R*zoom+Y, h2=height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[6]=RotateRectangle(C,D,angle,3);
CMP[6].line_width=3;
//picior drept
w1=width/10*R*zoom+X, w2=2*width/5*R*zoom+X,
h1=-height/2*R*zoom+Y, h2=height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[7]=RotateRectangle(C,D,angle,3);
CMP[7].line_width=3;
//tapla stanga
w1=-39*width/84*R*zoom+X, w2=-width/3*R*zoom+X,
h1=height/3*R*zoom+Y, h2=height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[8]=RotateRectangle(C,D,angle,3);
CMP[8].line_width=3;
//picior stang
w1=-width/10*R*zoom+X, w2=-2*width/5*R*zoom+X,
h1=-height/2*R*zoom+Y, h2=height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[9]=RotateRectangle(C,D,angle,3);
CMP[9].line_width=3;
//palarie
w1=-width/10*R*zoom+X, w2=width/5*R*zoom+X,
h1=-height/2*R*zoom+Y, h2=-height/2*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[10]=RotateRectangle(C,D,angle,3);
CMP[10].line_width=3;
//linie mijloc
w1=-width/4*R*zoom+X, w2=width/4*R*zoom+X,
h1=-height/12*R*zoom+Y, h2=-height/12*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[11]=RotateRectangle(C,D,angle,3);
CMP[11].line_width=3;
//centru
w1=X*R*zoom, w2=width*R*zoom,
h1=Y*R*zoom, h2=Y*R*zoom;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[12]=RotateRectangle(C,D,angle,4);
}
void construct_voltmeter(int W, int H, float R, int X, int Y, int angle, float zoom, struct componenta CMP[])
{
int width = W/8, height = H/4;
float w1, w2, h1, h2, w, h;
dreptunghi D;
coordonate C;
C.x=X, C.y=Y;
//chenar
w1=-(width*4-width/1.7)*R*zoom+X, w2=(width*4-width/1.7)*R*zoom+X,
h1=-(height*2-height/2.7)*R*zoom+Y, h2=(height*2-height/2.7)*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[1]=RotateRectangle(C,D,angle,1);
//conector stanga
w1=-3.3*width*R*zoom+X, w2=-3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[2]=RotateRectangle(C,D,angle,1);
//conector dreapta
w1=3*width*R*zoom+X, w2=3.3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[3]=RotateRectangle(C,D,angle,1);
//linie stanga
w1=-3*width*R*zoom+X, w2=-width*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[4]=RotateRectangle(C,D,angle,1);
//linie dreapta
w1=width*R*zoom+X, w2=3*width*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[5]=RotateRectangle(C,D,angle,1);
///litera V
//talpa dreapta
w1=width/3*R*zoom+X, w2=39*width/84*R*zoom+X,
h1=-height/3*R*zoom+Y, h2=-height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[6]=RotateRectangle(C,D,angle,3);
CMP[6].line_width=3;
//picior drept
w1=X*R*zoom, w2=2*width/5*R*zoom+X,
h1=height/2*R*zoom+Y, h2=-height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[7]=RotateRectangle(C,D,angle,3);
CMP[7].line_width=3;
//tapla stanga
w1=-39*width/84*R*zoom+X, w2=-width/3*R*zoom+X,
h1=-height/3*R*zoom+Y, h2=-height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[8]=RotateRectangle(C,D,angle,3);
CMP[8].line_width=3;
//picior stang
w1=X*R*zoom, w2=-2*width/5*R*zoom+X,
h1=height/2*R*zoom+Y, h2=-height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[9]=RotateRectangle(C,D,angle,3);
CMP[9].line_width=3;
//centru
w1=X*R*zoom, w2=width*R*zoom,
h1=Y*R*zoom, h2=Y*R*zoom;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[10]=RotateRectangle(C,D,angle,4);
}
void construct_capacitor(int W, int H, float R, int X, int Y, int angle, float zoom, struct componenta CMP[])
{
int width = W/8, height = H/4;
float w1, w2, h1, h2, w, h;
dreptunghi D;
coordonate C;
C.x=X, C.y=Y;
//chenar
w1=-(width*4-width/1.7)*R*zoom+X, w2=(width*4-width/1.7)*R*zoom+X,
h1=-(height*2-height/2.7)*R*zoom+Y, h2=(height*2-height/2.7)*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[1]=RotateRectangle(C,D,angle,1);
//conector stanga
w1=-3.3*width*R*zoom+X, w2=-3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[2]=RotateRectangle(C,D,angle,1);
//conector drept
w1=3*width*R*zoom+X, w2=3.3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[3]=RotateRectangle(C,D,angle,1);
//borna minus
w1=-width/4*R*zoom+X, w2=-width/4*R*zoom+X,
h1=-4*height/3*R*zoom+Y, h2=4*height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[4]=RotateRectangle(C,D,angle,1);
//borna plus
w1=width/4*R*zoom+X, w2=width/4*R*zoom+X,
h1=-4*height/3*R*zoom+Y, h2=4*height/3*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[5]=RotateRectangle(C,D,angle,1);
//linie stanga
w1=-3*width*R*zoom+X, w2=-width/4*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[6]=RotateRectangle(C,D,angle,1);
//linie dreapta
w1=width/4*R*zoom+X, w2=3*width*R*zoom+X,
h1=Y, h2=Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[7]=RotateRectangle(C,D,angle,1);
}
void construct_bulb(int W, int H, float R, int X, int Y, int angle, float zoom, struct componenta CMP[])
{
int width = W/8, height = H/4;
float w1, w2, h1, h2, w, h;
dreptunghi D;
coordonate C;
C.x=X, C.y=Y;
//chenar
w1=-(width*4-width/1.7)*R*zoom+X, w2=(width*4-width/1.7)*R*zoom+X,
h1=-(height*2-height/2.7)*R*zoom+Y, h2=(height*2-height/2.7)*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[1]=RotateRectangle(C,D,angle,1);
//conector stanga
w1=-3.3*width*R*zoom+X, w2=-3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[2]=RotateRectangle(C,D,angle,1);
//conector dreapta
w1=3*width*R*zoom+X, w2=3.3*width*R*zoom+X,
h1=-height/3*R*R*zoom+Y, h2=height/3*R*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[3]=RotateRectangle(C,D,angle,1);
//linie stanga
w1=-3*width*R*zoom+X, w2=-width*R*zoom+X,
h1=Y*R*zoom, h2=Y*R*zoom;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[4]=RotateRectangle(C,D,angle,1);
//linie dreapta
w1=width*R*zoom+X, w2=3*width*R*zoom+X,
h1=Y*R*zoom, h2=Y*R*zoom;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[5]=RotateRectangle(C,D,angle,1);
//bec linie stanga
w1=-2*width/5*R*zoom+X, w2=2*width/5*R*zoom+X,
h1=-height*R*zoom+Y, h2=height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[6]=RotateRectangle(C,D,angle,3);
//bec linie dreapta
w1=2*width/5*R*zoom+X, w2=-2*width/5*R*zoom+X,
h1=-height*R*zoom+Y, h2=height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[7]=RotateRectangle(C,D,angle,3);
//cerc
w1=X*R*zoom, w2=width*R*zoom,
h1=Y*R*zoom, h2=Y*R*zoom;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[8]=RotateRectangle(C,D,angle,4);
}
void construct_transistor(int W, int H, float R, int X, int Y, int angle, float zoom, struct componenta CMP[])
{
int width = W/8, height = H/4;
float w1, w2, h1, h2, w, h;
dreptunghi D;
coordonate C;
C.x=X, C.y=Y;
//chenar
w1=-2*width*R*zoom+X, w2=width*R*zoom+X,
h1=-(height*2-height/2.7)*R*zoom+Y, h2=(height*2-height/2.7)*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[1]=RotateRectangle(C,D,angle,1);
//conector stanga
w1=-1.8*width*R*zoom+X, w2=-1.5*width*R*zoom+X,
h1=-0.3*height*R*zoom+Y, h2=0.3*height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[2]=RotateRectangle(C,D,angle,1);
//conector top
w1=0.65*width*R*zoom+X, w2=0.95*width*R*zoom+X,
h1=-1.5*height*R*zoom+Y, h2=-height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[3]=RotateRectangle(C,D,angle,1);
//conector bot
w1=0.65*width*R*zoom+X, w2=0.95*width*R*zoom+X,
h1=height*R*zoom+Y, h2=1.5*height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[4]=RotateRectangle(C,D,angle,1);
//linie centru
w1=-0.1*width*R*zoom+X, w2=-0.1*width*R*zoom+X,
h1=-height/2*R*zoom+Y, h2=height/2*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[5]=RotateRectangle(C,D,angle,1);
//linie centru bot
w1=-0.1*width*R*zoom+X, w2=0.8*width*R*zoom+X,
h1=(height-height/1.2)*R*zoom+Y, h2=3*height/5.5*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[6]=RotateRectangle(C,D,angle,2);
//linie centru top
w1=-0.1*width*R*zoom+X, w2=0.8*width*R*zoom+X,
h1=(-(height-height/1.2))*R*zoom+Y, h2=-3*height/5.5*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[7]=RotateRectangle(C,D,angle,2);
//linie conector stanga
w1=-1.5*width*R*zoom+X, w2=-0.1*width*R*zoom+X,
h1=Y*R*zoom, h2=Y*R*zoom;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[8]=RotateRectangle(C,D,angle,1);
//linie conector top
w1=0.8*width*R*zoom+X, w2=0.8*width*R*zoom+X,
h1=-height/2*R*zoom+Y, h2=-height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[9]=RotateRectangle(C,D,angle,1);
//linie conector bot
w1=0.8*width*R*zoom+X, w2=0.8*width*R*zoom+X,
h1=height/2*R*zoom+Y, h2=height*R*zoom+Y;
D=create_struct_rectangle(w1,w2,h1,h2);
D=translate_rectangle(D,C);
CMP[10]=RotateRectangle(C,D,angle,1);
//centru
w1=X*R*zoom, w2=0.6*width*R*zoom,
h1=Y*R*zoom, h2=Y*R*zoom;
D=create_struct_rectangle(w1,w2,h1,h2);
CMP[11]=RotateRectangle(C,D,angle,4);
}
void draw_component(struct componenta CMP[], int n, int color)
{
setcolor(color);
for(int i=2; i<=n; i++)
{
setlinestyle(SOLID_LINE,0,CMP[i].line_width);
switch(CMP[i].branch)
{
case 1:
for(int j=0; j<8; j+=2)
line(CMP[i].points[j],CMP[i].points[j+1],CMP[i].points[(j+2)%8],CMP[i].points[(j+3)%8]);
break;
case 2:
line(CMP[i].points[0],CMP[i].points[1],CMP[i].points[2],CMP[i].points[3]);
break;
case 3:
line(CMP[i].points[0],CMP[i].points[1],CMP[i].points[2],CMP[i].points[3]);
break;
case 4:
circle(CMP[i].points[0],CMP[i].points[1],CMP[i].points[2]);
break;
}
}
}
void draw_components_on_working_table(int type, int W, int H, int X, int Y, float R, int angle, float zoom, int color, struct componenta CMP[])
{
switch(type)
{
case 1:
construct_resistor(W/10,H/16,R,X,Y,angle,zoom,CMP);
draw_component(CMP,6,color);
break;
case 2:
construct_fuse(W/10,H/16,R,X,Y,angle,zoom,CMP);
draw_component(CMP,5,color);
break;
case 3:
construct_electrical_cell(W/10,H/16,R,X,Y,angle,zoom,CMP);
draw_component(CMP,7,color);
break;
case 4:
construct_dioda(W/10,H/16,R,X,Y,angle,zoom,CMP);
draw_component(CMP,9,color);
break;
case 5:
construct_ampermeter(W/10,H/16,R,X,Y,angle,zoom,CMP);
draw_component(CMP,12,color);
break;
case 6:
construct_voltmeter(W/10,H/16,R,X,Y,angle,zoom,CMP);
draw_component(CMP,10,color);
break;
case 7:
construct_capacitor(W/10,H/16,R,X,Y,angle,zoom,CMP);
draw_component(CMP,7,color);
break;
case 8:
construct_bulb(W/10,H/16,R,X,Y,angle,zoom,CMP);
draw_component(CMP,8,color);
break;
case 9:
construct_transistor(W/10,H/16,R,X,Y,angle,zoom,CMP);
draw_component(CMP,11,color);
break;
}
}
#endif // DRAWING_COMPONENTS_H_INCLUDED
+319
View File
@@ -0,0 +1,319 @@
#ifndef EDIT_COMPONENT_VALUE_H_INCLUDED
#define EDIT_COMPONENT_VALUE_H_INCLUDED
#include <winuser.h>
using namespace std;
#define KEY_LEFT 75
#define KEY_RIGHT 77
//Andrei CEREBU pana jos
void creare_nume_componenta(int indx, char nume_componenta[], char unitate_masura[])
{
switch(indx)
{
case 1:
strcpy(nume_componenta,"Rezistor");
strcpy(unitate_masura,"Ohm");
break;
case 2:
strcpy(nume_componenta,"Fuse");
strcpy(unitate_masura,"Ohm");
break;
case 3:
strcpy(nume_componenta,"Battery");
strcpy(unitate_masura,"Volts");
break;
case 4:
strcpy(nume_componenta,"Dioda");
strcpy(unitate_masura,"Ohm");
break;
case 5:
strcpy(nume_componenta,"Ampermeter");
strcpy(unitate_masura,"Ohm");
break;
case 6:
strcpy(nume_componenta,"Voltmeter");
strcpy(unitate_masura,"Ohm");
break;
case 7:
strcpy(nume_componenta,"Capacitor");
strcpy(unitate_masura,"Farad");
break;
case 8:
strcpy(nume_componenta,"Transistor");
strcpy(unitate_masura,"Ohm");
break;
case 9:
strcpy(nume_componenta,"Light bulb");
strcpy(unitate_masura,"Ohm");
break;
}
}
int menu_selection_edit_value_window(int W, int H, int x, int y)
{
//enter button
if((x>W/2-W/10&&x<W/2+W/10)&&(y>H/2+3*H/12-H/12&&y<H/2+3*H/12+H/12))
return 1;
//back button
if((x>W-3*W/32-3*W/40&&x<W-3*W/32+3*W/40)&&(y>H/10-2*H/30&&y<H/10+2*H/30))
return 2;
return 0;
}
void print_text_on_edit_value_page(int W, int H, int R, int width_rectangle, int height_rectangle, int rect_w, int rect_h, char* str)
{
int text_w=textwidth(str);
int text_h=textheight(str);
float x=(width_rectangle+(rect_w-text_w)/2);
float y=(height_rectangle+(rect_h-text_h)/2);
outtextxy(x,y,str);
}
void draw_edit_value_window(int W, int H, float R, int cursor, char nume_componenta[], char unitate_masura[])
{
int width_rectangle, height_rectangle;
int font1, font2;
if(W*4<=1920)
font1=1,font2=3;
else font1=2,font2=4;
setlinestyle(SOLID_LINE,0,1);
settextstyle(COMPLEX_FONT,0,font1);
//text_box
width_rectangle=W/2;
height_rectangle=H/3+13*H/72;
rectangle(width_rectangle-W/4,height_rectangle-5*H/72,width_rectangle+W/4,height_rectangle+5*H/72);
line(W/2-W/5-W/80+W/31*cursor,H/3+H/9,W/2-W/5-W/80+W/31*cursor,H/3+H/4);
//enter_button
width_rectangle=W/2;
height_rectangle=H/2+3*H/12;
rectangle(width_rectangle-W/10,height_rectangle-H/12,width_rectangle+W/10,height_rectangle+H/12);
print_text_on_edit_value_page(W,H,R,width_rectangle-W/10,height_rectangle-H/12,W/5,H/6,"Enter");
//back_button
width_rectangle=W-3*W/32;
height_rectangle=H/10;
rectangle(width_rectangle-3*W/40,height_rectangle-2*H/30,width_rectangle+3*W/40,height_rectangle+2*H/30);
print_text_on_edit_value_page(W,H,R,width_rectangle-3*W/40,height_rectangle-2*H/30,3*W/20,2*H/15,"Back");
//unitate de masura
width_rectangle=W/2+4*W/12;
height_rectangle=H/3+13*H/72;
print_text_on_edit_value_page(W,H,R,width_rectangle-W/12,height_rectangle-5*H/72,W/6,5*H/36,unitate_masura);
settextstyle(EUROPEAN_FONT,0,font2);
//nume componenta
width_rectangle=W/2;
height_rectangle=H/2-4*H/20;
print_text_on_edit_value_page(W,H,R,width_rectangle-3*W/10,height_rectangle-H/20,3*W/5,H/10,nume_componenta);
}
void print_number_on_edit_value_screen(int W, int H, char aux[], int nr_elem)
{
setlinestyle(SOLID_LINE,0,W/120);
if(nr_elem>14) nr_elem-=14;
else nr_elem=0;
strcpy(aux,aux+nr_elem);
settextstyle(COMPLEX_FONT,0,1);
outtextxy(W/2-W/5-W/60,H/3+H/9+H/30,aux);
}
int det_numar_elemente(char number_initial[])
{
int nr_elem=0, i=0;
while(number_initial[i]!=0)
{
++nr_elem;
++i;
}
return nr_elem;
}
void convert_value_to_string(char number[], int nr)
{
int lenght=0;
do
{
number[lenght]=nr%10+'0';
nr/=10;
lenght+=1;
}
while(nr);
for(int i=0; i<lenght/2; i++)
{
char t = number[i];
number[i] = number[lenght-i-1];
number[lenght-i-1] = t;
}
}
int convert_string_to_value(char number[])
{
int nr=0;
for(int i=0; i<strlen(number); i++)
{
if(number[i]<'0'|| number[i]>'9')
return -1;
nr=nr*10+(number[i]-'0');
}
return nr;
}
int edit_value_window(int W, int H, float R, int indx, int value)
{
char number[10000];
convert_value_to_string(number, value);
int project_window1=initwindow(W/4,H/4,"Edit component",W/3,H/3,0,0);
POINT cursorPos;
char aux[10000], c, ex, number_initial[100000], unitate_masura[10],
nume_componenta[20];
int nr_elem=0, poz=0, cursor=0, xMouse, yMouse,
nr_elem_number_initial=det_numar_elemente(number_initial);
bool modif=false, afisare_numar_initial=false;
strcpy(number_initial,number);//se copiaza numarul initial
creare_nume_componenta(indx,nume_componenta,unitate_masura);
draw_edit_value_window(W/4,H/4,R,poz,nume_componenta,unitate_masura);
while(true)
{
GetCursorPos(&cursorPos);
ScreenToClient(GetForegroundWindow(), &cursorPos);
if(kbhit())
{
c=getch();
if(c&&c!=224)
{
if(c==8&&nr_elem&&poz)
{
strcpy(number+poz-1,number+poz);
nr_elem--;
--poz;
}
else if(c==13)
{
closegraph(project_window1);
return 0;
}
else if(nr_elem<10000&&c>=' '&&c<='~')
{
for(int i=nr_elem; i>poz; i--)
number[i]=number[i-1];
number[poz]=c;
++poz;
++nr_elem;
number[nr_elem]=0;
}
}
else
{
switch(ex=getch())
{
case KEY_LEFT:
if(poz>0)
--poz;
break;
case KEY_RIGHT:
if(poz<nr_elem)
++poz;
break;
}
}
if(poz>14)
cursor=14;
else cursor=poz;
//create new frame
cleardevice();
draw_edit_value_window(W/4,H/4,cursor,poz,nume_componenta,unitate_masura);
strcpy(aux,number);
print_number_on_edit_value_screen(W/4,H/4,aux,nr_elem);
if(nr_elem==0)
afisare_numar_initial=false;
}
if(afisare_numar_initial==false)
{
afisare_numar_initial=true;
cleardevice();
draw_edit_value_window(W/4,H/4,cursor,poz,nume_componenta,unitate_masura);
strcpy(aux,number_initial);
print_number_on_edit_value_screen(W/4,H/4,aux,nr_elem_number_initial);
}
if(ismouseclick(WM_LBUTTONDOWN))
{
getmouseclick(WM_LBUTTONDOWN,xMouse,yMouse);
switch(menu_selection_edit_value_window(W/4,H/4,xMouse,yMouse))
{
case 1://Enter was pressed
{
int val = convert_string_to_value(number);
if(val==-1)
{
//mesaj eroare
}
else
{
closegraph(project_window1);
memset(number, 0, 10000);
memset(number_initial, 0, 10000);
memset(aux, 0, 10000);
return val;
}
break;
}
case 2://back was pressed
strcpy(number,number_initial);
closegraph(project_window1);
memset(number, 0, 10000);
memset(number_initial, 0, 10000);
memset(aux, 0, 10000);
return value;
break;
case 0:
clearmouseclick(WM_LBUTTONDOWN);
break;
}
}
}
}
#endif // EDIT_COMPONENT_VALUE_H_INCLUDED
+1
View File
@@ -0,0 +1 @@
AT
+26
View File
@@ -0,0 +1,26 @@
#ifndef FUNCTII_AUXILIARE_H_INCLUDED
#define FUNCTII_AUXILIARE_H_INCLUDED
//Tudor Ilade
///Functie responsabila pentru a gasi calea absoluta a imaginilor folosite in proiect, indiferent de locatia proiectului pe dispozitiv
char* path_for_images(char* filename, char *path)
{
char *path_for_file=new char[strlen(path)+strlen(filename)+4];
*path_for_file='\0';
strcat(path_for_file,path);
strcat(path_for_file,"\\");
strcat(path_for_file,filename);
return path_for_file;
}
char* create_fixed_path(){
char cwd[256];
getcwd(cwd,256);
char* path = new char[strlen(cwd)+4];
*path = '\0';
strcat(path,cwd);
return path;
}
#endif // FUNCTII_AUXILIARE_H_INCLUDED
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

+7
View File
@@ -0,0 +1,7 @@
function SetBuildOptions(base)
{
if ( "LibFinder" in getroottable() )
{
LibFinder.SetupTarget(base);
}
}
+862
View File
@@ -0,0 +1,862 @@
///LIBRARIES
#include <iostream>
#include <graphics.h>
#include <string.h>
#include <winuser.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <filesystem>
///HEADERS
#include "startup_page.h"
#include "workplace_page.h"
#include "menu_selection.h"
#include "stare_table.h"
#include "new_project_name_reading_window.h"
#include "drawing_components.h"
#include "messages_panels_main_menu.h"
#include "open_save.h"
#include "change_color_panel.h"
#include "messages_log_panel.h"
#include "edit_component_value.h"
#include "zoom_rotate_fader_workplace.h"
#include "choose_from_two_options.h"
#include "functii_auxiliare.h"
using namespace std;
//Tudor ILADE && Andrei CERBU
int main()
{
//Tudor Ilade
DWORD W = GetSystemMetrics(SM_CXSCREEN);
DWORD H = GetSystemMetrics(SM_CYSCREEN);
POINT cursorPos;
RECTANGLE RECT[5];
RECTANGLE_FULL RECT_FULL[5];
RECTANGLE MAXIMUM_ROTATION_RECT;
SWITCHSTATE switcher;
SITUATIA_TABLEI project;
HISTORY stackk;
float R = (float)(W/H), zoom;
bool panel=false, click_l=false, aprinde=false, turnOn;
char filename[1024], *current_directory=create_fixed_path();
int x, y, ans, xMouse, yMouse, component_selected,
linking, right_menu, left_menu, top_menu, bulb=1,
undoRedo, type=1, type_line, ndxCmp, cmp, legNdx,
menu_select,center_fader=36.2*H/32*R, color=WHITE,
top_fader=19.7*H/22*R, angle, slider, indx;
int main_window=initwindow(W,H,"Electron");
draw_main_menu(W,H,R,current_directory);
while(true)
{
//TudorIlade
//Main Menu
if(panel==0)
{
GetCursorPos(&cursorPos);
ScreenToClient(GetForegroundWindow(), &cursorPos);
change_color_icon_startup_page(menu_selection_startup_page(W,H,R,cursorPos.x,cursorPos.y),W,H,R);
if(ismouseclick(WM_LBUTTONDOWN))
{
getmouseclick(WM_LBUTTONDOWN, x, y);
menu_select=menu_selection_startup_page(W,H,R,x,y);
switch(menu_select)
{
case 0:
clearmouseclick(WM_LBUTTONDOWN);
break;
case 1:
if(project.open)
{
//Andrei CERBU
int value=choose_from_two_options(W/4,H/4,R);
setcurrentwindow(main_window);
switch(value)
{
case 1:
draw_working_table(W,H,R,current_directory);
drawAllComponents(project,W,H,R,WHITE);
panel=1;
break;
case 2:
if(new_project_name_reading_window(W/4,H/4,R,filename)==1)
{
panel=1;
setcurrentwindow(main_window);
project=create_project(project,filename);
project.open = true;
draw_working_table(W,H,R,current_directory);
}
else
{
panel=0;
setcurrentwindow(main_window);
}
break;
}
}
//Tudor Ilade
else
{
if(new_project_name_reading_window(W/4,H/4,R,filename)==1)
{
panel=1;
setcurrentwindow(main_window);
project=create_project(project,filename);
project.open = true;
draw_working_table(W,H,R,current_directory);
}
else
{
panel=0;
setcurrentwindow(main_window);
}
}
break;
case 2:
//Tudor ILADE
project=open_dialog(1,project);
if(project.ans==-2||project.ans==-1||project.ans==-3)
{
if(project.ans!=-3)
error_code_main_menu(W,H,project.ans);
setcurrentwindow(main_window);
panel=0;
}
else
{
succes_panel_main_menu(W,H);
panel=1;
setcurrentwindow(main_window);
project.open = true;
draw_working_table(W,H,R,current_directory);
delay(10);
draw_components_from_file(project,W,H);
}
break;
case 3:
openHtml(current_directory);
break;
case 4:
closegraph();
return 0;
break;
}
}
}
//Workbench
else if(panel==1)
{
GetCursorPos(&cursorPos);
ScreenToClient(GetForegroundWindow(), &cursorPos);
change_color_icon_top_menu_workplace_page(W,H,R,top_menu_workplace_page(W,H,R,cursorPos.x,cursorPos.y));
change_color_icon_left_menu_workplace_page(W,H,R,left_menu_workplace_page(W,H,R,cursorPos.x,cursorPos.y));
change_color_icon_right_menu_workplace_page(W,H,R,right_menu_workplace_page(W,H,R,cursorPos.x,cursorPos.y));
//Tudor ILADE
if(ismouseclick(WM_LBUTTONDOWN))
{
getmouseclick(WM_LBUTTONDOWN,x,y);
top_menu=top_menu_workplace_page(W,H,R,x,y);
left_menu=left_menu_workplace_page(W,H,R,x,y);
right_menu=right_menu_workplace_page(W,H,R,x,y);
undoRedo=undo_redo_menu_workplace_page(W,H,R,x,y);
component_selected=isComponentselected(project,x,y,R);
linking=isLinking(project, W,H,x,y,R,CMP);
switcher=turnLight(W,H,R,x,y,switcher);
turnOn = turnBulbOn(project);
if(turnBulbOn(project)&&aprinde)
color=YELLOW;
else //apelez functia aici de stingere
{
readimagefile(path_for_images("becstins.jpg",current_directory),W-W/9+W/34,0.2*H/16,W-W/6.5+W/34,1.6*H/16);
color=WHITE;
}
if(!turnBulbOn(project) && color==YELLOW)
{
color = WHITE;
readimagefile(path_for_images("becstins.jpg",current_directory),W-W/9+W/34,0.2*H/16,W-W/6.5+W/34,1.6*H/16);
}
//Tudor ILADE
if(left_menu)
{
messages_log_panel(" ",W,H,R,W/9,H/16);
do
{
if(ismouseclick(WM_LBUTTONDOWN))
{
getmouseclick(WM_LBUTTONDOWN,xMouse,yMouse);
if(!top_menu_workplace_page(W,H,R,xMouse,yMouse) && !left_menu_workplace_page(W,H,R,xMouse,yMouse) &&
!right_menu_workplace_page(W,H,R,xMouse,yMouse) && !undo_redo_menu_workplace_page(W,H,R,xMouse,yMouse)&&left_menu)
{
draw_components_on_working_table(left_menu,W,H,xMouse,yMouse,R,0,1.0,BLACK,CMP);
drawAllComponents(project, W, H, R, color);
generate_rectangle_struct(RECT, CMP, left_menu);
generate_rectangle_full_struct(RECT_FULL,CMP, left_menu);
MAXIMUM_ROTATION_RECT=generate_maximum_rotation(W/10,H/16,R,xMouse, yMouse,1.0,left_menu);
if(!isColision(MAXIMUM_ROTATION_RECT,H,W,project,R,left_menu))
{
draw_components_on_working_table(left_menu,W,H,xMouse,yMouse,R,0,1.0,WHITE,CMP);
generate_rectangle_struct(RECT, CMP,left_menu);
generate_rectangle_full_struct(RECT_FULL,CMP, left_menu);
project=creare_obiect(project,left_menu,xMouse,yMouse,W,H,R, RECT, RECT_FULL, MAXIMUM_ROTATION_RECT);
stackk=actualizareStiva(stackk,project);
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Done!",W,H,R,W/9,H/16);
}
else{
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Colision!",W,H,R,W/9,H/16);
}
}
else if(left_menu_workplace_page(W,H,R,xMouse,yMouse)!=left_menu)
left_menu=left_menu_workplace_page(W,H,R,xMouse,yMouse),
change_color_icon_left_menu_workplace_page(W,H,R,0),
change_color_icon_left_menu_workplace_page(W,H,R,left_menu_workplace_page(W,H,R,xMouse,yMouse));
else if(left_menu_workplace_page(W,H,R,xMouse,yMouse)==left_menu)
break;
else if(top_menu_workplace_page(W,H,R,xMouse,yMouse))
break;
else if(right_menu_workplace_page(W,H,R,xMouse,yMouse))
break;
else if(undo_redo_menu_workplace_page(W,H,R,xMouse,yMouse))
break;
}
}
while(true);
}
//Tudor ILADE
else if(top_menu)
{
messages_log_panel(" ",W,H,R,W/9,H/16);
switch(top_menu)
{
case 1:
panel=0;
delay(50);
succes_panel_main_menu(W,H);
delay(50);
setcurrentwindow(main_window);
cleardevice();
draw_main_menu(W,H,R,current_directory);
break;
case 2:
project=open_dialog(1,project);
if(project.ans==-2||project.ans==-1||project.ans==-3)
{
if(project.ans!=-3)
error_code_main_menu(W,H,project.ans);
setcurrentwindow(main_window);
}
else
{
succes_panel_main_menu(W,H);
setcurrentwindow(main_window);
delay(10);
draw_working_table(W,H,R,current_directory);
delay(10);
draw_components_from_file(project,W,H);
stackk=emptyStack(stackk);
}
break;
case 3:
ans = save_project(project, project.path_file);
if(ans==-1)
{
error_code_main_menu(W,H,ans);
setcurrentwindow(main_window);
}
else
{
succes_panel_main_menu(W,H);
setcurrentwindow(main_window);
delay(10);
}
break;
case 4:
project=open_dialog(2,project);
if(project.ans==-1||project.ans==-3)
{
if(project.ans!=-3)
error_code_main_menu(W,H,project.ans);
setcurrentwindow(main_window);
}
else
{
succes_panel_main_menu(W,H);
setcurrentwindow(main_window);
delay(10);
draw_working_table(W,H,R,current_directory);
delay(10);
draw_components_from_file(project,W,H);
}
break;
case 5:
openHtml(current_directory);
break;
case 6:
project=stergere_tabla(project);
actualizareStiva(stackk,project);
cleardevice();
draw_working_table(W,H,R,current_directory);
break;
}
}
else if(right_menu)
{
//Andrei CERBU
switch(right_menu)
{
case 1://check integrity
if(checkIntegrity(project)){
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Connected!",W,H,R,W/9,H/16);
}
else{
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Disconnected!",W,H,R,W/9,H/16);
}
break;
case 2:
messages_log_panel("Choose a component!",W,H,R,W/9,H/16);
clearmouseclick(WM_LBUTTONDOWN);
int last_y;
do
{
if(ismouseclick(WM_LBUTTONDOWN))
{
getmouseclick(WM_LBUTTONDOWN,x,y);
if(isComponentselected(project,x,y,R))
{
int ndxCmp=getIndexOfComponent(project, x,y,R);
change_color_icon_zoom_rotate_menu_workplace_page(W,H,R,W/10,H/22,RED);
clearmouseclick(WM_LBUTTONDOWN);
//create_zoom_rotate_panel_workplace(W,H,R,W/10,H/22,BLACK);
//create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,convert_angle_to_y(project.v[ndxCmp].angle, top_fader),1,WHITE);
//create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,convert_zoom_to_y(project.v[ndxCmp].zoom, center_fader),2,WHITE);
do
{
if(ismouseclick(WM_LBUTTONDOWN))
{
getmouseclick(WM_LBUTTONDOWN, x, y);
clearmouseclick(WM_LBUTTONDOWN);
slider = determine_angle_fader_position(W,H,R,W/10,H/22,x,y);
if(slider)
{
draw_black_zoom_rotate_panel(W,H,R,W/10,H/22, slider);
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,project.v[ndxCmp].angle,project.v[ndxCmp].zoom,BLACK,CMP);
do
{
yMouse=mousey();
xMouse=mousex();
if(betweenBars(W,H, R, W/10, H/22, xMouse, yMouse, slider))
{
if(slider==1)
{
angle=convert_y_to_angle(yMouse,top_fader);
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,angle,project.v[ndxCmp].zoom,WHITE,CMP);
generate_rectangle_struct(RECT, CMP, project.v[ndxCmp].type);
generate_rectangle_full_struct(RECT_FULL,CMP, project.v[ndxCmp].type);
draw_moving_line(project,ndxCmp,color,W,H,R,RECT);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,last_y,slider,BLACK);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,yMouse,slider,WHITE);
delay(50);
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,angle,project.v[ndxCmp].zoom,BLACK,CMP);
generate_rectangle_struct(RECT, CMP, project.v[ndxCmp].type);
generate_rectangle_full_struct(RECT_FULL,CMP,project.v[ndxCmp].type);
draw_moving_line(project,ndxCmp,BLACK,W,H,R,RECT);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,yMouse,slider,BLACK);
}
else
{
zoom=convert_y_to_zoom(yMouse,center_fader);
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,project.v[ndxCmp].angle,zoom,WHITE,CMP);
generate_rectangle_struct(RECT, CMP, type);
generate_rectangle_full_struct(RECT_FULL,CMP, type);
draw_moving_line(project,ndxCmp,color,W,H,R,RECT);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,last_y,slider,BLACK);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,yMouse,slider,WHITE);
delay(50);
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,project.v[ndxCmp].angle,zoom,BLACK,CMP);
draw_moving_line(project,ndxCmp,BLACK,W,H,R,RECT);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,yMouse,slider,BLACK);
}
last_y = yMouse;
}
else
{
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,last_y,slider,WHITE);
if(slider==1)
{
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,angle,project.v[ndxCmp].zoom,WHITE,CMP);
generate_rectangle_struct(RECT, CMP, project.v[ndxCmp].type);
generate_rectangle_full_struct(RECT_FULL,CMP, project.v[ndxCmp].type);
draw_moving_line(project,ndxCmp,color,W,H,R,RECT);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,last_y,slider,BLACK);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,last_y,slider,WHITE);
delay(50);
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,angle,project.v[ndxCmp].zoom,BLACK,CMP);
generate_rectangle_struct(RECT, CMP, project.v[ndxCmp].type);
generate_rectangle_full_struct(RECT_FULL,CMP,project.v[ndxCmp].type);
draw_moving_line(project,ndxCmp,BLACK,W,H,R,RECT);
}
else
{
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,project.v[ndxCmp].angle,zoom,WHITE,CMP);
generate_rectangle_struct(RECT, CMP, type);
generate_rectangle_full_struct(RECT_FULL,CMP, type);
draw_moving_line(project,ndxCmp,color,W,H,R,RECT);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,last_y,slider,BLACK);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,last_y,slider,WHITE);
delay(50);
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,project.v[ndxCmp].angle,zoom,BLACK,CMP);
draw_moving_line(project,ndxCmp,BLACK,W,H,R,RECT);
}
}
if(ismouseclick(WM_LBUTTONDOWN))
break;
}
while(true);
clearmouseclick(WM_LBUTTONDOWN);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,yMouse,slider,WHITE);
if(slider==1)
{
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,angle,project.v[ndxCmp].zoom,WHITE,CMP);
generate_rectangle_struct(RECT, CMP, type);
generate_rectangle_full_struct(RECT_FULL,CMP, type);
draw_moving_line(project,ndxCmp,WHITE,W,H,R,RECT);
project = actualizareTabla(project, ndxCmp,project.v[ndxCmp].x1,project.v[ndxCmp].y1,W,H,R,angle,project.v[ndxCmp].zoom, RECT, RECT_FULL, project.v[ndxCmp].outsideRect);
stackk=actualizareStiva(stackk,project);
drawAllComponents(project, W,H,R,color);
}
else
{
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,R,project.v[ndxCmp].angle,zoom,BLACK,CMP);
generate_rectangle_full_struct(RECT_FULL, CMP, type);
generate_rectangle_struct(RECT, CMP, type);
MAXIMUM_ROTATION_RECT = generate_maximum_rotation(W/10,H/16,R,project.v[ndxCmp].x1, project.v[ndxCmp].y1,zoom, R);
draw_moving_line(project,ndxCmp,color,W,H,R,RECT);
project = actualizareTabla(project, ndxCmp,project.v[ndxCmp].x1,project.v[ndxCmp].y1,W,H,R,project.v[ndxCmp].angle,zoom, RECT, RECT_FULL, MAXIMUM_ROTATION_RECT);
stackk=actualizareStiva(stackk,project);
drawAllComponents(project, W,H,R,color);
}
}
}
if(right_menu_workplace_page(W,H,R,x,y)==2)
break;
}
while(true);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,convert_angle_to_y(angle, top_fader),1,BLACK);
create_zoom_rotate_fader_workplace(W,H,R,W/10,H/22,convert_zoom_to_y(zoom, center_fader),2,BLACK);
create_zoom_rotate_panel_workplace(W,H,R,W/10,H/22,WHITE);
}
if(right_menu_workplace_page(W,H,R,x,y)==2)
break;
}
}
while(true);
change_color_icon_zoom_rotate_menu_workplace_page(W,H,R,W/10,H/22,WHITE);
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Done!",W,H,R,W/9,H/16);
break;
case 3://delete component
//Tudor ILADE
messages_log_panel("Choose a component!",W,H,R,W/9,H/16);
do
{
click_l=ismouseclick(WM_LBUTTONDOWN);
getmouseclick(WM_LBUTTONDOWN,xMouse,yMouse);
if(click_l)
{
cmp=getIndexOfComponent(project,xMouse,yMouse,R);
if(right_menu_workplace_page(W,H,R,xMouse,yMouse)==3)
break;
if(cmp!=-1)
{
draw_components_on_working_table(project.v[cmp].type,W,H,project.v[cmp].x1, project.v[cmp].y1,project.v[cmp].R,project.v[cmp].angle,project.v[cmp].zoom,BLACK,CMP);
drawAllLinesBack(project,cmp,W,H,R);
project=deleteComponent(project,cmp);
stackk=actualizareStiva(stackk,project);
drawAllComponents(project,W,H,R,color);
}
}
}
while(true);
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Done!",W,H,R,W/9,H/16);
break;
case 4://Delete linking
//Tudor Ilade
messages_log_panel("Choose a linking!",W,H,R,W/9,H/16);
do
{
if(ismouseclick(WM_LBUTTONDOWN))
{
getmouseclick(WM_LBUTTONDOWN,xMouse,yMouse);
legNdx=isLinkSelected(project,xMouse,yMouse);
if(legNdx!=-1)
{
project=stergeLegatura(project,legNdx);
stackk=actualizareStiva(stackk,project);
drawAllComponents(project,W,H,R,color);
}
else if(right_menu_workplace_page(W,H,R,xMouse,yMouse)||!right_menu_workplace_page(W,H,R,xMouse,yMouse))
break;
}
}
while(true);
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Done!",W,H,R,W/9,H/16);
break;
case 5:
messages_log_panel("Choose a component!",W,H,R,W/9,H/16);
do
{
if(ismouseclick(WM_LBUTTONDOWN))
{
getmouseclick(WM_LBUTTONDOWN,xMouse,yMouse);
if(isComponentselected(project,xMouse,yMouse,R))
{
cmp=getIndexOfComponent(project,xMouse,yMouse,R);
indx=project.v[cmp].type;
int value_cmp=edit_value_window(W,H,R,indx, project.v[cmp].value);
project.v[cmp].value=value_cmp;
setcurrentwindow(main_window);
break;
}
else break;
}
}
while(true);
setcurrentwindow(main_window);
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Done!",W,H,R,W/9,H/16);
break;
//Tudor Ilade
case 6://Select linking type
messages_log_panel("Choose a linking type!",W,H,R,W/9,H/16);
delay(40);
create_drawing_line_type_menu_workplace(W,H,R,W/10,H/22,WHITE);
drawing_line_type(W,H,R,W/10,H/22,WHITE);
do
{
xMouse=mousex();
yMouse=mousey();
if(type)
change_color_icon_drawing_line_type_menu_workplace(W,H,R,type,type);
change_color_icon_drawing_line_type_menu_workplace(W,H,R,line_type_menu_workplace(W,H,R,xMouse,yMouse),type);
if(ismouseclick(WM_LBUTTONDOWN))
{
getmouseclick(WM_LBUTTONDOWN,xMouse,yMouse);
if(line_type_menu_workplace(W,H,R,xMouse,yMouse)==0)
break;
else if(type==0||line_type_menu_workplace(W,H,R,xMouse,yMouse)&&line_type_menu_workplace(W,H,R,xMouse,yMouse)!=type)
type=line_type_menu_workplace(W,H,R,xMouse,yMouse);
else if(line_type_menu_workplace(W,H,R,xMouse,yMouse)==type)
type=0;
}
}
while(true);
delay(50);
create_drawing_line_type_menu_workplace(W,H,R,W/10,H/22,BLACK);
drawing_line_type(W,H,R,W/10,H/22,BLACK);
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Done!",W,H,R,W/9,H/16);
break;
}
}
//Tudor Ilade
else if(undoRedo)
{
messages_log_panel(" ",W,H,R,W/9,H/16);
switch(undoRedo)
{
case 1://Undo
do
{
getmouseclick(WM_LBUTTONDBLCLK,xMouse,yMouse);
drawAllComponents(project,W,H,R,BLACK);
project=URfnc(stackk,undoRedo,project);
drawAllComponents(project,W,H,R,color);
}
while(undo_redo_menu_workplace_page(W,H,R,xMouse,yMouse)==1);
break;
case 2://Redo
do
{
getmouseclick(WM_LBUTTONDBLCLK,xMouse,yMouse);
drawAllComponents(project,W,H,R,BLACK);
project=URfnc(stackk,undoRedo,project);
drawAllComponents(project,W,H,R,color);
}
while(undo_redo_menu_workplace_page(W,H,R,xMouse,yMouse)==2);
break;
}
}
//Tudor Ilade
else if(component_selected && !linking)
{
messages_log_panel(" ",W,H,R,W/9,H/16);
ndxCmp=getIndexOfComponent(project,x,y,R);
getmouseclick(WM_LBUTTONDBLCLK,xMouse,yMouse);
clearmouseclick(WM_LBUTTONDBLCLK);
draw_components_on_working_table(project.v[ndxCmp].type,W,H,project.v[ndxCmp].x1,project.v[ndxCmp].y1,project.v[ndxCmp].R,project.v[ndxCmp].angle,project.v[ndxCmp].zoom,BLACK,CMP);
generate_rectangle_struct(RECT, CMP, project.v[ndxCmp].type);
generate_rectangle_full_struct(RECT_FULL,CMP, project.v[ndxCmp].type);
draw_moving_line(project, ndxCmp, BLACK, W,H,R,RECT);
do
{
click_l=ismouseclick(WM_LBUTTONDOWN);
x=mousex();
y=mousey();
MAXIMUM_ROTATION_RECT = generate_maximum_rotation(W/10,H/16,R,x,y,project.v[ndxCmp].zoom, project.v[ndxCmp].type);
if(click_l)
{
getmouseclick(WM_LBUTTONDOWN,x,y);
break;
}
if(outSideTable(x,y,H,W,R,MAXIMUM_ROTATION_RECT, project.v[ndxCmp].type))
{
messages_log_panel("A depasit limitele tablei!",W,H,R,W/9,H/16);
delay(50);
break;
}
if(xMouse!=x||yMouse!=y)
{
draw_components_on_working_table(project.v[ndxCmp].type,W,H,x,y,R,project.v[ndxCmp].angle,project.v[ndxCmp].zoom,WHITE,CMP);
generate_rectangle_struct(RECT, CMP, project.v[ndxCmp].type);
generate_rectangle_full_struct(RECT_FULL,CMP, project.v[ndxCmp].type);
draw_moving_line(project, ndxCmp,color,W,H,R, RECT);
delay(40);
draw_components_on_working_table(project.v[ndxCmp].type,W,H,x,y,R,project.v[ndxCmp].angle,project.v[ndxCmp].zoom,BLACK,CMP);
generate_rectangle_struct(RECT, CMP, project.v[ndxCmp].type);
generate_rectangle_full_struct(RECT_FULL,CMP, project.v[ndxCmp].type);
draw_moving_line(project,ndxCmp,BLACK,W,H,R, RECT);
drawComponentsXSelected(project, ndxCmp, W, H, R, color);
}
}
while(true);
MAXIMUM_ROTATION_RECT = generate_maximum_rotation(W/10,H/16,R,x,y,1.0, project.v[ndxCmp].type);
if(!isColision(MAXIMUM_ROTATION_RECT,H,W,project,R,project.v[ndxCmp].type,ndxCmp))
{
drawAllLinesBack(project,ndxCmp,W,H,R);
draw_components_on_working_table(project.v[ndxCmp].type,W,H,x,y,R,project.v[ndxCmp].angle,project.v[ndxCmp].zoom,BLACK,CMP);
generate_rectangle_struct(RECT, CMP,project.v[ndxCmp].type);
generate_rectangle_full_struct(RECT_FULL, CMP, project.v[ndxCmp].type);
project=actualizareTabla(project,ndxCmp,x,y,W,H,project.v[ndxCmp].R,project.v[ndxCmp].angle,project.v[ndxCmp].zoom, RECT, RECT_FULL, MAXIMUM_ROTATION_RECT);
stackk=actualizareStiva(stackk, project);
drawAllComponents(project,W, H, R, color);
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Done!",W,H,R,W/9,H/16);
}
else
{
messages_log_panel(" ",W,H,R,W/9,H/16);
messages_log_panel("Coliziune",W,H,R,W/9,H/16);
drawAllComponents(project, W, H, R, color);
}
}
//Tudor Ilade
else if(linking)
{
messages_log_panel(" ",W,H,R,W/9,H/16);
punctLegatura leg1, leg2;
int ndx = getIndexOfComponent(project,x,y,R);
COMPONENTE cmp = project.v[ndx];
leg1.x = x;
leg1.y = y;
leg1.sd = linking;
leg1.type = type;
xMouse = mousex();
yMouse = mousey();
click_l=0;
do
{
drawLine(leg1.x,leg1.y, xMouse,yMouse, WHITE,leg1.type);
delay(50);
drawLine(leg1.x,leg1.y, xMouse,yMouse, BLACK,leg1.type);
drawAllComponents(project, W,H,R, WHITE);
xMouse=mousex();
yMouse=mousey();
if(outSideTable(xMouse,yMouse,H,W,R,MAXIMUM_ROTATION_RECT))
{
delay(50);
break;
}
click_l = ismouseclick(WM_LBUTTONDOWN);
if(click_l)
break;
}
while(true);
click_l=0;
clearmouseclick(WM_LBUTTONDOWN);
clearmouseclick(click_l);
xMouse = mousex();
yMouse = mousey();
int leg = isLinking(project,W,H,xMouse,yMouse,R,CMP,ndx);
if(leg)
{
int ndx2 = getIndexOfComponent(project,xMouse,yMouse,R);
drawLine(leg1.x,leg1.y, xMouse,yMouse, WHITE,leg1.type);
leg1.xConnection = xMouse;
leg1.yConnection = yMouse;
leg1.ndxParent = ndx;
leg2.sd = leg;
leg2.x = xMouse;
leg2.y = yMouse;
leg2.ndxParent = ndx2;
leg2.xConnection = leg1.x;
leg2.yConnection = leg1.y;
leg2.type = leg1.type;
pair<punctLegatura, punctLegatura>PAIR;
PAIR.first = leg1;
PAIR.second = leg2;
project.p.push_back(PAIR);
project.v[ndx].legatura.push_back(PAIR);
project.v[ndx2].legatura.push_back(PAIR);
drawAllComponents(project, W,H,R, color);
stackk = actualizareStiva(stackk, project);
}
else
{
drawLine(leg1.x,leg1.y, xMouse,yMouse, BLACK,leg1.type);
drawAllComponents(project, W,H,R, color);
}
messages_log_panel("Done!",W,H,R,W/9,H/16);
}
//Tudor Ilade
else if(switcher.inOut)
{
messages_log_panel(" ",W,H,R,W/9,H/16);
if(switcher.bulb==1)//aprinde becu
{
if(turnOn)
{
readimagefile(path_for_images("bec_aprins.jpg",current_directory),W-W/9+W/34,0.2*H/16,W-W/6.5+W/34,1.6*H/16);
color=YELLOW;
aprinde=true;
messages_log_panel("Happy Circuit!",W,H,R,W/9,H/16);
drawAllComponents(project, W,H,R,color);
delay(100);
}
else
{
color=WHITE;
messages_log_panel("Not working!",W,H,R,W/9,H/16);
}
}
else if(switcher.bulb==2)//stinge becu
{
if(turnOn)
{
readimagefile(path_for_images("becstins.jpg",current_directory),W-W/9+W/34,0.2*H/16,W-W/6.5+W/34,1.6*H/16);
aprinde=false;
color=WHITE;
drawAllComponents(project,W,H,R,color);
delay(100);
messages_log_panel("Light off!",W,H,R,W/9,H/16);
}
else
{
color=WHITE;
messages_log_panel("Not working!",W,H,R,W/9,H/16);
}
}
}
}
}
}
}
BIN
View File
Binary file not shown.
+138
View File
@@ -0,0 +1,138 @@
#ifndef MENU_SELECTION_H_INCLUDED
#define MENU_SELECTION_H_INCLUDED
//Andrei CERBU
int menu_selection_startup_page(int W, int H, int R, int x, int y)
{
if((x>W/6&&x<W/6+R*H/6)&&(y>H/4&&y<H/4+R*H/6))
return 1;
if((x>W/3&&x<W/3+R*H/6)&&(y>H/4&&y<H/4+R*H/6))
return 2;
if((x>W/6&&x<W/6+R*H/6)&&(y>3*H/4-R*H/6&&y<3*H/4))
return 3;
if((x>W/3&&x<W/3+R*H/6)&&(y>3*H/4-R*H/6&&y<3*H/4))
return 4;
return 0;
}
int top_menu_workplace_page(int W, int H, int R, int x, int y)
{
int width_rectangle = W/12;
int height_rectangle = H/24;
if((x>width_rectangle*3*R&&x<(width_rectangle*4)*R)&&(y>0&&y<height_rectangle*R))
return 1;
if((x>width_rectangle*4*R&&x<width_rectangle*5*R)&&(y>0&&y<height_rectangle*R))
return 2;
if((x>width_rectangle*5*R&&x<width_rectangle*6*R)&&(y>0&&y<height_rectangle*R))
return 3;
if((x>width_rectangle*6*R&&x<width_rectangle*7*R)&&(y>0&&y<height_rectangle*R))
return 4;
if((x>width_rectangle*7*R&&x<width_rectangle*8*R)&&(y>0&&y<height_rectangle*R))
return 5;
if((x>width_rectangle*8*R&&x<width_rectangle*9*R)&&(y>0&&y<height_rectangle*R))
return 6;
return 0;
}
int left_menu_workplace_page(int W, int H, float R, int x, int y)
{
int width_rectangle = W/9;
int height_rectangle = H/16;
if((x>0&&x<(width_rectangle-width_rectangle/9)*R)&&(y>(height_rectangle*3)*R&&y<(height_rectangle*4)*R))
return 1;
if((x>0&&x<(width_rectangle-width_rectangle/9)*R)&&(y>(height_rectangle*4)*R&&y<(height_rectangle*5)*R))
return 2;
if((x>0&&x<(width_rectangle-width_rectangle/9)*R)&&(y>(height_rectangle*5)*R&&y<(height_rectangle*6)*R))
return 3;
if((x>0&&x<(width_rectangle-width_rectangle/9)*R)&&(y>(height_rectangle*6)*R&&y<(height_rectangle*7)*R))
return 4;
if((x>0&&x<(width_rectangle-width_rectangle/9)*R)&&(y>(height_rectangle*7)*R&&y<(height_rectangle*8)*R))
return 5;
if((x>0&&x<(width_rectangle-width_rectangle/9)*R)&&(y>(height_rectangle*8)*R&&y<(height_rectangle*9)*R))
return 6;
if((x>0&&x<(width_rectangle-width_rectangle/9)*R)&&(y>(height_rectangle*9)*R&&y<(height_rectangle*10)*R))
return 7;
if((x>0&&x<(width_rectangle-width_rectangle/9)*R)&&(y>(height_rectangle*10)*R&&y<(height_rectangle*11)*R))
return 8;
if((x>0&&x<(width_rectangle-width_rectangle/9)*R)&&(y>(height_rectangle*11)*R&&y<(height_rectangle*12)*R))
return 9;
return 0;
}
int right_menu_workplace_page(int W, int H, float R, int x, int y)
{
int width_rectangle = W/9;
int height_rectangle = H/16;
if(x>(W-width_rectangle)*R&&x<W&&(y>(height_rectangle*2)*R&&y<(height_rectangle*3)*R))
return 1;
if(x>(W-width_rectangle)*R&&x<W&&(y>(height_rectangle*3)*R&&y<(height_rectangle*4)*R))
return 2;
if(x>(W-width_rectangle)*R&&x<W&&(y>(height_rectangle*4)*R&&y<(height_rectangle*5)*R))
return 3;
if(x>(W-width_rectangle)*R&&x<W&&(y>(height_rectangle*5)*R&&y<(height_rectangle*6)*R))
return 4;
if(x>(W-width_rectangle)*R&&x<W&&(y>(height_rectangle*6)*R&&y<(height_rectangle*7)*R))
return 5;
if(x>(W-width_rectangle)*R&&x<W&&(y>(height_rectangle*7)*R&&y<(height_rectangle*8)*R))
return 6;
return 0;
}
//Tudor ILADE
int undo_redo_menu_workplace_page(int W, int H, float R, int x, int y)
{
int width_rectangle = W/18;
int height_rectangle = H/16;
if(x>=2*width_rectangle/9&&x<=width_rectangle&&y>=14.2*height_rectangle*R&&y<=15*height_rectangle*R)
return 1;
if(x>=width_rectangle&&x<=16*width_rectangle/9&&y>=14.2*height_rectangle*R&&y<=15*height_rectangle*R)
return 2;
return 0;
}
//Tudor Ilade
int line_type_menu_workplace(int W, int H, float R, int x, int y)
{
int width_rectangle = W/10;
int height_rectangle = H/22;
if((x>(W-width_rectangle)*R&&x<W-width_rectangle/9)&&(y>(height_rectangle*11.1)*R&&y<(height_rectangle*12.1)*R))
return 1;
if((x>(W-width_rectangle)*R&&x<W-width_rectangle/9)&&(y>(height_rectangle*12.1)*R&&y<(height_rectangle*13.1)*R))
return 4;
if((x>(W-width_rectangle)*R&&x<W-width_rectangle/9)&&(y>(height_rectangle*13.1)*R&&y<(height_rectangle*14.1)*R))
return 2;
if((x>(W-width_rectangle)*R&&x<W-width_rectangle/9)&&(y>(height_rectangle*14.1)*R&&y<(height_rectangle*15.1)*R))
return 3;
return 0;
}
//Tudor Ilade
SWITCHSTATE turnLight(int W, int H, float R, int x, int y, SWITCHSTATE switcher)
{
if((x>W-W/6.5+W/15)*R&&x<(W-W/9+W/12.5)*R&&(y>0.2*H/16&&y<1.6*H/16*R))
{
switcher.inOut = true;
if(switcher.bulb==2)
switcher.bulb = 1;
else if(switcher.bulb==1)
switcher.bulb = 2;
return switcher;
}
switcher.inOut = false;
switcher.bulb = 2;
return switcher;
}
#endif // MENU_SELECTION_H_INCLUDED
+5
View File
@@ -0,0 +1,5 @@
#ifndef MESSAGES_LOG_PANEL_H_INCLUDED
#define MESSAGES_LOG_PANEL_H_INCLUDED
#endif // MESSAGES_LOG_PANEL_H_INCLUDED
+78
View File
@@ -0,0 +1,78 @@
#ifndef ERROR_PANELS_MAIN_MENU_H_INCLUDED
#define ERROR_PANELS_MAIN_MENU_H_INCLUDED
#include <windows.h>
//Andrei CERBU pana jos
void succes_panel_main_menu(int W, int H){
int width=W/4,height=H/4;
POINT cursorPos;
bool click;
char text[]="Loading\0";
int k=4, poz=8, timp=0;
int panel=initwindow(width,height,"Loading panel",W/3,H/3,0,0);
while(k){
settextstyle(COMPLEX_FONT,0,width/123);
outtextxy(width/2-width/5,height/3+height/20,text);
strcat(text,".");
--k;
delay(1500-timp);
timp+=500;
}
closegraph(panel);
}
void error_code_main_menu(int W, int H, int error){
int width=W/4,height=H/4;
POINT cursorPos;
bool click; char c;
int panel=initwindow(width,height,"Error",W/3,H/3,0,0);
//first message
if(error==-1){
settextstyle(COMPLEX_FONT,0,width/160);
outtextxy(width/6,height/3+height/20,"Error opening project");
}
else if(error==-2){
settextstyle(COMPLEX_FONT,0,width/160);
outtextxy(width/6+width/35,height/3+height/20,"Incorrect file type");
}
//second message
settextstyle(COMPLEX_FONT,0,width/213);
outtextxy(width/4+width/15,height/2,"Please try again");
//button for exit
rectangle(width/2-width/10,height/2+height/8,width/2+width/10,height/2+height/4);
settextstyle(COMPLEX_FONT,0,width/213);
outtextxy(width/2-width/20,height/2+height/7,"Back");
while(true){
GetCursorPos(&cursorPos);
ScreenToClient(GetForegroundWindow(), &cursorPos);
click=ismouseclick(WM_LBUTTONDOWN);
bool menu=0;
if((cursorPos.x>width/2-width/10&&cursorPos.x<width/2+width/10)&&(cursorPos.y>height/2+height/8&&cursorPos.y<height/2+height/4))
menu=1;
if(click&&menu){
closegraph(panel);
break;
}
if(kbhit()){
c=getch();
if(c==13){
closegraph(panel);
break;
}
}
}
}
#endif // ERROR_PANELS_MAIN_MENU_H_INCLUDED
+161
View File
@@ -0,0 +1,161 @@
#ifndef NEW_PROJECT_NAME_READING_WINDOW_H_INCLUDED
#define NEW_PROJECT_NAME_READING_WINDOW_H_INCLUDED
#include <winuser.h>
#define KEY_LEFT 75
#define KEY_RIGHT 77
//Andrei CERBU pana jos
int menu_selection_reading_window(int W, int H, int x, int y){
//enter button
if((x>W/2-W/10&&x<W/2+W/10)&&(y>H/2+3*H/12-H/12&&y<H/2+3*H/12+H/12))
return 1;
//back button
if((x>W-3*W/32-3*W/40&&x<W-3*W/32+3*W/40)&&(y>H/10-2*H/30&&y<H/10+2*H/30))
return 2;
return 0;
}
void print_text_on_new_project_name_reading_page(int W, int H, int R, int width_rectangle, int height_rectangle, int rect_w, int rect_h, char* str){
int text_w=textwidth(str);
int text_h=textheight(str);
float x=(width_rectangle+(rect_w-text_w)/2);
float y=(height_rectangle+(rect_h-text_h)/2);
outtextxy(x,y,str);
}
void draw_new_project_name_reading_window(int W, int H, float R, int cursor){
int width_rectangle, height_rectangle;
int font1, font2;
if(W*4<=1920)
font1=1,font2=2;
else font1=2,font2=3;
setlinestyle(SOLID_LINE,0,1);
settextstyle(COMPLEX_FONT,0,font1);
//text_box
width_rectangle=W/2;
height_rectangle=H/3+13*H/72;
rectangle(width_rectangle-W/4,height_rectangle-5*H/72,width_rectangle+W/4,height_rectangle+5*H/72);
line(W/2-W/5-W/80+W/31*cursor,H/3+H/9,W/2-W/5-W/80+W/31*cursor,H/3+H/4);
//enter_button
width_rectangle=W/2;
height_rectangle=H/2;
rectangle(width_rectangle-W/10,height_rectangle+2*H/12,width_rectangle+W/10,height_rectangle+4*H/12);
print_text_on_new_project_name_reading_page(W,H,R,width_rectangle-W/10,height_rectangle+2*H/12,W/5,H/6,"Enter");
//back_button
width_rectangle=W-3*W/32;
height_rectangle=H/10;
rectangle(width_rectangle-3*W/40,height_rectangle-2*H/30,width_rectangle+3*W/40,height_rectangle+2*H/30);
print_text_on_new_project_name_reading_page(W,H,R,width_rectangle-3*W/40,height_rectangle-2*H/30,3*W/20,2*H/15,"Back");
//text
settextstyle(COMPLEX_FONT,0,font2);
width_rectangle=W/2;
height_rectangle=H/2-4*H/20;
print_text_on_new_project_name_reading_page(W,H,R,width_rectangle-3*W/10,height_rectangle-H/20,3*W/5,H/10,"TYPE THE NAME HERE:");
}
void print_text_on_new_project_screen(int W, int H, char aux[], int nr_elem){
setlinestyle(SOLID_LINE,0,W/120);
if(nr_elem>14) nr_elem-=14;
else nr_elem=0;
strcpy(aux, aux+nr_elem);
outtextxy(W/2-W/5-W/60,H/3+H/9+H/50,aux);
}
int new_project_name_reading_window(int W, int H, float R, char filename[]){
int project_window1=initwindow(W,H,"New Project panel",W/3,H/3,0,0);
POINT cursorPos;
char aux[10000],c, ex;
filename[0]=0;
int nr_elem=0, poz=0, cursor=0, xMouse, yMouse;
bool modif=0;
draw_new_project_name_reading_window(W,H,R,poz);
while(true){
GetCursorPos(&cursorPos);
ScreenToClient(GetForegroundWindow(), &cursorPos);
if(kbhit()){
c=getch();
if(c&&c!=224){
if(c==8&&nr_elem&&poz){
strcpy(filename+poz-1,filename+poz);
nr_elem--;
--poz;
}
else if(c==13){
closegraph(project_window1);
return 1;
}
else if(nr_elem<10000&&c>=' '&&c<='~'){
for(int i=nr_elem; i>poz; i--)
filename[i]=filename[i-1];
filename[poz]=c;
++poz;
++nr_elem;
filename[nr_elem]=0;
}
}
else{
switch(ex=getch()){
case KEY_LEFT:
if(poz>0)
--poz;
break;
case KEY_RIGHT:
if(poz<nr_elem)
++poz;
break;
}
}
if(poz>14)
cursor=14;
else cursor=poz;
//create new frame
cleardevice();
draw_new_project_name_reading_window(W,H,R,poz);
strcpy(aux,filename);
print_text_on_new_project_screen(W,H,aux,nr_elem);
}
else if(ismouseclick(WM_LBUTTONDOWN)){
getmouseclick(WM_LBUTTONDOWN,xMouse,yMouse);
switch(menu_selection_reading_window(W,H,xMouse,yMouse)){
case 1://Enter was pressed
closegraph(project_window1);
return 1;
break;
case 2://back was pressed
closegraph(project_window1);
return 2;
break;
case 0:
clearmouseclick(WM_LBUTTONDOWN);
break;
}
}
}
}
#endif // NEW_PROJECT_NAME_READING_WINDOW_H_INCLUDED
+266
View File
@@ -0,0 +1,266 @@
#ifndef OPEN_SAVE_H_INCLUDED
#define OPEN_SAVE_H_INCLUDED
///LIBRARIES
#include <vector>
#include <stack>
#include <conio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <filesystem>
#include "drawing_components.h"
#include "stare_table.h"
//Tudor ILADE toate functiile
///Functie responsabila de crearea fisierului de proiect in directorul Projects
char* path_for_projects_directory(int type=0)
{
//se creaza path-ul catre directorul unde vor fi salvate proiectele
char cwd[256];
getcwd(cwd, 256);
char* dir = new char[40];
char* path = new char[strlen(cwd)+12+strlen(dir)];
*path = '\0';
*dir = '\0';
strcat(dir, "Projects");
strcat(path, cwd);
if(type==1)
return path;
strcat(path,"\\");
strcat(path,dir);
//Se verifica existenta directorului pentru proiecte
bool isDir = false;
struct stat info;
if(stat(path,&info)!=0)
isDir = false;
else if(info.st_mode & S_IFDIR)
isDir = true;
if(isDir==0)
{
//Directorul nu exista, deci
int check = mkdir(path);
if(!check)
{
return path;
}
}
else
{
//Directorul exista, deci returnam path-ul
return path;
}
}
///Functie responsabila de crearea unui proiect care returneaza path-ul catre fisier ul unde se va salva proiectul
SITUATIA_TABLEI create_project(SITUATIA_TABLEI tabla,char* file_name)
{
char* path_to_file = new char[strlen(path_for_projects_directory())+strlen(file_name)+5];
path_to_file = path_for_projects_directory();
strcpy(tabla.path_to_dir,path_to_file);
strcat(path_to_file, "\\");
strcat(path_to_file, file_name);
strcat(path_to_file, "\.AT");
strcpy(tabla.path_file,path_to_file);
FILE* project;
project = fopen(path_to_file, "wb+");
if(project==NULL)
{
exit(1);
tabla.ans=-1;
return tabla;
}
char header[2] = {'A', 'T'};
fwrite(&header, sizeof(header),1,project);
fclose(project);
return tabla;
}
///Functie responsabila de salvarea tablei actuale in proiectul deschis. (se va folosi si pentru save as)
int save_project(SITUATIA_TABLEI &table, char* path)
{
FILE* project;
project = fopen(path, "wb+");
if(project == NULL)
{
return -1;
}
char header[2] = {'A', 'T'};
fwrite(&header, sizeof(header),1,project);
if(table.v.size()!=0)
{
for(int i=0; i<table.v.size(); i++)
{
BinaryCMP bnr;
bnr.type = table.v[i].type;
bnr.x = table.v[i].x1;
bnr.y = table.v[i].y1;
bnr.conectat = table.v[i].connectat;
bnr.rect = table.v[i].rect;
bnr.R = table.v[i].R;
bnr.angle = table.v[i].angle;
bnr.zoom = table.v[i].zoom;
bnr.value = table.v[i].value;
bnr.outsideRect = table.v[i].outsideRect;
bnr.coordinates[0] = table.v[i].coordinates[0];
bnr.coordinates[1] = table.v[i].coordinates[1];
bnr.coordinates[2] = table.v[i].coordinates[2];
bnr.coordinates[3] = table.v[i].coordinates[3];
bnr.nodes[0] = table.v[i].nodes[0];
bnr.nodes[1] = table.v[i].nodes[1];
bnr.nodes[2] = table.v[i].nodes[2];
bnr.nodes[3] = table.v[i].nodes[3];
strcpy(bnr.name,table.v[i].name);
if(!table.v[i].legatura.empty())
{
for(int j = 0; j<table.v[i].legatura.size(); j++)
{
bnr.legatura[2*j] = table.v[i].legatura[j].first;
bnr.legatura[2*j+1] = table.v[i].legatura[j].second;
}
}
bnr.size_of_linkings = table.v[i].legatura.size();
fwrite(&bnr, sizeof(bnr), 1, project);
}
}
fclose(project);
return 1;
}
///Functie responsabila pentru deschiderea unui proiect.
SITUATIA_TABLEI open_project(char* path)
{
FILE* project_file;
SITUATIA_TABLEI tabla;
BinaryCMP cmp;
project_file = fopen(path, "rb");
if(project_file == NULL)
{
tabla.ans = -1;
return tabla;
}
char c1[1] = {fgetc(project_file)};
char c2[1] = {fgetc(project_file)};
if(c1[0]!='A'&&c2[0]!='T')
{
tabla.ans = -2;
return tabla;
}
while(fread(&cmp,sizeof(cmp),1,project_file)!=0)
{
COMPONENTE cmp_table;
cmp_table.type = cmp.type;
cmp_table.angle = cmp.angle;
cmp_table.zoom = cmp.zoom;
cmp_table.x1 = cmp.x;
cmp_table.y1 = cmp.y;
cmp_table.connectat = cmp.conectat;
strcpy(cmp_table.name, cmp.name);
cmp_table.rect = cmp.rect;
cmp_table.R = cmp.R;
cmp_table.value = cmp.value;
cmp_table.outsideRect = cmp.outsideRect;
cmp_table.coordinates[0] = cmp.coordinates[0];
cmp_table.coordinates[1] = cmp.coordinates[1];
cmp_table.coordinates[2] = cmp.coordinates[2];
cmp_table.coordinates[3] = cmp.coordinates[3];
cmp_table.nodes[0] = cmp.nodes[0];
cmp_table.nodes[1] = cmp.nodes[1];
cmp_table.nodes[2] = cmp.nodes[2];
cmp_table.nodes[3] = cmp.nodes[3];
int sz = cmp.size_of_linkings;
for(int i = 0; i<sz; i++)
{
pair<punctLegatura, punctLegatura>PAIR;
PAIR.first = cmp.legatura[2*i];
PAIR.second = cmp.legatura[2*i+1];
cmp_table.legatura.push_back(PAIR);
}
tabla.v.push_back(cmp_table);
}
for(int i =0; i<tabla.v.size(); i++)
{
for(int j = 0; j<tabla.v[i].legatura.size(); j++)
{
tabla.p.push_back(tabla.v[i].legatura[j]);
}
}
for(int i = 0; i<tabla.p.size(); i++)
{
for(int k = i+1; k<tabla.p.size(); k++)
{
if(tabla.p[i].first.ndxParent == tabla.p[k].first.ndxParent && tabla.p[i].second.ndxParent == tabla.p[k].second.ndxParent)
{
tabla.p.erase(tabla.p.begin()+k);
}
}
}
tabla.ans = 1;
strcpy(tabla.path_file,path);
strcpy(tabla.path_to_dir,path_for_projects_directory(1));
fclose(project_file);
return tabla;
}
///Functie responsabila de deschiderea unei casute de dialog unde user-ul poate salva/crea etc, proiectul
//Internet && Tudor Ilade
SITUATIA_TABLEI open_dialog(int type,SITUATIA_TABLEI tabla)
{
OPENFILENAME ofn;
char szFileName[MAX_PATH] = "";
char szPathDir[MAX_PATH] = "";
ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFilter = "AT Files (*.AT)\0*.AT\0All Files (*.*)\0*.*\0";
ofn.nMaxFile = MAX_PATH;
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
ofn.lpstrDefExt = "bin";
if(type==1)
{
ofn.lpstrFile = szFileName;
if(GetOpenFileName(&ofn))
{
SITUATIA_TABLEI tabla;
tabla = open_project(szFileName);
return tabla;
}
else
{
tabla.ans = -3;
return tabla;
}
}
else
{
ofn.lpstrInitialDir = tabla.path_to_dir;
ofn.lpstrFile = tabla.path_file;
if(GetSaveFileName(&ofn))
{
int ans = save_project(tabla,ofn.lpstrFile);
tabla.ans = ans;
return tabla;
}
else
{
tabla.ans = -3;
return tabla;
}
}
}
#endif // OPEN_SAVE_H_INCLUDED
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

+256
View File
@@ -0,0 +1,256 @@
<link rel="stylesheet" href="static/CSS/style.css">
<div class="body">
<div class="b-title">
ElectronAT
</div>
<div class="intro" id="intro-id">
<p class="par">
Acest proiect isi propune sa permita utilizatorului sa deseneze scheme electronice practice, conform indicatiilor oferite la seminar. Realizarea proiectului
a fost una plina de provocari, logica programului devenind foarte interesant de implementat. Scopul nostru a fost sa gandim un program
scalabil, care poate fi usor de intretinut si intuitiv de utilizat pentru user!
</p>
<p class="par">
In cele ce urmeaza, ne propunem sa prezentam functionalitatie principale ale programului si in ce mod poate fi folosit.
</p>
</div>
<p class="par copyright">
Proiectul a fost realizat cu placere de:
<ul class="copyright-ul">
<li>Andrei Mihnea Cerbu</li>
<li>
Tudor Ilade
</li>
</li>
</ul>
</p>
<div class="first-panel" id="first-par">
<div class="par" id="par12">
<h4>Panoul principal</h4>
O data ce programul este lansat, panoul principal va fi primul care va aparea, ce va face posibila selectia urmatoarelor actiuni:
<ol>
<li class="list-obj">Creaza nou proiect</li>
<li class="list-obj">Deschide un proiect existent</li>
<li class="list-obj"> Info</li>
<li class="list-obj">Inchidere</li>
</ol>
<p><b><i>1) Creaza nou proiect</i></b></p>
<p>
Utilizatorul poate opta pentru a crea un nou proiect, prin apasarea menu ului din partea stanga sus. In momentul in care acesta va fi selectat,
o casuta de dialog va fi aruncata care va cere drept input numele fisierului. Acest nume va fi preluat de catre program si se va crea un fisier binar
de tipul .AT cu numele dat.
</p>
<p><b><i>2) Deschide un proiect </i></b></p>
<p>
Utilizatorul poate deschide un fisier de tip .AT deja existent. In momentul citirii, se va face o scurta verificare a integritatii fisierului
inainte de a se putea procesa informatia.
</p>
<p><b><i>3) Info </i></b></p>
<p>
Pentru a citi mai multe despre modul de functionare a programului, se poate consulta pagina web aferenta prin selectarea panoului 3.
</p>
<p><b><i>4) Iesire </i></b></p>
<p>
Ultimul panou, desenat cu un X, este utilizat pentru iesirea din program.
</p>
</div>
<div class="img">
<img src="static/IMG/main-menu.png" alt="main_menu" class="img_f">
</div>
</div>
<div class="first-panel" id="second">
<div class="intro"></div>
<div class="par" id="second-par">
<h4>Masa de lucru</h4>
<p>Dupa crearea unui nou proiect sau deschiderea unuia existent, user-ul va fi trimis catre masa de lucru, unde poate efectua urmatoarele operatii:</p>
<ol>
<li class="list-obj">Desenare componenta</li>
<li class="list-obj">Mutare componenta</li>
<li class="list-obj"> Stergere componenta</li>
<li class="list-obj"> Rotire si zoom in/out pe componenta</li>
<li class="list-obj"> Deseneare legatura</li>
<li class="list-obj"> Stergere legatura</li>
<li class="list-obj"> Selectare tip de legatura</li>
<li class="list-obj"> Verificare conectivitatea circuitului</li>
<li class="list-obj">Salvarea proiectului</li>
<li class="list-obj"> Deschiderea unui alt proiect</li>
<li class="list-obj"> Undo/Redo</li>
<li class="list-obj">Aprinde becul</li>
</ol>
</div>
<div class="img">
<img src="static/IMG/WORK-TABLE.png" alt="main_menu" class="img_f">
</div>
</div>
<div class="intro" id="sdss"></div>
<div class="first-panel panel" id="c1">
<p><b><i>1) Desenare componenta</i></b></p>
<p>
Pentru a putea amplasa o componenta pe tabla, utilizatorul trebuie sa selecteze o componenta din panoul din partea stanga. Odata selectata aceasta componenta,
utilizatorul poate amplasa piesa in chenarul verde, ce reprezinta masa de lucru. Daca se va face click in afara chenarului, va fi informat in casuta de log
ca acesta nu poate sa depaseasca limitele masei de lucru. <br>
Daca se face click peste o componenta deja existenta, utilizatorul va fi instiintat despre faptul ca nu va putea amplasa o piesa peste
una deja existenta, tot prin casuta de log, iar piesa se va redesena la ultima pozitie existenta.
</p>
<p><b><i>2) Mutare componenta </i></b></p>
<p>
Mutarea componentei pe masa de lucru se face prin selectarea componentei dorite de pe tabla prin click stanga, ce va permite mutarea oriunde in limitele chenarului
verde. Daca se va merge cu cursorul in afara chenarului verde, utilizatrul va fi informat ca a depasit limitele masei de lucru, iar componenta se va redesena
la ultima sa pozitie.(cea dinainte de click)
</p>
<p><b><i>3) Stergere componenta </i></b></p>
<p>
Stergerea unei componente de pe masa de lucru se face prin selectarea actiunii specifice din panoul din dreapta (Delete component). Odata functionalitatea activata,
utilizatorul va trebui sa selecteze de pe tabla piesa ce se doreste a fi stearsa.<br>
Daca aceasta componenta are si legaturi care ies sau intra, acestea vor fi sterse o data cu stergerea componentei.Daca se va face click intr-un loc unde nu este nicio componenta,
si nici un menu nu a fost selectat, nu se va intampla nimic.
</p>
<p><b><i>4) Rotire si zoom in/out pe componenta </i></b></p>
<p>
Rotirea si zoom in/out pot fi activate prin selectarea casutei aferenta din panoul din dreapta. Odata ce se activeaza aceasta functionalitate, utilizatorul trebuie sa
aleaga de pe masa piesa care se doreste a fi rotita sau micsorata/marita. Daca nu se va selecta nimic, nimic nu se va intampla. Se va astepta urmatoarea comanda.
<br>
O data ce componenta este selectata, in partea dreapta jos vor aparea doua glisatoare, unul responsabil pentru rotire la 360 G, iar celalalt pentru micsorare/marire.
In functie de preferinta, se selecteaza glisatorul si se gliseaza sus/jos. Pentru ca actiunile sa fie aplicate componentei, va fi nevoie sa se apese butonul "Aplica modificarile"
de sub glisator.
</p>
</div>
<!-- <div class="img">
<img src="static/IMG/main-menu.png" alt="main_menu" class="img_f">
</div> -->
</div>
<div class="intro"></div>
<div class="panel first-panel" id="c2">
<p><b><i>5) Desenarea legaturii</i></b></p>
<p>
Desenarea legaturii se face prin selectarea unui nod al unei componente, care se doreste a fi legata de o alta componenta. O data facuta selectia,
legatura va incepe sa urmareasca cursorul.
Daca cursorul merge in afara tablei de lucru, legatura se va pierde, fiind nevoita reselectarea nodului.
<p>
Pentru a se face conexiunea cu o alta componenta, este nevoie sa se faca click pe nodul celeilalte componente. Daca click-ul s-a facut cu succes pe nod,
cele doua componente vor fi conectate.
</p>
<p>
Dintr-un nod pot pleca/intra o infinitate de legaturi. Nu exista restrictii.
</p>
</p>
<p><b><i>6) Mutare componenta </i></b></p>
<p>
Mutarea componentei pe masa de lucru se face prin selectarea componentei dorite de pe tabla prin click stanga, ce va permite mutarea oriunde in limitele chenarului
verde. Daca se va merge cu cursorul in afara chenarului verde, utilizatrul va fi informat ca a depasit limitele masei de lucru, iar componenta se va redesena
la ultima sa pozitie.(cea dinainte de click)
</p>
<p><b><i>7) Stergere componenta </i></b></p>
<p>
Stergerea unei componente de pe masa de lucru se face prin selectarea actiunii specifice din panoul din dreapta (Delete component). Odata functionalitatea activata,
utilizatorul va trebui sa selecteze de pe tabla piesa ce se doreste a fi stearsa.<br>
Daca aceasta componenta are si legaturi care ies sau intra, acestea vor fi sterse o data cu stergerea componentei.Daca se va face click intr-un loc unde nu este nicio componenta,
si nici un menu nu a fost selectat, nu se va intampla nimic.
</p>
<p><b><i>8) Rotire si zoom in/out pe componenta </i></b></p>
<p>
Rotirea si zoom in/out pot fi activate prin selectarea casutei aferenta din panoul din dreapta. Odata ce se activeaza aceasta functionalitate, utilizatorul trebuie sa
aleaga de pe masa piesa care se doreste a fi rotita sau micsorata/marita. Daca nu se va selecta nimic, nimic nu se va intampla. Se va astepta urmatoarea comanda.
<br>
O data ce componenta este selectata, in partea dreapta jos vor aparea doua glisatoare, unul responsabil pentru rotire la 360 G, iar celalalt pentru micsorare/marire.
In functie de preferinta, se selecteaza glisatorul si se gliseaza sus/jos. Pentru ca actiunile sa fie aplicate componentei, va fi nevoie sa se apese butonul "Aplica modificarile"
de sub glisator.
</p>
</div>
<!-- <div class="img">
<img src="static/IMG/main-menu.png" alt="main_menu" class="img_f">
</div> -->
</div>
<div class="intro"></div>
<div class="first-panel panel" id="c3">
<p><b><i>9) Salvarea proiectului</i></b></p>
<p>
Functionalitatea "Save" de pe masa de lucru ofera posibilitatea user-ului sa poata
salva progresul realizat in crearea schemelor electrice dorite. Aceasta functionalitate a fost
implementata cu ajutorul fisierelor binare, care vor stoca informatiile fiecarei componente
de pe tabla. Fisierul va fi de tip .AT .
Fisierele vor fi salvate in directorul /Projects din root-ul proiectului.
Daca acest director nu exista, el va fi creat.
<p>
Daca se doreste sa se salveze proiectul in alt folder decat cel predefinit, el poate opta pentru
functionalitatea "Save as" care ii a permite sa isi aleaga un director unde sa isi salveze progresul.
</p>
</p>
<p><b><i>10) Deschiderea unui alt proiect</i></b></p>
<p>
Utilizatorul poate sa deschida un proiect la care a lucrat si sa isi continue dezvoltarea circuitului dorit.
Se poate deschide orice fisier de tip .AT care respecta cateva conditii de integritate. Alte fisiere, care nu sunt de tipul
.AT, nu vor fi deschise, o eroare fiind aruncata.
<p>Fisierul se poate afla oriunde pe device, fiind permisa navigarea cate fisierul target pentru a putea fi deschis.</p>
</p>
<p><b><i>11) Undo/Redo </i></b></p>
<p>
Undo/Redo reprezinta o functionalitate utilizata de orice user/programator, fiind implementata nativ
in majoritatea sistemelor de operare comercializate. O astfel de functionalitate este implementata
si in proiectul nostru.
<p>Undo/Redo permite revenire la o stare anterioara (sau succesoare dupa caz), daca se doreste acest lucru
prin actionarea butonului de UNDO. Daca userul doreste totusi sa revina la starea la care a fost inainte
de aplicarea UNDO-ului, acesta poate prin apasarea butonului de REDO, care revine pana la ultima stare,
dinainte de UNDO (sau la o stare intermediara, daca au fost aplicate mai multe UNDO uri succesive).
</p>
</p>
</p>
</div>
<!-- <div class="img">
<img src="static/IMG/main-menu.png" alt="main_menu" class="img_f">
</div> -->
</div>
<div class="intro"></div>
<div class="first-panel panel" id="c5">
<div class="wrapper">
<div class="bulb-div">
<h3><i>Aprinde becul !</i></h3>
<img src="static/IMG/Untitled.png" alt="bulb" class="bulb">
</div>
</div>
<div class="light-bulb">
<p>Aprinde becul este un mic joc implementat de catre noi de care utilizatorul se poate bucura!</p>
<p>
Acest joc presupune crearea unui "Circuit Fericit" format dintr-un numar specific de componente si tipuri de componente,
conectate intre ele (nu conteaza ordinea) care va putea aprinde un bec!
</p>
<p style="display:table-cell;">Acesta trebuie sa contina:
<div class="wrapper-ul">
<ul class="unordered">
<li>2 surse</li>
<li >2 rezistori</li>
<li >1 voltmetru</li>
<li >1 ampermetru</li>
<li >1 dioda</li>
<li >1 tranzistor</li>
<li >1 siguranta</li>
<li >1 capacitor</li>
<li >1 bec</li>
</ul>
<img src="static/IMG/APRINDE-BECU.png" alt="main_menu" class="img_f" id="bulb_img">
</div>
</p>
</div>
</div>
<div class="footer">
</div>
</div>
<script>
</script>
+1584
View File
File diff suppressed because it is too large Load Diff
+112
View File
@@ -0,0 +1,112 @@
#ifndef STARTUP_PAGE_H_INCLUDED
#define STARTUP_PAGE_H_INCLUDED
#include "open_save.h"
#include "functii_auxiliare.h"
//Andrei CERBU pana jos
void background_image(int W, int H, char*current_path){
readimagefile(path_for_images("bg_main_menu.jpg",current_path),0,0,W,H);
}
void create_panels_startup_page(int W, int H, float R){
setlinestyle(SOLID_LINE,0,7);
setcolor(WHITE);
rectangle(W/6,H/4,W/6+R*H/6,H/4+R*H/6);//upper left
rectangle(W/3,H/4,W/3+R*H/6,H/4+R*H/6);//upper right
rectangle(W/6,3*H/4-R*H/6,W/6+R*H/6,3*H/4);//down left
rectangle(W/3,3*H/4-R*H/6,W/3+R*H/6,3*H/4);//down right
}
void create_texts_startup_page(int W, int H, float R){
setcolor(WHITE);
settextstyle(COMPLEX_FONT,0,W/240);
outtextxy(W/2+W/20,H/2-H/26,"ElectronAT");
settextstyle(COMPLEX_FONT,0,W/450);
outtextxy(W/2-W/22,H/30,"MAIN MENU");
setlinestyle(SOLID_LINE,0,4); setcolor(WHITE);
line(W/2-W/20,H/15,W/2+W/20,H/15);
}
void create_icons_startup_page(int W, int H, char* current_path){
//!"New Project" icon
//rectangle
setlinestyle(SOLID_LINE,0,4);
setcolor(BLACK);
rectangle(W/5,H/3-H/17,W/6+W/14,H/3+H/20);
//plus sign
setcolor(YELLOW);
line(W/5-W/500,H/3-H/14,W/5-W/500,H/3-H/20);
line(W/5-W/150,H/3-H/16,W/5+W/300,H/3-H/16);
readimagefile(path_for_images("patrat_stang_sus.jpg",current_path),W/5,H/3-H/17,W/6+W/14,H/3+H/20);
//!"Open Project" icon
//rectangle
setlinestyle(SOLID_LINE,0,4);
setcolor(BLACK);
rectangle(W/3+W/80,H/3-H/32,W/3+W/12,H/3+H/23);
readimagefile(path_for_images("patrat_dreapta_sus_alb.jpg",current_path),W/3+W/80,H/3-H/32,W/3+W/12,H/3+H/23);
//arrow
//base
setcolor(BLACK);
line(W/3+W/23,H/3,W/3+W/19,H/3);//base
line(W/3+W/23,H/3,W/3+W/23,H/3-H/25);//upleft
line(W/3+W/19,H/3,W/3+W/19,H/3-H/25);//upright
readimagefile(path_for_images("patrat_dreapta_sus_galben.jpg",current_path),W/3+W/23,H/3-H/25,W/3+W/19,H/3);
//fill the arrow with yellow lines
//on width
setcolor(YELLOW);
line(W/3+W/26,H/3-H/24,W/3+W/18+W/500,H/3-H/24);
line(W/3+W/25,H/3-H/23,W/3+W/19+W/300,H/3-H/23);
line(W/3+W/25-W/1290,H/3-H/22,W/3+W/19+W/235,H/3-H/22);
line(W/3+W/25+W/1290,H/3-H/21,W/3+W/18,H/3-H/21);
line(W/3+W/25+W/500,H/3-H/20,W/3+W/18-W/500,H/3-H/20);
line(W/3+W/23,H/3-H/19-H/1000,W/3+W/19,H/3-H/19-H/1000);
line(W/3+W/23,H/3-H/18+H/700,W/3+W/19,H/3-H/18+H/700);
line(W/3+W/23+W/500,H/3-H/18,W/3+W/19-W/1000,H/3-H/18);
line(W/3+W/22,H/3-H/17,W/3+W/20,H/3-H/17);
line(W/3+W/21,H/3-H/17,W/3+W/20,H/3-H/17);
line((W/3+W/27+W/3+W/17)/2,H/3-H/25,(W/3+W/27+W/3+W/17)/2,H/3-H/25);
//on hight
line((W/3+W/27+W/3+W/17)/2,H/4+H/45,(W/3+W/27+W/3+W/17)/2,H/3-H/25);
line((W/3+W/27+W/3+W/17)/2-W/500,H/4+H/45,(W/3+W/27+W/3+W/17)/2,H/3-H/25);
line((W/3+W/27+W/3+W/17)/2+W/600,H/4+H/48,(W/3+W/27+W/3+W/17)/2,H/3-H/25);
//arrow sides
setcolor(BLACK);
line(W/3+W/27,H/3-H/25,W/3+W/17,H/3-H/25);//triangebase
line((2*W/3+W/27+W/17)/2,H/4+H/60,W/3+W/27,H/3-H/25);//triangleleftside
line((2*W/3+W/27+W/17)/2,H/4+H/60,W/3+W/17,H/3-H/25);//trianglerightside
//!"Info" icon
setlinestyle(SOLID_LINE,0,7);
setcolor(YELLOW);
arc((W/3+H/6)/2,3*H/4-H/9,0,90,W/50);
arc((W/3+H/6)/2,3*H/4-H/9,90,160,W/50);
arc((W/3+H/6)/2,3*H/4-H/9,270,0,W/50);
line(W/5+W/80,3*H/4-H/13,W/5+W/80,3*H/4-H/25);
setlinestyle(SOLID_LINE,0,3);
circle(W/5+W/80,3*H/4-H/50,5);
//!"Exit" Icon
setlinestyle(SOLID_LINE,0,7);
setcolor(YELLOW);
line(W/3+W/50,3*H/4-H/7,W/3+W/13,3*H/4-H/40);
line(W/3+W/50,3*H/4-H/40,W/3+W/13,3*H/4-H/7);
}
void draw_main_menu(int W, int H, float R, char *current_path){
background_image(W,H,current_path);
create_panels_startup_page(W,H,R);
create_icons_startup_page(W,H,current_path);
create_texts_startup_page(W,H,R);
}
#endif // STARTUP_PAGE_H_INCLUDED
+287
View File
@@ -0,0 +1,287 @@
#ifndef WORKPLACE_PAGE_H_INCLUDED
#define WORKPLACE_PAGE_H_INCLUDED
#include "drawing_components.h"
#include "stare_table.h"
#include "zoom_rotate_fader_workplace.h"
#include "functii_auxiliare.h"
void create_workbench_workplace(int W, int H, float R){
setlinestyle(SOLID_LINE,0,0);
setcolor(GREEN);
rectangle(W/8*R,H/12*R,7*W/8*R,11*H/12*R);
}
//Tudor ILADE && Andrei Cerbu
void create_top_menu_workplace(int W, int H, float R, int width_rectangle, int height_rectangle){
setlinestyle(SOLID_LINE,0,3);
setcolor(WHITE);
rectangle(width_rectangle*3*R,0,width_rectangle*4*R, height_rectangle*R);
rectangle(width_rectangle*4*R,0,width_rectangle*5*R, height_rectangle*R);
rectangle(width_rectangle*5*R,0,width_rectangle*6*R, height_rectangle*R);
rectangle(width_rectangle*6*R,0,width_rectangle*7*R, height_rectangle*R);
rectangle(width_rectangle*7*R,0,width_rectangle*8*R, height_rectangle*R);
rectangle(width_rectangle*8*R,0,width_rectangle*9*R, height_rectangle*R);
}
void create_left_menu_workplace(int W, int H, float R, int width_rectangle, int height_rectangle){
setlinestyle(SOLID_LINE,0,3);
setcolor(WHITE);
rectangle(0,(height_rectangle*3)*R,width_rectangle*R,(height_rectangle*4)*R);
rectangle(0,(height_rectangle*4)*R,width_rectangle*R,(height_rectangle*5)*R);
rectangle(0,(height_rectangle*5)*R,width_rectangle*R,(height_rectangle*6)*R);
rectangle(0,(height_rectangle*6)*R,width_rectangle*R,(height_rectangle*7)*R);
rectangle(0,(height_rectangle*7)*R,width_rectangle*R,(height_rectangle*8)*R);
rectangle(0,(height_rectangle*8)*R,width_rectangle*R,(height_rectangle*9)*R);
rectangle(0,(height_rectangle*9)*R,width_rectangle*R,(height_rectangle*10)*R);
rectangle(0,(height_rectangle*10)*R,width_rectangle*R,(height_rectangle*11)*R);
rectangle(0,(height_rectangle*11)*R,width_rectangle*R,(height_rectangle*12)*R);
}
void create_right_menu_workplace(int W, int H, float R, int width_rectangle, int height_rectangle){
setlinestyle(SOLID_LINE,0,3);
setcolor(WHITE);
rectangle((W-width_rectangle)*R,(height_rectangle*2)*R,W,(height_rectangle*3)*R);
rectangle((W-width_rectangle)*R,(height_rectangle*3)*R,W,(height_rectangle*4)*R);
rectangle((W-width_rectangle)*R,(height_rectangle*4)*R,W,(height_rectangle*5)*R);
rectangle((W-width_rectangle)*R,(height_rectangle*5)*R,W,(height_rectangle*6)*R);
rectangle((W-width_rectangle)*R,(height_rectangle*6)*R,W,(height_rectangle*7)*R);
rectangle((W-width_rectangle)*R,(height_rectangle*7)*R,W,(height_rectangle*8)*R);
}
void create_undo_redo_menu_workplace(int W, int H, float R, int width_rectangle, int height_rectangle){
setlinestyle(SOLID_LINE,0,2);
setcolor(WHITE);
//Undo
arc((width_rectangle+2*width_rectangle/9)/2*R,14.6*height_rectangle*R,250,170,width_rectangle/5);
line((width_rectangle+2*width_rectangle/9)/2*R-width_rectangle/5,14.6*height_rectangle*R,(width_rectangle+2*width_rectangle/9)/2*R-width_rectangle/4,14.3*height_rectangle*R);
line((width_rectangle+2*width_rectangle/9)/2*R-width_rectangle/5,14.6*height_rectangle*R,(width_rectangle+2*width_rectangle/9)/2*R-width_rectangle/30,14.4*height_rectangle*R);
//Redo
arc((16*width_rectangle/9+width_rectangle)/2,14.6*height_rectangle*R,10,270,width_rectangle/5);
line((16*width_rectangle/9+width_rectangle)/2+width_rectangle/5,14.6*height_rectangle*R,(16*width_rectangle/9+width_rectangle)/2-width_rectangle/30,14.4*height_rectangle*R);
line((16*width_rectangle/9+width_rectangle)/2+width_rectangle/5,14.6*height_rectangle*R,(16*width_rectangle/9+width_rectangle)/2+width_rectangle/4,14.25*height_rectangle*R);
}
void create_drawing_line_type_menu_workplace(int W, int H, int R, int width_rectangle, int height_rectangle, int color){
setcolor(color);
setlinestyle(SOLID_LINE,0,1);
rectangle((W-width_rectangle)*R,(height_rectangle*11.1)*R,W-width_rectangle/9,(height_rectangle*12.1)*R);
rectangle((W-width_rectangle)*R,(height_rectangle*12.1)*R,W-width_rectangle/9,(height_rectangle*13.1)*R);
rectangle((W-width_rectangle)*R,(height_rectangle*13.1)*R,W-width_rectangle/9,(height_rectangle*14.1)*R);
rectangle((W-width_rectangle)*R,(height_rectangle*14.1)*R,W-width_rectangle/9,(height_rectangle*15.1)*R);
}
//Andrei Cerbu
void create_zoom_rotate_panel_workplace(int W, int H, int R, int width_rectangle, int height_rectangle, int color){
setcolor(color);
setlinestyle(SOLID_LINE,0,0);
fader rrotate;
rrotate.Centru.x=(W-width_rectangle)*R+4*W/225;
rrotate.Centru.y=((height_rectangle*16.95)+(height_rectangle*19.7))*R/2;
//desenare dreptunghiurile exterioare
rectangle((W-width_rectangle)*R,(height_rectangle*16.1)*R,(W-width_rectangle)*R+4*W/225*2,(height_rectangle*20.1)*R);
rectangle((W-width_rectangle)*R+4*W/225*3,(height_rectangle*16.1)*R,W-width_rectangle/9,(height_rectangle*20.1)*R);
//desenare glisator rotate
rectangle(rrotate.Centru.x-W/140,rrotate.Centru.y-H/70,rrotate.Centru.x+W/140,rrotate.Centru.y+H/70);
line((W-width_rectangle)*R+4*W/225,(height_rectangle*16.5)*R,(W-width_rectangle)*R+4*W/225,(height_rectangle*19.7)*R);
//desenare glisator zoom
fader zzom;
zzom.Centru.x=(W-width_rectangle)*R+4*W/225*4;
zzom.Centru.y=((height_rectangle*16.95)+(height_rectangle*19.7))*R/2;
rectangle(zzom.Centru.x-W/140,zzom.Centru.y-H/70,zzom.Centru.x+W/140,zzom.Centru.y+H/70);
line((W-width_rectangle)*R+4*W/225*4,(height_rectangle*16.5)*R,(W-width_rectangle)*R+4*W/225*4,(height_rectangle*19.7)*R);
}
//Tudor ILADE
void draw_black_zoom_rotate_panel(int W, int H, int R, int width_rectangle, int height_rectangle, int id){
if(id == 1)
{
setcolor(BLACK);
fader rrotate;
rrotate.Centru.x=(W-width_rectangle)*R+4*W/225;
rrotate.Centru.y=((height_rectangle*16.95)+(height_rectangle*19.7))*R/2;
rectangle(rrotate.Centru.x-W/140,rrotate.Centru.y-H/70,rrotate.Centru.x+W/140,rrotate.Centru.y+H/70);
line((W-width_rectangle)*R+4*W/225,(height_rectangle*16.5)*R,(W-width_rectangle)*R+4*W/225,(height_rectangle*19.7)*R);
}
else if(id == 2)
{
setcolor(BLACK);
fader zzom;
zzom.Centru.x=(W-width_rectangle)*R+4*W/225*4;
zzom.Centru.y=((height_rectangle*16.95)+(height_rectangle*19.7))*R/2;
rectangle(zzom.Centru.x-W/140,zzom.Centru.y-H/70,zzom.Centru.x+W/140,zzom.Centru.y+H/70);
line((W-width_rectangle)*R+4*W/225*4,(height_rectangle*16.5)*R,(W-width_rectangle)*R+4*W/225*4,(height_rectangle*19.7)*R);
}
}
int betweenBars(int W, int H, int R, int width_rectangle, int height_rectangle, int x, int y, int id){
if(x>(W-width_rectangle)*R && x<(W-width_rectangle)*R+4*W/225*2 && y>height_rectangle*16.1*R && y<(height_rectangle*20.1)*R && id == 1)
return 1;
if(x>(W-width_rectangle)*R+4*W/225*3 && x<W-width_rectangle/9 && y>height_rectangle*16.1*R && y<(height_rectangle*20.1)*R && id == 2)
return 2;
return 0;
}
//Andrei CERBU pana jos
void print_text_on_workplace_page(int W, int H, int R, int width_rectangle, int height_rectangle, int rect_w, int rect_h, char* str){
int text_w=textwidth(str);
int text_h=textheight(str);
float x=(width_rectangle+(rect_w-text_w)/2);
float y=(height_rectangle+(rect_h-text_h)/2);
outtextxy(x,y,str);
}
void create_text_workplace(int W, int H, float R){
int width_rectangle, height_rectangle, FONT;
if(W<=1920)
FONT=1;
else FONT=3;
settextstyle(EUROPEAN_FONT,HORIZ_DIR,FONT);
setcolor(WHITE);
///TOP TEXT
width_rectangle=W/12;
height_rectangle=H/24;
print_text_on_workplace_page(W,H,R,width_rectangle*3*R,0,width_rectangle,height_rectangle,"Start panel");
print_text_on_workplace_page(W,H,R,width_rectangle*4*R,0,width_rectangle,height_rectangle,"Open");
print_text_on_workplace_page(W,H,R,width_rectangle*5*R,0,width_rectangle,height_rectangle,"Save");
print_text_on_workplace_page(W,H,R,width_rectangle*6*R,0,width_rectangle,height_rectangle,"Save as");
print_text_on_workplace_page(W,H,R,width_rectangle*7*R,0,width_rectangle,height_rectangle,"Help");
print_text_on_workplace_page(W,H,R,width_rectangle*8*R,0,width_rectangle,height_rectangle,"Reset");
///RIGHT TEXT
width_rectangle = W/9;
height_rectangle = H/16;
print_text_on_workplace_page(W,H,R,(W-width_rectangle)*R,(height_rectangle*2),width_rectangle,height_rectangle,"Check integrity");
print_text_on_workplace_page(W,H,R,(W-width_rectangle)*R,(height_rectangle*3),width_rectangle,height_rectangle,"Zoom/Rotate");
print_text_on_workplace_page(W,H,R,(W-width_rectangle)*R,(height_rectangle*4),width_rectangle,height_rectangle,"Delete comp.");
print_text_on_workplace_page(W,H,R,(W-width_rectangle)*R,(height_rectangle*5),width_rectangle,height_rectangle,"Delete link");
print_text_on_workplace_page(W,H,R,(W-width_rectangle)*R,(height_rectangle*6),width_rectangle,height_rectangle,"Update comp.");
print_text_on_workplace_page(W,H,R,(W-width_rectangle)*R,(height_rectangle*7),width_rectangle,height_rectangle,"Line type");
}
void create_bulb(int W, int H, int R, int width_rectangle, int height_rectangle, int color){
/*setfillstyle(SOLID_FILL,color);
circle(W-width_rectangle/2,height_rectangle,W/100);
floodfill(W-width_rectangle/2,height_rectangle,WHITE);
line(W-width_rectangle/2-width_rectangle/20,height_rectangle+W/120,W-width_rectangle/2-width_rectangle/20,1.6*(height_rectangle)*R);
line(W-width_rectangle/2+width_rectangle/20,height_rectangle+W/120,W-width_rectangle/2+width_rectangle/20,1.6*(height_rectangle)*R);
line((W-width_rectangle/2-width_rectangle/20)*R,1.6*(height_rectangle)*R,(W-width_rectangle/2+width_rectangle/20)*R,1.6*(height_rectangle)*R);*/
}
void messages_log_panel(char* str, int W, int H, float R, int width_rectangle, int height_rectangle){
setlinestyle(SOLID_LINE,0,2);
setcolor(WHITE);
rectangle(3.5*width_rectangle*R,15*height_rectangle*R,5.5*width_rectangle*R,15.7*height_rectangle*R);
int text_w=textwidth(str);
int text_h=textheight(str);
int rect_w=width_rectangle*R;
int rect_h=0.7*height_rectangle*R;
float x=(4*width_rectangle+(rect_w-text_w)/2)*R;
float y=(15*height_rectangle+(rect_h-text_h)/2)*R;
outtextxy(x,y,str);
}
void draw_components_left_panel(int W, int H, float R){
int X=W/8,Y=H/16;
struct componenta CMP[30];
construct_resistor(W/10,H/16,R,7*X/16,7*Y/2,0,1.0,CMP);
draw_component(CMP,6,WHITE);
construct_fuse(W/10,H/16,R,7*X/16,9*Y/2,0,1.0,CMP);
draw_component(CMP,5,WHITE);
construct_electrical_cell(W/10,H/16,R,7*X/16,11*Y/2,0,1.0,CMP);
draw_component(CMP,7,WHITE);
construct_dioda(W/10,H/16,R,7*X/16,13*Y/2,0,1.0,CMP);
draw_component(CMP,9,WHITE);
construct_ampermeter(W/10,H/16,R,7*X/16,15*Y/2,0,1.0,CMP);
draw_component(CMP,12,WHITE);
construct_voltmeter(W/10,H/16,R,7*X/16,17*Y/2,0,1.0,CMP);
draw_component(CMP,10,WHITE);
construct_capacitor(W/10,H/16,R,7*X/16,19*Y/2,0,1.0,CMP);
draw_component(CMP,7,WHITE);
construct_bulb(W/10,H/16,R,7*X/16,21*Y/2,0,1.0,CMP);
draw_component(CMP,8,WHITE);
construct_transistor(W/10,H/16,R,7*X/16,23*Y/2,0,1.0,CMP);
draw_component(CMP,11,WHITE);
}
void drawing_line_type(int W, int H, float R, int width_rectangle, int height_rectangle, int color){
setcolor(color);
setlinestyle(SOLID_LINE,0,0);
drawLine((W-width_rectangle)*R+width_rectangle/5,height_rectangle*11.1+height_rectangle/6,W-width_rectangle/5,height_rectangle*12.1-height_rectangle/6,color,1);
drawLine((W-width_rectangle)*R+width_rectangle/5,height_rectangle*12.1+height_rectangle/6,W-width_rectangle/5,height_rectangle*13.1-height_rectangle/6,color,4);
drawLine((W-width_rectangle)*R+width_rectangle/5,height_rectangle*13.1+height_rectangle/6,W-width_rectangle/5,height_rectangle*14.1-height_rectangle/6,color,3);
drawLine((W-width_rectangle)*R+width_rectangle/5,height_rectangle*14.1+height_rectangle/6,W-width_rectangle/5,height_rectangle*15.1-height_rectangle/6,color,2);
}
void draw_images(int W, int H, float R, char *current_path)
{
readimagefile(path_for_images("icon.jpg",current_path),W/70+W/70,W/70+W/70,W/15+W/70,W/15+W/70);
readimagefile(path_for_images("becstins.jpg",current_path),W-W/9+W/34,0.2*H/16,W-W/6.5+W/34,1.6*H/16);
}
void draw_working_table(int W, int H, float R, char *current_path){
cleardevice();
draw_images(W,H,R,current_path);
create_workbench_workplace(W,H,R);
create_top_menu_workplace(W,H,R,W/12,H/24);
create_left_menu_workplace(W,H,R,W/9,H/16);
create_right_menu_workplace(W,H,R,W/9,H/16);
create_undo_redo_menu_workplace(W,H,R,W/18,H/16);
create_zoom_rotate_panel_workplace(W,H,R,W/10,H/22,WHITE);
create_text_workplace(W,H,R);
create_bulb(W,H,R,W/9,H/16,WHITE);
messages_log_panel("Logs",W,H,R,W/9,H/16);
draw_components_left_panel(W,H,R);
}
#endif // WORKPLACE_PAGE_H_INCLUDED
+109
View File
@@ -0,0 +1,109 @@
#ifndef ZOOM_ROTATE_FADER_WORKPLACE_H_INCLUDED
#define ZOOM_ROTATE_FADER_WORKPLACE_H_INCLUDED
//Andrei CERBU
struct point
{
int x, y;
};
struct fader
{
point Centru;
int angle;
float R_ZOOM;
};
//Andrei CERBU && Tudor Ilade
void create_zoom_rotate_fader_workplace(int W, int H, int R, int width_rectangle, int height_rectangle, int y, int id, int color)
{
if(id==1)
{
fader rrotate;
rrotate.Centru.x=(W-width_rectangle)*R+4*W/225;
rrotate.Centru.y=((height_rectangle*16.95)+(height_rectangle*19.7))*R/2;
if(y>((height_rectangle*16.5)*R)&&y<(height_rectangle*19.7)*R)
{
setcolor(color);
setlinestyle(SOLID_LINE,0,0);
rectangle(rrotate.Centru.x-W/140,y-H/70,rrotate.Centru.x+W/140,y+H/70);
setlinestyle(SOLID_LINE,0,0);
line((W-width_rectangle)*R+4*W/225,(height_rectangle*16.5)*R,(W-width_rectangle)*R+4*W/225,(height_rectangle*19.7)*R);
}
else if(y<((height_rectangle*16.4)*R))
{
setcolor(color);
setlinestyle(SOLID_LINE,0,0);
rectangle(rrotate.Centru.x-W/140,((height_rectangle*16.4)*R),rrotate.Centru.x+W/140,(height_rectangle*16.4)*R+2*H/70);
setlinestyle(SOLID_LINE,0,0);
line((W-width_rectangle)*R+4*W/225,(height_rectangle*16.5)*R,(W-width_rectangle)*R+4*W/225,(height_rectangle*19.7)*R);
}
else if(y>(height_rectangle*19.7)*R)
{
setcolor(color);
setlinestyle(SOLID_LINE,0,0);
rectangle(rrotate.Centru.x-W/140,(height_rectangle*19.7)*R-2*H/70,rrotate.Centru.x+W/140,(height_rectangle*19.7)*R);
setlinestyle(SOLID_LINE,0,0);
line((W-width_rectangle)*R+4*W/225,(height_rectangle*16.5)*R,(W-width_rectangle)*R+4*W/225,(height_rectangle*19.7)*R);
}
}
else if(id == 2)
{
fader zzom;
zzom.Centru.x=(W-width_rectangle)*R+4*W/225*4;
zzom.Centru.y=((height_rectangle*16.95)+(height_rectangle*19.7))*R/2;
if(y-H/70>((height_rectangle*16.5)*R)&&y+H/70<(height_rectangle*19.7)*R)
{
setcolor(color);
setlinestyle(SOLID_LINE,0,0);
rectangle(zzom.Centru.x-W/140,y-H/70,zzom.Centru.x+W/140,y+H/70);
setlinestyle(SOLID_LINE,0,0);
line((W-width_rectangle)*R+4*W/225*4,(height_rectangle*16.5)*R,(W-width_rectangle)*R+4*W/225*4,(height_rectangle*19.7)*R);
}
else if(y-H/70<((height_rectangle*16.4)*R))
{
setcolor(color);
setlinestyle(SOLID_LINE,0,0);
rectangle(zzom.Centru.x-W/140,((height_rectangle*16.4)*R),zzom.Centru.x+W/140,(height_rectangle*16.4)*R+2*H/70);
setlinestyle(SOLID_LINE,0,0);
line((W-width_rectangle)*R+4*W/225*4,(height_rectangle*16.5)*R,(W-width_rectangle)*R+4*W/225*4,(height_rectangle*19.7)*R);
}
else if(y+H/70>(height_rectangle*19.7)*R)
{
setcolor(color);
setlinestyle(SOLID_LINE,0,0);
rectangle(zzom.Centru.x-W/140,(height_rectangle*19.7)*R-2*H/70,zzom.Centru.x+W/140,(height_rectangle*19.7)*R);
setlinestyle(SOLID_LINE,0,0);
line((W-width_rectangle)*R+4*W/225*4,(height_rectangle*16.5)*R,(W-width_rectangle)*R+4*W/225*4,(height_rectangle*19.7)*R);
}
}
}
//Andrei Cerbu
int determine_angle_fader_position(int W, int H, int R, int width_rectangle, int height_rectangle, int x, int y)
{
fader rrotate, zzom;
rrotate.Centru.x=(W-width_rectangle)*R+4*W/225;
rrotate.Centru.y=((height_rectangle*16.95)+(height_rectangle*19.7))*R/2;
zzom.Centru.x=(W-width_rectangle)*R+4*W/225*4;
zzom.Centru.y=((height_rectangle*16.95)+(height_rectangle*19.7))*R/2;
if(x>rrotate.Centru.x-W/140&&x<rrotate.Centru.x+W/140&&y>rrotate.Centru.y-H/70&&y<rrotate.Centru.y+H/70)
return 1;
if(x>zzom.Centru.x-W/140 && x< zzom.Centru.x+W/140 && y>zzom.Centru.y-H/70 && zzom.Centru.y+H/70)
return 2;
return 0;
}
#endif // ZOOM_ROTATE_FADER_WORKPLACE_H_INCLUDED