控件rstray优化,减少对UI层的依赖

master
lhiven 2 years ago
parent 12072ee6df
commit c609d1e59f

@ -38,6 +38,10 @@
<Reference Include="HWindow_Tool"> <Reference Include="HWindow_Tool">
<HintPath>C:\Users\Administrator\Desktop\1\bin\Debug\HWindow_Tool.dll</HintPath> <HintPath>C:\Users\Administrator\Desktop\1\bin\Debug\HWindow_Tool.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Users\Administrator\Desktop\新建文件夹 (3)\Rs.MotionPlat\Rs.Framework\bin\Debug\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />

@ -32,6 +32,7 @@ namespace Rs.Controls
public partial class RsTray : UserControl public partial class RsTray : UserControl
{ {
public string RecipeName { get; set; } = "default";
private int CurrentSlot { get; set; } = 1; private int CurrentSlot { get; set; } = 1;
private TrayInfo trayInfo; private TrayInfo trayInfo;
@ -255,7 +256,7 @@ namespace Rs.Controls
public void Init() public void Init()
{ {
trayInfo = new TrayInfo(SortDir, RowNum, ColumnNum, ItemName); trayInfo = new TrayInfo(SortDir, RowNum, ColumnNum, ItemName);
trayInfo = trayInfo.Init(); trayInfo = trayInfo.Init(RecipeName);
} }
public bool Save() public bool Save()
@ -703,7 +704,7 @@ namespace Rs.Controls
} }
} }
} }
string dirPath = Path.Combine(GlobalVar.Instance.RecipeDir, ItemName); string dirPath = Path.Combine(rsTray.RecipeName, ItemName);
if (!Directory.Exists(dirPath)) if (!Directory.Exists(dirPath))
{ {
Directory.CreateDirectory(dirPath); Directory.CreateDirectory(dirPath);
@ -718,9 +719,9 @@ namespace Rs.Controls
} }
public TrayInfo Init() public TrayInfo Init(string recipeName)
{ {
string dirPath = Path.Combine(GlobalVar.Instance.RecipeDir, ItemName); string dirPath = Path.Combine(recipeName, ItemName);
if (!Directory.Exists(dirPath)) if (!Directory.Exists(dirPath))
{ {
Directory.CreateDirectory(dirPath); Directory.CreateDirectory(dirPath);

@ -89,7 +89,9 @@
<Compile Include="Commom\GlobalTray.cs" /> <Compile Include="Commom\GlobalTray.cs" />
<Compile Include="Commom\GlobalUser.cs" /> <Compile Include="Commom\GlobalUser.cs" />
<Compile Include="Commom\GlobalVar.cs" /> <Compile Include="Commom\GlobalVar.cs" />
<Compile Include="Commom\IoEntitys.cs" />
<Compile Include="Commom\NozzleCollection.cs" /> <Compile Include="Commom\NozzleCollection.cs" />
<Compile Include="Commom\Ops.cs" />
<Compile Include="Commom\Scheduling.cs" /> <Compile Include="Commom\Scheduling.cs" />
<Compile Include="Commom\VacManager.cs" /> <Compile Include="Commom\VacManager.cs" />
<Compile Include="Commom\VisionProcess.cs" /> <Compile Include="Commom\VisionProcess.cs" />
@ -138,11 +140,11 @@
<Compile Include="FormMain.Designer.cs"> <Compile Include="FormMain.Designer.cs">
<DependentUpon>FormMain.cs</DependentUpon> <DependentUpon>FormMain.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Home2.cs"> <Compile Include="Home.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Home2.Designer.cs"> <Compile Include="Home.Designer.cs">
<DependentUpon>Home2.cs</DependentUpon> <DependentUpon>Home.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="MonitorConfig.cs"> <Compile Include="MonitorConfig.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
@ -251,8 +253,8 @@
<EmbeddedResource Include="FormMain.resx"> <EmbeddedResource Include="FormMain.resx">
<DependentUpon>FormMain.cs</DependentUpon> <DependentUpon>FormMain.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Home2.resx"> <EmbeddedResource Include="Home.resx">
<DependentUpon>Home2.cs</DependentUpon> <DependentUpon>Home.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="MonitorConfig.resx"> <EmbeddedResource Include="MonitorConfig.resx">
<DependentUpon>MonitorConfig.cs</DependentUpon> <DependentUpon>MonitorConfig.cs</DependentUpon>

Loading…
Cancel
Save