Skip to content

Commit

Permalink
Non Real time data provider are missing the call of InitializeDataPro…
Browse files Browse the repository at this point in the history
…vider fix #1556
  • Loading branch information
LiorBanai committed Nov 13, 2022
1 parent 1069960 commit 12dfea2
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 60 deletions.
2 changes: 1 addition & 1 deletion Analogy/Analogy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<OutputType>WinExe</OutputType>
<NeutralLanguage>en-US</NeutralLanguage>
<TargetFrameworks>net48;net471;net7.0-windows;net6.0-windows</TargetFrameworks>
<Version>4.10.0</Version>
<Version>4.10.1</Version>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
Expand Down
1 change: 1 addition & 0 deletions Analogy/CommonChangeLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public static IEnumerable<AnalogyChangeLog> GetChangeLog()
{
return new List<AnalogyChangeLog>
{
new AnalogyChangeLog("V4.10.1 - Non Real time data provider are missing the call of InitializeDataProvider #1556",AnalogChangeLogType.Bug, "Lior Banai", new DateTime(2022, 11, 12)),
new AnalogyChangeLog("V4.10.0 - reverse connect/disconnect icons #1552",AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2022, 11, 11)),
new AnalogyChangeLog("V4.10.0 - Add NET7 Target Framework #1551",AnalogChangeLogType.Improvement, "Lior Banai", new DateTime(2022, 11, 10)),
new AnalogyChangeLog("V4.10.0 - Reduce number of builds due to low usage. #1495", AnalogChangeLogType.Improvement, "Lior Banai",new DateTime(2022, 11, 10)),
Expand Down
23 changes: 14 additions & 9 deletions Analogy/Forms/FluentDesignMainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -812,9 +812,10 @@ private void AddOfflineDataSource(FactoryContainer fc, IAnalogyDataProvidersFact

#region actions

void OpenOffline(string titleOfDataSource, string initialFolder, string[] files = null)
async Task OpenOffline(string titleOfDataSource, string initialFolder, string[] files = null)
{
openedWindows++;
await FactoriesManager.Instance.InitializeIfNeeded(offlineAnalogy);
UserControl offlineUC = new LocalLogFilesUC(offlineAnalogy, files, initialFolder);
var page = dockManager1.AddPanel(DockingStyle.Float);
page.DockedAsTabbedDocument = true;
Expand Down Expand Up @@ -887,7 +888,10 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
specificLocalFolder.Style = ElementStyle.Item;
specificLocalFolder.Text = "Open Pre-defined Folder";
specificLocalFolder.ImageOptions.Image = images?.GetLargeOpenFolderImage(factoryId) ?? Resources.OpenFolder_32x32;
specificLocalFolder.Click += (sender, e) => { OpenOffline(title, specificDirectory); };
specificLocalFolder.Click += async (sender, e) =>
{
await OpenOffline(title, specificDirectory);
};
}

AccordionControlElement recentFolders = new AccordionControlElement { Text = "Recent Folders" };
Expand All @@ -898,7 +902,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
localfolder.Style = ElementStyle.Item;
localfolder.Text = "Open Folder Selection";
localfolder.ImageOptions.Image = images?.GetLargeOpenFolderImage(factoryId) ?? Resources.OpenFolder_32x32;
localfolder.Click += (sender, e) =>
localfolder.Click += async (sender, e) =>
{
using (var folderBrowserDialog = new XtraFolderBrowserDialog { ShowNewFolderButton = false })
{
Expand All @@ -910,7 +914,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
{
if (!string.IsNullOrEmpty(folderBrowserDialog.SelectedPath))
{
OpenOffline(title, folderBrowserDialog.SelectedPath);
await OpenOffline(title, folderBrowserDialog.SelectedPath);
AddRecentFolder(recentFolders, offlineAnalogy, title, folderBrowserDialog.SelectedPath);
}
}
Expand All @@ -935,9 +939,9 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
// args.Contents.Image = realTime.ToolTip.Image;
toolTip.Setup(args);
btn.SuperTip = toolTip;
btn.Click += (s, be) =>
btn.Click += async (s, be) =>
{
OpenOffline(offlineAnalogy.OptionalTitle, path.Path);
await OpenOffline(offlineAnalogy.OptionalTitle, path.Path);
};
}
}
Expand All @@ -955,7 +959,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
acRootGroupHome.Elements.Add(openFiles);
openFiles.Style = ElementStyle.Item;
openFiles.ImageOptions.Image = offlineAnalogy.LargeImage ?? Resources.Article_32x32;
openFiles.Click += (sender, e) =>
openFiles.Click += async (sender, e) =>
{
OpenFileDialog openFileDialog1 = new OpenFileDialog
{
Expand All @@ -965,7 +969,7 @@ void OnXtcLogsOnControlRemoved(object sender, DockPanelEventArgs arg)
};
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
OpenOffline(title, offlineAnalogy.InitialFolderFullPath, openFileDialog1.FileNames);
await OpenOffline(title, offlineAnalogy.InitialFolderFullPath, openFileDialog1.FileNames);
AddRecentFiles(recentfiles, offlineAnalogy, title, openFileDialog1.FileNames.ToList());
}
};
Expand Down Expand Up @@ -1308,8 +1312,9 @@ private void AddSingleDataSources(FactoryContainer fc, IAnalogyDataProvidersFact
singleBtn.SuperTip = toolTip;
}
openedWindows++;
singleBtn.Click += (sender, e) =>
singleBtn.Click += async (sender, e) =>
{
await FactoriesManager.Instance.InitializeIfNeeded(single);
CancellationTokenSource cts = new CancellationTokenSource();
LocalLogFilesUC offlineUC = new LocalLogFilesUC(single, cts);
var page = dockManager1.AddPanel(DockingStyle.Float);
Expand Down
Loading

0 comments on commit 12dfea2

Please sign in to comment.