Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
311a8186
Commit
311a8186
authored
Nov 08, 2011
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sweet editor, compiler warning
parent
cd0b2316
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
23 deletions
+86
-23
symbedit.cpp
eeschema/symbedit.cpp
+1
-1
CMakeLists.txt
new/CMakeLists.txt
+11
-9
design.h
new/design.h
+1
-1
sch_canvas.cpp
new/sch_canvas.cpp
+67
-6
sch_canvas.h
new/sch_canvas.h
+5
-3
sweet_edit.cpp
new/sweet_edit.cpp
+1
-2
test_sch_lib_table.cpp
new/test_sch_lib_table.cpp
+0
-1
No files found.
eeschema/symbedit.cpp
View file @
311a8186
...
@@ -204,7 +204,7 @@ void LIB_EDIT_FRAME::SaveOneSymbol()
...
@@ -204,7 +204,7 @@ void LIB_EDIT_FRAME::SaveOneSymbol()
try
try
{
{
formatter
.
Print
(
0
,
TO_UTF8
(
line
)
);
formatter
.
Print
(
0
,
"%s"
,
TO_UTF8
(
line
)
);
m_component
->
GetReferenceField
().
Save
(
formatter
);
m_component
->
GetReferenceField
().
Save
(
formatter
);
m_component
->
GetValueField
().
Save
(
formatter
);
m_component
->
GetValueField
().
Save
(
formatter
);
formatter
.
Print
(
0
,
"DRAW
\n
"
);
formatter
.
Print
(
0
,
"DRAW
\n
"
);
...
...
new/CMakeLists.txt
View file @
311a8186
...
@@ -176,7 +176,6 @@ else()
...
@@ -176,7 +176,6 @@ else()
set
(
gal_ROOT
"
${
CMAKE_CURRENT_BINARY_DIR
}
/gal-src"
)
set
(
gal_ROOT
"
${
CMAKE_CURRENT_BINARY_DIR
}
/gal-src"
)
set
(
gal_LIBRARY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/gal-src/libgal.a"
)
set
(
gal_LIBRARY
"
${
CMAKE_CURRENT_BINARY_DIR
}
/gal-src/libgal.a"
)
include
(
ExternalProject
)
include
(
ExternalProject
)
ExternalProject_Add
(
ki_gal
ExternalProject_Add
(
ki_gal
# skip the install step, build in source, use from source
# skip the install step, build in source, use from source
...
@@ -197,12 +196,14 @@ include_directories( "${gal_ROOT}" )
...
@@ -197,12 +196,14 @@ include_directories( "${gal_ROOT}" )
find_package
(
PkgConfig REQUIRED
)
find_package
(
PkgConfig REQUIRED
)
# Find cairo.
# Find cairo.
pkg_search_module
(
CAIRO REQUIRED cairo>=1.8.1
)
#pkg_search_module( CAIRO REQUIRED cairo>=1.8.1 )
include_directories
(
${
CAIRO_INCLUDE_DIRS
}
)
#include_directories( ${CAIRO_INCLUDE_DIRS} )
# Find the OpenGL libraries (gl and glu)
# Find the OpenGL libraries (gl and glu)
find_package
(
OpenGL
)
find_package
(
OpenGL
)
# Find GLEW
# Find GLEW
pkg_search_module
(
GLEW REQUIRED glew>=1.5.0
)
pkg_search_module
(
GLEW REQUIRED glew>=1.5.0
)
include_directories
(
${
GLEW_INCLUDE_DIRS
}
)
include_directories
(
${
GLEW_INCLUDE_DIRS
}
)
...
@@ -213,12 +214,13 @@ include_directories( ${gal_ROOT} )
...
@@ -213,12 +214,13 @@ include_directories( ${gal_ROOT} )
add_executable
(
sweet_edit sweet_edit.cpp sweet_editor_panel.cpp sch_canvas.cpp
)
add_executable
(
sweet_edit sweet_edit.cpp sweet_editor_panel.cpp sch_canvas.cpp
)
target_link_libraries
(
sweet_edit
target_link_libraries
(
sweet_edit
${
OPENGL_LIBRARIES
}
sweet
${
gal_LIBRARY
}
${
OPENGL_LIBRARIES
}
${
wxWidgets_LIBRARIES
}
${
gal_LIBRARY
}
${
GLEW_LIBRARIES
}
${
wxWidgets_LIBRARIES
}
${
GDI_PLUS_LIBRARIES
}
${
GLEW_LIBRARIES
}
)
${
GDI_PLUS_LIBRARIES
}
)
#=====<USE_SWIG>============================================================
#=====<USE_SWIG>============================================================
...
...
new/design.h
View file @
311a8186
...
@@ -151,7 +151,7 @@ of the base part as having most if not all the graphical lines for any
...
@@ -151,7 +151,7 @@ of the base part as having most if not all the graphical lines for any
derivatives. But we do not need to use the term symbol to describe that
derivatives. But we do not need to use the term symbol to describe that
relationship, the term "part" is sufficient.</dd>
relationship, the term "part" is sufficient.</dd>
<dt>LPID</dt><dd>This stand for "Logical Part ID", and is a reference to any
<dt>LPID</dt><dd>This stand
s
for "Logical Part ID", and is a reference to any
part within any known library. The term "logical" is used because the contained
part within any known library. The term "logical" is used because the contained
library name is logical, not a full library name. The LPID consists of 3 main
library name is logical, not a full library name. The LPID consists of 3 main
portions: logical library name, part name, and revision number.</dd>
portions: logical library name, part name, and revision number.</dd>
...
...
new/sch_canvas.cpp
View file @
311a8186
...
@@ -27,6 +27,11 @@
...
@@ -27,6 +27,11 @@
#include "sch_part.h"
#include "sch_part.h"
#include <gal/font/newstroke_font.h>
#include <gal/font/newstroke_font.h>
#define SWEET_UNIT 50 ///< world units comprizing a sweet grid cell
namespace
SCH
{
namespace
SCH
{
...
@@ -57,26 +62,26 @@ CANVAS::CANVAS( wxWindow* aParent ) :
...
@@ -57,26 +62,26 @@ CANVAS::CANVAS( wxWindow* aParent ) :
void
CANVAS
::
onRedraw
(
wxCommandEvent
&
event
)
void
CANVAS
::
onRedraw
(
wxCommandEvent
&
event
)
{
{
D
(
printf
(
"%s:
\n
"
,
__FUNCTION__
);)
PaintScene
();
PaintScene
();
}
}
void
CANVAS
::
PaintScene
()
void
CANVAS
::
PaintScene
()
{
{
D
(
printf
(
"%s:
\n
"
,
__FUNCTION__
);)
BeginDrawing
();
BeginDrawing
();
SetBackgroundColor
(
COLOR4D
(
0
,
0
,
0
,
1.0
)
);
SetBackgroundColor
(
COLOR4D
(
0
x6c
/
255.0
,
0x53
/
255.0
,
0x53
/
255.
0
,
1.0
)
);
ClearScreen
();
ClearScreen
();
SetLayerDepth
(
-
10
);
SetLayerDepth
(
-
10
);
SetGridSize
(
VECTOR2D
(
50
,
50
)
);
SetGridSize
(
VECTOR2D
(
SWEET_UNIT
,
SWEET_UNIT
)
);
DrawGrid
();
DrawGrid
();
PaintRectangle
();
SetLayerDepth
(
0
);
SetLayerDepth
(
0
);
Flush
();
Flush
();
...
@@ -84,4 +89,60 @@ void CANVAS::PaintScene()
...
@@ -84,4 +89,60 @@ void CANVAS::PaintScene()
}
}
void
CANVAS
::
PaintRectangle
()
{
VECTOR2D
worldSize
=
GetSize
();
#if 1
SetLineWidth
(
1
);
SetIsFill
(
true
);
SetIsStroke
(
true
);
SetFillColor
(
COLOR4D
(
1
,
1
,
1
,
1
)
);
SetStrokeColor
(
COLOR4D
(
0
,
0
,
0
,
1
)
);
DrawRectangle
(
VECTOR2D
(
worldSize
.
x
/
4
,
worldSize
.
y
/
4
),
VECTOR2D
(
3
*
worldSize
.
x
/
4
,
3
*
worldSize
.
y
/
4
)
);
#else
D
(
cout
<<
worldSize
<<
endl
;
)
int
k
=
0
;
double
alpha
=
0
;
for
(
double
y
=
0
;
y
<
worldSize
.
y
-
worldSize
.
y
/
4
;
y
+=
worldSize
.
y
/
8
)
{
double
index
=
1
;
double
y2
=
y
;
for
(
double
x
=
0
;
x
<
worldSize
.
x
-
worldSize
.
x
/
4
;
x
+=
worldSize
.
x
/
8
)
{
SetLineWidth
(
index
+
1
);
SetIsFill
(
(
k
==
1
)
||
(
k
==
2
)
);
SetIsStroke
(
(
k
==
0
)
||
(
k
==
2
)
);
SetFillColor
(
COLOR4D
(
1
-
alpha
,
1
,
1
,
1
-
alpha
)
);
SetStrokeColor
(
COLOR4D
(
alpha
,
alpha
,
1
-
alpha
,
alpha
)
);
DrawRectangle
(
VECTOR2D
(
x
,
y2
),
VECTOR2D
(
x
+
index
*
10
,
y2
+
index
*
10
)
);
x
+=
index
*
5
;
y2
+=
index
*
5
;
index
+=
1
;
}
k
=
(
k
+
1
)
%
3
;
alpha
+=
0.1
;
}
#endif
}
}
// namespace SCH
}
// namespace SCH
new/sch_canvas.h
View file @
311a8186
...
@@ -37,13 +37,13 @@ class CANVAS : public OPENGL_GAL
...
@@ -37,13 +37,13 @@ class CANVAS : public OPENGL_GAL
{
{
protected
:
protected
:
PART
*
m_part
;
///< which PART to draw
PART
*
m_part
;
///< which PART to draw
STROKE_FONT
m_font
;
STROKE_FONT
m_font
;
void
onRedraw
(
wxCommandEvent
&
event
);
void
onRedraw
(
wxCommandEvent
&
event
);
public
:
public
:
CANVAS
(
wxWindow
*
aParent
);
CANVAS
(
wxWindow
*
aParent
);
/**
/**
...
@@ -58,6 +58,8 @@ public:
...
@@ -58,6 +58,8 @@ public:
}
}
void
PaintScene
();
void
PaintScene
();
void
PaintRectangle
();
};
};
...
...
new/sweet_edit.cpp
View file @
311a8186
...
@@ -33,11 +33,10 @@
...
@@ -33,11 +33,10 @@
// Graphics Abstraction Layer imports
// Graphics Abstraction Layer imports
#include <gal/common/definitions.h>
#include <gal/common/definitions.h>
#include <gal/common/graphics_abstraction_layer.h>
#include <gal/common/graphics_abstraction_layer.h>
#include <gal/cairo/cairo_gal.h>
#include <gal/opengl/opengl_gal.h>
#include <gal/opengl/opengl_gal.h>
#include <gal/common/stroke_font.h>
#include <gal/common/stroke_font.h>
#include <gal/common/color4d.h>
#include <gal/common/color4d.h>
#include
"gal/font/newstroke_font.h"
#include
<gal/font/newstroke_font.h>
#include <math/vector2d.h>
#include <math/vector2d.h>
#include <math/matrix3x3.h>
#include <math/matrix3x3.h>
...
...
new/test_sch_lib_table.cpp
View file @
311a8186
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
using
namespace
SCH
;
using
namespace
SCH
;
// If LIB_TABLE::Test() is conditioned on DEBUG being defined, build with
// If LIB_TABLE::Test() is conditioned on DEBUG being defined, build with
// CMAKE_BUILD_TYPE=Debug, otherwise don't worry about it, because it will work
// CMAKE_BUILD_TYPE=Debug, otherwise don't worry about it, because it will work
// on any CMAKE_BUILD_TYPE, including Release.
// on any CMAKE_BUILD_TYPE, including Release.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment