mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Element autonumbering. New tab inside autonumbering menu to assign formulas to element label. XML containing elements labels according ISO/IEC 81346 (./elements/10_electric/qet_labels.xml
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4563 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
576
elements/10_electric/qet_labels.xml
Normal file
576
elements/10_electric/qet_labels.xml
Normal file
@@ -0,0 +1,576 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--This xml is used for retrieving elements default labels according to ISO/IEC 81346-12
|
||||
A prefix is assigned for each directory. Every element inside that directory
|
||||
will be assigned the directory prefix unless it has a text with tag "label"
|
||||
different than "_" inside its .elmt file. If a directory does not have a prefix the
|
||||
element will assign its parent directory prefix and so on.
|
||||
Prefix tag MUST be located AFTER its child categorys
|
||||
Example:
|
||||
<category name="310_relays_contactors&contacts">
|
||||
<category name="01_coils">
|
||||
<prefix>K</prefix>
|
||||
</category>
|
||||
<category name="02_contacts_cross_referencing">
|
||||
<category name="01_auxiliary_contacts"></category>
|
||||
<category name="02_power_contacts"></category>
|
||||
<category name="11_delayed_contacts"></category>
|
||||
<category name="15_protection_contacts"></category>
|
||||
<prefix>S</prefix>
|
||||
</category>
|
||||
Every Coil will be assigned "K" as a label
|
||||
Auxiliary, power, delayed and protection contacts will be assigned "S" as a label.
|
||||
-->
|
||||
<labels>
|
||||
<category name="10_allpole">
|
||||
<category name="100_sheet_referencing"></category>
|
||||
<category name="110_network_supplies"></category>
|
||||
<category name="114_connections"></category>
|
||||
<category name="120_cables&wiring"></category>
|
||||
<category name="130_terminals&terminal_strips">
|
||||
<category name="90_terminal_strips_diagram"></category>
|
||||
<prefix>X</prefix>
|
||||
</category>
|
||||
<category name="140_connectors&plugs">
|
||||
<category name="01_connectors_pins"></category>
|
||||
<category name="10_connectors_circular"></category>
|
||||
<category name="15_connectors_dsub"></category>
|
||||
<category name="20_socket_outlets"></category>
|
||||
<category name="60_connectors_electronics"></category>
|
||||
<prefix>X</prefix>
|
||||
</category>
|
||||
<category name="200_fuses&protective_gears">
|
||||
<category name="10_fuses">
|
||||
<prefix>F</prefix>
|
||||
</category>
|
||||
<category name="11_circuit_breakers">
|
||||
<prefix>F</prefix>
|
||||
</category>
|
||||
<category name="12_magneto_thermal_circuit_breakers">
|
||||
<prefix>Q</prefix>
|
||||
</category>
|
||||
<category name="20_disconnecting_switches">
|
||||
<prefix>Q</prefix>
|
||||
</category>
|
||||
<category name="30_thermal_relays">
|
||||
<prefix>F</prefix>
|
||||
</category>
|
||||
<category name="50_residual_current_circuit_breaker">
|
||||
<prefix>Q</prefix>
|
||||
</category>
|
||||
<category name="90_overvoltage_protections">
|
||||
<prefix>F</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="310_relays_contactors&contacts">
|
||||
<category name="01_coils">
|
||||
<prefix>K</prefix>
|
||||
</category>
|
||||
<category name="02_contacts_cross_referencing">
|
||||
<category name="01_auxiliary_contacts"></category>
|
||||
<category name="02_power_contacts"></category>
|
||||
<category name="11_delayed_contacts"></category>
|
||||
<category name="15_protection_contacts"></category>
|
||||
<prefix>S</prefix>
|
||||
</category>
|
||||
<category name="03_contacts">
|
||||
<prefix>S</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="330_transformers&power_supplies">
|
||||
<category name="10_transformers">
|
||||
<prefix>T</prefix>
|
||||
</category>
|
||||
<category name="30_power_supplies">
|
||||
<prefix>G</prefix>
|
||||
</category>
|
||||
<category name="40_uninterruptible_power_supply">
|
||||
<prefix>RB</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="340_converters&inverters">
|
||||
<category name="10_converters">
|
||||
<prefix>T</prefix>
|
||||
</category>
|
||||
<category name="15_measuring_transducers"></category>
|
||||
<category name="20_current_tansformers">
|
||||
<prefix>L</prefix>
|
||||
</category>
|
||||
<category name="90_filters">
|
||||
<prefix>KF</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="380_signaling&operating">
|
||||
<category name="01_human_machine_interface"></category>
|
||||
<category name="11_optical_signaling">
|
||||
<prefix>H</prefix>
|
||||
</category>
|
||||
<category name="12_acoustic_signaling">
|
||||
<prefix>H</prefix>
|
||||
</category>
|
||||
<category name="20_push_buttons">
|
||||
<prefix>S</prefix>
|
||||
</category>
|
||||
<category name="21_selector_switches">
|
||||
<prefix>S</prefix>
|
||||
</category>
|
||||
<category name="25_lever_switches">
|
||||
<prefix>S</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="390_sensors&instruments">
|
||||
<category name="01_sensors_capacitive"></category>
|
||||
<category name="02_sensors_inductive"></category>
|
||||
<category name="03_sensors_magnetic"></category>
|
||||
<category name="04_sensors_optical"></category>
|
||||
<category name="11_sensors_flow"></category>
|
||||
<category name="12_sensors_level"></category>
|
||||
<category name="13_sensors_pressure"></category>
|
||||
<category name="14_sensors_humidity"></category>
|
||||
<category name="15_sensors_temperature"></category>
|
||||
<category name="16_sensors_ultrasonic"></category>
|
||||
<category name="41_limit_switches">
|
||||
<prefix>S</prefix>
|
||||
</category>
|
||||
<category name="60_timers">
|
||||
<prefix>H</prefix>
|
||||
</category>
|
||||
<category name="70_meters&measuring_indicators"></category>
|
||||
<prefix>P</prefix>
|
||||
</category>
|
||||
<category name="391_consumers&actuators">
|
||||
<category name="10_engines">
|
||||
<prefix>M</prefix>
|
||||
</category>
|
||||
<category name="20_valves">
|
||||
<prefix>Y</prefix>
|
||||
</category>
|
||||
<category name="30_brakes">
|
||||
<prefix>YB</prefix>
|
||||
</category>
|
||||
<category name="50_heatings">
|
||||
<prefix>R</prefix>
|
||||
</category>
|
||||
<category name="60_lightings">
|
||||
<prefix>EH</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="392_generators&sources">
|
||||
<category name="10_generators">
|
||||
<prefix>B</prefix>
|
||||
</category>
|
||||
<category name="20_power_units"></category>
|
||||
<category name="30_batteries"></category>
|
||||
<category name="70_voltage_current_sources">
|
||||
<prefix>B</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="395_electronics&semiconductors">
|
||||
<category name="01_resistors">
|
||||
<prefix>R</prefix>
|
||||
</category>
|
||||
<category name="02_capacitors">
|
||||
<prefix>C</prefix>
|
||||
</category>
|
||||
<category name="03_inductors">
|
||||
<prefix>L</prefix>
|
||||
</category>
|
||||
<category name="09_disturbances"></category>
|
||||
<category name="11_diodes">
|
||||
<prefix>V</prefix>
|
||||
</category>
|
||||
<category name="12_transistors"></category>
|
||||
<category name="13_thyristors"></category>
|
||||
<category name="24piezo"></category>
|
||||
<category name="31_integrated_circuits"></category>
|
||||
<category name="41_PLC&controllers"></category>
|
||||
<category name="91_computer_science"></category>
|
||||
</category>
|
||||
<category name="450_high_voltage"></category>
|
||||
</category>
|
||||
<category name="11_singlepole">
|
||||
<category name="140_connectors&plugs">
|
||||
<prefix>X</prefix>
|
||||
</category>
|
||||
<category name="200_fuses&protective_gears">
|
||||
<category name="10_fuses">
|
||||
<prefix>F</prefix>
|
||||
</category>
|
||||
<category name="11_circuit_breakers">
|
||||
<prefix>F</prefix>
|
||||
</category>
|
||||
<category name="12_magneto_thermal_circuit_breakers">
|
||||
<prefix>Q</prefix>
|
||||
</category>
|
||||
<category name="20_disconnecting_switches">
|
||||
<prefix>Q</prefix>
|
||||
</category>
|
||||
<category name="30_thermal_relays">
|
||||
<prefix>F</prefix>
|
||||
</category>
|
||||
<category name="50_residual_current_circuit_breaker">
|
||||
<prefix>Q</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="330_transformers&power_supplies">
|
||||
<category name="10_transformers">
|
||||
<prefix>T</prefix>
|
||||
</category>
|
||||
<category name="20_current_tansformers">
|
||||
<prefix>L</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="340_converters&inverters">
|
||||
<category name="10_converters">
|
||||
<prefix>T</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="392_generators&sources">
|
||||
<category name="10_generators"></category>
|
||||
</category>
|
||||
<category name="395_electronics&semiconductors">
|
||||
<category name="10_resistors">
|
||||
<prefix>R</prefix>
|
||||
</category>
|
||||
<category name="20_capacitors">
|
||||
<prefix>C</prefix>
|
||||
</category>
|
||||
<category name="30_inductors">
|
||||
<prefix>L</prefix>
|
||||
</category>
|
||||
</category>
|
||||
<category name="500_home_installation">
|
||||
<category name="20_home_appliances"></category>
|
||||
<category name="30_architectural"></category>
|
||||
<category name="40_meters"></category>
|
||||
</category>
|
||||
</category>
|
||||
<category name="20_manufacturers_articles">
|
||||
<category name="abb">
|
||||
<category name="20_frequency_drives"></category>
|
||||
</category>
|
||||
<category name="allen_bradley">
|
||||
<category name="01_PLC&controllers"></category>
|
||||
<category name="09_safety_modules">
|
||||
<category name="10_delayed_outputs"></category>
|
||||
</category>
|
||||
<category name="11_safety_switches"></category>
|
||||
<category name="20_frequency_drives"></category>
|
||||
</category>
|
||||
<category name="april">
|
||||
<category name="5000"></category>
|
||||
</category>
|
||||
<category name="arduino"></category>
|
||||
<category name="aucom">
|
||||
<category name="10_softstarter"></category>
|
||||
</category>
|
||||
<category name="balluff">
|
||||
<category name="02_sensors_inductive"></category>
|
||||
<category name="04_sensors_optical"></category>
|
||||
<category name="51_transformers&power_supply"></category>
|
||||
</category>
|
||||
<category name="bamo"></category>
|
||||
<category name="becker"></category>
|
||||
<category name="beckhoff">
|
||||
<category name="80building_management"></category>
|
||||
</category>
|
||||
<category name="beka"></category>
|
||||
<category name="bosch_rexroth"></category>
|
||||
<category name="bti">
|
||||
<category name="11_safety_switches"></category>
|
||||
</category>
|
||||
<category name="bwo">
|
||||
<category name="09_vektor_c"></category>
|
||||
<category name="10_vio64"></category>
|
||||
</category>
|
||||
<category name="campbell"></category>
|
||||
<category name="chauvin_arnoux"></category>
|
||||
<category name="citec">
|
||||
<category name="06_sensors_pressure"></category>
|
||||
</category>
|
||||
<category name="crouzet">
|
||||
<category name="01_PLC&controllers"></category>
|
||||
</category>
|
||||
<category name="danfoss">
|
||||
<category name="10_softstarter"></category>
|
||||
<category name="20_frequency_drives"></category>
|
||||
</category>
|
||||
<category name="dold"></category>
|
||||
<category name="eaton_moeller">
|
||||
<category name="01_PLC&controllers"></category>
|
||||
<category name="200_fuses&protective_gears">
|
||||
<category name="11_circuit_breakers"></category>
|
||||
<category name="12_magneto_thermal_circuit_breakers"></category>
|
||||
<category name="20_disconnecting_switches"></category>
|
||||
</category>
|
||||
</category>
|
||||
<category name="eliwel"></category>
|
||||
<category name="endress_hauser"></category>
|
||||
<category name="euchner">
|
||||
<category name="09_safety_modules"></category>
|
||||
<category name="11_safety_switches"></category>
|
||||
</category>
|
||||
<category name="eurotherm">
|
||||
<category name="10_softstarters"></category>
|
||||
</category>
|
||||
<category name="festo"></category>
|
||||
<category name="finder">
|
||||
<category name="99_assembly_plan"></category>
|
||||
</category>
|
||||
<category name="fuji_electric">
|
||||
<category name="20_frequency_drives"></category>
|
||||
</category>
|
||||
<category name="gce"></category>
|
||||
<category name="geindustrial">
|
||||
<category name="10_sofstarters"></category>
|
||||
</category>
|
||||
<category name="guitar">
|
||||
<category name="capacitors"></category>
|
||||
<category name="ouputjacks"></category>
|
||||
<category name="pickups"></category>
|
||||
<category name="potentiometers"></category>
|
||||
<category name="special_purpose"></category>
|
||||
<category name="switches"></category>
|
||||
</category>
|
||||
<category name="hiquel">
|
||||
<category name="99_assembly_plan"></category>
|
||||
</category>
|
||||
<category name="ifm">
|
||||
<category name="06_sensors_pressure"></category>
|
||||
<category name="10_connection_technology"></category>
|
||||
</category>
|
||||
<category name="johnson_controls">
|
||||
<category name="dx">
|
||||
<category name="modules_extension"></category>
|
||||
</category>
|
||||
</category>
|
||||
<category name="jumo"></category>
|
||||
<category name="keyence">
|
||||
<category name="100_safety_light_curtain"></category>
|
||||
</category>
|
||||
<category name="knx">
|
||||
<category name="actionneur"></category>
|
||||
<category name="capteurs"></category>
|
||||
<category name="divers"></category>
|
||||
<category name="poussoirs"></category>
|
||||
<category name="powersupplies"></category>
|
||||
<category name="recepteurs"></category>
|
||||
<category name="transmetteurs"></category>
|
||||
</category>
|
||||
<category name="leroy_somer">
|
||||
<category name="20_frequency_drives"></category>
|
||||
</category>
|
||||
<category name="leuze">
|
||||
<category name="09_safety_modules"></category>
|
||||
</category>
|
||||
<category name="litecom"></category>
|
||||
<category name="murr_elektronik">
|
||||
<category name="370_fuses&protective_gears"></category>
|
||||
</category>
|
||||
<category name="national_instrument">
|
||||
<category name="01_PLC&controllers">
|
||||
<category name="crio"></category>
|
||||
</category>
|
||||
</category>
|
||||
<category name="network"></category>
|
||||
<category name="omron">
|
||||
<category name="01_PLC&controllers">
|
||||
<category name="cj1">
|
||||
<category name="taille1"></category>
|
||||
<category name="taille2"></category>
|
||||
</category>
|
||||
<category name="cj2"></category>
|
||||
<category name="cqm1">
|
||||
<category name="taille1"></category>
|
||||
<category name="taille2"></category>
|
||||
</category>
|
||||
</category>
|
||||
<category name="03_relays"></category>
|
||||
<category name="09_safety_modules"></category>
|
||||
<category name="20_frequency_drives"></category>
|
||||
<category name="99_assembly_plan"></category>
|
||||
</category>
|
||||
<category name="parker"></category>
|
||||
<category name="perske"></category>
|
||||
<category name="phoenix_contact"></category>
|
||||
<category name="pic"></category>
|
||||
<category name="pilz">
|
||||
<category name="09_safety_modules">
|
||||
<category name="pnoz"></category>
|
||||
</category>
|
||||
<category name="15_safety_switches">
|
||||
<category name="psen"></category>
|
||||
</category>
|
||||
</category>
|
||||
<category name="pro-face"></category>
|
||||
<category name="raspberry"></category>
|
||||
<category name="rittal"></category>
|
||||
<category name="rockwell">
|
||||
<category name="10_softstarters"></category>
|
||||
</category>
|
||||
<category name="satchwell"></category>
|
||||
<category name="schaffner">
|
||||
<category name="99_assembly_plan"></category>
|
||||
</category>
|
||||
<category name="schmersal"></category>
|
||||
<category name="schneider_electric">
|
||||
<category name="01_PLC&controllers">
|
||||
<category name="241"></category>
|
||||
<category name="extension_tm3">
|
||||
<category name="ana"></category>
|
||||
<category name="tor"></category>
|
||||
</category>
|
||||
<category name="m221"></category>
|
||||
<category name="m251"></category>
|
||||
<category name="m340"></category>
|
||||
<category name="magelis"></category>
|
||||
<category name="telefast"></category>
|
||||
<category name="tsx">
|
||||
<category name="config"></category>
|
||||
<category name="input"></category>
|
||||
<category name="output"></category>
|
||||
</category>
|
||||
<category name="twido">
|
||||
<category name="e-s_ana"></category>
|
||||
</category>
|
||||
<category name="zelio"></category>
|
||||
</category>
|
||||
<category name="08_control_relays"></category>
|
||||
<category name="09_motor_starters"></category>
|
||||
<category name="10_softstarter"></category>
|
||||
<category name="20_frequency_drives"></category>
|
||||
<category name="81_safety_switches"></category>
|
||||
<category name="90_TAC_Xenta">
|
||||
<category name="boitier_mural"></category>
|
||||
<category name="ecran"></category>
|
||||
<category name="module_ai"></category>
|
||||
<category name="module_ao"></category>
|
||||
<category name="module_di"></category>
|
||||
<category name="module_repetiteur"></category>
|
||||
<category name="module_serveur_web"></category>
|
||||
<category name="module_ui_ao"></category>
|
||||
<category name="module_ui_tor"></category>
|
||||
<category name="peripheriques"></category>
|
||||
<category name="regulateurs"></category>
|
||||
</category>
|
||||
<category name="99_assembly_plan"></category>
|
||||
<category name="preventa">
|
||||
<category name="09_safety_modules"></category>
|
||||
</category>
|
||||
</category>
|
||||
<category name="sew">
|
||||
<category name="20_frequency_drives"></category>
|
||||
</category>
|
||||
<category name="sfere"></category>
|
||||
<category name="sick">
|
||||
<category name="008_safety_controllers"></category>
|
||||
<category name="009_safety_modules"></category>
|
||||
<category name="100_safety_light_curtain"></category>
|
||||
<category name="101_safety_switches"></category>
|
||||
</category>
|
||||
<category name="siemens">
|
||||
<category name="01_PLC&controllers">
|
||||
<category name="6es5">
|
||||
<category name="6es5_95"></category>
|
||||
<category name="carte_entree"></category>
|
||||
<category name="carte_sortie"></category>
|
||||
<category name="cpu"></category>
|
||||
</category>
|
||||
<category name="6es7">
|
||||
<category name="alimentations"></category>
|
||||
<category name="cartes_ana_entree"></category>
|
||||
<category name="cartes_ana_entree_sortie"></category>
|
||||
<category name="cartes_ana_sortie"></category>
|
||||
<category name="cartes_entree"></category>
|
||||
<category name="cartes_sortie"></category>
|
||||
</category>
|
||||
<category name="6es7-1200">
|
||||
<category name="communication_cards"></category>
|
||||
<category name="cpu"></category>
|
||||
<category name="digital_inputs_cards"></category>
|
||||
<category name="digital_inputs-outputs_cards"></category>
|
||||
</category>
|
||||
<category name="6es7-200"></category>
|
||||
<category name="6es7-312"></category>
|
||||
<category name="6es7-313"></category>
|
||||
<category name="6se7-300"></category>
|
||||
<category name="config"></category>
|
||||
<category name="cp_343-2"></category>
|
||||
<category name="et200s">
|
||||
<category name="cards_and_modules"></category>
|
||||
<category name="channels"></category>
|
||||
<category name="io_overviews"></category>
|
||||
<category name="power_supply"></category>
|
||||
</category>
|
||||
<category name="interface_modules"></category>
|
||||
<category name="logo"></category>
|
||||
<category name="s7_300">
|
||||
<category name="cards_and_modules"></category>
|
||||
<category name="channels"></category>
|
||||
<category name="io_overviews"></category>
|
||||
</category>
|
||||
<category name="sinumerik"></category>
|
||||
</category>
|
||||
<category name="02_human_machine_interface">
|
||||
<category name="terminal_operateur"></category>
|
||||
</category>
|
||||
<category name="10_softstarter"></category>
|
||||
<category name="20_frequency_drives"></category>
|
||||
<category name="23_sinamics_drives"></category>
|
||||
<category name="71_asynchronous_motors"></category>
|
||||
<category name="73_servo_motors"></category>
|
||||
<category name="80_building_management"></category>
|
||||
</category>
|
||||
<category name="sofrel">
|
||||
<category name="01_PLC&controllers">
|
||||
<category name="s500"></category>
|
||||
</category>
|
||||
</category>
|
||||
<category name="telemecanique">
|
||||
<category name="20_frequency_drives"></category>
|
||||
</category>
|
||||
<category name="unitronics_plc"></category>
|
||||
<category name="vega"></category>
|
||||
<category name="vipa"></category>
|
||||
<category name="wago">
|
||||
<category name="01_PLC&controllers"></category>
|
||||
</category>
|
||||
<category name="west"></category>
|
||||
<category name="wit"></category>
|
||||
</category>
|
||||
<category name="90_american_standards">
|
||||
<category name="15_allpole">
|
||||
<category name="140_connectors&plugs">
|
||||
<category name="01_connectors_pins"></category>
|
||||
</category>
|
||||
<category name="200_fuses&protective_gears">
|
||||
<category name="11_circuit_breakers"></category>
|
||||
</category>
|
||||
</category>
|
||||
<category name="16_singlepole"></category>
|
||||
</category>
|
||||
<category name="98_graphics">
|
||||
<category name="01_auxiliary_symbols">
|
||||
<category name="01_cross_ref_symbols">
|
||||
<category name="01_with_linking_function">
|
||||
<category name="01_parents"></category>
|
||||
<category name="02_children"></category>
|
||||
</category>
|
||||
<category name="02_without_linking_function"></category>
|
||||
</category>
|
||||
<category name="20_switch_positions"></category>
|
||||
</category>
|
||||
<category name="11_tags&comments"></category>
|
||||
<category name="21_forms&tabs"></category>
|
||||
<category name="99_assembly_plan">
|
||||
<category name="01_thumbnails_mounting_plate"></category>
|
||||
<category name="21_signaling&operating">
|
||||
<category name="21_size_2x2"></category>
|
||||
<category name="31_size_4x4"></category>
|
||||
</category>
|
||||
</category>
|
||||
</category>
|
||||
<category name="99_miscellaneous&unsorted"></category>
|
||||
<report>
|
||||
<directories>361</directories>
|
||||
</report>
|
||||
</labels>
|
||||
@@ -124,6 +124,16 @@ QString ElementsLocation::baseName() const {
|
||||
return(QString());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementsLocation::projectId
|
||||
* This method is used to know if an element belongs to
|
||||
* a project or not.
|
||||
* @return Element Project Id
|
||||
*/
|
||||
int ElementsLocation::projectId() const {
|
||||
return QETApp::projectId(m_project);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementsLocation::collectionPath
|
||||
* Return the path of the represented element relative to collection
|
||||
|
||||
@@ -44,6 +44,7 @@ class ElementsLocation
|
||||
|
||||
public:
|
||||
QString baseName() const;
|
||||
int projectId() const;
|
||||
|
||||
QString collectionPath(bool protocol = true) const;
|
||||
QString projectCollectionPath() const;
|
||||
|
||||
@@ -101,6 +101,8 @@ class BorderTitleBlock : public QObject
|
||||
DiagramContext additionalFields() const { return (additional_fields_); }
|
||||
/// @return the value of the title block
|
||||
QString autoPageNum() const { return(btb_auto_page_num_); }
|
||||
/// @return the value of the total number of folios
|
||||
int folioTotal() const { return(folio_total_);}
|
||||
|
||||
// methods to get display options
|
||||
/// @return true si le cartouche est affiche, false sinon
|
||||
|
||||
@@ -855,9 +855,19 @@ void Diagram::addItem(QGraphicsItem *item)
|
||||
{
|
||||
case Element::Type:
|
||||
{
|
||||
const Element *elmt = static_cast<const Element*>(item);
|
||||
Element *elmt = static_cast<Element*>(item);
|
||||
foreach(ElementTextItem *eti, elmt->texts())
|
||||
connect (eti, &ElementTextItem::diagramTextChanged, this, &Diagram::diagramTextChanged);
|
||||
Element::kind linkType = elmt->linkType();
|
||||
if ((linkType == Element::Simple) ||
|
||||
(linkType == Element::Master) ||
|
||||
(linkType == Element::Slave) ||
|
||||
(linkType == Element::Terminale)) {
|
||||
CustomElement *celmt = static_cast<CustomElement*>(item);
|
||||
celmt->parseLabels();
|
||||
}
|
||||
|
||||
elmt->updateLabel();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "selectautonumw.h"
|
||||
#include "numerotationcontext.h"
|
||||
#include "folioautonumbering.h"
|
||||
#include "elementautonumberingw.h"
|
||||
/**
|
||||
Constructor
|
||||
@param project Project this page is editing.
|
||||
@@ -269,6 +270,10 @@ void ProjectAutoNumConfigPage::initWidgets() {
|
||||
|
||||
m_saw = new SelectAutonumW(conductor_tab_widget);
|
||||
|
||||
//Element Tab
|
||||
element_tab_widget = new QWidget(this);
|
||||
m_eaw = new ElementAutonumberingW(element_tab_widget);
|
||||
|
||||
//Folio Tab
|
||||
folio_tab_widget = new QWidget(this);
|
||||
folio_tab_widget->setObjectName("FolioTab");
|
||||
@@ -296,7 +301,7 @@ void ProjectAutoNumConfigPage::initWidgets() {
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::initLayout() {
|
||||
|
||||
//Conductor tab
|
||||
//Conductor Tab
|
||||
tab_widget->addTab(conductor_tab_widget, tr("Conductor"));
|
||||
|
||||
QHBoxLayout *context_layout = new QHBoxLayout();
|
||||
@@ -312,6 +317,9 @@ void ProjectAutoNumConfigPage::initLayout() {
|
||||
main_layout->addLayout(aux_layout);
|
||||
conductor_tab_widget -> setLayout (main_layout);
|
||||
|
||||
//Element Tab
|
||||
tab_widget->addTab(element_tab_widget,tr ("Element"));
|
||||
|
||||
// Folio Tab
|
||||
tab_widget->addTab(folio_tab_widget, tr("Folio"));
|
||||
|
||||
@@ -345,6 +353,10 @@ void ProjectAutoNumConfigPage::readValuesFromProject() {
|
||||
foreach (QString str, keys) { m_context_cb -> addItem(str); }
|
||||
}
|
||||
|
||||
//Element Tab
|
||||
if (!project_->elementAutoNum().isEmpty())
|
||||
m_eaw->setContext(project_->elementAutoNum());
|
||||
|
||||
//Folio Tab
|
||||
QList <QString> keys_2 = project_->folioAutoNum().keys();
|
||||
if (!keys_2.isEmpty()){
|
||||
@@ -375,6 +387,9 @@ void ProjectAutoNumConfigPage::buildConnections() {
|
||||
connect (m_saw, SIGNAL (applyPressed()), this, SLOT (saveContext()));
|
||||
connect (m_remove_pb, SIGNAL (clicked()), this, SLOT(removeContext()));
|
||||
|
||||
//Element Tab
|
||||
connect (m_eaw, SIGNAL (applyPressed()), this, SLOT (saveContext_3()));
|
||||
|
||||
//Folio Tab
|
||||
connect (m_context_cb_2, SIGNAL (currentIndexChanged(QString)), this, SLOT (updateContext_2(QString)));
|
||||
connect (m_saw_2, SIGNAL (applyPressed()), this, SLOT (saveContext_2()));
|
||||
@@ -448,6 +463,14 @@ void ProjectAutoNumConfigPage::saveContext_2() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ProjectAutoNumConfigPage::saveContext_3
|
||||
* Save the current displayed Element formula in project
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::saveContext_3() {
|
||||
project()->addElementAutoNum (m_eaw->formula());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ProjectAutoNumConfigPage::applyAutoNum
|
||||
* Apply auto folio numbering, New Folios or Selected Folios
|
||||
@@ -508,7 +531,7 @@ void ProjectAutoNumConfigPage::changeToTab(int i){
|
||||
*/
|
||||
void ProjectAutoNumConfigPage::tabChanged(int i){
|
||||
if (i>0){
|
||||
if (tab_widget->currentIndex()==2){
|
||||
if (tab_widget->currentIndex()==3){
|
||||
tab_widget->resize(470,tab_widget->height());
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -35,6 +35,7 @@ class SelectAutonumW;
|
||||
class QComboBox;
|
||||
class QPushButton;
|
||||
class FolioAutonumberingW;
|
||||
class ElementAutonumberingW;
|
||||
|
||||
/**
|
||||
This class, derived from ConfigPage, aims at providing the basic skeleton
|
||||
@@ -142,10 +143,11 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
|
||||
private slots:
|
||||
void updateContext(QString);
|
||||
void saveContext();
|
||||
void removeContext();
|
||||
void removeContext(); //conductor
|
||||
void updateContext_2(QString);
|
||||
void saveContext_2();
|
||||
void saveContext_2(); //folio
|
||||
void removeContext_2();
|
||||
void saveContext_3(); //element
|
||||
|
||||
void applyAutoNum();
|
||||
|
||||
@@ -160,8 +162,8 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
|
||||
//Attributes
|
||||
private:
|
||||
QTabWidget *tab_widget;
|
||||
QWidget *element_widget;
|
||||
QWidget *conductor_tab_widget;
|
||||
QWidget *element_tab_widget;
|
||||
QWidget *folio_tab_widget;
|
||||
QWidget *autoNumbering_tab_widget;
|
||||
QScrollArea *scrollArea;
|
||||
@@ -174,6 +176,7 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
|
||||
SelectAutonumW *m_saw;
|
||||
SelectAutonumW *m_saw_2;
|
||||
FolioAutonumberingW *m_faw;
|
||||
ElementAutonumberingW *m_eaw;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <iostream>
|
||||
#include "terminal.h"
|
||||
#include "diagramposition.h"
|
||||
#include "diagramcontent.h"
|
||||
|
||||
/**
|
||||
Constructeur de la classe CustomElement. Permet d'instancier un element
|
||||
@@ -263,6 +264,89 @@ void CustomElement::paint(QPainter *qp, const QStyleOptionGraphicsItem *options)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Retrieves the element label stored in file ./elements/ * /qet_labels.xml
|
||||
The labels are applied to all elements inside a folder. If an element
|
||||
has a specific label, it will be applied. See qet_labels.xml for more
|
||||
instructions.
|
||||
*/
|
||||
void CustomElement::parseLabels() {
|
||||
if ((this->taggedText("label")!= NULL) && (location().projectId()!=-1) && (this->taggedText("label")->toPlainText()=="_")) { //element is being added
|
||||
QXmlStreamReader rxml;
|
||||
QString path[10];
|
||||
QString prefix;
|
||||
int i = -1;
|
||||
ElementsLocation current_location = location();
|
||||
int dirLevel = -1;
|
||||
|
||||
//Add location name to path array
|
||||
while(current_location.parent().name()!="Imported elements" ) {
|
||||
i++;
|
||||
path[i]=current_location.fileName();
|
||||
current_location = current_location.parent();
|
||||
dirLevel++;
|
||||
}
|
||||
|
||||
// Only Electric labels created so far
|
||||
if (current_location.name()!= "Electric") return;
|
||||
QString qet_labels = "10_electric/qet_labels.xml";
|
||||
QString filepath = QETApp::commonElementsDir().append(qet_labels);
|
||||
QFile file(filepath);
|
||||
file.isReadable();
|
||||
if (!file.open(QFile::ReadOnly | QFile::Text)) return;
|
||||
rxml.setDevice(&file);
|
||||
rxml.readNext();
|
||||
|
||||
while(!rxml.atEnd()) {
|
||||
if (rxml.attributes().value("name").toString() == path[i]) {
|
||||
rxml.readNext();
|
||||
i=i-1;
|
||||
//reached element directory
|
||||
if (i==0) {
|
||||
for (int j=i; j<= dirLevel; j = j +1){
|
||||
//if there is a prefix available apply prefix
|
||||
if(rxml.name()=="prefix") {
|
||||
prefix = rxml.readElementText();
|
||||
DiagramContext &dc = this->rElementInformations();
|
||||
//if there is a formula to assign, assign it
|
||||
if (!location().project()->elementAutoNum().isEmpty() && this->linkType()!=Element::Slave) {
|
||||
QString formula = location().project()->elementAutoNum();
|
||||
formula.replace("%prefix", prefix);
|
||||
dc.addValue("label", formula);
|
||||
this->setTaggedText("label",formula);
|
||||
} else { //assign only prefix
|
||||
dc.addValue("label", prefix);
|
||||
this->setTaggedText("label", prefix);
|
||||
}
|
||||
this->setElementInformations(dc);
|
||||
return;
|
||||
}
|
||||
//if there isn't a prefix available, find parent prefix in parent folder
|
||||
else {
|
||||
while (rxml.readNextStartElement() && rxml.name()!="prefix") {
|
||||
rxml.skipCurrentElement();
|
||||
rxml.readNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rxml.readNext();
|
||||
}
|
||||
}
|
||||
//apply formula to specific label
|
||||
else if ((this->taggedText("label")!= NULL) && (location().projectId()!=-1) &&
|
||||
(!location().project()->elementAutoNum().isEmpty()) && (this->linkType()!=Element::Slave)) {
|
||||
QString formula = location().project()->elementAutoNum();
|
||||
DiagramContext &dc = this->rElementInformations();
|
||||
QString prefix = this->taggedText("label")->toPlainText();
|
||||
formula.replace("%prefix", prefix);
|
||||
dc.addValue("label", formula);
|
||||
this->setTaggedText("label",formula);
|
||||
this->setElementInformations(dc);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Analyse et prend en compte un element XML decrivant une partie du dessin
|
||||
de l'element perso. Si l'analyse reussit, la partie est ajoutee au dessin.
|
||||
@@ -696,6 +780,18 @@ ElementTextItem *CustomElement::parseInput(QDomElement &e) {
|
||||
eti -> setFont(QETApp::diagramTextsFont(size));
|
||||
eti -> setTagg(e.attribute("tagg", "other"));
|
||||
|
||||
if (e.attribute("tagg")=="label") {
|
||||
DiagramContext &dc = this->rElementInformations();
|
||||
dc.addValue("label", e.attribute("text"));
|
||||
this->setElementInformations(dc);
|
||||
this->setTaggedText("label", e.attribute("text"));
|
||||
}
|
||||
else if (e.attribute("tagg")=="function") {
|
||||
DiagramContext &dc = this->rElementInformations();
|
||||
dc.addValue("function", e.attribute("text"));
|
||||
this->setElementInformations(dc);
|
||||
}
|
||||
|
||||
// position the text field
|
||||
eti -> setOriginalPos(QPointF(pos_x, pos_y));
|
||||
eti -> setPos(pos_x, pos_y);
|
||||
|
||||
@@ -72,6 +72,7 @@ class CustomElement : public FixedElement
|
||||
virtual QList<QVector<qreal> *> arcs() const;
|
||||
virtual int terminalsCount() const;
|
||||
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *);
|
||||
virtual void parseLabels();
|
||||
QString typeId() const;
|
||||
ElementsLocation location() const;
|
||||
QString name() const;
|
||||
@@ -93,6 +94,7 @@ class CustomElement : public FixedElement
|
||||
virtual bool validOrientationAttribute(const QDomElement &);
|
||||
virtual void setPainterStyle(QDomElement &, QPainter &);
|
||||
ElementTextItem* setTaggedText(const QString &tagg, const QString &newstr, const bool noeditable=false);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -659,5 +659,7 @@ QString Element::assignVariables(QString label, Element *elmt){
|
||||
label.replace("%F", elmt->diagram() -> border_and_titleblock.folio());
|
||||
label.replace("%c", QString::number(elmt->diagram() -> convertPosition(elmt -> scenePos()).number()));
|
||||
label.replace("%l", elmt->diagram() -> convertPosition(elmt -> scenePos()).letter());
|
||||
label.replace("%id", QString::number(elmt->diagram()->folioIndex()+1));
|
||||
label.replace("%total", QString::number(elmt->diagram()->border_and_titleblock.folioTotal()));
|
||||
return label;
|
||||
}
|
||||
|
||||
@@ -120,8 +120,9 @@ class Element : public QetGraphicsItem {
|
||||
kind link_type_;
|
||||
|
||||
signals:
|
||||
void linkedElementChanged(); //This signal is emtied when the linked elements with this element change
|
||||
void linkedElementChanged(); //This signal is emited when the linked elements with this element change
|
||||
void elementInfoChange(DiagramContext old_info, DiagramContext new_info);
|
||||
void updateLabel(); //This signal is emited to update element's label
|
||||
|
||||
//METHODS related to information
|
||||
public:
|
||||
|
||||
@@ -254,6 +254,7 @@ void ElementTextItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) {
|
||||
if (m_first_move) {
|
||||
//We signal the beginning of movement to the parent diagram
|
||||
int moved_texts_count = diagram_ptr -> beginMoveElementTexts(this);
|
||||
parent_element_ -> setHighlighted(true);
|
||||
|
||||
//If there is one texte to move, we highlight the parent element.
|
||||
if (moved_texts_count == 1 && parent_element_) {
|
||||
|
||||
@@ -35,6 +35,7 @@ MasterElement::MasterElement(const ElementsLocation &location, QGraphicsItem *qg
|
||||
connect(this, SIGNAL(elementInfoChange(DiagramContext, DiagramContext)), this, SLOT(updateLabel(DiagramContext, DiagramContext)));
|
||||
connect(this, SIGNAL(xChanged()), this, SLOT(changeElementInfo()));
|
||||
connect(this, SIGNAL(yChanged()), this, SLOT(changeElementInfo()));
|
||||
connect(this, SIGNAL(updateLabel()), this, SLOT(changeElementInfo()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,6 +64,7 @@ void MasterElement::linkToElement(Element *elmt)
|
||||
|
||||
connect(elmt, SIGNAL(xChanged()), cri_, SLOT(updateLabel()));
|
||||
connect(elmt, SIGNAL(yChanged()), cri_, SLOT(updateLabel()));
|
||||
connect(elmt, SIGNAL(updateLabel()), cri_, SLOT(updateLabel()));
|
||||
cri_ -> updateLabel();
|
||||
emit linkedElementChanged();
|
||||
}
|
||||
@@ -100,6 +102,7 @@ void MasterElement::unlinkElement(Element *elmt)
|
||||
//update the graphics cross ref
|
||||
disconnect(elmt, SIGNAL(xChanged()), cri_, SLOT(updateLabel()));
|
||||
disconnect(elmt, SIGNAL(yChanged()), cri_, SLOT(updateLabel()));
|
||||
disconnect(elmt, SIGNAL(updateLabel()), cri_, SLOT(updateLabel()));
|
||||
|
||||
cri_ -> updateLabel();
|
||||
aboutDeleteXref();
|
||||
|
||||
@@ -219,10 +219,7 @@ void ReportElement::updateLabel()
|
||||
{
|
||||
Element *elmt = connected_elements.at(0);
|
||||
QString label = label_;
|
||||
label.replace("%f", QString::number(elmt->diagram()->folioIndex()+1));
|
||||
label.replace("%F", elmt->diagram() -> border_and_titleblock.folio());
|
||||
label.replace("%c", QString::number(elmt->diagram() -> convertPosition(elmt -> scenePos()).number()));
|
||||
label.replace("%l", elmt->diagram() -> convertPosition(elmt -> scenePos()).letter());
|
||||
label = assignVariables(label,elmt);
|
||||
m_text_field -> setPlainText(label);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -35,6 +35,7 @@ SimpleElement::SimpleElement(const ElementsLocation &location, QGraphicsItem *qg
|
||||
connect(this, SIGNAL(elementInfoChange(DiagramContext, DiagramContext)), this, SLOT(updateLabel(DiagramContext, DiagramContext)));
|
||||
connect(this, SIGNAL(xChanged()),this, SLOT(changeElementInfo()));
|
||||
connect(this, SIGNAL(yChanged()),this, SLOT(changeElementInfo()));
|
||||
connect(this, SIGNAL(updateLabel()),this,SLOT(changeElementInfo()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,6 +64,7 @@ void SlaveElement::linkToElement(Element *elmt)
|
||||
connect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
|
||||
connect(diagram()->project(), SIGNAL(diagramRemoved(QETProject*,Diagram*)), this, SLOT(updateLabel()));
|
||||
connect(elmt -> diagram(), SIGNAL(XRefPropertiesChanged()), this, SLOT(updateLabel()));
|
||||
connect(elmt, SIGNAL(updateLabel()), this, SLOT(updateLabel()));
|
||||
|
||||
updateLabel();
|
||||
elmt -> linkToElement(this);
|
||||
@@ -104,6 +105,7 @@ void SlaveElement::unlinkElement(Element *elmt)
|
||||
disconnect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
|
||||
disconnect(diagram()->project(), SIGNAL(diagramRemoved(QETProject*,Diagram*)), this, SLOT(updateLabel()));
|
||||
disconnect(elmt -> diagram(), SIGNAL(XRefPropertiesChanged()), this, SLOT(updateLabel()));
|
||||
disconnect(elmt, SIGNAL(updateLabel()), this, SLOT(updateLabel()));
|
||||
|
||||
delete Xref_item; Xref_item = NULL;
|
||||
|
||||
|
||||
@@ -408,6 +408,14 @@ QHash <QString, NumerotationContext> QETProject::conductorAutoNum() const {
|
||||
return m_conductor_autonum;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETProject::elementAutoNum
|
||||
* @return Formula of element autonum stored in project
|
||||
*/
|
||||
QString QETProject::elementAutoNum() const {
|
||||
return m_element_autonum;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETProject::folioAutoNum
|
||||
* @return All value of conductor autonum stored in project
|
||||
@@ -427,6 +435,15 @@ void QETProject::addConductorAutoNum(QString key, NumerotationContext context) {
|
||||
m_conductor_autonum.insert(key, context);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETProject::addElementAutoNum
|
||||
* Add the new formula
|
||||
* @param formula
|
||||
*/
|
||||
void QETProject::addElementAutoNum(QString formula) {
|
||||
m_element_autonum = formula;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief QETProject::addFolioAutoNum
|
||||
* Add a new folio numerotation context. If key already exist,
|
||||
@@ -1176,7 +1193,7 @@ void QETProject::readDefaultPropertiesXml(QDomDocument &xml_project)
|
||||
m_default_xref_properties = XRefProperties:: defaultProperties();
|
||||
|
||||
//Read values indicate in project
|
||||
QDomElement border_elmt, titleblock_elmt, conductors_elmt, report_elmt, xref_elmt, conds_autonums, folio_autonums;
|
||||
QDomElement border_elmt, titleblock_elmt, conductors_elmt, report_elmt, xref_elmt, conds_autonums, folio_autonums, element_autonums;
|
||||
|
||||
for (QDomNode child = newdiagrams_elmt.firstChild() ; !child.isNull() ; child = child.nextSibling())
|
||||
{
|
||||
@@ -1197,9 +1214,11 @@ void QETProject::readDefaultPropertiesXml(QDomDocument &xml_project)
|
||||
conds_autonums = child_elmt;
|
||||
else if (child_elmt.tagName()== "folio_autonums")
|
||||
folio_autonums = child_elmt;
|
||||
else if (child_elmt.tagName()== "element_autonums")
|
||||
element_autonums = child_elmt;
|
||||
}
|
||||
|
||||
// size, titleblock, conductor, report, conductor autonum
|
||||
// size, titleblock, conductor, report, conductor autonum, folio autonum, element autonum
|
||||
if (!border_elmt.isNull()) default_border_properties_.fromXml(border_elmt);
|
||||
if (!titleblock_elmt.isNull()) default_titleblock_properties_.fromXml(titleblock_elmt);
|
||||
if (!conductors_elmt.isNull()) default_conductor_properties_.fromXml(conductors_elmt);
|
||||
@@ -1231,6 +1250,10 @@ void QETProject::readDefaultPropertiesXml(QDomDocument &xml_project)
|
||||
m_folio_autonum.insert(elmt.attribute("title"), nc);
|
||||
}
|
||||
}
|
||||
if (!element_autonums.isNull())
|
||||
{
|
||||
m_element_autonum = element_autonums.attribute("formula");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1300,6 +1323,11 @@ void QETProject::writeDefaultPropertiesXml(QDomElement &xml_element) {
|
||||
folio_autonums.appendChild(folio_autonum);
|
||||
}
|
||||
xml_element.appendChild(folio_autonums);
|
||||
|
||||
//Export Element Autonums
|
||||
QDomElement element_autonums = xml_document.createElement("element_autonums");
|
||||
element_autonums.setAttribute("formula", m_element_autonum);
|
||||
xml_element.appendChild(element_autonums);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -109,11 +109,13 @@ class QETProject : public QObject
|
||||
QHash <QString, NumerotationContext> conductorAutoNum() const;
|
||||
QHash <QString, NumerotationContext> folioAutoNum() const;
|
||||
void addConductorAutoNum (QString key, NumerotationContext context);
|
||||
void addElementAutoNum (QString formula);
|
||||
void addFolioAutoNum (QString key, NumerotationContext context);
|
||||
void removeConductorAutonum (QString key);
|
||||
void removeFolioAutoNum (QString key);
|
||||
NumerotationContext conductorAutoNum(const QString &key) const;
|
||||
NumerotationContext folioAutoNum(const QString &key) const;
|
||||
QString elementAutoNum() const;
|
||||
|
||||
bool autoConductor () const;
|
||||
bool autoFolio () const;
|
||||
@@ -218,7 +220,10 @@ class QETProject : public QObject
|
||||
QUndoStack *undo_stack_;
|
||||
/// Conductor auto numerotation
|
||||
QHash <QString, NumerotationContext> m_conductor_autonum;
|
||||
/// Folio auto numbering
|
||||
QHash <QString, NumerotationContext> m_folio_autonum;
|
||||
/// Element Auto Numbering
|
||||
QString m_element_autonum;
|
||||
/// Folio List Sheets quantity for this project.
|
||||
int folioSheetsQuantity;
|
||||
bool m_auto_conductor;
|
||||
|
||||
92
sources/ui/elementautonumberingw.cpp
Normal file
92
sources/ui/elementautonumberingw.cpp
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
Copyright 2006-2016 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
QElectroTech is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
QElectroTech is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "elementautonumberingw.h"
|
||||
#include "ui_elementautonumberingw.h"
|
||||
#include <QMessageBox>
|
||||
#include <QPushButton>
|
||||
#include <QtWidgets>
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
ElementAutonumberingW::ElementAutonumberingW(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::ElementAutonumberingW)
|
||||
|
||||
{
|
||||
ui->setupUi(this);
|
||||
applyEnable(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
ElementAutonumberingW::~ElementAutonumberingW()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementAutonumberingW::setContext
|
||||
* @param formula to be inserted into context
|
||||
*/
|
||||
void ElementAutonumberingW::setContext(QString formula) {
|
||||
ui->m_formula_le->insert(formula);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementAutonumberingW::formula
|
||||
* @return formula to be stored into project
|
||||
*/
|
||||
QString ElementAutonumberingW::formula() {
|
||||
return ui->m_formula_le->text();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementAutonumberingW::on_m_formula_le_textChanged
|
||||
* Update Apply Button
|
||||
*/
|
||||
void ElementAutonumberingW::on_m_formula_le_textChanged() {
|
||||
if (!ui->m_formula_le->text().isEmpty())
|
||||
applyEnable(true);
|
||||
else applyEnable(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementAutonumberingW::on_buttonBox_clicked
|
||||
* Action on @buttonBox clicked
|
||||
*/
|
||||
void ElementAutonumberingW::on_buttonBox_clicked(QAbstractButton *button) {
|
||||
//transform button to int
|
||||
int answer = ui -> buttonBox -> buttonRole(button);
|
||||
|
||||
switch (answer) {
|
||||
case QDialogButtonBox::ApplyRole:
|
||||
applyEnable(true);
|
||||
emit applyPressed();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ElementAutonumberingW::applyEnable
|
||||
* enable/disable the apply button
|
||||
*/
|
||||
void ElementAutonumberingW::applyEnable(bool b) {
|
||||
ui -> buttonBox -> button(QDialogButtonBox::Apply) -> setEnabled(b);
|
||||
}
|
||||
64
sources/ui/elementautonumberingw.h
Normal file
64
sources/ui/elementautonumberingw.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
Copyright 2006-2016 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
QElectroTech is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
QElectroTech is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef ELEMENTAUTONUMBERINGW_H
|
||||
#define ELEMENTAUTONUMBERINGW_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
class QAbstractButton;
|
||||
|
||||
namespace Ui {
|
||||
class ElementAutonumberingW;
|
||||
}
|
||||
|
||||
/**
|
||||
This class implements the element autonumbering widget.
|
||||
It loads the current formula applied to new elements and allows
|
||||
the user to overwrite it with a new formula. Formula is added
|
||||
while parsing label in customelement.cpp
|
||||
*/
|
||||
class ElementAutonumberingW : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
//METHODS
|
||||
public:
|
||||
explicit ElementAutonumberingW(QWidget *parent = 0);
|
||||
~ElementAutonumberingW();
|
||||
QString formula();
|
||||
void setContext(QString);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// SIGNALS
|
||||
signals:
|
||||
void applyPressed();
|
||||
|
||||
//SLOTS
|
||||
private slots:
|
||||
void on_m_formula_le_textChanged();
|
||||
void on_buttonBox_clicked(QAbstractButton *);
|
||||
void applyEnable (bool = true);
|
||||
|
||||
//ATTRIBUTES
|
||||
private:
|
||||
Ui::ElementAutonumberingW *ui;
|
||||
};
|
||||
|
||||
#endif // ELEMENTAUTONUMBERINGW_H
|
||||
176
sources/ui/elementautonumberingw.ui
Normal file
176
sources/ui/elementautonumberingw.ui
Normal file
@@ -0,0 +1,176 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ElementAutonumberingW</class>
|
||||
<widget class="QWidget" name="ElementAutonumberingW">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>460</width>
|
||||
<height>550</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>460</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>50</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="mouseTracking">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="verticalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignHCenter|Qt::AlignTop</set>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>440</width>
|
||||
<height>495</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item row="4" column="1" colspan="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="1" rowspan="2" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Auto Naming Pattern:</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="m_formula_le">
|
||||
<property name="inputMask">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Insert Formula Here e.g.: %prefix%l%c</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Formula:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" rowspan="2" colspan="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>You can use the following variables to your formula:
|
||||
-%prefix: Default Element Prefix
|
||||
-%l: Element Line
|
||||
-%c: Element Column
|
||||
-%F: Folio Name
|
||||
-%f or %id: Folio ID
|
||||
-%total: Total of folios
|
||||
You can also assign any other titleblock variable
|
||||
that you create. Text and number inputs are also available</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Apply</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -135,7 +135,7 @@ void FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked() {
|
||||
* @brief FolioAutonumberingW::on_m_new_tabs_sb_valueChanged
|
||||
* Enable Apply if any new folio is to be created
|
||||
*/
|
||||
void FolioAutonumberingW::on_m_new_tabs_sb_valueChanged(){
|
||||
void FolioAutonumberingW::on_m_new_tabs_sb_valueChanged(int){
|
||||
if (ui->m_new_tabs_sb->value()>0) applyEnable(true);
|
||||
else applyEnable(false);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ void FolioAutonumberingW::on_m_new_tabs_sb_valueChanged(){
|
||||
* @brief FolioAutonumberingW::on_m_from_cb_currentIndexChanged
|
||||
* Enable To ComboBox
|
||||
*/
|
||||
void FolioAutonumberingW::on_m_from_cb_currentIndexChanged(){
|
||||
void FolioAutonumberingW::on_m_from_cb_currentIndexChanged(int){
|
||||
int index = ui->m_from_cb->currentIndex();
|
||||
ui->m_to_cb->clear();
|
||||
if (index > 0){
|
||||
|
||||
@@ -55,9 +55,9 @@ class FolioAutonumberingW : public QWidget
|
||||
private slots:
|
||||
void on_m_create_new_tabs_rb_clicked();
|
||||
void on_m_autonumber_tabs_rb_clicked();
|
||||
void on_m_new_tabs_sb_valueChanged();
|
||||
void on_m_new_tabs_sb_valueChanged(int);
|
||||
void on_buttonBox_clicked(QAbstractButton *);
|
||||
void on_m_from_cb_currentIndexChanged();
|
||||
void on_m_from_cb_currentIndexChanged(int);
|
||||
void applyEnable (bool = true);
|
||||
|
||||
//ATTRIBUTES
|
||||
|
||||
@@ -149,7 +149,7 @@ void NumPartEditorW::on_value_field_textEdited() {
|
||||
* @brief NumPartEditorW::on_increase_spinBox_valueChanged
|
||||
* emit changed when @increase_spinBox value changed
|
||||
*/
|
||||
void NumPartEditorW::on_increase_spinBox_valueChanged() {
|
||||
void NumPartEditorW::on_increase_spinBox_valueChanged(int) {
|
||||
if (!ui -> value_field -> text().isEmpty()) emit changed();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class NumPartEditorW : public QWidget
|
||||
private slots:
|
||||
void on_type_combo_activated(int);
|
||||
void on_value_field_textEdited();
|
||||
void on_increase_spinBox_valueChanged();
|
||||
void on_increase_spinBox_valueChanged(int);
|
||||
void setType (NumPartEditorW::type t, bool=false);
|
||||
|
||||
signals:
|
||||
|
||||
@@ -72,5 +72,5 @@ void ProjectPropertiesDialog::setCurrentPage(ProjectPropertiesDialog::Page p) {
|
||||
*/
|
||||
void ProjectPropertiesDialog::changeToFolio() {
|
||||
ProjectAutoNumConfigPage *autoNumPage = static_cast <ProjectAutoNumConfigPage*>(m_properties_dialog->pages.at(2));
|
||||
autoNumPage->changeToTab(1);
|
||||
autoNumPage->changeToTab(2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user