Skip to content

Commit

Permalink
latest work on HeeksCNC
Browse files Browse the repository at this point in the history
  • Loading branch information
danheeks committed Feb 13, 2014
1 parent 9bf8e34 commit feabb3b
Show file tree
Hide file tree
Showing 18 changed files with 143 additions and 80 deletions.
34 changes: 24 additions & 10 deletions HeeksCNC installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{FE583F3D-8863-438B-AD81-790FD54A7113}
AppName=HeeksCNC
AppVerName=HeeksCNC 0.28.0
AppId={{12E3C404-8533-4A91-BB89-DEA488957F84}
AppName=HeeksCNC030
AppVerName=HeeksCNC 0.30.0
AppPublisher=Heeks Software
AppPublisherURL=http://heeks.net/
AppSupportURL=http://code.google.com/p/heekscnc/
AppUpdatesURL=http://code.google.com/p/heekscnc/
DefaultDirName={pf}\HeeksCNC
DefaultGroupName=HeeksCNC
DefaultDirName={pf}\HeeksCNC030
DefaultGroupName=HeeksCNC030
DisableProgramGroupPage=yes
OutputBaseFilename=HeeksCNC 0.28.0
OutputBaseFilename=HeeksCNC 0.30.0
Compression=lzma
SolidCompression=yes

Expand All @@ -25,6 +25,13 @@ Name: de; MessagesFile: "compiler:Languages\German.isl"
Name: fr; MessagesFile: "compiler:Languages\French.isl"
Name: it; MessagesFile: "compiler:Languages\Italian.isl"

[Dirs]
Name: "{app}\bitmaps"; Permissions: users-modify
Name: "{app}\bitmaps\angle"; Permissions: users-modify
Name: "{app}\icons"; Permissions: users-modify
Name: "{app}\HeeksCNC"; Permissions: users-modify
Name: "{app}\HeeksCNC\nc"; Permissions: users-modify

[Files]
Source: "C:\Dev\HeeksCADSVN\HeeksCAD.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Dev\HeeksCADSVN\bitmaps\*.png"; DestDir: "{app}\bitmaps"; Flags: ignoreversion
Expand Down Expand Up @@ -52,13 +59,20 @@ Source: "C:\Dev\libarea\ClipperRelease\area.pyd"; DestDir: "{app}\HeeksCNC\Clipp
Source: "C:\Dev\HeeksCNCSVN\subdir.manifest"; DestDir: "{app}\HeeksCNC\Clipper"; DestName: "Microsoft.VC90.CRT.manifest"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\ocl_funcs.py"; DestDir: "{app}\HeeksCNC"; Flags: ignoreversion; Permissions: users-modify
Source: "C:\Dev\HeeksCNCSVN\ocl.pyd"; DestDir: "{app}\HeeksCNC"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\depth_params.py"; DestDir: "{app}\HeeksCNC"; Flags: ignoreversion; Permissions: users-modify
Source: "C:\Dev\HeeksCNCSVN\*.speeds"; DestDir: "{app}\HeeksCNC"; Flags: ignoreversion; Permissions: users-modify
Source: "C:\Dev\HeeksCNCSVN\*.tooltable"; DestDir: "{app}\HeeksCNC"; Flags: ignoreversion; Permissions: users-modify
Source: "C:\Dev\HeeksCNCSVN\nc\*.py"; DestDir: "{app}\HeeksCNC\nc"; Flags: ignoreversion; Permissions: users-modify
Source: "C:\Dev\HeeksCNCSVN\nc\*.txt"; DestDir: "{app}\HeeksCNC\nc"; Flags: ignoreversion; Permissions: users-modify
Source: "C:\Dev\HeeksCNCSVN\nc\*.xml"; DestDir: "{app}\HeeksCNC\nc"; Flags: ignoreversion; Permissions: users-modify
Source: "C:\Dev\HeeksCNCSVN\src\Unicode Release\HeeksCNC.dll"; DestDir: "{app}\HeeksCNC"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\bitmaps\*.png"; DestDir: "{app}\HeeksCNC\bitmaps"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\bitmaps\ctool\*.png"; DestDir: "{app}\HeeksCNC\bitmaps\ctool"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\bitmaps\depthop\*.png"; DestDir: "{app}\HeeksCNC\bitmaps\depthop"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\bitmaps\drilling\*.png"; DestDir: "{app}\HeeksCNC\bitmaps\drilling"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\bitmaps\pattern\*.png"; DestDir: "{app}\HeeksCNC\bitmaps\pattern"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\bitmaps\pocket\*.png"; DestDir: "{app}\HeeksCNC\bitmaps\pocket"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\bitmaps\profile\*.png"; DestDir: "{app}\HeeksCNC\bitmaps\profile"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\bitmaps\surface\*.png"; DestDir: "{app}\HeeksCNC\bitmaps\surface"; Flags: ignoreversion
Source: "C:\Dev\HeeksCNCSVN\icons\*.png"; DestDir: "{app}\HeeksCNC\icons"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\redist\x86\Microsoft.VC90.CRT\*"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Program Files (x86)\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\*"; DestDir: "{app}"; Flags: ignoreversion
Expand All @@ -76,13 +90,13 @@ Source: "C:\Program Files (x86)\VoxelCut\wx*.dll"; DestDir: "{app}\HeeksCNC"; Fl
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\HeeksCNC"; Filename: "{app}\HeeksCAD.exe"; WorkingDir: "{app}"; Parameters: "HeeksCNC/HeeksCNC.dll"
Name: "{group}\HeeksCNC030"; Filename: "{app}\HeeksCAD.exe"; WorkingDir: "{app}"; Parameters: "HeeksCNC/HeeksCNC.dll"

[Run]
Filename: "{app}\HeeksCAD.exe"; WorkingDir: "{app}"; Parameters: "HeeksCNC/HeeksCNC.dll"; Description: "{cm:LaunchProgram,HeeksCNC}"; Flags: nowait postinstall skipifsilent

[Registry]
Root: HKCU; Subkey: "Software\HeeksCAD"; Flags: uninsdeletekeyifempty
Root: HKCU; Subkey: "Software\HeeksCNC"; Flags: uninsdeletekeyifempty
Root: HKCU; Subkey: "Software\HeeksCAD030"; Flags: uninsdeletekeyifempty
Root: HKCU; Subkey: "Software\HeeksCNC030"; Flags: uninsdeletekeyifempty


14 changes: 14 additions & 0 deletions kurve_funcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
from nc.nc import *
import area

def set_good_start_point( curve ):
if curve.IsClosed():
# find the longest span and use the middle as the new start point
longest_length = None
mid_point = None
for span in curve.GetSpans():
length = span.Length()
if longest_length == None or length > longest_length:
longest_length = length
mid_point = span.MidParam(0.5)
if mid_point != None:
make_smaller(curve, mid_point)

def make_smaller( curve, start = None, finish = None, end_beyond = False ):
if start != None:
curve.ChangeStart(curve.NearestPoint(start))
Expand Down Expand Up @@ -369,6 +382,7 @@ def profile(curve, direction = "on", radius = 1.0, offset_extra = 0.0, roll_radi
# rapid up to the clearance height
rapid(z = depth_params.clearance_height)

#rapid(z = depth_params.clearance_height)

del offset_curve

Expand Down
22 changes: 0 additions & 22 deletions nc/machines.txt

This file was deleted.

2 changes: 0 additions & 2 deletions nc_read for installer.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
.\python.exe backplot.py %1 %2

#pause
2 changes: 0 additions & 2 deletions post for installer.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
.\python.exe %1

#pause
2 changes: 1 addition & 1 deletion src/CNCConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
class CNCConfig: public wxConfig
{
public:
CNCConfig():wxConfig(wxString(_T("HeeksCNC"))){}
CNCConfig():wxConfig(wxString(_T("HeeksCNC")) + _T(STR_VALUE(HEEKSCAD_VERSION_MAIN)) + _T(STR_VALUE(HEEKSCAD_VERSION_SUB))){}
};
2 changes: 1 addition & 1 deletion src/DepthOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Python CDepthOp::AppendTextToProgram()

python << CSpeedOp::AppendTextToProgram();

python << _T("depth_params = depth_params(");
python << _T("depthparams = depth_params(");
python << _T("float(") << m_depth_op_params.m_clearance_height / theApp.m_program->m_units << _T(")");
python << _T(", float(") << m_depth_op_params.m_rapid_safety_space / theApp.m_program->m_units << _T(")");
python << _T(", float(") << m_depth_op_params.m_start_depth / theApp.m_program->m_units << _T(")");
Expand Down
2 changes: 1 addition & 1 deletion src/Drilling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Python CDrilling::AppendTextToProgram()
<< _T("x=") << p[0]/theApp.m_program->m_units << _T(", ")
<< _T("y=") << p[1]/theApp.m_program->m_units << _T(", ")
<< _T("dwell=") << m_params.m_dwell << _T(", ")
<< _T("depth_params = depth_params, ")
<< _T("depthparams = depthparams, ")
<< _T("retract_mode=") << m_params.m_retract_mode << _T(", ")
<< _T("spindle_mode=") << m_params.m_spindle_mode
<< _T(")\n");
Expand Down
3 changes: 3 additions & 0 deletions src/HeeksCNC VC2008.sln
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Unicode Debug|Win32 = Unicode Debug|Win32
Unicode Release with debug|Win32 = Unicode Release with debug|Win32
Unicode Release|Win32 = Unicode Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BE9260B2-CF4A-413B-87BE-4AD857278689}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32
{BE9260B2-CF4A-413B-87BE-4AD857278689}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32
{BE9260B2-CF4A-413B-87BE-4AD857278689}.Unicode Release with debug|Win32.ActiveCfg = Unicode Release|Win32
{BE9260B2-CF4A-413B-87BE-4AD857278689}.Unicode Release with debug|Win32.Build.0 = Unicode Release|Win32
{BE9260B2-CF4A-413B-87BE-4AD857278689}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32
{BE9260B2-CF4A-413B-87BE-4AD857278689}.Unicode Release|Win32.Build.0 = Unicode Release|Win32
EndGlobalSection
Expand Down
4 changes: 2 additions & 2 deletions src/HeeksCNC VC2008.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
ObjectFile=".\vc_msw\"
ProgramDataBaseFileName="vc_msw\HeeksCNC.pdb"
WarningLevel="3"
DebugInformationFormat="3"
DebugInformationFormat="0"
CompileAs="0"
/>
<Tool
Expand All @@ -315,7 +315,7 @@
OutputFile="$(OutDir)\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories="&quot;$(WXWIN)\lib\vc_dll&quot;;&quot;$(CASROOT)\win32\vc8\lib&quot;"
GenerateDebugInformation="true"
GenerateDebugInformation="false"
SubSystem="2"
OptimizeReferences="0"
EnableCOMDATFolding="0"
Expand Down
79 changes: 76 additions & 3 deletions src/HeeksCNC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static void GetSketches(std::list<int>& sketches, std::list<int> &tools )
}
}

