atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
workinfo.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2026 by CNRS and University of Strasbourg */
15
21
22/*
23* This file: 'workinfo.c'
24*
25* Contains:
26*
27
28 - Functions to display project information in GtkTextBuffer
29
30*
31* List of functions:
32
33 void workinfo (project * this_proj, int i);
34
35*/
36
37#include "global.h"
38#include "interface.h"
39#include "project.h"
40
41extern void update_rdf_view (project * this_proj, int rdf);
42extern void update_sq_view (project * this_proj, int sqk);
43extern void update_angle_view (project * this_proj);
44extern void update_rings_view (project * this_proj, int c);
45extern void update_chains_view (project * this_proj);
46extern void update_spherical_view (project * this_proj);
47extern void update_msd_view (project * this_proj);
48extern void update_skt_view (project * this_proj);
49extern void model_info (project * this_proj, GtkTextBuffer * buf);
50extern void opengl_info (project * this_proj, GtkTextBuffer * buf);
51
60void workinfo (project * this_proj, int i)
61{
62 gchar * str;
63 int j;
65 switch (i)
66 {
67 case -4:
68 this_proj -> text_buffer[0] = add_buffer (NULL, NULL, NULL);
69 print_info (_("\n\nWorkspace information\n\n\n"), "heading", this_proj -> text_buffer[0]);
70 if (g_strcmp0(workspacefile, "(null)") == 0) workspacefile = NULL;
71 if (workspacefile != NULL)
72 {
73 print_info (_("\tWorkspace file: "), "italic", this_proj -> text_buffer[0]);
74 print_info (workspacefile, NULL, this_proj -> text_buffer[0]);
75 }
76 str = g_strdup_printf ("\n\n\t%d", nprojects);
77 print_info (str, "bold_red", this_proj -> text_buffer[0]);
78 g_free (str);
79 print_info (_(" project(s) in workspace: "), NULL, this_proj -> text_buffer[0]);
80 tmp_proj = workzone.first;
81 for (j=0; j<nprojects; j++)
82 {
83 print_info ("\n\n\t\t- ", NULL, this_proj -> text_buffer[0]);
84 print_info (prepare_for_title(tmp_proj -> name), "italic", this_proj -> text_buffer[0]);
85 if (tmp_proj -> next != NULL) tmp_proj = tmp_proj -> next;
86 }
87 print_info (_("\n\n\tActive project: "), NULL, this_proj -> text_buffer[0]);
88 print_info (prepare_for_title(active_project -> name), "bold_green", this_proj -> text_buffer[0]);
89 break;
90 case -3:
91 this_proj -> text_buffer[1] = add_buffer (NULL, NULL, NULL);
92 model_info (this_proj, this_proj -> text_buffer[1]);
93 break;
94 case -2:
95 this_proj -> text_buffer[2] = add_buffer (NULL, NULL, NULL);
96 opengl_info (this_proj, this_proj -> text_buffer[2]);
97 break;
98 default:
99 if (i > -1)
100 {
101 if (this_proj -> analysis[i] -> calc_buffer == NULL && this_proj -> analysis[i] -> calc_ok)
102 {
103 switch (i)
104 {
105 case GDR:
106 update_rdf_view (this_proj, GDR);
107 break;
108 case SQD:
109 update_sq_view (this_proj, SQD);
110 break;
111 case SKD:
112 update_sq_view (this_proj, SKD);
113 break;
114 case GDK:
115 update_rdf_view (this_proj, GDK);
116 break;
117 case ANG:
118 update_angle_view (this_proj);
119 break;
120 case RIN:
121 for (j=0; j<5; j++) if (this_proj -> rsparam[j][5]) update_rings_view (this_proj, j);
122 break;
123 case CHA:
124 update_chains_view (this_proj);
125 break;
126 case SPH:
127 update_spherical_view (this_proj);
128 break;
129 case MSD:
130 update_msd_view (this_proj);
131 break;
132 case SKT:
133 update_skt_view (this_proj);
134 break;
135 }
136 }
137 }
138 break;
139 }
140 if (i < 0)
141 {
142 j = i + 4;
143 if (this_proj -> text_buffer[j] == NULL) this_proj -> text_buffer[j] = add_buffer (NULL, NULL, NULL);
144 view_buffer (this_proj -> text_buffer[j]);
145 }
146 else
147 {
148 if (this_proj -> analysis[i] -> calc_buffer == NULL) this_proj -> analysis[i] -> calc_buffer = add_buffer (NULL, NULL, NULL);
149 view_buffer (this_proj -> analysis[i] -> calc_buffer);
150 }
151}
project * tmp_proj
Definition dlp_field.c:1043
gchar * workspacefile
Definition global.c:159
int nprojects
Definition global.c:161
Global variable declarations Global convenience function declarations Global data structure defin...
#define SKT
Definition global.h:347
workspace workzone
Definition project.c:46
#define SQD
Definition global.h:338
GtkTextBuffer * add_buffer(GCallback handler, gpointer data, gchar *text)
create a GtkTextBuffer
Definition gtk-misc.c:1258
#define RIN
Definition global.h:343
#define SPH
Definition global.h:345
#define ANG
Definition global.h:342
#define CHA
Definition global.h:344
#define SKD
Definition global.h:339
gchar * prepare_for_title(gchar *init)
prepare a string for a window title, getting rid of all markup
Definition tools.c:71
#define GDK
Definition global.h:340
project * active_project
Definition project.c:47
#define MSD
Definition global.h:346
#define GDR
Definition global.h:337
void view_buffer(GtkTextBuffer *buffer)
set a text buffer in the main window or an image
Definition gui.c:311
void print_info(gchar *str, gchar *stag, GtkTextBuffer *buffer)
print information in GtkTextBuffer
Definition interface.c:869
Messaging function declarations.
Function declarations for reading atomes project file Function declarations for saving atomes proje...
void update_chains_view(project *this_proj)
update the chains statistics text view after the calculation
Definition chainscall.c:111
void update_rdf_view(project *this_proj, int rdf)
update the project text view for the g(r)/g(k) calculation
Definition grcall.c:128
void update_sq_view(project *this_proj, int sqk)
update the text view for s(q) / s(k) calculation
Definition sqcall.c:124
void update_rings_view(project *this_proj, int c)
update the text view for ring statistics
Definition ringscall.c:150
void opengl_info(project *this_proj, GtkTextBuffer *buf)
display OpenGL information in a GtkTextBuffer
Definition modelinfo.c:352
void model_info(project *this_proj, GtkTextBuffer *buf)
display model information in GtkTexBuffer
Definition modelinfo.c:110
void update_skt_view(project *this_proj)
update the text view for s(k,t) and s(q,w) calculation
Definition sktcall.c:248
void workinfo(project *this_proj, int i)
display information about a workspace menu item for a project
Definition workinfo.c:60
void update_angle_view(project *this_proj)
update angle calculation information text buffer
Definition bdcall.c:989
void update_msd_view(project *this_proj)
update the project text view for the MSD calculation
Definition msdcall.c:149
void update_spherical_view(project *this_proj)
update the text view for spherical harmonics
Definition spcall.c:107