-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassemble.py
1182 lines (1001 loc) · 73 KB
/
assemble.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import os
import copy
import enum
import dict_locale as lcl
from typedef_components import Components_typeDef #класс базы данных компонентов
script_dirName = os.path.dirname(__file__) #адрес папки со скриптом
script_baseName = os.path.splitext(os.path.basename(__file__))[0] #базовое имя модуля
#Значения строки таблицы перечня
class eskdValue():
def __init__(self, designator = '', label = '', quantity = 0, annotation = ''):
self.designator = designator
self.label = label
self.quantity = quantity
self.annotation = annotation
#Метрические множители
class MetricMultiplier(float, enum.Enum):
YOCTO = 1e-24
ZEPTO = 1e-21
ATTO = 1e-18
FEMTO = 1e-15
PICO = 1e-12
NANO = 1e-9
MICRO = 1e-6
MILLI = 1e-3
CENTI = 1e-2
DECI = 1e-1
NONE = 1e0
DECA = 1e1
HECTO = 1e2
KILO = 1e3
MEGA = 1e6
GIGA = 1e9
TERA = 1e12
PETA = 1e15
EXA = 1e18
ZETTA = 1e21
YOTTA = 1e24
# ----------------------------------------------------------- Generic functions -------------------------------------------------
#Stips word from string
def string_strip_word(string, words, direction = 0, count = 0):
if len(words) == 0: return string
if isinstance(words, (str)): words = [words]
if isinstance(words, (list, tuple)):
#determine which end to strip from
strip_start = False
strip_end = False
if direction == 0:
strip_start = True
strip_end = True
elif direction == 1:
strip_start = True
elif direction == 2:
strip_end = True
if strip_start:
for word in words:
counter = 0
while (counter < count) or (count == 0):
if string.startswith(word):
string = string[len(word):]
counter += 1
else:
break
if strip_end:
for word in words:
counter = 0
while (counter < count) or (count == 0):
if string.endswith(word):
string = string[0:-len(word)]
counter += 1
else:
break
return string
#Convert float number to string
def _floatToString(value, decimalPoint = '.'):
result = '{0:.10f}'.format(value)
result = result.rstrip('0').rstrip('.')
result = result.replace('.', decimalPoint)
return result
#========================================================== END Generic functions =================================================
#сборка ЕСКД из параметров компонента
def assemble_eskd(component, **kwargs):
#locale
locale_index = kwargs.get('locale_index', lcl.LocaleIndex.RU.value)
#параметры содержимого полей
content_value = kwargs.get('content_value', True)
content_value_explicit = kwargs.get('content_value_explicit', False)
content_manufacturer = kwargs.get('content_mfr', True)
content_parameters = kwargs.get('content_param', True)
content_substitutes = kwargs.get('content_subst', True)
#параметры формата
format_value_enclosure = kwargs.get('format_value_enclosure', ['', ''])
format_mfr_enclosure = kwargs.get('format_mfr_enclosure', [' ф.\xa0', ''])
format_param_enclosure = kwargs.get('format_param_enclosure', ['', ''])
format_subst_enclosure = kwargs.get('format_subst_enclosure', ['', ''])
format_annot_enclosure = kwargs.get('format_annot_enclosure', ['', ''])
format_annot_delimiter = kwargs.get('format_annot_delimiter', ';\n')
format_fitted_label = kwargs.get('format_fitted_label', [lcl.assemble_eskd.DO_PLACE.value[locale_index], lcl.assemble_eskd.DO_NOT_PLACE.value[locale_index]])
#инициализируем переменные
result = eskdValue()
#Basic fields
designator = component.GENERIC_designator
if designator is None: designator = ''
result.designator = designator
result.quantity = component.GENERIC_quantity
if component.GENERIC_note is not None: result.annotation = component.GENERIC_note
if component.GENERIC_fitted:
result.annotation += format_annot_delimiter + format_fitted_label[0]
else:
result.quantity = 1 #фикс нулей в перечне когда элемент не устанавливается
result.annotation += format_annot_delimiter + format_fitted_label[1]
result.annotation = string_strip_word(result.annotation, format_annot_delimiter)
if len(result.annotation) > 0: result.annotation = format_annot_enclosure[0] + result.annotation + format_annot_enclosure[1]
#Наименование
#--- номинал
if content_value:
if content_value_explicit or component.GENERIC_explicit or (not content_parameters):
value = assemble_value(component, **kwargs)
if len(value) > 0:
result.label += format_value_enclosure[0] + value + format_value_enclosure[1]
#--- производитель (указываем только если есть номинал)
if content_manufacturer is not False:
manufacturer = assemble_manufacturer(component, **kwargs)
if len(manufacturer) > 0: result.label += format_mfr_enclosure[0] + manufacturer + format_mfr_enclosure[1]
#--- параметрическое описание
if content_parameters:
parameters = assemble_parameters(component, **kwargs) #собираем параметрическое описание
if len(parameters) > 0:
if len(result.label) == 0: result.label += parameters #если до этого было пусто то пишем без ограждения
else: result.label += format_param_enclosure[0] + parameters + format_param_enclosure[1]
#--- допустимые замены
if content_substitutes:
substitutes = assemble_substitutes(component, **kwargs)
if len(substitutes) > 0:
result.label += format_subst_enclosure[0] + substitutes + format_subst_enclosure[1]
return result
#сборка типа компонента
def assemble_kind(component, **kwargs):
#locale
locale_index = kwargs.get('locale_index', lcl.LocaleIndex.RU.value)
#параметры сборки
assemble_kind = kwargs.get('assemble_kind', True)
#параметры формата
format_capitalize = kwargs.get('format_kind_capitalize', False)
result = ''
if assemble_kind:
#Сборка (Устройство)
if isinstance(component, component.types.Assembly):
result = lcl.assemble_kind.ASSEMBLY.value[locale_index]
#Фотоэлемент
elif isinstance(component, component.types.Photocell):
result = lcl.assemble_kind.PHOTO_CELL.value[locale_index]
if component.PHOTO_type == component.Type.DIODE: result = lcl.assemble_kind.PHOTO_DIODE.value[locale_index]
elif component.PHOTO_type == component.Type.TRANSISTOR: result = lcl.assemble_kind.PHOTO_TRANSISTOR.value[locale_index]
elif component.PHOTO_type == component.Type.RESISTOR: result = lcl.assemble_kind.PHOTO_RESISTOR.value[locale_index]
#Конденсатор
elif isinstance(component, component.types.Capacitor):
result = lcl.assemble_kind.CAPACITOR.value[locale_index]
#Микросхема
elif isinstance(component, component.types.IntegratedCircuit):
result = lcl.assemble_kind.INTEGRATED_CIRCUIT.value[locale_index]
#Крепёж
elif type(component) is component.types.Fastener:
result = lcl.assemble_kind.FASTENER.value[locale_index]
#Радиатор
elif type(component) is component.types.Heatsink:
result = lcl.assemble_kind.HEATSINK.value[locale_index]
#Автоматический выключатель (Предохранитель)
elif isinstance(component, component.types.CircuitBreaker):
result = lcl.assemble_kind.CIRCUIT_BREAKER.value[locale_index]
if component.CBRK_type == component.Type.FUSE: result = lcl.assemble_kind.FUSE.value[locale_index]
elif component.CBRK_type == component.Type.FUSE_PTC_RESETTABLE: result = lcl.assemble_kind.FUSE_PTC_RESETTABLE.value[locale_index]
elif component.CBRK_type == component.Type.FUSE_THERMAL: result = lcl.assemble_kind.FUSE_THERMAL.value[locale_index]
#Ограничитель перенапряжения
elif isinstance(component, component.types.SurgeProtector):
result = lcl.assemble_kind.SURGE_PROTECTOR.value[locale_index]
if component.SPD_type == component.Type.DIODE: result = lcl.assemble_kind.TVS_DIODE.value[locale_index]
elif component.SPD_type == component.Type.THYRISTOR: result = lcl.assemble_kind.TVS_THYRISTOR.value[locale_index]
elif component.SPD_type == component.Type.VARISTOR: result = lcl.assemble_kind.VARISTOR.value[locale_index]
elif component.SPD_type == component.Type.GAS_DISCHARGE_TUBE: result = lcl.assemble_kind.GAS_DISCHARGE_TUBE.value[locale_index]
elif component.SPD_type == component.Type.IC: result = lcl.assemble_kind.SURGE_PROTECTOR.value[locale_index]
#Батарея
elif isinstance(component, component.types.Battery):
result = lcl.assemble_kind.BATTERY.value[locale_index]
#Дисплей
elif isinstance(component, component.types.Display):
result = lcl.assemble_kind.DISPLAY.value[locale_index]
#Светодиод
elif isinstance(component, component.types.LED):
result = lcl.assemble_kind.LED.value[locale_index]
#Перемычка
elif isinstance(component, component.types.Jumper):
result = lcl.assemble_kind.JUMPER.value[locale_index]
#Реле
elif isinstance(component, component.types.Relay):
result = lcl.assemble_kind.RELAY.value[locale_index]
#Индуктивность
elif isinstance(component, component.types.Inductor):
result = lcl.assemble_kind.INDUCTOR.value[locale_index]
if component.IND_type == component.Type.CHOKE: result = lcl.assemble_kind.CHOKE.value[locale_index]
#Резистор
elif isinstance(component, component.types.Resistor):
result = lcl.assemble_kind.RESISTOR.value[locale_index]
if component.RES_type == component.Type.VARIABLE: result = lcl.assemble_kind.POTENTIOMETER.value[locale_index]
#Переключатель
elif isinstance(component, component.types.Switch):
result = lcl.assemble_kind.SWITCH.value[locale_index]
#Трансформатор
elif isinstance(component, component.types.Transformer):
result = lcl.assemble_kind.TRANSFORMER.value[locale_index]
#Диод
elif isinstance(component, component.types.Diode):
result = lcl.assemble_kind.DIODE.value[locale_index]
if component.DIODE_type == component.Type.ZENER: result = lcl.assemble_kind.ZENER_DIODE.value[locale_index]
elif component.DIODE_type == component.Type.VARICAP: result = lcl.assemble_kind.VARICAP.value[locale_index]
#Тиристор
elif isinstance(component, component.types.Thyristor):
result = lcl.assemble_kind.THYRISTOR.value[locale_index]
if component.THYR_type == component.Type.TRIAC: result = lcl.assemble_kind.TRIAC.value[locale_index]
elif component.THYR_type == component.Type.DYNISTOR: result = lcl.assemble_kind.DYNISTOR.value[locale_index]
#Транзистор
elif isinstance(component, component.types.Transistor):
result = lcl.assemble_kind.TRANSISTOR.value[locale_index]
#Оптоизолятор
elif isinstance(component, component.types.Optoisolator):
result = lcl.assemble_kind.OPTOISOLATOR.value[locale_index]
if component.OPTOISO_outputType == component.OutputType.TRANSISTOR: result = lcl.assemble_kind.OPTOCOUPLER.value[locale_index]
elif component.OPTOISO_outputType == component.OutputType.DARLINGTON: result = lcl.assemble_kind.OPTOCOUPLER.value[locale_index]
elif component.OPTOISO_outputType == component.OutputType.LINEAR: result = lcl.assemble_kind.OPTOCOUPLER.value[locale_index]
elif component.OPTOISO_outputType == component.OutputType.TRIAC: result = lcl.assemble_kind.PHOTOTRIAC.value[locale_index]
#Соединитель
elif isinstance(component, component.types.Connector):
result = lcl.assemble_kind.CONNECTOR.value[locale_index]
#Фильтр ЭМП
elif isinstance(component, component.types.EMIFilter):
result = lcl.assemble_kind.EMI_FILTER.value[locale_index]
#Осциллятор (Резонатор)
elif isinstance(component, component.types.Oscillator):
result = lcl.assemble_kind.OSCILLATOR.value[locale_index]
if component.OSC_type == component.Type.RESONATOR:
result = lcl.assemble_kind.RESONATOR.value[locale_index]
if component.OSC_structure == component.Structure.QUARTZ:
result = lcl.assemble_kind.CRYSTAL.value[locale_index]
else:
result = component.GENERIC_kind
else:
result = component.GENERIC_kind
if format_capitalize:
if len(result) > 0: result = result[0].upper() + result[1:]
return result
#сборка номинала
def assemble_value(component, **kwargs):
#locale
locale_index = kwargs.get('locale_index', lcl.LocaleIndex.RU.value)
#параметры содержимого
content_value = kwargs.get('content_value_value', True)
result = ''
if component.GENERIC_value is not None:
if content_value: result += component.GENERIC_value
return result
#сборка производителя
def assemble_manufacturer(component, **kwargs):
#locale
locale_index = kwargs.get('locale_index', lcl.LocaleIndex.RU.value)
#параметры содержимого
content_name = kwargs.get('content_mfr_value', True)
result = ''
if component.GENERIC_manufacturer is not None:
if content_name: result += component.GENERIC_manufacturer
return result
#сборка параметрической записи
def assemble_parameters(component, **kwargs):
#локализация
locale_index = kwargs.get('locale_index', lcl.LocaleIndex.RU.value)
#параметры сборки
assemble_param = kwargs.get('assemble_param', True)
#параметры содержимого
content_basic = kwargs.get('content_param_basic', True)
content_misc = kwargs.get('content_param_misc', True)
#параметры формата
format_decimalPoint = kwargs.get('format_param_decimalPoint', '.')
format_rangeSymbol = kwargs.get('format_param_rangeSymbol', '\u2026')
format_param_delimiter = kwargs.get('format_param_delimiter', ', ')
format_unit_enclosure = kwargs.get('format_param_unit_enclosure', ['', ''])
format_multivalue_delimiter = kwargs.get('format_param_multivalue_delimiter', '/')
format_tolerance_enclosure = kwargs.get('format_param_tolerance_enclosure', ['\xa0', ''])
format_tolerance_signDelimiter = kwargs.get('format_param_tolerance_signDelimiter', '')
format_conditions_enclosure = kwargs.get('format_param_conditions_enclosure', ['\xa0(', ')'])
format_conditions_delimiter = kwargs.get('format_param_conditions_delimiter', '; ')
format_temperature_positiveSign = kwargs.get('format_param_temperature_positiveSign', True)
result = ''
if assemble_param:
#базовые параметры
if content_basic:
#Сборка (Устройство)
if type(component) is component.types.Assembly:
pass
#Фотоэлемент
elif type(component) is component.types.Photocell:
pass
#Конденсатор
elif type(component) is component.types.Capacitor:
#тип
if component.CAP_type == component.Type.CERAMIC:
result += lcl.assemble_parameters.CAP_TYPE_CERAMIC.value[locale_index]
elif component.CAP_type == component.Type.TANTALUM:
result += lcl.assemble_parameters.CAP_TYPE_TANTALUM.value[locale_index]
elif component.CAP_type == component.Type.FILM:
result += lcl.assemble_parameters.CAP_TYPE_FILM.value[locale_index]
elif component.CAP_type == component.Type.ALUM_ELECTROLYTIC:
result += lcl.assemble_parameters.CAP_TYPE_ALUM_ELECTROLYTIC.value[locale_index]
elif component.CAP_type == component.Type.ALUM_POLYMER:
result += lcl.assemble_parameters.CAP_TYPE_ALUM_POLYMER.value[locale_index]
elif component.CAP_type == component.Type.SUPERCAPACITOR:
result += lcl.assemble_parameters.CAP_TYPE_SUPERCAPACITOR.value[locale_index]
if len(result) > 0: result += format_param_delimiter
#размер
if component.GENERIC_mount == component.Mounting.Type.SURFACE:
result += lcl.assemble_parameters.MOUNT_SURFACE.value[locale_index]
elif component.GENERIC_mount == component.Mounting.Type.THROUGHHOLE:
if component.GENERIC_THtype == component.Mounting.ThroughHole.AXIAL:
result += lcl.assemble_parameters.MOUNT_AXIAL.value[locale_index]
elif component.GENERIC_THtype == component.Mounting.ThroughHole.RADIAL:
result += lcl.assemble_parameters.MOUNT_RADIAL.value[locale_index]
result += "\xa0"
if component.GENERIC_size is not None: result += component.GENERIC_size
result = result.strip('\xa0')
result += format_param_delimiter
#диэлектрик
if component.CAP_dielectric is not None:
result += component.CAP_dielectric
result += format_param_delimiter
#напряжение
if component.CAP_voltage is not None:
ranges = ((1e0, MetricMultiplier.NONE), (10e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.CAP_voltage, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#ёмкость + допуск
if component.CAP_capacitance is not None:
ranges = ((1e-12, MetricMultiplier.PICO), (10e-9, MetricMultiplier.MICRO), (0.1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.CAP_capacitance, lcl.Units.FARAD, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.CAP_tolerance is not None:
result += format_tolerance_enclosure[0] + _assemble_param_tolerance(component.CAP_tolerance, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index) + format_tolerance_enclosure[1]
result += format_param_delimiter
#низкий импеданс
if component.CAP_lowImpedance:
result += lcl.assemble_parameters.LOW_ESR.value[locale_index]
result += format_param_delimiter
#Микросхема
elif type(component) is component.types.IntegratedCircuit:
pass
#Крепёж
elif type(component) is component.types.Fastener:
pass
#Радиатор
elif type(component) is component.types.Heatsink:
pass
#Автоматический выключатель (Предохранитель)
elif type(component) is component.types.CircuitBreaker:
#тип
if component.CBRK_type == component.Type.FUSE:
result += lcl.assemble_parameters.CBRK_TYPE_FUSE.value[locale_index]
elif component.CBRK_type == component.Type.FUSE_PTC_RESETTABLE:
result += lcl.assemble_parameters.CBRK_TYPE_FUSE_PTCRESETTABLE.value[locale_index]
elif component.CBRK_type == component.Type.FUSE_THERMAL:
result += lcl.assemble_parameters.CBRK_TYPE_FUSE_THERMAL.value[locale_index]
elif component.CBRK_type == component.Type.BREAKER:
result += lcl.assemble_parameters.CBRK_TYPE_BREAKER.value[locale_index]
elif component.CBRK_type == component.Type.HOLDER:
result += lcl.assemble_parameters.CBRK_TYPE_HOLDER.value[locale_index]
if len(result) > 0: result += format_param_delimiter
#тип монтажа + размер
if component.GENERIC_mount == component.Mounting.Type.SURFACE: result += lcl.assemble_parameters.MOUNT_SURFACE.value[locale_index] + '\xa0'
elif component.GENERIC_mount == component.Mounting.Type.THROUGHHOLE: result += lcl.assemble_parameters.MOUNT_THROUGHHOLE.value[locale_index] + '\xa0'
elif component.GENERIC_mount == component.Mounting.Type.HOLDER: result += lcl.assemble_parameters.MOUNT_HOLDER.value[locale_index] + '\xa0'
if component.GENERIC_size is not None: result += component.GENERIC_size
result = result.strip('\xa0')
result += format_param_delimiter
#номинальный ток
if component.CBRK_current_rating is not None:
ranges = ((1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.CBRK_current_rating, lcl.Units.AMPERE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#точка плавления
if component.CBRK_meltingPoint is not None:
ranges = ((1e0, MetricMultiplier.NONE), )
result += _assemble_param_value(component.CBRK_meltingPoint, lcl.Units.AMPERE.value[locale_index] + '²' + lcl.Units.SECOND.value[locale_index], format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#максимальное напряжение
if component.CBRK_voltage is not None:
ranges = ((1e0, MetricMultiplier.NONE), (10e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.CBRK_voltage, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.CBRK_voltage_ac: result += '\xa0' + lcl.assemble_parameters.VOLTAGE_AC.value[locale_index]
result += format_param_delimiter
#сопротивление
if component.CBRK_resistance is not None:
ranges = ((1e-6, MetricMultiplier.MICRO), (1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.CBRK_resistance, lcl.Units.OHM, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#максимальная мощность
if component.CBRK_power is not None:
ranges = ((1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.CBRK_power, lcl.Units.WATT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#классификация скорости срабатывания
if component.CBRK_speed_grade is not None:
if component.CBRK_speed_grade == component.SpeedGrade.FAST: result += lcl.assemble_parameters.CBRK_SPEEDGRADE_FAST.value[locale_index] + format_param_delimiter
elif component.CBRK_speed_grade == component.SpeedGrade.MEDIUM: result += lcl.assemble_parameters.CBRK_SPEEDGRADE_MEDIUM.value[locale_index] + format_param_delimiter
elif component.CBRK_speed_grade == component.SpeedGrade.SLOW: result += lcl.assemble_parameters.CBRK_SPEEDGRADE_SLOW.value[locale_index] + format_param_delimiter
#Ограничитель перенапряжения
elif type(component) is component.types.SurgeProtector:
#тип
if component.SPD_type == component.Type.DIODE: #диод
result += lcl.assemble_parameters.SPD_TYPE_DIODE.value[locale_index]
result += format_param_delimiter
#двунаправленный тип
if component.SPD_bidirectional is not None:
if component.SPD_bidirectional:
result += lcl.assemble_parameters.SPD_BIDIRECTIONAL.value[locale_index]
else:
result += lcl.assemble_parameters.SPD_UNIDIRECTIONAL.value[locale_index]
result += format_param_delimiter
#максимальное рабочее напряжение
if component.SPD_standoff_voltage is not None:
ranges = ((1e0, MetricMultiplier.NONE), (10e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.SPD_standoff_voltage, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#мощность + тип тестового импульса
if component.SPD_power is not None:
ranges = ((1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.SPD_power, lcl.Units.WATT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.SPD_testPulse is not None:
result += format_conditions_enclosure[0]
if component.SPD_testPulse == component.TestPulse.US_8_20:
result += '8/20' + format_unit_enclosure[0] + lcl.MetricPrefix.MICRO.value[locale_index] + lcl.Units.SECOND.value[locale_index] + format_unit_enclosure[1]
elif component.SPD_testPulse == component.TestPulse.US_10_1000:
result += '10/1000' + format_unit_enclosure[0] + lcl.MetricPrefix.MICRO.value[locale_index] + lcl.Units.SECOND.value[locale_index] + format_unit_enclosure[1]
else:
result += '???'
result += format_conditions_enclosure[1]
result += format_param_delimiter
#корпус
if component.GENERIC_package is not None:
result += lcl.assemble_parameters.PACKAGE.value[locale_index] + '\xa0' + component.GENERIC_package
result += format_param_delimiter
elif component.SPD_type == component.Type.VARISTOR: #варистор
result += lcl.assemble_parameters.SPD_TYPE_VARISTOR.value[locale_index]
result += format_param_delimiter
#тип + размер
if component.GENERIC_mount == component.Mounting.Type.SURFACE: result += lcl.assemble_parameters.MOUNT_SURFACE.value[locale_index]
elif component.GENERIC_mount == component.Mounting.Type.THROUGHHOLE: result += lcl.assemble_parameters.MOUNT_THROUGHHOLE.value[locale_index]
result += '\xa0'
if component.GENERIC_size is not None: result += component.GENERIC_size
result = result.strip('\xa0')
result += format_param_delimiter
#максимальное рабочее напряжение
if component.SPD_standoff_voltage is not None:
ranges = ((1e0, MetricMultiplier.NONE), (10e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.SPD_standoff_voltage, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#энергия + тип тестового импульса
if component.SPD_energy is not None:
ranges = ((1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.SPD_energy, lcl.Units.JOULE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.SPD_testPulse is not None:
result += format_conditions_enclosure[0]
if component.SPD_testPulse == component.TestPulse.US_8_20:
result += '8/20' + format_unit_enclosure[0] + lcl.MetricPrefix.MICRO.value[locale_index] + lcl.Units.SECOND.value[locale_index] + format_unit_enclosure[1]
elif component.SPD_testPulse == component.TestPulse.US_10_1000:
result += '10/1000' + format_unit_enclosure[0] + lcl.MetricPrefix.MICRO.value[locale_index] + lcl.Units.SECOND.value[locale_index] + format_unit_enclosure[1]
else:
result += '???'
result += format_conditions_enclosure[1]
result += format_param_delimiter
#Батарея
elif type(component) is component.types.Battery:
#тип
if component.BAT_type == component.Type.HOLDER:
result += lcl.assemble_parameters.BAT_TYPE_HOLDER.value[locale_index]
if len(result) > 0: result += format_param_delimiter
#размер
if component.GENERIC_size is not None:
result += component.GENERIC_size + format_param_delimiter
#номинальное напряжение
if component.BAT_voltage_rated is not None:
ranges = ((1e0, MetricMultiplier.NONE), )
result += _assemble_param_value(component.BAT_voltage_rated, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#ёмкость @ нагрузка + температура
if component.BAT_capacity is not None:
ranges = ((1e-6, MetricMultiplier.MICRO), (1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.BAT_capacity, lcl.Units.AMPERE.value[locale_index] + lcl.Units.HOUR.value[locale_index], format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if (component.BAT_capacity_load_current is not None) or (component.BAT_capacity_load_resistance is not None) or (component.BAT_capacity_voltage is not None) or (component.BAT_capacity_temperature is not None):
result += format_conditions_enclosure[0]
if component.BAT_capacity_load_current is not None:
ranges = ((1e-6, MetricMultiplier.MICRO), (1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.BAT_capacity_load_current, lcl.Units.AMPERE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_conditions_delimiter
if component.BAT_capacity_load_resistance is not None:
ranges = ((1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO), (1e6, MetricMultiplier.MEGA))
result += _assemble_param_value(component.BAT_capacity_load_resistance, lcl.Units.OHM, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_conditions_delimiter
if component.BAT_capacity_voltage is not None:
ranges = ((1e0, MetricMultiplier.NONE), )
result += _assemble_param_value(component.BAT_capacity_voltage, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_conditions_delimiter
if component.BAT_capacity_temperature is not None:
result += _assemble_param_temperature(component.BAT_capacity_temperature, lcl.Units.CELCIUS_DEG, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, format_temperature_positiveSign)
result += format_conditions_delimiter
result = string_strip_word(result, format_conditions_delimiter)
result += format_conditions_enclosure[1]
result += format_param_delimiter
#диапазон рабочих температур
if component.GENERIC_temperature_range is not None:
result += _assemble_param_temperature_range(component.GENERIC_temperature_range, lcl.Units.CELCIUS_DEG, format_decimalPoint, format_unit_enclosure, format_rangeSymbol, locale_index, format_temperature_positiveSign)
result += format_param_delimiter
#Дисплей
elif type(component) is component.types.Display:
pass
#Светодиод
elif type(component) is component.types.LED:
#тип
if component.LED_type == component.Type.INDICATION:
result += lcl.assemble_parameters.LED_TYPE_INDICATOR.value[locale_index]
elif component.LED_type == component.Type.LIGHTING:
result += lcl.assemble_parameters.LED_TYPE_LIGHTING.value[locale_index]
if len(result) > 0: result += format_param_delimiter
#тип монтажа + размер
if component.GENERIC_mount == component.Mounting.Type.SURFACE:
result += lcl.assemble_parameters.MOUNT_SURFACE.value[locale_index]
if component.GENERIC_size is not None:
result += '\xa0' + component.GENERIC_size
result += format_param_delimiter
elif component.GENERIC_mount == component.Mounting.Type.THROUGHHOLE:
result += lcl.assemble_parameters.MOUNT_THROUGHHOLE.value[locale_index]
if component.GENERIC_size is not None:
result += '\xa0' + component.GENERIC_size
result += format_param_delimiter
#цвет
if component.LED_color is not None:
if component.LED_color == component.Color.INFRARED: result += lcl.Color.INFRARED.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.ULTRAVIOLET: result += lcl.Color.ULTRAVIOLET.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.RED: result += lcl.Color.RED.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.ORANGE: result += lcl.Color.ORANGE.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.AMBER: result += lcl.Color.AMBER.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.YELLOW: result += lcl.Color.YELLOW.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.LIME: result += lcl.Color.LIME.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.GREEN: result += lcl.Color.GREEN.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.TURQUOISE: result += lcl.Color.TURQUOISE.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.CYAN: result += lcl.Color.CYAN.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.BLUE: result += lcl.Color.BLUE.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.VIOLET: result += lcl.Color.VIOLET.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.PURPLE: result += lcl.Color.PURPLE.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.PINK: result += lcl.Color.PINK.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.MULTI: result += lcl.Color.MULTI.value[locale_index] + format_param_delimiter
elif component.LED_color == component.Color.WHITE: result += lcl.Color.WHITE.value[locale_index] + format_param_delimiter
#цветовая температура
if component.LED_color_temperature is not None:
result += '\xa0' + _floatToString(component.LED_color_temperature, format_decimalPoint) + format_unit_enclosure[0] + lcl.Units.KELVIN.value[locale_index] + format_unit_enclosure[1]
result += format_param_delimiter
#длина волны
if component.LED_wavelength_peak is not None:
value = [component.LED_wavelength_peak]
if component.LED_wavelength_dominant is not None: value.append(component.LED_wavelength_dominant)
ranges = ((1e-9, MetricMultiplier.NANO), )
result += _assemble_param_value(value, lcl.Units.METRE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#индекс цветопередачи
if component.LED_color_renderingIndex is not None:
result += lcl.assemble_parameters.LED_CRI.value[locale_index] + format_unit_enclosure[0] + _floatToString(component.LED_color_renderingIndex, format_decimalPoint) + format_unit_enclosure[1]
result += format_param_delimiter
#сила света
if component.LED_luminous_intensity is not None:
ranges = ((1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.LED_luminous_intensity, lcl.Units.CANDELA, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.LED_luminous_intensity_current is not None:
result += format_conditions_enclosure[0]
ranges = ((1e-6, MetricMultiplier.MICRO), (1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.LED_luminous_intensity_current, lcl.Units.AMPERE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_conditions_enclosure[1]
result += format_param_delimiter
#световой поток
if component.LED_luminous_flux is not None:
ranges = ((1e0, MetricMultiplier.NONE), )
result += _assemble_param_value(component.LED_luminous_flux, lcl.Units.LUMEN, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.LED_luminous_flux_current is not None:
result += format_conditions_enclosure[0]
ranges = ((1e-6, MetricMultiplier.MICRO), (1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.LED_luminous_flux_current, lcl.Units.AMPERE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_conditions_enclosure[1]
result += format_param_delimiter
#угол обзора
if component.LED_viewingAngle is not None:
ranges = ((1e0, MetricMultiplier.NONE), )
result += _assemble_param_value(component.LED_viewingAngle, lcl.Units.DEGREE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#прямой ток
if component.LED_current_nominal is not None:
value = [component.LED_current_nominal]
if component.LED_current_maximum is not None: value.append(component.LED_current_maximum)
ranges = ((1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(value, lcl.Units.AMPERE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#прямое падение напряжения
if component.LED_voltage_forward is not None:
ranges = ((1e0, MetricMultiplier.NONE), )
result += _assemble_param_value(component.LED_voltage_forward, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#сборка
if component.GENERIC_array is not None:
result += lcl.assemble_parameters.ARRAY.value[locale_index]
result += format_param_delimiter
#Перемычка
elif type(component) is component.types.Jumper:
#тип
if component.JMP_type is not None:
if component.JMP_type == component.Type.ELECTRICAL:
pass #result += '' + format_param_delimiter
elif component.JMP_type == component.Type.THERMAL:
result += lcl.assemble_parameters.JMP_TYPE_THERMAL.value[locale_index] + format_param_delimiter
#тип монтажа + размер
if component.GENERIC_mount == component.Mounting.Type.SURFACE: result += lcl.assemble_parameters.MOUNT_SURFACE.value[locale_index]
elif component.GENERIC_mount == component.Mounting.Type.THROUGHHOLE: result += lcl.assemble_parameters.MOUNT_THROUGHHOLE.value[locale_index]
result += '\xa0'
if component.GENERIC_size is not None: result += component.GENERIC_size
result = result.strip('\xa0')
result += format_param_delimiter
#Реле
elif type(component) is component.types.Relay:
pass
#Индуктивность
elif type(component) is component.types.Inductor:
#тип монтажа + размер
if component.GENERIC_mount == component.Mounting.Type.SURFACE: result += lcl.assemble_parameters.MOUNT_SURFACE.value[locale_index]
elif component.GENERIC_mount == component.Mounting.Type.THROUGHHOLE: result += lcl.assemble_parameters.MOUNT_THROUGHHOLE.value[locale_index]
result += '\xa0'
if component.GENERIC_size is not None: result += component.GENERIC_size
result = result.strip('\xa0')
result += format_param_delimiter
#индуктивность + допуск
if component.IND_inductance is not None:
ranges = ((1e-9, MetricMultiplier.NANO), (1e-6, MetricMultiplier.MICRO), (1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.IND_inductance, lcl.Units.HENRY, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.IND_tolerance is not None:
result += format_tolerance_enclosure[0] + _assemble_param_tolerance(component.IND_tolerance, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index) + format_tolerance_enclosure[1]
result += format_param_delimiter
#ток
if component.IND_current is not None:
ranges = ((1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.IND_current, lcl.Units.AMPERE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#низкая ёмкость
if component.IND_lowCapacitance:
result += lcl.assemble_parameters.LOW_CAPACITANCE.value[locale_index]
result += format_param_delimiter
#Резистор
elif type(component) is component.types.Resistor:
#тип монтажа + размер
if component.GENERIC_mount == component.Mounting.Type.SURFACE: result += lcl.assemble_parameters.MOUNT_SURFACE.value[locale_index]
elif component.GENERIC_mount == component.Mounting.Type.THROUGHHOLE: result += lcl.assemble_parameters.MOUNT_THROUGHHOLE.value[locale_index]
result += '\xa0'
if component.GENERIC_size is not None: result += component.GENERIC_size
result = result.strip('\xa0')
result += format_param_delimiter
#мощность
if component.RES_power is not None:
ranges = ((1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.RES_power, lcl.Units.WATT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#напряжение
if component.RES_voltage is not None:
ranges = ((1e0, MetricMultiplier.NONE), (10e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.RES_voltage, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#сопротивление + допуск
if component.RES_resistance is not None:
ranges = ((1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO), (1e6, MetricMultiplier.MEGA), (1e9, MetricMultiplier.GIGA))
result += _assemble_param_value(component.RES_resistance, lcl.Units.OHM, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.RES_tolerance is not None:
result += format_tolerance_enclosure[0] + _assemble_param_tolerance(component.RES_tolerance, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index) + format_tolerance_enclosure[1]
result += format_param_delimiter
#ТКС
if component.RES_temperature_coefficient is not None:
result += _assemble_param_tolerance(component.RES_temperature_coefficient, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index)
result += format_param_delimiter
#Переключатель
elif type(component) is component.types.Switch:
pass
#Трансформатор
elif type(component) is component.types.Transformer:
pass
#Диод
elif type(component) is component.types.Diode:
#тип
if component.DIODE_type == component.Type.SCHOTTKY:
result += lcl.assemble_parameters.SCHOTTKY.value[locale_index]
result += format_param_delimiter
#обратное напряжение
if component.DIODE_reverseVoltage is not None:
ranges = ((1e0, MetricMultiplier.NONE), (10e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.DIODE_reverseVoltage, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.DIODE_reverseVoltage_tolerance is not None:
result += format_tolerance_enclosure[0] + _assemble_param_tolerance(component.DIODE_reverseVoltage_tolerance, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index) + format_tolerance_enclosure[1]
result += format_param_delimiter
#прямой ток
if component.DIODE_forwardCurrent is not None:
ranges = ((1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.DIODE_forwardCurrent, lcl.Units.AMPERE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#максимальная мощность
if component.DIODE_power is not None:
ranges = ((1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.DIODE_power, lcl.Units.WATT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#ёмкость + допуск + условия
if component.DIODE_capacitance is not None:
ranges = ((1e-12, MetricMultiplier.PICO), )
result += _assemble_param_value(component.DIODE_capacitance, lcl.Units.FARAD, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
#допуск
if component.DIODE_capacitance_tolerance is not None:
result += format_tolerance_enclosure[0] + _assemble_param_tolerance(component.DIODE_capacitance_tolerance, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index) + format_tolerance_enclosure[1]
#условия
if (component.DIODE_capacitance_voltage is not None) or (component.DIODE_capacitance_frequency is not None):
result += format_conditions_enclosure[0]
#напряжение
if component.DIODE_capacitance_voltage is not None:
ranges = ((1e0, MetricMultiplier.NONE), (10e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.DIODE_capacitance_voltage, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_conditions_delimiter
#частота
if component.DIODE_capacitance_frequency is not None:
ranges = ((1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO), (1e6, MetricMultiplier.MEGA), (1e9, MetricMultiplier.GIGA))
result += _assemble_param_value(component.DIODE_capacitance_frequency, lcl.Units.HERTZ, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_conditions_delimiter
result = string_strip_word(result, format_conditions_delimiter)
result += format_conditions_enclosure[1]
result += format_param_delimiter
#корпус
if component.GENERIC_package is not None:
result += lcl.assemble_parameters.PACKAGE.value[locale_index] + '\xa0' + component.GENERIC_package
result += format_param_delimiter
#Тиристор
elif type(component) is component.types.Thyristor:
pass
#Транзистор
elif type(component) is component.types.Transistor:
pass
#Оптоизолятор
elif type(component) is component.types.Optoisolator:
pass
#Соединитель
elif type(component) is component.types.Connector:
pass
#Фильтр ЭМП
elif type(component) is component.types.EMIFilter:
#тип
if component.EMIF_type == component.Type.FERRITE_BEAD:
result += lcl.assemble_parameters.FERRITE_BEAD.value[locale_index]
elif component.EMIF_type == component.Type.COMMON_MODE_CHOKE:
result += lcl.assemble_parameters.COMMON_MODE_CHOKE.value[locale_index]
if len(result) > 0: result += format_param_delimiter
#тип монтажа + размер
if component.GENERIC_mount == component.Mounting.Type.SURFACE:
result += lcl.assemble_parameters.MOUNT_SURFACE.value[locale_index]
if component.GENERIC_size is not None:
result += '\xa0' + component.GENERIC_size
result += format_param_delimiter
elif component.GENERIC_mount == component.Mounting.Type.THROUGHHOLE:
result += lcl.assemble_parameters.MOUNT_THROUGHHOLE.value[locale_index]
if component.GENERIC_size is not None:
result += '\xa0' + component.GENERIC_size
result += format_param_delimiter
#импеданс + допуск @ частота
if component.EMIF_impedance is not None:
ranges = ((1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.EMIF_impedance, lcl.Units.OHM, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.EMIF_impedance_tolerance is not None:
result += format_tolerance_enclosure[0] + _assemble_param_tolerance(component.EMIF_impedance_tolerance, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index) + format_tolerance_enclosure[1]
if component.EMIF_impedance_frequency is not None:
result += format_conditions_enclosure[0]
ranges = ((1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO), (1e6, MetricMultiplier.MEGA), (1e9, MetricMultiplier.GIGA))
result += _assemble_param_value(component.EMIF_impedance_frequency, lcl.Units.HERTZ, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_conditions_enclosure[1]
result += format_param_delimiter
#индуктивность + допуск
if component.EMIF_inductance is not None:
ranges = ((1e-9, MetricMultiplier.NANO), (1e-6, MetricMultiplier.MICRO), (1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.EMIF_inductance, lcl.Units.HENRY, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.EMIF_inductance_tolerance is not None:
result += format_tolerance_enclosure[0] + _assemble_param_tolerance(component.EMIF_inductance_tolerance, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index) + format_tolerance_enclosure[1]
result += format_param_delimiter
#ёмкость + допуск
if component.EMIF_capacitance is not None:
ranges = ((1e-12, MetricMultiplier.PICO), (1e-9, MetricMultiplier.NANO), (1e-6, MetricMultiplier.MICRO), (0.1e0, MetricMultiplier.NONE))
result += _assemble_param_value(component.EMIF_capacitance, lcl.Units.FARAD, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.EMIF_capacitance_tolerance is not None:
result += format_tolerance_enclosure[0] + _assemble_param_tolerance(component.EMIF_capacitance_tolerance, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index) + format_tolerance_enclosure[1]
result += format_param_delimiter
#сопротивление + допуск
if component.EMIF_resistance is not None:
ranges = ((1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.EMIF_resistance, lcl.Units.OHM, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.EMIF_resistance_tolerance is not None:
result += format_tolerance_enclosure[0] + _assemble_param_tolerance(component.EMIF_resistance_tolerance, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index) + format_tolerance_enclosure[1]
result += format_param_delimiter
#номинальный ток
if component.EMIF_current is not None:
ranges = ((1e-3, MetricMultiplier.MILLI), (1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.EMIF_current, lcl.Units.AMPERE, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#максимальное напряжение
if component.EMIF_voltage is not None:
ranges = ((1e0, MetricMultiplier.NONE), (10e3, MetricMultiplier.KILO))
result += _assemble_param_value(component.EMIF_voltage, lcl.Units.VOLT, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#Осциллятор (Резонатор)
elif type(component) is component.types.Oscillator:
#структура
if component.OSC_structure == component.Structure.QUARTZ:
result += lcl.assemble_parameters.OSC_STRUCTURE_QUARTZ.value[locale_index]
elif component.OSC_structure == component.Structure.CERAMIC:
result += lcl.assemble_parameters.OSC_STRUCTURE_CERAMIC.value[locale_index]
if len(result) > 0: result += format_param_delimiter
#частота + допуск
if component.OSC_frequency is not None:
ranges = ((1e0, MetricMultiplier.NONE), (1e3, MetricMultiplier.KILO), (1e6, MetricMultiplier.MEGA), (1e9, MetricMultiplier.GIGA))
result += _assemble_param_value(component.OSC_frequency, lcl.Units.HERTZ, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
if component.OSC_tolerance is not None:
result += format_tolerance_enclosure[0] + _assemble_param_tolerance(component.OSC_tolerance, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index) + format_tolerance_enclosure[1]
result += format_param_delimiter
#гармоника
if component.OSC_overtone is not None:
if component.OSC_overtone == 1:
result += lcl.assemble_parameters.OSC_OVERTONE_FUNDAMENTAL.value[locale_index]
else:
result += str(component.OSC_overtone) + '\xa0' + lcl.assemble_parameters.OSC_OVERTONE.value[locale_index]
result += format_param_delimiter
#стабильность частоты
if component.OSC_stability is not None:
result += _assemble_param_tolerance(component.OSC_stability, None, format_decimalPoint, format_unit_enclosure, format_tolerance_signDelimiter, format_rangeSymbol, locale_index)
result += format_param_delimiter
#ёмкость нагрузки
if component.OSC_loadCapacitance is not None:
ranges = ((1e-12, MetricMultiplier.PICO), )
result += _assemble_param_value(component.OSC_loadCapacitance, lcl.Units.FARAD, format_decimalPoint, format_unit_enclosure, format_multivalue_delimiter, locale_index, ranges)
result += format_param_delimiter
#эквивалентное последовательное сопротивление
if component.OSC_ESR is not None: