Engineering Requirements Management

 View Only
Expand all | Collapse all

How to Make DXL Recognize that User Has Selected a Different Module?

  • 1.  How to Make DXL Recognize that User Has Selected a Different Module?

    Posted Wed March 24, 2021 05:54 PM

    I launch a DXL in a DOORS formal module (module #1). The DXL displays a dialog box using the "show" command that asks the user to select an object in a different DOORS module (module #2). Because the dialog box was realized using the "show" command, the rest of the DOORS interface is still sensitive to user input. The user (me) then opens a different DOORS formal module (module #2), selects an object in module #2, and then presses the <OK> button in the dialog box. The DXL then assigns 'Module m2 = current' and 'Object o2 = current' with the expectation that m2 is module #2 and the o2 is the object selected in module #2.

    However, when I print the name m2 and the Absolute Number of o2, I find that m2 is module #1 and o2 is the last object selected in module #1.

    Any ideas on how I make the DXL recognize that the user has selected an object in a different module than the module in which the DXL was launched?





    #SupportMigration
    #Sustainability
    #Support
    #DOORS
    #EngineeringRequirementsManagement


  • 2.  RE: How to Make DXL Recognize that User Has Selected a Different Module?

    Posted Tue May 25, 2021 08:17 AM

    (Just launch the script from the DOORS explorer instead of the module ... ?

    Have fun !)





    #DOORS
    #EngineeringRequirementsManagement
    #Sustainability
    #SupportMigration
    #Support


  • 3.  RE: How to Make DXL Recognize that User Has Selected a Different Module?

    Posted Tue May 25, 2021 03:23 PM

    Thank you for the suggestion, but it didn't work. When I launched the DXL from the DOORS explorer and then selected an object in a module, when the DXL reached the point where it had to assign "current" to a module, the value of "current" came back null.





    #DOORS
    #EngineeringRequirementsManagement
    #Support
    #Sustainability
    #SupportMigration


  • 4.  RE: How to Make DXL Recognize that User Has Selected a Different Module?

    Posted Mon May 31, 2021 01:31 PM
    I did not take the time to test the last time, sorry about that ... This time, I will explain the method that I personally use during my developments. First of all, in the directory DOOORS>your version>lib>dxl>startupfiles, add a dxl file containing 3 triggers in order to deal with object synchronisation, module opening and module closing. In my case, those triggers are updating 2 variables m_toolbox and o_toolbox in order to follow the 'really' currents module and object instead of the 'current' idea followed by DOORS. I'm not spending time on this because it's well documented ... but feel free to ask more ints if you need. So i can use m_toolbox and o_toolbox variables in all my scripts to follow the current selection. Now let's talk about your concern: use this selection in your script! I personnaly deal with it using timer ... Here after an example to do it. // ------------------------------------------ // - globals DB main DBE info DBE stimer Object agent_obj = null Module agent_module = null bool need_to_update = false // - zone info string mod_(){ return (null agent_module)?"No current Module":name(agent_module) "" } string obj_(){ return (null agent_obj)?"No current Object":agent_obj."absolute number""" } void update_info(string msg){ if (null msg) return set(info, msg"") } // - deal with timer void do_nothing(){ /* literally ... */ } void start_work (DBE x) { update_info "start timer\n"; startTimer stimer } void pause_work (DBE x) { update_info "stop timer\n"; stopTimer stimer } void do_timer_things(DBE x) { string msg = "" if (m_toolbox != agent_module) { if (o_toolbox != agent_obj){ msg = "New Module and Object: " } else { msg = "New module :" } } else { if (o_toolbox != agent_obj) { msg = "New object:" } } agent_obj = o_toolbox agent_module = m_toolbox if ( msg == "") msg = mod_ " -- " obj_ "" else msg = msg ":" mod_ " -- " obj_ "" update_info(msg) } // - build an gui to see what's going on here ... main = topMost "do what you want in DXL ..." info = label(main, "") // timer to 100 ms stimer = timer(main, 0.1, do_timer_things, "tictac") void do_close(DB x){ pause_work(null DBE); hide x; destroy x } close(main, false, do_close) void start_timer(DB x){ start_work(null DBE) } void stop_timer(DB x) { pause_work(null DBE) } apply(main, "survey selection on", start_timer) apply(main, "survey selection off", stop_timer) realize(main){ setSize(main, 400, 160) } show(main) // ------------------------------------------ Have fun ! :)





    #Support
    #Sustainability
    #DOORS
    #SupportMigration
    #EngineeringRequirementsManagement