2013-08-23 2 views
2

this question에서 시작시 MODELICAPATH에 사용자 정의 패키지를 추가 할 수있는 방법을 물었습니다. 그러나 응답에 모호한 점이있었습니다. 답변을 바탕으로, 내가 사용할 수 있습니다Dymola/Modelica의 openModelFile과 openModel 명령의 차이점은 무엇입니까?

openModel("path\to\file.mo") 

또는 내가 모든 경우에, 때 하나 또는 다른을 사용하려면 다음 명령이 어떻게 다른지 알고 싶습니다

openModelFile("Fully.Qualified.Model.Name") 

.

편집 : 대답하면 Modelica 문서에 소스를 제공하십시오. 이 명령을 찾기 위해 문서를 탐색하는 방법조차 모르겠다. 그래서 이것은 아마도 큰 장애물이다.

+0

이러한 명령은 다이 모라에만 해당되므로 질문을 편집하여이를 반영해야합니다 (물론 openmodelica 태그는 없습니다). –

답변

3

차드는 "내장"Dymola에서 명령, 당신은 document(...) 기능을 사용하여 기본적인 문서를 얻을 수 있음을 유의하시기 바랍니다 관련된 질문

는 (분명히, help도 보행자와 elucidate이이었다 너무 허풍 쟁이?). 이 명령은 Dymola의 "Simulation"탭 맨 아래에있는 명령 행에서 호출 할 수 있습니다. 함수 이름의 문자열을 인수로 취합니다. 질문에 대답하려면 :

document("openModel"); 

    function openModel "open a Modelica-file" 
    input String path "File-path to open"; 
    input Boolean mustRead := true "If false we can skip reading the file"; 
    output Boolean result "true if successful"; 

    "Opens a Modelica-file and pops up a window with the model in it" 
    end openModel; 

document("openModelFile"); 

    function openModelFile "open a Modelica-model from a file" 
    input String model "Model to open"; 
    input String path := "" "File-path to open (can be the empty string)"; 
    input String version := "" "Version to open (can be the empty string)"; 
    output Boolean result "true if successful"; 

    "Opens a Modelica-file and pops up a window with the given model in it" 
    end openModelFile; 

슬프게도, 문서가 여기에 차이점을 잘 포착했다고 생각하지 않습니다. 사실, 당신이 그것에 대해 생각할 때 그 이름이 정말로 후방이라고 주장 할 것입니다. openModel파일을 인수로 사용하여 해당 파일에 포함 된 정의를 엽니 다 (일반적으로 package (반드시 그런 것은 아님)). 반면에 openModelFile 모델 이름을 인수로 사용하고 해당 모델을 모델 브라우저에서 엽니 다 (필요한 경우 MODELICAPATH을 검색하여 모델을 찾고 엽니 다).

도움이 되었기를 바랍니다.

+1

완벽! 방금 물고기를 가르쳐 줬어. – Chad

+0

... 내 첫 생선을 제공하는 것 외에도. – Chad

+0

'elucidate()'는 Dymola에서 아무것도하지 않지만'help()'는 추가적인 도움을 얻기위한 작업 명령입니다. 또한이 답변을 참조하십시오 : http://stackoverflow.com/a/17399473 – matth

관련 문제