Skip to content
Snippets Groups Projects
Commit 1383ec70 authored by Sören Münker's avatar Sören Münker
Browse files

Merge branch 'experiments' into 'master'

Experiments

See merge request soeren.muenker/AssemblyTiersNET!2
parents 8a1bf705 56e3994c
Branches
No related tags found
1 merge request!2Experiments
...@@ -15,8 +15,10 @@ Public Class AndOrDataExtraction ...@@ -15,8 +15,10 @@ Public Class AndOrDataExtraction
Public bGenerateANDOR As Boolean Public bGenerateANDOR As Boolean
Public bAutomaticStep As Boolean Public bAutomaticStep As Boolean
Public iBoundingBoxCode As Integer Public iBoundingBoxCode As Integer
Public intStep As Integer Public intStep As Double
Public dCollSens As Double Public dCollSens As Double
Public t_liaison As Double
Public t_mw As Double
Public xlsPath As String Public xlsPath As String
Public xlsFileName As String Public xlsFileName As String
Public cAllProducts As New ArrayList Public cAllProducts As New ArrayList
...@@ -40,14 +42,14 @@ Public Class AndOrDataExtraction ...@@ -40,14 +42,14 @@ Public Class AndOrDataExtraction
Sub CatMain() Sub CatMain()
'Test parameters 'Test parameters
iBoundingBoxCode = 1 iBoundingBoxCode = 2
bBoundingBoxProjectionCheck = True bBoundingBoxProjectionCheck = True
bGenerateANDOR = False bGenerateANDOR = False
bAutomaticStep = True bAutomaticStep = False
intStep = 13 intStep = 2
dCollSens = 1 dCollSens = 1
xlsPath = "D:\mikep\Files\RWTH\Master Produktionstechnik\Masterarbeit\Experimente\Protocols\" xlsPath = "D:\03_Dissertation\20_Tools\CATIA_NET\ProgData\"
xlsFileName = "UglyStikRC" xlsFileName = "ex_rq1_5_shear_mold"
CATIA = GetObject(, "CATIA.Application") CATIA = GetObject(, "CATIA.Application")
If CATIA Is Nothing Then CATIA = CreateObject("CATIA.Application") If CATIA Is Nothing Then CATIA = CreateObject("CATIA.Application")
...@@ -78,6 +80,53 @@ Public Class AndOrDataExtraction ...@@ -78,6 +80,53 @@ Public Class AndOrDataExtraction
Debug.Print("AND/OR edges: " + CStr(numEdges)) Debug.Print("AND/OR edges: " + CStr(numEdges))
End If End If
SaveMetaDataToExcel_MW()
End Sub
Sub SaveMetaDataToExcel_MW()
'Use Excel
Dim oExcel As Microsoft.Office.Interop.Excel.Application
oExcel = CreateObject("Excel.Application")
oExcel.Visible = True
oExcel.Workbooks.Add()
oExcel.ActiveWorkbook.Sheets.Add.Name = "meta_data_mw"
Dim objSheet_m As Object
objSheet_m = oExcel.ActiveWorkbook.Worksheets(1)
'Output Metadata
objSheet_m.Cells(1, 1).Value = "n_parts"
objSheet_m.Cells(1, 2).Value = cAllProducts.Count
objSheet_m.Cells(2, 1).Value = "bb_projection_check"
objSheet_m.Cells(2, 2).Value = bBoundingBoxProjectionCheck
objSheet_m.Cells(3, 1).Value = "bounding_box_code_type"
objSheet_m.Cells(3, 2).Value = iBoundingBoxCode
objSheet_m.Cells(4, 1).Value = "auto_step"
objSheet_m.Cells(4, 2).Value = bAutomaticStep
objSheet_m.Cells(5, 1).Value = "step_size"
objSheet_m.Cells(5, 2).Value = intStep
objSheet_m.Cells(6, 1).Value = "step_size_sensitivity"
objSheet_m.Cells(6, 2).Value = dCollSens
objSheet_m.Cells(7, 1).Value = "t_liaison"
objSheet_m.Cells(7, 2).Value = t_liaison
objSheet_m.Cells(8, 1).Value = "t_mw"
objSheet_m.Cells(8, 2).Value = t_mw
'Save and close excel workbook
oExcel.ActiveWorkbook.SaveAs(Filename:=xlsPath & xlsFileName & "_meta_data_mw.xlsx")
oExcel.ActiveWorkbook.Close(SaveChanges:=True)
'close the excel application
oExcel.Quit()
ReleaseObject(oExcel)
End Sub End Sub
Sub AndOrGraph(prod As List(Of Integer), nodes As List(Of List(Of Integer))) Sub AndOrGraph(prod As List(Of Integer), nodes As List(Of List(Of Integer)))
...@@ -481,6 +530,7 @@ Public Class AndOrDataExtraction ...@@ -481,6 +530,7 @@ Public Class AndOrDataExtraction
Dim MillisecondsElapsed As Double Dim MillisecondsElapsed As Double
MillisecondsElapsed = (Now - MovingWedgeStartTime).TotalMilliseconds MillisecondsElapsed = (Now - MovingWedgeStartTime).TotalMilliseconds
SecondsElapsed = Math.Round(MillisecondsElapsed / 1000.0, 2) SecondsElapsed = Math.Round(MillisecondsElapsed / 1000.0, 2)
t_mw = SecondsElapsed
MsgBox("Moving wedge extraction took " & CStr(SecondsElapsed) & " seconds") MsgBox("Moving wedge extraction took " & CStr(SecondsElapsed) & " seconds")
'Use Excel 'Use Excel
...@@ -596,6 +646,7 @@ Public Class AndOrDataExtraction ...@@ -596,6 +646,7 @@ Public Class AndOrDataExtraction
Dim MillisecondsElapsed As Double Dim MillisecondsElapsed As Double
MillisecondsElapsed = (Now - LiaisonStartTime).TotalMilliseconds MillisecondsElapsed = (Now - LiaisonStartTime).TotalMilliseconds
SecondsElapsed = Math.Round(MillisecondsElapsed / 1000.0, 2) SecondsElapsed = Math.Round(MillisecondsElapsed / 1000.0, 2)
t_liaison = SecondsElapsed
MsgBox("Liaison graph extraction took " & CStr(SecondsElapsed) & " seconds") MsgBox("Liaison graph extraction took " & CStr(SecondsElapsed) & " seconds")
'Save and close excel workbook 'Save and close excel workbook
......
This diff is collapsed.
This diff is collapsed.
...@@ -74,8 +74,7 @@ ...@@ -74,8 +74,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AndOrDataExtraction.vb" /> <Compile Include="AndOrDataExtraction.vb" />
<Compile Include="AssemblyTiers2.vb" /> <Compile Include="AssemblyTiers2.vb">
<Compile Include="AssemblyTiers3.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Form1.vb"> <Compile Include="Form1.vb">
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment