Skip to content

Commit 356869e

Browse files
fixed logging error
1 parent ef11b86 commit 356869e

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

docs/rot2prog/rot2prog.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ <h1 class="title">Module <code>rot2prog.rot2prog</code></h1>
168168

169169
if el &gt; self.max_el:
170170
el = self.max_el
171-
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
171+
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))
172172
if el &lt; self.min_el:
173173
el = self.min_el
174-
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
174+
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))
175175

176176
self._log.debug(&#39;Set command to be sent&#39;)
177177
self._log.debug(&#39;-&gt; Azimuth: &#39; + str(round(float(az), 2)))
@@ -182,8 +182,8 @@ <h1 class="title">Module <code>rot2prog.rot2prog</code></h1>
182182
V = int(self._resolution * (float(el) + 360))
183183

184184
# convert to ascii characters
185-
H = &#34;000&#34; + str(H)
186-
V = &#34;000&#34; + str(V)
185+
H = &#34;0000&#34; + str(H)
186+
V = &#34;0000&#34; + str(V)
187187

188188
# build command
189189
cmd = [
@@ -255,8 +255,8 @@ <h1 class="title">Module <code>rot2prog.rot2prog</code></h1>
255255
self._log.info(&#39;Status command received&#39;)
256256

257257
# convert to byte values
258-
H = &#34;000&#34; + str(round(float(self.az + 360), 1))
259-
V = &#34;000&#34; + str(round(float(self.el + 360), 1))
258+
H = &#34;00000&#34; + str(round(float(self.az + 360), 1))
259+
V = &#34;00000&#34; + str(round(float(self.el + 360), 1))
260260

261261
rsp = [
262262
0x57,
@@ -469,10 +469,10 @@ <h2 id="args">Args</h2>
469469

470470
if el &gt; self.max_el:
471471
el = self.max_el
472-
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
472+
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))
473473
if el &lt; self.min_el:
474474
el = self.min_el
475-
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
475+
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))
476476

477477
self._log.debug(&#39;Set command to be sent&#39;)
478478
self._log.debug(&#39;-&gt; Azimuth: &#39; + str(round(float(az), 2)))
@@ -483,8 +483,8 @@ <h2 id="args">Args</h2>
483483
V = int(self._resolution * (float(el) + 360))
484484

485485
# convert to ascii characters
486-
H = &#34;000&#34; + str(H)
487-
V = &#34;000&#34; + str(V)
486+
H = &#34;0000&#34; + str(H)
487+
V = &#34;0000&#34; + str(V)
488488

489489
# build command
490490
cmd = [
@@ -554,10 +554,10 @@ <h2 id="args">Args</h2>
554554

555555
if el &gt; self.max_el:
556556
el = self.max_el
557-
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
557+
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))
558558
if el &lt; self.min_el:
559559
el = self.min_el
560-
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(az), 2)))
560+
self._log.warning(&#39;Elevation corrected to: &#39; + str(round(float(el), 2)))
561561

562562
self._log.debug(&#39;Set command to be sent&#39;)
563563
self._log.debug(&#39;-&gt; Azimuth: &#39; + str(round(float(az), 2)))
@@ -568,8 +568,8 @@ <h2 id="args">Args</h2>
568568
V = int(self._resolution * (float(el) + 360))
569569

570570
# convert to ascii characters
571-
H = &#34;000&#34; + str(H)
572-
V = &#34;000&#34; + str(V)
571+
H = &#34;0000&#34; + str(H)
572+
V = &#34;0000&#34; + str(V)
573573

574574
# build command
575575
cmd = [
@@ -723,8 +723,8 @@ <h2 id="args">Args</h2>
723723
self._log.info(&#39;Status command received&#39;)
724724

725725
# convert to byte values
726-
H = &#34;000&#34; + str(round(float(self.az + 360), 1))
727-
V = &#34;000&#34; + str(round(float(self.el + 360), 1))
726+
H = &#34;00000&#34; + str(round(float(self.az + 360), 1))
727+
V = &#34;00000&#34; + str(round(float(self.el + 360), 1))
728728

729729
rsp = [
730730
0x57,
@@ -802,8 +802,8 @@ <h3>Methods</h3>
802802
self._log.info(&#39;Status command received&#39;)
803803

804804
# convert to byte values
805-
H = &#34;000&#34; + str(round(float(self.az + 360), 1))
806-
V = &#34;000&#34; + str(round(float(self.el + 360), 1))
805+
H = &#34;00000&#34; + str(round(float(self.az + 360), 1))
806+
V = &#34;00000&#34; + str(round(float(self.el + 360), 1))
807807

808808
rsp = [
809809
0x57,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
setuptools.setup(
2525
name = "rot2prog",
26-
version = "0.0.3",
26+
version = "0.0.4",
2727
author = "TJ Scherer",
2828
author_email = "[email protected]",
2929
description = "A python interface to the Alfa ROT2Prog Controller.",

src/rot2prog/rot2prog.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ def set(self, az, el):
139139

140140
if el > self.max_el:
141141
el = self.max_el
142-
self._log.warning('Elevation corrected to: ' + str(round(float(az), 2)))
142+
self._log.warning('Elevation corrected to: ' + str(round(float(el), 2)))
143143
if el < self.min_el:
144144
el = self.min_el
145-
self._log.warning('Elevation corrected to: ' + str(round(float(az), 2)))
145+
self._log.warning('Elevation corrected to: ' + str(round(float(el), 2)))
146146

147147
self._log.debug('Set command to be sent')
148148
self._log.debug('-> Azimuth: ' + str(round(float(az), 2)))
@@ -153,8 +153,8 @@ def set(self, az, el):
153153
V = int(self._resolution * (float(el) + 360))
154154

155155
# convert to ascii characters
156-
H = "000" + str(H)
157-
V = "000" + str(V)
156+
H = "0000" + str(H)
157+
V = "0000" + str(V)
158158

159159
# build command
160160
cmd = [
@@ -226,8 +226,8 @@ def run(self):
226226
self._log.info('Status command received')
227227

228228
# convert to byte values
229-
H = "000" + str(round(float(self.az + 360), 1))
230-
V = "000" + str(round(float(self.el + 360), 1))
229+
H = "00000" + str(round(float(self.az + 360), 1))
230+
V = "00000" + str(round(float(self.el + 360), 1))
231231

232232
rsp = [
233233
0x57,

0 commit comments

Comments
 (0)