summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/oxygen/psewidget.cpp168
1 files changed, 84 insertions, 84 deletions
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp
index 4f990b0..be5185b 100644
--- a/noncore/apps/oxygen/psewidget.cpp
+++ b/noncore/apps/oxygen/psewidget.cpp
@@ -1,11 +1,11 @@
1/*************************************************************************** 1/***************************************************************************
2 application: : Oxygen 2 application: : Oxygen
3 3
4 begin : September 2002 4 begin : September 2002
5 copyright : ( C ) 2002 by Carsten Niehaus 5 copyright : ( C ) 2002, 2003 by Carsten Niehaus
6 email : cniehaus@handhelds.org 6 email : cniehaus@handhelds.org
7 **************************************************************************/ 7 **************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
@@ -91,108 +91,108 @@ void PSEWidget::slotShowElement(QString number)
91{ 91{
92 oxyDW->setElement( number.toInt() ); 92 oxyDW->setElement( number.toInt() );
93}; 93};
94 94
95void PSEWidget::position(int n, int& h, int& v) 95void PSEWidget::position(int n, int& h, int& v)
96{ 96{
97 //Hydrogen 97 //Hydrogen
98 if (n == 1) 98 if (n == 1)
99 { 99 {
100 h=0; v=0; 100 h=0; v=0;
101 } 101 }
102
103
104 //Helium
105 if (n == 2)
106 {
107 h=680; v=0;
108 }
109
110
111 //Lithium
112 if (n == 3)
113 {
114 h=0; v=40;
115 }
116 102
117 103
118 //Beryllium 104 //Helium
119 if (n == 4) 105 if (n == 2)
120 { 106 {
121 h=40; v=40; 107 h=680; v=0;
122 } 108 }
123 109
124 110
125 //Boron-->Neon or Aluminum --> Argon 111 //Lithium
126 if ((n >= 5 && n <= 10) || (n >= 13 && n <= 18)) 112 if (n == 3)
127 for (int i = 1; i <= (6-(10-n)); i++)
128 { 113 {
129 h=((i*40)+440); 114 h=0; v=40;
130 v = 40;
131 if (n >= 13)
132 {
133 v=80;
134 h=(h-320);
135 }
136 } 115 }
137 116
138 117
139 //Sodium 118 //Beryllium
140 if (n == 11) 119 if (n == 4)
141 { 120 {
142 h=0; v=80; 121 h=40; v=40;
143 } 122 }
144 123
145 124
146 //Magnesium 125 //Boron-->Neon or Aluminum --> Argon
147 if (n == 12) 126 if ((n >= 5 && n <= 10) || (n >= 13 && n <= 18))
148 { 127 for (int i = 1; i <= (6-(10-n)); i++)
149 h=40; v=80; 128 {
150 } 129 h=((i*40)+440);
130 v = 40;
131 if (n >= 13)
132 {
133 v=80;
134 h=(h-320);
135 }
136 }
151 137
152 138
153 //Potassium --> Uuo without La and Ac 139 //Sodium
154 if ((n >= 19 && n <= 56) || (n >= 72 && n <= 88) || n >= 104) 140 if (n == 11)
155 for (int i = 1; i <= 18; i++)
156 { 141 {
157 int f = n; 142 h=0; v=80;
158 if (n > 18)
159 f = n-18;
160 if (n > 36)
161 f = n-36;
162 if (n > 54)
163 f = n-54;
164 if (n > 71)
165 f = n-68;
166 if (n > 86)
167 f = n-86;
168 if (n > 103)
169 f = n-100;
170
171 h=((f*40)-40);
172
173 v = 120;
174 if (n >= 37)
175 v=160;
176 if (n >= 55)
177 v=200;
178 if (n >= 87)
179 v=240;
180 } 143 }
181 144
182 145
183 //Lanthanum --> Lutetium and Actinum --> Lawrencium 146 //Magnesium
184 if ((n >= 57 && n <= 71) || (n >= 89 && n <= 103)) 147 if (n == 12)
185 for (int i = 1; i <= 14; i++)
186 { 148 {
187 int f = n; 149 h=40; v=80;
188 if (n > 56)
189 f = n-55;
190 if (n > 88)
191 f = n-87;
192 h=(f*40);
193 v = 290;
194 if (n >= 89)
195 v=330;
196 } 150 }
197 v += 10; 151
152
153 //Potassium --> Uuo without La and Ac
154 if ((n >= 19 && n <= 57) || (n >= 72 && n <= 89) || n >= 104)
155 for (int i = 1; i <= 18; i++)
156 {
157 int f = n;
158 if (n > 18)
159 f = n-18;
160 if (n > 36)
161 f = n-36;
162 if (n > 54)
163 f = n-54;
164 if (n > 71)
165 f = n-68;
166 if (n > 86)
167 f = n-86;
168 if (n > 103)
169 f = n-100;
170
171 h=((f*40)-40);
172
173 v = 120;
174 if (n >= 37)
175 v=160;
176 if (n >= 55)
177 v=200;
178 if (n >= 87)
179 v=240;
180 }
181
182
183 //Lanthanum --> Lutetium and Actinum --> Lawrencium
184 if ((n >= 58 && n <= 71) || (n >= 90 && n <= 103))
185 for (int i = 1; i <= 14; i++)
186 {
187 int f = n;
188 if (n > 57)
189 f = n-55;
190 if (n > 88)
191 f = n-87;
192 h=(f*40);
193 v = 290;
194 if (n >= 90)
195 v=330;
196 }
197 v += 10;
198} 198}