bug fix on test.html
This commit is contained in:
parent
e3b06b39c8
commit
014a13340c
|
@ -42,6 +42,7 @@
|
||||||
float: none;
|
float: none;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
margin-left: var(--navWidth);
|
margin-left: var(--navWidth);
|
||||||
|
height: 1000px;
|
||||||
height : 100vh;
|
height : 100vh;
|
||||||
/* background: #1363A7; */
|
/* background: #1363A7; */
|
||||||
background: #6DB33E;
|
background: #6DB33E;
|
||||||
|
@ -49,7 +50,7 @@
|
||||||
a {
|
a {
|
||||||
color : #F7CF3C;
|
color : #F7CF3C;
|
||||||
}
|
}
|
||||||
|
|
||||||
.column1{
|
.column1{
|
||||||
float : left;
|
float : left;
|
||||||
width : 50%;
|
width : 50%;
|
||||||
|
@ -123,10 +124,10 @@
|
||||||
<td style="text-align:right"><a href="instruction.html" target="uploaded">Intructions & Credits</a></td>
|
<td style="text-align:right"><a href="instruction.html" target="uploaded">Intructions & Credits</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align:right"><a href="WoodsSaxon.html" target="uploaded">Woods-Saxon (const.)</a></td>
|
<td style="text-align:right"><a href="test.html" target="_blank">Woods-Saxon (const.)</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align:right"><a href="nuclearChart.html" target="uploaded">Nuclides Chart (const.)</a></td>
|
<td style="text-align:right"><a href="nuclearChart.html" target="_blank">Nuclides Chart (const.)</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -156,7 +157,7 @@
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<!-- ////////////////////////////////////////// -->
|
<!-- ////////////////////////////////////////// -->
|
||||||
<article id="article">
|
<article id="article" >
|
||||||
<iframe id="main" name="uploaded" style="border:none;width:100%;" src="heliosmatics.html"></iframe>
|
<iframe id="main" name="uploaded" style="border:none;width:100%;" src="heliosmatics.html"></iframe>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
|
|
56
test.cpp
56
test.cpp
|
@ -20,9 +20,6 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
//======= Woods-Saxon Library
|
|
||||||
#include "RK4.h"
|
|
||||||
#include "WS.h"
|
#include "WS.h"
|
||||||
|
|
||||||
const int nPt = 300;
|
const int nPt = 300;
|
||||||
|
@ -45,7 +42,6 @@ GLFWwindow* g_window;
|
||||||
ImVec4 clear_color = ImVec4(0.427, 0.702f, 0.243f, 1.00f);
|
ImVec4 clear_color = ImVec4(0.427, 0.702f, 0.243f, 1.00f);
|
||||||
int g_width;
|
int g_width;
|
||||||
int g_height;
|
int g_height;
|
||||||
|
|
||||||
// Function used by c++ to get the size of the html canvas
|
// Function used by c++ to get the size of the html canvas
|
||||||
EM_JS(int, canvas_get_width, (), {
|
EM_JS(int, canvas_get_width, (), {
|
||||||
return Module.canvas.width;
|
return Module.canvas.width;
|
||||||
|
@ -99,6 +95,7 @@ void loop(){
|
||||||
// Woods-Saxon window
|
// Woods-Saxon window
|
||||||
{
|
{
|
||||||
ImGui::SetNextWindowSize(ImVec2(600, 1000), ImGuiCond_FirstUseEver);
|
ImGui::SetNextWindowSize(ImVec2(600, 1000), ImGuiCond_FirstUseEver);
|
||||||
|
ImGui::SetNextWindowPos(ImVec2(50, 50), ImGuiCond_FirstUseEver);
|
||||||
static float V0 = -45, r0 = 1.25, R0 = 3.5, a0 = 0.6;
|
static float V0 = -45, r0 = 1.25, R0 = 3.5, a0 = 0.6;
|
||||||
static float VSO = 28, rSO = 1.25, RSO = 3.5, aSO = 0.6;
|
static float VSO = 28, rSO = 1.25, RSO = 3.5, aSO = 0.6;
|
||||||
static int Z = 0, nStep = 300;
|
static int Z = 0, nStep = 300;
|
||||||
|
@ -109,8 +106,27 @@ void loop(){
|
||||||
ImGui::Begin("Woods-Saxon Calculation");
|
ImGui::Begin("Woods-Saxon Calculation");
|
||||||
|
|
||||||
static int e = 0;
|
static int e = 0;
|
||||||
ImGui::RadioButton("Arbitary", &e, 0); ImGui::SameLine();
|
if( ImGui::RadioButton("Arbitary", &e, 0) ){
|
||||||
ImGui::RadioButton("Isotope", &e, 1);
|
A = 1;
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
if( ImGui::RadioButton("Isotope", &e, 1) ){
|
||||||
|
rc = 1.25;
|
||||||
|
r0 = 1.25;
|
||||||
|
rSO = 1.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( e == 0){
|
||||||
|
rc = Rc / pow(A, 1./3);
|
||||||
|
r0 = R0 / pow(A, 1./3);
|
||||||
|
rSO = RSO / pow(A, 1./3);
|
||||||
|
}
|
||||||
|
|
||||||
|
if( e == 1){
|
||||||
|
Rc = rc * pow(A, 1./3);
|
||||||
|
R0 = r0 * pow(A, 1./3);
|
||||||
|
RSO = rSO * pow(A, 1./3);
|
||||||
|
}
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
ImGui::PushItemWidth(100);
|
ImGui::PushItemWidth(100);
|
||||||
|
@ -128,14 +144,6 @@ void loop(){
|
||||||
ImGui::DragFloat("rc [fm] ", &rc, 0.01, 1, 10);
|
ImGui::DragFloat("rc [fm] ", &rc, 0.01, 1, 10);
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
if( e == 0 ) {A = 1; rc = Rc / pow(A, 1./3);}
|
|
||||||
if( e == 1 ) {
|
|
||||||
rc = 1.25;
|
|
||||||
r0 = 1.25;
|
|
||||||
rSO = 1.25;
|
|
||||||
Rc = rc * pow(A, 1./3);
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::Text("Eff. mass : %.3f ", mass);
|
ImGui::Text("Eff. mass : %.3f ", mass);
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
@ -145,16 +153,12 @@ void loop(){
|
||||||
ImGui::BeginDisabled(e==1); ImGui::DragFloat("R0 [fm] ", &R0, 0.01, 1, 10); ImGui::EndDisabled();
|
ImGui::BeginDisabled(e==1); ImGui::DragFloat("R0 [fm] ", &R0, 0.01, 1, 10); ImGui::EndDisabled();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::BeginDisabled(e==0); ImGui::DragFloat("r0 [fm] ", &r0, 0.01, 1, 10); ImGui::EndDisabled();
|
ImGui::BeginDisabled(e==0); ImGui::DragFloat("r0 [fm] ", &r0, 0.01, 1, 10); ImGui::EndDisabled();
|
||||||
if( e == 0 ) {A = 1; r0 = R0 / pow(A, 1./3);}
|
|
||||||
if( e == 1 ) R0 = r0 * pow(A, 1./3);
|
|
||||||
|
|
||||||
ImGui::DragFloat("a0 [fm]", &a0, 0.01, 0.1, 2);
|
ImGui::DragFloat("a0 [fm]", &a0, 0.01, 0.1, 2);
|
||||||
ImGui::DragFloat("VSO [MeV]", &VSO, 0.1, 0, 40);
|
ImGui::DragFloat("VSO [MeV]", &VSO, 0.1, 0, 40);
|
||||||
ImGui::BeginDisabled(e==1); ImGui::DragFloat("RSO [fm] ", &RSO, 0.01, 1, 10); ImGui::EndDisabled();
|
ImGui::BeginDisabled(e==1); ImGui::DragFloat("RSO [fm] ", &RSO, 0.01, 1, 10); ImGui::EndDisabled();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::BeginDisabled(e==0); ImGui::DragFloat("rSO [fm] ", &rSO, 0.01, 1, 10); ImGui::EndDisabled();
|
ImGui::BeginDisabled(e==0); ImGui::DragFloat("rSO [fm] ", &rSO, 0.01, 1, 10); ImGui::EndDisabled();
|
||||||
if( e == 0 ) {A = 1; rSO = RSO / pow(A, 1./3);}
|
|
||||||
if( e == 1 ) RSO = rSO * pow(A, 1./3);
|
|
||||||
ImGui::DragFloat("aSO [fm]", &aSO, 0.01, 0.1, 2);
|
ImGui::DragFloat("aSO [fm]", &aSO, 0.01, 0.1, 2);
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
@ -258,7 +262,7 @@ void loop(){
|
||||||
//*============= WS Trend
|
//*============= WS Trend
|
||||||
{
|
{
|
||||||
ImGui::SetNextWindowSize(ImVec2(600, 800), ImGuiCond_FirstUseEver);
|
ImGui::SetNextWindowSize(ImVec2(600, 800), ImGuiCond_FirstUseEver);
|
||||||
ImGui::SetNextWindowPos(ImVec2(100, 200), ImGuiCond_FirstUseEver);
|
ImGui::SetNextWindowPos(ImVec2(680, 50), ImGuiCond_FirstUseEver);
|
||||||
static float V0 = -45, r0 = 1.25, a0 = 0.6;
|
static float V0 = -45, r0 = 1.25, a0 = 0.6;
|
||||||
static float VSO = 28, rSO = 1.25, aSO = 0.6;
|
static float VSO = 28, rSO = 1.25, aSO = 0.6;
|
||||||
static int Z = 0, N = 1, nStep = 300;
|
static int Z = 0, N = 1, nStep = 300;
|
||||||
|
@ -479,8 +483,20 @@ void loop(){
|
||||||
|
|
||||||
ImPlot::EndPlot();
|
ImPlot::EndPlot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool saveDataClicked = false;
|
||||||
|
if( ImGui::Button("Download data") ){
|
||||||
|
// FILE * file_out;
|
||||||
|
// file_out = fopen("", "w+");
|
||||||
|
saveDataClicked = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( saveDataClicked ) {
|
||||||
|
ImGui::Text("to be impletmented....");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -509,7 +525,7 @@ int init_gl(){
|
||||||
// Open a window and create its OpenGL context
|
// Open a window and create its OpenGL context
|
||||||
int canvasWidth = g_width;
|
int canvasWidth = g_width;
|
||||||
int canvasHeight = g_height;
|
int canvasHeight = g_height;
|
||||||
g_window = glfwCreateWindow(canvasWidth, canvasHeight, "WebGui Demo", NULL, NULL);
|
g_window = glfwCreateWindow(canvasWidth, canvasHeight, "Woods-Saxon Calculation Demo", NULL, NULL);
|
||||||
if( g_window == NULL ){
|
if( g_window == NULL ){
|
||||||
fprintf( stderr, "Failed to open GLFW window.\n" );
|
fprintf( stderr, "Failed to open GLFW window.\n" );
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user