Thursday, April 14, 2022

19-Microwave Tools Circuit Class

It is anticipated that the Microwave Tools application will require many classes. The classes will be organized into folders which also represent namespaces. An intial class diagram is shown below.

Class Desriptions

Program - Application entry point with main() which creates the MainForm and event loop.

MainForm - Main graphical user interface.

Circuit - Class to manage complete circuits. Contains the component list where all schematic components are stored. Also provide file management on the local storage system.

Comp - Base class for all components including lumped elements, ideal elements, microstrip components, wires and nodes.

Lumped Components

  • RES - Resistor class
  • IND - Inductor class
  • CAP - Capacitor class
Ideal Components

  • InPort - Input port class
  • OutPort - Output port class
  • Ground - Ground class
Microstrip Components
  • MLIN - Microstrip line class
  • MCROS - Microstrip cross class
  • MTEE - Microstrip tee clas
Wires
  • Wire - Wire class
  • Node - Node class

Folders

Add 3 folders to the Microwave Tools project by right click on project name > Add > New Folder
  • Circuits
  • Components
  • Wires
Add 3 subfolders to Components by right click on Components folder > Add > New Folder
  • Lumped
  • Ideal
  • Microstrip
The solution explorer after folders added:


Circuit Class

Create a new class in the Components directory by right click on Components Foler > Add > Class
  • Name: Comp.cs
Make Comp a public class:

using System;
using System.Collections.Generic;
 
namespace MicrowaveTools.Components
{
    public class Comp
    {
 
    }
}

Create a new class in the Circuits directory by right click on Circuits Folder > Add > Class
  • Name: Circuit.cs
Make Circuit a public class:

// C# Libraries
using System;
using System.Collections.Generic;
 
// Microwave Tools Libraries
using MicrowaveTools.Components;
 
namespace MicrowaveTools.Circuits
{
    public class Circuit
    {
        public List<Comp> comps = new List<Comp>();
    }
}

Run the program to ensure that all errors are clear. The source code for this post is available on GitHub.


No comments:

Post a Comment

34-Microwave Tools with Analysis (Series Final Post)

In this final blog post, I have integrated Y-Matrix analysis into the Microwave Tools project. This version has addition Lumped, Ideal, Micr...