Component Editor for CEDAR Logic Simulator

Are you writing your own components and need help with how to set them up or have questions about the components you are deriving from ? Ask them here.
User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Component Editor for CEDAR Logic Simulator

Postby Fahad » Sat May 06, 2017 1:12 pm

Hi,

i want to add a new component in an existing software consisting on two feature i.e:

1- To create a new circuit like 8 bit AND, 16 bit AND, 32 bit AND or more depends on you.
2- To remove or save that circuit.

guide me, Thanks

User avatar
doublemax
Moderator
Moderator
Posts: 11384
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Component Editor for CEDAR Logic Simulator

Postby doublemax » Sat May 06, 2017 2:06 pm

That's a too generic question and answering it obviously requires knowledge about CEDAR's inner workings, so i don't think anyone will be able to help with this.
Use the source, Luke!

User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: Component Editor for CEDAR Logic Simulator

Postby Fahad » Sat May 06, 2017 2:23 pm

Thank you #doublemax,

ok leave CEDAR Logic, i just want to make a new project having functionality of creating ,saving and removing logic gate without any INPUT limitations.
if i want to make logic AND gate with 64 , 32, 128 input than it have flexibility to make it. let say i set maximum limitation of 128 INPUT logic gate.

A simple logic gate COMPONENT EDITOR.

User avatar
doublemax
Moderator
Moderator
Posts: 11384
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Component Editor for CEDAR Logic Simulator

Postby doublemax » Sat May 06, 2017 3:04 pm

While i do have a general understanding about logic gates, i have no idea how such an editor would look like. Is it a graphical editor where you build an component using drag-and-drop? Or are we talking about a simple text-based dialog where you just enter data?
Use the source, Luke!

User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: Component Editor for CEDAR Logic Simulator

Postby Fahad » Sat May 06, 2017 3:34 pm

Graphical editor is more suitable than to the simple text based( i have seen in logisim based on text based ),

User avatar
doublemax
Moderator
Moderator
Posts: 11384
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Component Editor for CEDAR Logic Simulator

Postby doublemax » Sat May 06, 2017 4:35 pm

You have a big task ahead of you.

Try looking into wxShapeFramework and wxArt2D, they could save you a lot of time:
https://sourceforge.net/projects/wxsf/
http://www.wxart2d.org/cgi-bin/moin.cgi/wxArt2D

Unfortunately the wxArt2D site is somewhat broken, so you can't see any screenshots.
Use the source, Luke!

User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: Component Editor for CEDAR Logic Simulator

Postby Fahad » Sat May 06, 2017 6:11 pm

Thank you doublemax,

I'll get back to you after this,


best regards,

User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: Component Editor for CEDAR Logic Simulator

Postby Fahad » Wed May 10, 2017 3:28 pm

Well here few changes in domain, #doublemax,

What if i edit an existing logic gates.

lets say i made any component consisting on AND gate, flip flop , inverters and so on. and i want to make changes in existing gates and that changes
apply virtually not physically.

User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: Component Editor for CEDAR Logic Simulator

Postby Fahad » Thu May 25, 2017 6:16 am

kindly take a look over the attached picture. I want to do something like this. A kind of sequential/combination logic circuit. we have individual logic gate xml like AND, OR etc, i am getting problem while connecting one's output others input as given in picture.In connecting more than one gate in single logic gate.
xml code of AND gate is as follows.
<gate> <name>AA_AND2</name>
<caption>2-input AND</caption>
<input> <name>IN_0</name>
<point>-3.00,1</point>
</input>
<input> <name>IN_1</name>
<point>-3.00,-1</point>
</input>
<output> <name>OUT</name>
<point>3.00,0</point>
</output>
<shape>
<line>-2,1,-3.00,1</line>
<line>-2,-1,-3.00,-1</line>
<line>-2,2,-2,-2</line>
<line>-2,2,0,2</line>
<line>-2,-2,0,-2</line>
<line>0,2,0.31,1.98</line>
<line>0.31,1.98,0.62,1.9</line>
<line>0.62,1.9,0.91,1.78</line>
<line>0.91,1.78,1.18,1.62</line>
<line>1.18,1.62,1.41,1.41</line>
<line>1.41,1.41,1.62,1.18</line>
<line>1.62,1.18,1.78,0.91</line>
<line>1.78,0.91,1.9,0.62</line>
<line>1.9,0.62,1.98,0.31</line>
<line>1.98,0.31,2,0</line>
<line>2,0,1.98,-0.31</line>
<line>1.98,-0.31,1.9,-0.62</line>
<line>1.9,-0.62,1.78,-0.91</line>
<line>1.78,-0.91,1.62,-1.18</line>
<line>1.62,-1.18,1.41,-1.41</line>
<line>1.41,-1.41,1.18,-1.62</line>
<line>1.18,-1.62,0.91,-1.78</line>
<line>0.91,-1.78,0.62,-1.9</line>
<line>0.62,-1.9,0.31,-1.98</line>
<line>0.31,-1.98,0,-2</line>
<line>2,0,3.00,0</line>
<line>2.2,0,3.00,0</line>
</shape>
<logic_type>AND</logic_type>
<logic_param>INPUT_BITS 2</logic_param>
</gate>

