| 223 | } |
| 224 | |
| 225 | void KicadLibParser::writeDraw(Draw *draw) |
| 226 | { |
| 227 | DrawRect *drawRect; |
| 228 | DrawText *drawText; |
| 229 | |
| 230 | switch (draw->type()) |
| 231 | { |
| 232 | case Draw::TypeDrawArc: |
| 233 | break; |
| 234 | case Draw::TypeDrawCircle: |
| 235 | break; |
| 236 | case Draw::TypeDrawPoly: |
| 237 | break; |
| 238 | case Draw::TypeDrawRect: |
| 239 | // S startx starty endx endy unit convert thickness fill |
| 240 | drawRect = static_cast<DrawRect*>(draw); |
| 241 | _stream << "S " |
| 242 | << drawRect->pos().x() << " " |
| 243 | << -drawRect->pos().y() << " " |
| 244 | << drawRect->endPos().x() << " " |
| 245 | << -drawRect->endPos().y() << " " |
| 246 | << drawRect->unit() << " " |
| 247 | << drawRect->convert() << " " |
| 248 | << drawRect->thickness() << " "; |
| 249 | switch (drawRect->filled()) |
| 250 | { |
| 251 | case Draw::DrawNotFilled: |
| 252 | _stream << "N"; |
| 253 | break; |
| 254 | case Draw::DrawFilledForeGround: |
| 255 | _stream << "F"; |
| 256 | break; |
| 257 | case Draw::DrawFilledBackGround: |
| 258 | _stream << "f"; |
| 259 | break; |
| 260 | } |
| 261 | break; |
| 262 | |
| 263 | case Draw::TypeDrawText: |
| 264 | // T direction posx posy text_size text_type unit convert text text_italic text_bold text_hjustify text_vjustify |
| 265 | drawText = static_cast<DrawText*>(draw); |
| 266 | _stream << "T "; |
| 267 | if (drawText->direction() == DrawText::DirectionHorizontal) |
| 268 | _stream << "0 "; |
| 269 | else |
| 270 | _stream << "900 "; |
| 271 | |
| 272 | _stream << drawText->pos().x() << " " |
| 273 | << -drawText->pos().y() << " " |
| 274 | << drawText->textSize() << " " |
| 275 | << "0 " |
| 276 | << drawText->unit() << " " |
| 277 | << drawText->convert() << " " |
| 278 | << "\"" << drawText->text()<< "\"" << " "; |
| 279 | |
| 280 | if (drawText->textStyle().testFlag(DrawText::TextItalic)) |
| 281 | _stream << "Italic "; |
| 282 | else |
nothing calls this directly
no test coverage detected