Exemple #1
0
        public async Task AddTemplateButton(EventTokenButton token)
        {
            try
            {
                // Show Dialog
                var td = new TemplateDialog
                {
                    AccentColor = (new ColorUtil.HSV((float)MathUtil.Rand() * 360, 1.0f, 1.0f)).ToColor(),
                };
                Hot.KeybordShortcutDisabledFlags["AddTemplate"] = true;
                var res = await td.ShowAsync();

                if (res == ContentDialogResult.Primary)
                {
                    AddTemplateChip(td.TemplateName, td.AccentColor, td.TemplateRemarks);
                    LOG.AddMes(LLV.INF, new LogAccessor.Image {
                        Key = "Lump16"
                    }, "FeatureJitTemplatePanel-CannotUndo");
                }
            }
            finally
            {
                Hot.KeybordShortcutDisabledFlags["AddTemplate"] = false;
            }
        }
Exemple #2
0
 /// <summary>
 /// check true
 /// </summary>
 /// <param name="condition"></param>
 /// <param name="extendDesign">NG時のログに表示するアイコンなど</param>
 /// <param name="meskey"></param>
 /// <param name="param"></param>
 public static void IsTrue(bool condition, LogAccessor.ExtendDesign extendDesign, string meskey, params object[] param)
 {
     if (condition == false)
     {
         LOG.AddMes(LLV.Auto, extendDesign, meskey, param);
         throw new TestFailureException("Boolean check error");
     }
 }
Exemple #3
0
 /// <summary>
 /// check same a with b
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="a"></param>
 /// <param name="b"></param>
 /// <param name="meskey"></param>
 /// <param name="param"></param>
 public static void AreEqual <T>(T a, T b, string meskey, params object[] param)
 {
     if (a.Equals(b) == false)
     {
         LOG.AddMes(LLV.Auto, meskey, param);
         throw new TestFailureException(string.Format("Not Equals {0} to {1}", a.ToString(), b.ToString()));
     }
 }
Exemple #4
0
 public void Start(EventTokenButton token)
 {
     Mes.ChangeLanguage(LanguageCode);
     if (IsMute == false)
     {
         LOG.AddMes(LLV.WAR, "RestartForLanguage").Solo();
     }
     Redraw();
 }
Exemple #5
0
        public MainPage()
        {
            this.InitializeComponent();

            var ver = Windows.ApplicationModel.Package.Current.Id.Version;

            LOG.AddMes(LLV.INF, new LogAccessor.Image {
                Key = "Lump16"
            }, "Start-Welcome", $"{ver.Build}.{ver.Major}.{ver.Minor}.{ver.Revision}", DateTime.Now.Year);
        }
Exemple #6
0
        public void Redo(EventTokenButton token)
        {
            if (Hot.ActiveTemplate.UndoRedoCurrenttPointer > Hot.ActiveTemplate.RedoStream.Count - 1)
            {
                LOG.AddMes(LLV.WAR, "FeatureUndoRedo-NoRedo").Solo();
                return;
            }

            Hot.ActiveTemplate.UndoRedoRequestedPointer++;
            QueueConsumptionTask(null);
        }
Exemple #7
0
        public MainPage()
        {
            InitializeComponent();

            // GUI Default
            GuiView.ZoomX = 20;
            GuiView.ZoomY = 20;

            // Welcome message
            var ver = Windows.ApplicationModel.Package.Current.Id.Version;

            LOG.AddMes(LLV.INF, "Start-Welcome", $"{ver.Build}.{ver.Major}.{ver.Minor}.{ver.Revision}", DateTime.Now.Year);
            LOG.AddMes(LLV.INF, new LogAccessor.Image {
                Key = "Lump16"
            }, "Start-Quickhelp");
        }
Exemple #8
0
        public async Task Open(EventTokenButton token)
        {
            var fd = new FileOpenPicker
            {
                SuggestedStartLocation = PickerLocationId.DocumentsLibrary,
            };
            var last = ConfigUtil.Get("LastStudyFilePath", string.Empty);

            fd.FileTypeFilter.Add(".jmt");
            var file = await fd.PickSingleFileAsync();

            await LoadFromJson(file, token);

            LOG.AddMes(LLV.INF, "FeatureOpenStudy-LoadCompletely", file.Name, file.Path);
            ControlUtil.SetTitleText(file.Name);
            Cold.StudyFilePath = file.Path;
            ConfigUtil.Set("LastStudyFilePath", Cold.StudyFilePath);
        }
Exemple #9
0
        public async Task Save(EventTokenButton token)
        {
            var fd = new FileSavePicker
            {
                DefaultFileExtension = ".jmt",
                SuggestedFileName    = Cold.StudyFilePath != null?Path.GetFileName(Cold.StudyFilePath) : $"Jit Model {(DateTime.Now.ToString("yyyyMMdd-HHmmss"))}",
            };

            fd.FileTypeChoices.Add("Jit Stream Designer", new List <string>()
            {
                ".jmt", ".json", ".txt"
            });
            var file = await fd.PickSaveFileAsync();

            await WriteAsJson(file);

            LOG.AddMes(LLV.INF, "FeatureSaveStudy-SaveCompletely", file.Name, file.Path);
            ControlUtil.SetTitleText(file.Name);
            Cold.StudyFilePath = file.Path;
            ConfigUtil.Set("LastStudyFilePath", Cold.StudyFilePath);
        }
Exemple #10
0
 /// <summary>
 /// check false
 /// </summary>
 /// <param name="condition"></param>
 /// <param name="meskey"></param>
 /// <param name="mesver"></param>
 /// <param name="param"></param>
 public static void IsFalse(bool condition, string meskey, params object[] param)
 {
     LOG.AddMes(LLV.Auto, meskey, param);
     IsTrue(!condition, meskey, param);
 }