@@ -180,28 +180,41 @@ def angle(theta):
180
180
181
181
s = str (table )
182
182
183
- table = ANSITable (
184
- Column ("" , colalign = ">" ),
185
- Column ("" , colalign = "<" ), border = "thin" , header = False )
186
- if self ._base is not None :
187
- table .row (
188
- "base" , self ._base .printline (
189
- orient = "rpy/xyz" , fmt = "{:.2g}" , file = None ))
190
- if self ._tool is not None :
191
- table .row (
192
- "tool" , self ._tool .printline (
193
- orient = "rpy/xyz" ,
8000
fmt = "{:.2g}" , file = None ))
194
-
195
- for name , q in self ._configdict .items ():
196
- qlist = []
197
- for i , L in enumerate (self ):
198
- if L .isprismatic ():
199
- qlist .append (f"{ q [i ]:.3g} " )
200
- else :
201
- qlist .append (f"{ q [i ] * deg :.3g} \u00b0 " )
202
- table .row (name , ', ' .join (qlist ))
183
+ # show tool and base
184
+ if self ._tool is not None or self ._tool is not None :
185
+ table = ANSITable (
186
+ Column ("" , colalign = ">" ),
187
+ Column ("" , colalign = "<" ),
188
+ border = "thin" , header = False )
189
+ if self ._base is not None :
190
+ table .row (
191
+ "base" , self ._base .printline (
192
+ orient = "rpy/xyz" , fmt = "{:.2g}" , file = None ))
193
+ if self ._tool is not None :
194
+ table .row (
195
+ "tool" , self ._tool .printline (
196
+ orient = "rpy/xyz" , fmt = "{:.2g}" , file = None ))
197
+ s += "\n " + str (table )
203
198
204
- return s + "\n " + str (table )
199
+ # show named configurations
200
+ if len (self ._configdict ) > 0 :
201
+ table = ANSITable (
202
+ Column ("name" , colalign = ">" ),
203
+ * [Column (f"q{ j :d} " , colalign = "<" , headalign = "<" ) for j in range (self .n )],
204
+ border = "thin" )
205
+
206
+ for name , q in self ._configdict .items ():
207
+ qlist = []
208
+ for i , L in enumerate (self ):
209
+ if L .isprismatic ():
210
+ qlist .append (f"{ q [i ]:.3g} " )
211
+ else :
212
+ qlist .append (angle (q [i ]))
213
+ table .row (name , * qlist )
214
+
215
+ s += "\n " + str (table )
216
+
217
+ return s
205
218
206
219
207
220
def __add__ (self , L ):
0 commit comments