Skip to content

Commit

Permalink
Voltage heat map implemented
Browse files Browse the repository at this point in the history
Voltage heat map implemented using modern OpenGL =)
New external library required:
-GLEW
-GLFW
-GLM (incorporeted at the source)
Old memory leaks fixed =)
  • Loading branch information
Thales1330 committed Jul 8, 2020
1 parent 6c0e98a commit ab30228
Show file tree
Hide file tree
Showing 474 changed files with 76,316 additions and 9,779 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ docs/doxygen/latex
data/
Debug/
Release/
ExtLibs/
x64/

# Compiled source #
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ before_install:
- sudo apt-get install freeglut3-dev
- sudo apt-get install libglew-dev
- sudo apt-get install mesa-utils
- sudo apt-get install libglfw3-dev

- sudo apt-get install at-spi2-core

Expand Down
4 changes: 2 additions & 2 deletions PSP.workspace
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<CodeLite_Workspace Name="PSP" Database="" Version="10.0.0">
<Project Name="Project" Path="Project/Project.project" Active="Yes"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release_Windows_x32" Selected="no">
<WorkspaceConfiguration Name="Release_Windows_x32" Selected="yes">
<Environment/>
<Project Name="Project" ConfigName="Release_Windows_x32"/>
</WorkspaceConfiguration>
<WorkspaceConfiguration Name="Release_Windows_x64" Selected="yes">
<WorkspaceConfiguration Name="Release_Windows_x64" Selected="no">
<Environment/>
<Project Name="Project" ConfigName="Release_Windows_x64"/>
</WorkspaceConfiguration>
Expand Down
2 changes: 1 addition & 1 deletion Project/AboutForm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ AboutForm::~AboutForm() {}
void AboutForm::Init()
{
// Set program version. Format: (Alpha/Beta/Release) (YEAR)w(WEEK)(a/b/c/...)
m_staticTextVersion->SetLabel("2020w24a-beta");
m_staticTextVersion->SetLabel("2020w28a-beta");

// Create developers table
m_gridCredits->EnableGridLines(false);
Expand Down
30 changes: 30 additions & 0 deletions Project/Basic.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#shader vertex
#version 330 core

layout(location = 0) in vec4 position;
layout(location = 1) in vec3 colour;

uniform mat4 u_mvpMatrix;

void main()
{
gl_Position = u_mvpMatrix * position;
};

#shader fragment
#version 330 core

layout(location = 0) out vec4 color;

vec3 hsl2rgb(in vec3 c)
{
vec3 rgb = clamp(abs(mod(c.x * 6.0 + vec3(0.0, 4.0, 2.0), 6.0) - 3.0) - 1.0, 0.0, 1.0);

return c.z + c.y * (rgb - 0.5) * (1.0 - abs(2.0 * c.z - 1.0));
}

void main()
{
vec3 colorRGB = hsl2rgb(vec3(gl_FragCoord.z * 0.8, 1.0, 0.5));
color = vec4(colorRGB, 1.0);
};
5 changes: 4 additions & 1 deletion Project/ControlEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@
#ifndef CONTROLEDITOR_H
#define CONTROLEDITOR_H

#include <GL/glew.h>

#include "ControlEditorBase.h"
#include <wx/wrapsizer.h>
#include <wx/dcclient.h>
#include <wx/dcscreen.h>
#include <wx/graphics.h>

#ifdef _MSC_VER
#include <windows.h>
#endif
#include <GL/gl.h>
//#include <GL/gl.h>
#include <GL/glu.h>

#include <wx/progdlg.h>
Expand Down
2 changes: 2 additions & 0 deletions Project/ControlSystemTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#ifndef CONTROLSYSTEMTEST_H
#define CONTROLSYSTEMTEST_H

#include <GL/glew.h>

#include "ControlEditorBase.h"

class ControlEditor;
Expand Down
3 changes: 2 additions & 1 deletion Project/Element.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
#include <wx/menu.h>
#include <wx/stdpaths.h>
#include <wx/filename.h>
#include <GL/glew.h>
#ifdef _MSC_VER
#include <windows.h>
#endif
#include <GL/gl.h>
//#include <GL/gl.h>
#include <wx/graphics.h>

#include <complex>
Expand Down
2 changes: 2 additions & 0 deletions Project/GeneratorStabForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#ifndef GENERATORSTABFORM_H
#define GENERATORSTABFORM_H

#include <GL/glew.h>

#include <wx/glcanvas.h>
#include "ElementFormBase.h"

Expand Down
35 changes: 35 additions & 0 deletions Project/HMLabel.shader
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#shader vertex
#version 330 core

layout(location = 0) in vec4 position;

uniform mat4 u_mvpMatrix;

void main()
{
gl_Position = u_mvpMatrix * position;
};

#shader fragment
#version 330 core

layout(location = 0) out vec4 color;

uniform vec4 u_offset;

vec3 hsl2rgb(in vec3 c)
{
vec3 rgb = clamp(abs(mod(c.x * 6.0 + vec3(0.0, 4.0, 2.0), 6.0) - 3.0) - 1.0, 0.0, 1.0);

return c.z + c.y * (rgb - 0.5) * (1.0 - abs(2.0 * c.z - 1.0));
}

void main()
{
vec3 colorRGB = hsl2rgb(vec3(gl_FragCoord.z * 0.8, 1.0, 0.5));
color = vec4(colorRGB, 1.0);
if(gl_FragCoord.x - u_offset.x <= 2.0) color = vec4(0.0, 0.0, 0.0, 1.0);
if(gl_FragCoord.x - u_offset.x >= 28.0) color = vec4(0.0, 0.0, 0.0, 1.0);
if(gl_FragCoord.y + u_offset.y >= u_offset.w - 2.0) color = vec4(0.0, 0.0, 0.0, 1.0);
if(gl_FragCoord.y + u_offset.y <= u_offset.w - 298.0) color = vec4(0.0, 0.0, 0.0, 1.0);
};
Loading

0 comments on commit ab30228

Please sign in to comment.