Commit bbdb4cf0 authored by lcgamboa's avatar lcgamboa

new: New part \"Logic Block\" with logic functions: Not, Buffer, And, Nand, Or, Nor, Xor and Xnor.

parent 4ba8ae87
...@@ -2,5 +2,5 @@ PACKAGE=picsimlab ...@@ -2,5 +2,5 @@ PACKAGE=picsimlab
MAINVER=0 MAINVER=0
MINORVER=9 MINORVER=9
VERSION=0.9.2 VERSION=0.9.2
DATE=240407 DATE=240414
VERSION_STABLE=0.9.1 VERSION_STABLE=0.9.1
<img src="[push_buttons] (sobrescrita)" width="581" height="112" border="0" usemap="#map" />
<map name="map">
<!-- #$-:Image map file created by GIMP Image Map plug-in -->
<!-- #$-:GIMP Image Map plug-in by Maurits Rijk -->
<!-- #$-:Please do not edit lines starting with "#$" -->
<!-- #$VERSION:2.3 -->
<!-- #$AUTHOR:Luis Claudio Gamboa Lopes -->
<area shape="rect" coords="523,58,572,77" href="O_PN_9" />
<area shape="rect" coords="523,82,572,101" href="O_PN_10" />
<area shape="rect" coords="559,43,569,53" href="O_OUT" />
<area shape="rect" coords="477,20,543,39" href="O_TYPE" />
<area shape="rect" coords="9,82,58,101" href="O_PN_1" />
<area shape="rect" coords="14,66,24,76" href="O_IN_1" />
<area shape="rect" coords="71,82,120,101" href="O_PN_2" />
<area shape="rect" coords="76,66,86,76" href="O_IN_2" />
<area shape="rect" coords="134,82,183,101" href="O_PN_3" />
<area shape="rect" coords="138,66,148,76" href="O_IN_3" />
<area shape="rect" coords="195,82,244,101" href="O_PN_4" />
<area shape="rect" coords="200,66,210,76" href="O_IN_4" />
<area shape="rect" coords="257,82,306,101" href="O_PN_5" />
<area shape="rect" coords="262,66,272,76" href="O_IN_5" />
<area shape="rect" coords="321,82,370,101" href="O_PN_6" />
<area shape="rect" coords="326,66,336,76" href="O_IN_6" />
<area shape="rect" coords="383,82,432,101" href="O_PN_7" />
<area shape="rect" coords="387,66,397,76" href="O_IN_7" />
<area shape="rect" coords="444,82,493,101" href="O_PN_8" />
<area shape="rect" coords="448,66,458,76" href="O_IN_8" />
</map>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="581"
height="112"
viewBox="0 0 46598 9016.9"
version="1.1"
id="svg1514"
sodipodi:docname="part.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs1518">
<mask
maskUnits="userSpaceOnUse"
id="mask7851">
<g
id="g7877"
transform="translate(41785,12097)">
<g
id="g7875">
<path
fill="#ffffff"
d="M -105,-17 H 46734 V 9644 H -105 Z"
id="path7853" />
<path
stroke="#000000"
stroke-linecap="round"
stroke-width="393"
d="m 45215,4203 v 0 m -1000,0 v 0 m 1000,1000 v 0 m -1000,0 v 0 m 1000,1000 v 0 m -1000,0 v 0 m 1000,1000 v 0 m -1000,0 v 0 m 1000,1000 v 0 m -1000,0 v 0"
id="path7855" />
<path
stroke="#000000"
stroke-linecap="round"
stroke-width="433"
d="m 24274,2580 v 0 m 1,1771 v 0 M 21715,2579 v 0 m 0,1772 v 0 m 7600,-1748 v 0 m 0,1772 v 0 M 26755,2603 v 0 m 0,1772 v 0 m 7520,-1772 v 0 m -1,1771 v 0 M 31715,2603 v 0 m 0,1772 v 0"
id="path7857" />
<path
stroke="#000000"
stroke-linecap="round"
stroke-width="275"
d="m 25615,603 v 0 m 0,2000 v 0 M 30615,603 v 0 m 0,2000 v 0"
id="path7859" />
<path
stroke="#000000"
stroke-linecap="round"
stroke-width="433"
d="m 39174,2580 v 0 m 1,1771 v 0 M 36615,2579 v 0 m 0,1772 v 0 M 19215,2579 v 0 m 0,1772 v 0 M 16655,2579 v 0 m 0,1772 v 0"
id="path7861" />
<path
stroke="#000000"
stroke-linecap="round"
stroke-width="275"
d="m 20615,603 v 0 m 0,2000 v 0 M 5515,603 v 0 m 0,2000 v 0"
id="path7863" />
<path
stroke="#000000"
stroke-linecap="round"
stroke-width="354"
d="m 41047,1303 v 0 m 984,0 v 0 m 984,0 v 0 m -1968,1300 v 0 m 984,0 v 0 m 984,0 v 0"
id="path7865" />
<path
stroke="#000000"
stroke-linecap="round"
stroke-width="433"
d="m 4215,2603 v 0 m 0,1772 v 0 M 1655,2603 v 0 m 0,1772 v 0"
id="path7867" />
<path
stroke="#000000"
stroke-linecap="round"
stroke-width="275"
d="m 35515,603 v 0 m 0,2000 v 0"
id="path7869" />
<path
stroke="#000000"
stroke-linecap="round"
stroke-width="433"
d="m 14174,2580 v 0 m 1,1771 v 0 M 11615,2579 v 0 m 0,1772 v 0 M 9215,2579 v 0 m 0,1772 v 0 M 6655,2579 v 0 m 0,1772 v 0"
id="path7871" />
<path
stroke="#000000"
stroke-linecap="round"
stroke-width="275"
d="m 515,603 v 0 m 0,2000 v 0 M 10515,603 v 0 m 0,2000 v 0 M 15515,603 v 0 m 0,2000 v 0"
id="path7873" />
</g>
</g>
</mask>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath7907">
<g
id="g7913"
transform="translate(41785,12097)">
<g
id="g7911">
<path
d="M 46715,3 H -85 V 9003 H 46715 V 3"
fill-rule="evenodd"
id="path7909" />
</g>
</g>
</clipPath>
</defs>
<sodipodi:namedview
id="namedview1516"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="2.1071429"
inkscape:cx="251.76271"
inkscape:cy="55.999999"
inkscape:window-width="1920"
inkscape:window-height="1025"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg1514" />
<rect
style="fill:#313d63;fill-opacity:1;stroke:#000000;stroke-width:1.3927;stroke-dasharray:none"
id="rect8030"
width="46748.02"
height="9015.5068"
x="-62.130016"
y="0.69635189" />
<g
fill-opacity="0"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="39.37"
fill="none"
stroke="#000000"
id="g11"
transform="translate(-41785,-12097)"
mask="url(#mask7851)"
clip-path="url(#clipPath7907)" />
<rect
style="fill:#ffffff;stroke:#000000;stroke-width:0.588305;stroke-dasharray:none"
id="rect7976"
width="6577.9277"
height="3188.6836"
x="37671.254"
y="815.65051" />
</svg>
This diff is collapsed.
/* ########################################################################
PICSimLab - Programmable IC Simulator Laboratory
########################################################################
Copyright (c) : 2010-2024 Luis Claudio Gambôa Lopes <lcgamboa@yahoo.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
For e-mail suggestions : lcgamboa@yahoo.com
######################################################################## */
#ifndef PART_LOGIC_BLOCK_H
#define PART_LOGIC_BLOCK_H
#include "../lib/part.h"
#define PART_LOGIC_BLOCK_Name "Logic Block"
enum { LG_NOT, LG_BUFFER, LG_AND, LG_NAND, LG_OR, LG_NOR, LG_XOR, LG_XNOR };
const char* logicgate_name[] = {"NOT", "BUFFER", "AND", "NAND", "OR", "NOR", "XOR", "XNOR"};
class cpart_lblock : public part {
public:
std::string GetAboutInfo(void) override { return "L.C. Gamboa \n <lcgamboa@yahoo.com>"; };
cpart_lblock(const unsigned x, const unsigned y, const char* name, const char* type, board* pboard_, const int id_);
~cpart_lblock(void);
void DrawOutput(const unsigned int index) override;
void PreProcess(void) override;
void Process(void) override;
void PostProcess(void) override;
void Reset(void) override;
void ConfigurePropertiesWindow(void) override;
void ReadPropertiesWindow(void) override;
void LoadPartImage(void) override;
std::string WritePreferences(void) override;
void ReadPreferences(std::string value) override;
unsigned short GetInputId(char* name) override;
unsigned short GetOutputId(char* name) override;
void SpinChange(const char* controlname, int value) override;
void ComboChange(const char* controlname, std::string value) override;
private:
void ChangeSize(const unsigned int sz);
unsigned char gatetype;
unsigned char input_pins[8];
unsigned char output_pins[2];
unsigned long output_pins_alm;
unsigned char output_value;
int OWidth;
int OHeight;
int xoff;
unsigned int Size;
long mcount;
int JUMPSTEPS_;
};
#endif /* PART_LOGIC_BLOCK_H */
...@@ -662,7 +662,7 @@ static void set_signal_handler(void) { ...@@ -662,7 +662,7 @@ static void set_signal_handler(void) {
} }
#endif #endif
#else #else
static void set_signal_handler(void){}; static void set_signal_handler(void) {};
#endif #endif
void CPWindow1::_EvOnCreate(CControl* control) { void CPWindow1::_EvOnCreate(CControl* control) {
...@@ -2187,7 +2187,7 @@ int CPWindow1::WinCmd(CControl* ctrl, const PICSimLabWindowAction action, const ...@@ -2187,7 +2187,7 @@ int CPWindow1::WinCmd(CControl* ctrl, const PICSimLabWindowAction action, const
case PWA_COMBODELETEITEMS: case PWA_COMBODELETEITEMS:
((CCombo*)ctrl)->DeleteItems(); ((CCombo*)ctrl)->DeleteItems();
break; break;
case PWM_COMBOADDITEM: case PWA_COMBOADDITEM:
((CCombo*)ctrl)->AddItem(Value); ((CCombo*)ctrl)->AddItem(Value);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment