<div dir="ltr">Hi all,<div><br></div><div>It's been a while, since I posted my previous query on the forum. However, I have not yet received any response to it. I'm quite stuck with this for the past week or so.</div><div><br></div><div>Could you please help me out?</div><div><br></div><div>Adhitya</div><img src="http://t.sidekickopen35.com/e1t/o/5/f18dQhb0S7ks8dDMPbW2n0x6l2B9gXrN7sKj6v5dcLjN3MqgLHQZqYPVRbxVd3LvrVvW5QwNNf1k1H6H0?si=5806921825386496&pi=ec667ab4-124b-4fee-c1d3-35e66e87890d" style="display:none!important" height="1" width="1"></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 12, 2016 at 10:41 PM, adhitya <span dir="ltr"><<a href="mailto:adhitya07@gmail.com" target="_blank">adhitya07@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div dir="ltr"><div>Hi,</div><div><br></div><div>Thank you for your response. I will definitely go through the links that you have provided for a better understanding.</div><div><br></div><div>---- 1 ----</div><div><br></div><div>As a part of my reverse engineering process, I have started from the point where Xcos application is invoked, when the button is pressed in the MenuBar.</div><div><br></div><div>The flow of files that I have gone through, after the button has been pressed, is the following:  </div><div><br></div><div>- main_menubar.xml</div><div>- MenuBarBuilder.java</div><div>- GraphicController.java</div><div>- GraphicObject.java</div><div>- CallBack.java</div><div>- CommonCallBack.java</div><div>- ScilabCallBack.java</div><div>- InterpreterManagement.java</div><div>- InterpreterManagementJNI.java</div><div>- StoreCommand.cpp</div><div>- ThreadManagement.cpp</div><div><br></div><div><br></div><div>In the file named StoreCommand.cpp, the following function is invoked - (<a href="https://github.com/opencollab/scilab/blob/9cc3c2b45eec49626d82b496a80117b048745836/scilab/modules/core/src/cpp/storeCommand.cpp#L76" rel="nofollow" link="external" target="_blank">https://github.com/opencollab/scilab/blob/9cc3c2b45eec49626d82b496a80117b048745836/scilab/modules/core/src/cpp/storeCommand.cpp#L76</a>)</div><div><br></div><div>int StoreCommand(char *command)</div><div>{</div><div>    ThreadManagement::LockStoreCommand();</div><div>    commandQueue.emplace_back(os_strdup(command),</div><div>                              /*is prioritary*/ 0,</div><div>                              /* is interruptible*/ 1,</div><div>                              /* cmd origin */ NONE);</div><div><br></div><div>    ThreadManagement::UnlockStoreCommand();</div><div>    // Awake Scilab to execute a new command</div><div>    ThreadManagement::SendCommandStoredSignal();</div><div><br></div><div>    return 0;</div><div>}</div><div><br></div><div>In this function calls are further made to - <a href="https://github.com/opencollab/scilab/blob/9cc3c2b45eec49626d82b496a80117b048745836/scilab/modules/ast/src/cpp/system_env/threadmanagement.cpp#L110" rel="nofollow" link="external" target="_blank">https://github.com/opencollab/scilab/blob/9cc3c2b45eec49626d82b496a80117b048745836/scilab/modules/ast/src/cpp/system_env/threadmanagement.cpp#L110</a></div><div><br></div><div>void ThreadManagement::LockStoreCommand(void)</div><div>{</div><div>#ifdef DEBUG_THREAD</div><div>    PrintDebug("LockStoreCommand");</div><div>#endif // DEBUG_THREAD</div><div>    __Lock(&m_StoreCommandLock);</div><div>}</div><div><br></div><div>void ThreadManagement::UnlockStoreCommand(void)</div><div>{</div><div>#ifdef DEBUG_THREAD</div><div>    PrintDebug("UnlockStoreCommand");</div><div>#endif // DEBUG_THREAD</div><div>    __UnLock(&m_StoreCommandLock);</div><div>}</div><div>    </div><div>I'm unable to understand the Lock and Unlock mechanisms that are used in this function. What happens before/during/after Lock and Unlock? Would you have any documentation for this part?</div><div><br></div><div>If possible, could you explain the StoreCommand() function? I see that all incoming commands are en-queued in the commandQueue, to be processed one by one. But where in the code, is the command getting de-queued for parsing?</div><div><br></div><div>---- 2 ----</div><div><br></div><div>The command that is given in /etc/main_menubar.xml for opening Xcos is</div><div><br></div><div>if with_mode ('xcos') then xcos();</div><div>else disp(gettext('Please install xcos module'))</div><div><br></div><div>Would it be possible for you to point where xcos() is invoked after interpretation and parsing?</div><div><br></div><div>Hypothetically for instance, if I were to create a new method in Java, so that I can see the Block Diagram Editor, like this - </div><div><br></div><div>public static void main (String args[]){</div><div>    Xcos xcos = new Xcos(); //Assuming I can write something like this</div><div>}</div><div><br></div><div>If this is possible, I would like to know, which is that particular 'XCos' Class that can allow me to do this?</div><div><br></div><div>Do let me know, if any of my questions are vague or unclear.</div><div><br></div><div>Thanks,</div><div><br></div><div>Adhitya</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Mon, Feb 1, 2016 at 1:02 PM, Clément David-2 [via Scilab / Xcos - Mailing Lists Archives] <span dir="ltr"><<a href="http:///user/SendEmail.jtp?type=node&node=4033448&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>></span> wrote:<br></div></div><blockquote style="border-left:2px solid #cccccc;padding:0 1em" class="gmail_quote"><div><div class="h5"><span>

        Hi Adhitya,
<br><br>The code is *the* reference but for more internal views I suggest you to read these documents :
<br><br>* R. NIKOUKHAH AND S. STEER , Scicos a dynamic system builder and simulator, IEEE INTERNATIONAL
<br>CONFERENCE ON CACSD, DEARBORN , MICHIGAN , 1996.
<br>* S. STEER , R. NIKOUKHAH , Scicos: a hybrid system formalism, ESS’99, E RLANGEN , GERMANY , 1999.
<br>* Masoud NAJAFI thesis , The Numerical Solver for the Simulation of the Hybrid Dynamical Systems
<br>, 2005 .
<br><br>And for understanding what's behind each block, take a look at the Scilab documentation, and
<br>ScilabTec presentations.
<br><br>Regards,
<br><br>--
<br>Clément
<br><br><br>Le vendredi 29 janvier 2016 à 23:31 -0700, adhitya a écrit :
</span></div></div><div><div><div class="h5"><span><div><br>> Hi,
<br>> 
<br>> My name is Adhitya Kamakshidasan and I'm an Intern at FOSSEE, IIT Bombay. 
<br>> 
<br>> We are trying to develop a standalone version of Xcos, that is completely
<br>> web-based.
<br>> 
<br>> I would like to know if there is any documentation with respect to how Xcos
<br>> has been written - Flowcharts, Main methods, PDF's, etc.
<br>> 
<br>> Currently, I'm trying to reverse-engineer the code, by slowly moving through
<br>> the code, and removing the parts that are not related to Xcos. However, this
<br>> is taking a lot of time.
<br>> 
<br>> We would like your support in this regard.
<br>> 
<br>> Thanks,
<br>> 
<br>> Adhitya Kamakshidasan
<br>> 
<br>> 
<br>> 
<br>> --
<br>> View this message in context: <a href="http://mailinglists.scilab.org/Documentation-for-Xcos-tp4033357.html" rel="nofollow" link="external" target="_blank">http://mailinglists.scilab.org/Documentation-for-Xcos-tp4033357.html</a><br>> Sent from the Scilab developers - Mailing Lists Archives mailing list archive at Nabble.com.
<br>> _______________________________________________
<br>> dev mailing list
</div></span></div></div>> <a href="http:///user/SendEmail.jtp?type=node&node=4033359&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br>> <a href="http://lists.scilab.org/mailman/listinfo/dev" rel="nofollow" link="external" target="_blank">http://lists.scilab.org/mailman/listinfo/dev</a></div>_______________________________________________
<br>dev mailing list
<br><span class=""><a href="http:///user/SendEmail.jtp?type=node&node=4033359&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="http://lists.scilab.org/mailman/listinfo/dev" rel="nofollow" link="external" target="_blank">http://lists.scilab.org/mailman/listinfo/dev</a><br>

        
        
        
        <br>
        <br>
        <hr noshade size="1" color="#cccccc">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://mailinglists.scilab.org/Documentation-for-Xcos-tp4033357p4033359.html" rel="nofollow" link="external" target="_blank">http://mailinglists.scilab.org/Documentation-for-Xcos-tp4033357p4033359.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from Documentation for Xcos, <a rel="nofollow" link="external">click here</a>.<br>
                <a href="http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" link="external" target="_blank">NAML</a>
        </div></span></blockquote></div><br></div>


        
        
        
<br><hr align="left" width="300">
View this message in context: <a href="http://mailinglists.scilab.org/Documentation-for-Xcos-tp4033357p4033448.html" target="_blank">Re: Documentation for Xcos</a><div class="HOEnZb"><div class="h5"><br>
Sent from the <a href="http://mailinglists.scilab.org/Scilab-developers-Mailing-Lists-Archives-f2574944.html" target="_blank">Scilab developers - Mailing Lists Archives mailing list archive</a> at Nabble.com.<br></div></div><br>_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@lists.scilab.org">dev@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/dev" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/dev</a><br>
<br></blockquote></div><br></div>