static void NewProfileOpMenuCallback(wxCommandEvent &event)
static void NewProfileOp()
{
std::list<int> tools;
std::list<int> sketches;
Expand All @@ -186,7 +186,12 @@ static void NewProfileOpMenuCallback(wxCommandEvent &event)
delete new_object;
}

static void NewPocketOpMenuCallback(wxCommandEvent &event)
static void NewProfileOpMenuCallback(wxCommandEvent &event)
{
NewProfileOp();
}

static void NewPocketOp()
{
std::list<int> tools;
std::list<int> sketches;
Expand All @@ -203,6 +208,11 @@ static void NewPocketOpMenuCallback(wxCommandEvent &event)
delete new_object;
}

static void NewPocketOpMenuCallback(wxCommandEvent &event)
{
NewPocketOp();
}

static void AddNewObjectUndoablyAndMarkIt(HeeksObj* new_object, HeeksObj* parent)
{
heeksCAD->StartHistory();
Expand All @@ -212,7 +222,7 @@ static void AddNewObjectUndoablyAndMarkIt(HeeksObj* new_object, HeeksObj* parent
heeksCAD->EndHistory();
}

static void NewDrillingOpMenuCallback(wxCommandEvent &event)
static void NewDrillingOp()
{
std::list<int> points;

Expand All @@ -239,6 +249,11 @@ static void NewDrillingOpMenuCallback(wxCommandEvent &event)
}
}

