Exemplo n.º 1
0
 public ProcessComponentFrame(DiagramModel model, TestAppForm appForm)
 {
     _AppForm = appForm;
     _Model   = model;
     Prepare();
     Process();
 }
 private string GetXmlFileNameFor(DiagramModel model)
 {
     string lastMatchingLine = null;
     string mappingFileName = GetMappingFileName ();
     if (File.Exists (mappingFileName))
     {
         using (StreamReader sr = File.OpenText (mappingFileName))
         {
             while (sr.Peek () != -1)
             {
                 string line = sr.ReadLine ();
                 if (line.StartsWith (model.Header.ModelGuid))
                 {
                     lastMatchingLine = line;
                 }
             }
         }
     }
     if (lastMatchingLine != null)
     {
         string[] strList = lastMatchingLine.Split (',');
         System.Diagnostics.Debug.Assert (strList.Length == 4);
         string fileName = strList [1];
         return fileName;
     }
     return model.Header.Name;
 }
        private string GetXmlFileNameFor(DiagramModel model)
        {
            string lastMatchingLine = null;
            string mappingFileName  = GetMappingFileName();

            if (File.Exists(mappingFileName))
            {
                using (StreamReader sr = File.OpenText(mappingFileName))
                {
                    while (sr.Peek() != -1)
                    {
                        string line = sr.ReadLine();
                        if (line.StartsWith(model.Header.ModelGuid))
                        {
                            lastMatchingLine = line;
                        }
                    }
                }
            }
            if (lastMatchingLine != null)
            {
                string[] strList = lastMatchingLine.Split(',');
                System.Diagnostics.Debug.Assert(strList.Length == 4);
                string fileName = strList [1];
                return(fileName);
            }
            return(model.Header.Name);
        }
 public ProcessComponentFrame(DiagramModel model, TestAppForm appForm)
 {
     _AppForm = appForm;
     _Model = model;
     Prepare ();
     Process ();
 }
 protected void SaveCodeFileMapping(DiagramModel model, string codeFileName)
 {
     using (StreamWriter sw = File.AppendText (GetMappingFileName ()))
     {
         sw.WriteLine ("{0}, {1}, {2}, {3}", model.Header.ModelGuid, codeFileName, model.Header.Name, DateTime.Now);
     }
 }
 protected void SaveXmlFileMapping(DiagramModel model, string xmlFileName)
 {
     using (StreamWriter sw = File.AppendText(GetMappingFileName()))
     {
         sw.WriteLine("{0}, {1}, {2}, {3}", model.Header.ModelGuid, xmlFileName, model.Header.Name, DateTime.Now);
     }
 }
Exemplo n.º 7
0
 public ConvertToCode(DiagramModel model, bool signalAsEnum)
     : base(model.GetGlyphsList ())
 {
     _Model = model;
     _Header = model.Header;
     _SignalAsEnum = signalAsEnum;
 }
Exemplo n.º 8
0
        protected void ClearModel_i()
        {
            DoModelCleared();

            _InteractionHandler = null;
            _Model        = new DiagramModel();
            _LastFileName = null;
            SelectMoveInteractor();
        }
Exemplo n.º 9
0
 public CompilerResults Compile(DiagramModel model)
 {
     ConvertToCode convert = new ConvertToCode (model, false);
     string code = convert.Convert ();
     Type loggingUtilType = typeof (LoggingUserBase);
     Type qf4netType = typeof (qf4net.QHsm);
     Type qfExtensionsType = typeof (qf4net.LQHsm);
     CompilerResults results = Compile (code, new Type[] {loggingUtilType, qf4netType, qfExtensionsType});
     return results;
 }
Exemplo n.º 10
0
        public CompilerResults Compile(DiagramModel model)
        {
            ConvertToCode   convert          = new ConvertToCode(model, false);
            string          code             = convert.Convert();
            Type            loggingUtilType  = typeof(LoggingUserBase);
            Type            qf4netType       = typeof(qf4net.QHsm);
            Type            qfExtensionsType = typeof(qf4net.LQHsm);
            CompilerResults results          = Compile(code, new Type[] { loggingUtilType, qf4netType, qfExtensionsType });

            return(results);
        }