guide me, thanks.
Attachments
logic circuit.jpg

User avatar
doublemax
Moderator
Moderator
Posts: 11384
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Component Editor for CEDAR Logic Simulator

Postby doublemax » Thu May 25, 2017 11:58 am

I still haven't see the software, so i don't know if this can be done by extending the present code.

If you need to do this from scratch, it'll be some work and i can only give you a general idea:

Create a baseclass for the different gates and then subclasses for the individual gates. The classes need to be able to draw themselves onto a wxDC and they need to contain information about the nodes that can connect to other nodes.

In the background window for all the components, catch all mouse events. On a mouseclick, check if there is a node under it. If the user clicks and drags with a node under the mouse, you need to track the position while the user is dragging. If the mouse is released with another node under the mouse, check if this is a type of node that can connect to the first node. If yes, create an internal connection between the nodes. In addition to that, the drawing code must be able to draw these connections in a "nice" way, i.e. not just straight lines between them.
Use the source, Luke!

User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: Component Editor for CEDAR Logic Simulator

Postby Fahad » Thu May 25, 2017 3:39 pm

you may get idea from below snapshots.
Attachments
gate_box.jpg
circuits.jpg
Last edited by Fahad on Thu May 25, 2017 4:41 pm, edited 1 time in total.

User avatar
doublemax
Moderator
Moderator
Posts: 11384
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Component Editor for CEDAR Logic Simulator

Postby doublemax » Thu May 25, 2017 3:46 pm

You've totally lost me. I've no idea what to do with those XML files or what you expect from me.
Use the source, Luke!

User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: Component Editor for CEDAR Logic Simulator

Postby Fahad » Thu May 25, 2017 4:03 pm

ok let me explain, here we have three logic gates, 2 AND gate with 2 input and 1 OR gate. right
individual i can connect them with each other, cedar logic give the functionality of individual drag and drop, but i want to make combinational logic gate, i want to put thrice of them in a single box with 4 input and 1 output.

here i am unable that how i place in a box, and the wire connectivity . kindly install cedar logic in your pc for a moment, so that you may get clear idea what i am trying to say.
Attachments
circuit.jpg

User avatar
doublemax
Moderator
Moderator
Posts: 11384
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Component Editor for CEDAR Logic Simulator

Postby doublemax » Thu May 25, 2017 6:02 pm

I installed version 1.5 which doesn't have the "My library" and "User library". But this seems to be more like a Cedar usage question than a wxWidgets programming question.

I understand you want to create a new element that has the combination of the three (2 x AND + 1 x OR) inside. I have no idea if this is possible with the latest Cedar version. And if not and you ask me how to implement it, i don't know either and i'm not willing to dig so deep into the Cedar code to find out. Sorry.
Use the source, Luke!

User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: Component Editor for CEDAR Logic Simulator

Postby Fahad » Thu May 25, 2017 6:15 pm

Oh , these three libraries "My library", "User library" and "Logic gate" i made it for testing these are not part of actual coding. (1 -10) libraries are the part of actual coding.

Anyhow thanks allot for your time.

stay blessed


Return to “Component Writing”

Who is online

Users browsing this forum: No registered users and 1 guest