static void NewDrillingOpMenuCallback(wxCommandEvent &event)
{
NewDrillingOp();
}

static void NewScriptOpMenuCallback(wxCommandEvent &event)
{
CScriptOp *new_object = new CScriptOp();
Expand Down Expand Up @@ -703,6 +718,62 @@ class HeeksCADObserver: public Observer
}
}heekscad_observer;

class NewProfileOpTool:public Tool
{
// Tool's virtual functions
const wxChar* GetTitle(){return _("New Profile Operatio");}
void Run(){
NewProfileOp();
}
wxString BitmapPath(){ return _T("opprofile");}
};

class NewPocketOpTool:public Tool
{
// Tool's virtual functions
const wxChar* GetTitle(){return _("New Pocket Operatio");}
void Run(){
NewPocketOp();
}
wxString BitmapPath(){ return _T("pocket");}
};

class NewDrillingOpTool:public Tool
{
// Tool's virtual functions
const wxChar* GetTitle(){return _("New Drilling Operatio");}
void Run(){
NewDrillingOp();
}
wxString BitmapPath(){ return _T("drilling");}
};

static void GetMarkedListTools(std::list<Tool*>& t_list)
{
std::set<int> types;

const std::list<HeeksObj*>& list = heeksCAD->GetMarkedList();
for(std::list<HeeksObj*>::const_iterator It = list.begin(); It != list.end(); It++)
{
HeeksObj* object = *It;
types.insert(object->GetType());
}

for(std::set<int>::iterator It = types.begin(); It != types.end(); It++)
{
switch(*It)
{
case SketchType:
t_list.push_back(new NewProfileOpTool);
t_list.push_back(new NewPocketOpTool);
break;
case PointType:
t_list.push_back(new NewDrillingOpTool);
break;
}
}
}

void CHeeksCNCApp::OnStartUp(CHeeksCADInterface* h, const wxString& dll_path)
{
m_dll_path = dll_path;
Expand Down Expand Up @@ -872,6 +943,8 @@ void CHeeksCNCApp::OnStartUp(CHeeksCADInterface* h, const wxString& dll_path)

heeksCAD->RegisterUnitsChangeHandler( UnitsChangedHandler );
heeksCAD->RegisterHeeksTypesConverter( HeeksCNCType );

heeksCAD->RegisterMarkeListTools(&GetMarkedListTools);
}

std::list<wxString> CHeeksCNCApp::GetFileNames( const char *p_szRoot ) const
Expand Down
Loading

0 comments on commit feabb3b

Please sign in to comment.