Exemplo n.º 11
0
        public override void Execute()
        {
            LoadGlyphDataFile loadFile = new LoadGlyphDataFile();

            loadFile.Load(_FileName);
            DiagramModel model = new DiagramModel(loadFile.Header, loadFile.Glyphs);

            Context.ReplaceModel(model);
            Context.LastFileName = _FileName;

            Context.RefreshView();
        }
 public void SetMachineModel(DiagramModel model, TestAppForm appForm)
 {
     CodeCompiler compiler = new CodeCompiler ();
     System.CodeDom.Compiler.CompilerResults results = compiler.Compile (model);
     if (!results.Errors.HasErrors)
     {
         string typeName = model.Header.NameSpace + "." + model.Header.Name;
         Type type = results.CompiledAssembly.GetType (typeName);
         qf4net.ILQHsm hsm = HsmUtil.CreateHsm (type);
         Controller.Execute (hsm);
     }
     else
     {
         foreach (string msg in results.Output)
         {
             appForm.Log (Color.Red, msg + "\n");
         }
     }
 }
Exemplo n.º 13
0
        public void SetMachineModel(DiagramModel model, TestAppForm appForm)
        {
            CodeCompiler compiler = new CodeCompiler();

            System.CodeDom.Compiler.CompilerResults results = compiler.Compile(model);
            if (!results.Errors.HasErrors)
            {
                string        typeName = model.Header.NameSpace + "." + model.Header.Name;
                Type          type     = results.CompiledAssembly.GetType(typeName);
                qf4net.ILQHsm hsm      = HsmUtil.CreateHsm(type);
                Controller.Execute(hsm);
            }
            else
            {
                foreach (string msg in results.Output)
                {
                    appForm.Log(Color.Red, msg + "\n");
                }
            }
        }
 public ExecuteHsmCommand(DiagramModel model, IUIInterationContext context, string lastFileName)
 {
     _Model = model;
     _Context = context;
     _LastFileName = lastFileName;
 }
Exemplo n.º 15
0
		public QHsmExecutionController(DiagramModel model)
			: base (model.GetGlyphsList ())
		{
		}
 public void ClearModel()
 {
     if (AppForm () != null)
     {
         AppForm ().ClearExecutionModelTabs ();
     }
     _InteractionHandler = null;
     _Model = new DiagramModel ();
     _LastFileName = null;
     SelectMoveInteractor ();
 }
Exemplo n.º 17
0
 public ConvertToXml(DiagramModel model)
     : base(model.GetGlyphsList ())
 {
 }
Exemplo n.º 18
0
 public void ReplaceModel(DiagramModel model)
 {
     _Model = model;
 }
Exemplo n.º 19
0
 public ExecuteHsmCommand(DiagramModel model, IUIInterationContext context, string lastFileName)
 {
     _Model        = model;
     _Context      = context;
     _LastFileName = lastFileName;
 }
 public SaveGlyphDataFile(DiagramModel model)
 {
     _Model = model;
     _Header = model.Header;
     _Glyphs = model.GetGlyphsList ();
 }
 public QHsmExecutionController(DiagramModel model)
     : base(model.GetGlyphsList ())
 {
 }
 public SaveAsImageCommand(DiagramModel model, IUIInterationContext context, string lastFileName)
 {
     _Model = model;
     _Context = context;
     _LastFileName = lastFileName;
 }
 public void ReplaceModel(DiagramModel model)
 {
     _Model = model;
 }
Exemplo n.º 24
0
 public ConvertToXml(DiagramModel model)
     : base(model.GetGlyphsList())
 {
     _Model = model;
 }
Exemplo n.º 25
0
 public SaveGlyphDataFile(DiagramModel model)
 {
     _Model  = model;
     _Header = model.Header;
     _Glyphs = model.GetGlyphsList();
 }
Exemplo n.º 26
0
 public SaveAsImageCommand(DiagramModel model, IUIInterationContext context, string lastFileName)
 {
     _Model        = model;
     _Context      = context;
     _LastFileName = lastFileName;
 }