-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
623 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
Src/Serial.Server/ClientApp/src/app/models/preview-input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
This file is part of CNCLib - A library for stepper motors. | ||
Copyright (c) Herbert Aitenbichler | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), | ||
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
export class PreviewGCode { | ||
|
||
sizeX: number = 200; | ||
|
||
sizeY: number = 200; | ||
|
||
sizeZ: number = 200; | ||
|
||
keepRatio: boolean = true; | ||
|
||
zoom: number = 1; | ||
|
||
offsetX: number = 0; | ||
|
||
offsetY: number = 0; | ||
|
||
offsetZ: number = 0; | ||
|
||
cutterSize: number = 0.254; | ||
|
||
laserSize: number = 0; | ||
|
||
machineColor: number; | ||
|
||
laserOnColor: number; | ||
|
||
laserOffColor: number; | ||
|
||
cutColor: number; | ||
|
||
cutDotColor: number; | ||
|
||
cutEllipseColor: number; | ||
|
||
cutArcColor: number; | ||
|
||
fastMoveColor: number; | ||
|
||
helpLineColor: number; | ||
|
||
// public Rotate3D Rotate | ||
|
||
rotate3DAngle: number = 0; | ||
|
||
rotate3DVectX: number = 0; | ||
rotate3DVectY: number = 0; | ||
rotate3DVectZ: number = 1.0; | ||
|
||
rotate3DVect: number[] = [this.rotate3DVectX, this.rotate3DVectY, this.rotate3DVectZ]; | ||
|
||
renderSizeX: number = 800; | ||
|
||
renderSizeY: number = 800; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
|
||
|
||
|
||
|
3 changes: 3 additions & 0 deletions
3
Src/Serial.Server/ClientApp/src/app/preview/preview-input/preview-input.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.form-group { margin-bottom: 2px } | ||
|
||
.input-group-addon { width: 150px; } |
86 changes: 86 additions & 0 deletions
86
Src/Serial.Server/ClientApp/src/app/preview/preview-input/preview-input.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<form novalidate [formGroup]="previewOptForm" (ngSubmit)="savegCode(previewOptForm.value)"> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">RenderSizeX</span> | ||
<input matInput class="form-control" type="number" min="10" max="2500" step="10" formControlName="renderSizeX"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">RenderSizeY</span> | ||
<input matInput class="form-control" type="number" min="10" max="2500" step="10" formControlName="renderSizeY"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">SizeX</span> | ||
<input matInput class="form-control" type="number" min="10" max="2500" step="10" formControlName="sizeX"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">SizeY</span> | ||
<input matInput class="form-control" type="number" min="10" max="2500" step="10" formControlName="sizeY"/> | ||
</div> | ||
<div class="form-group input-group"> | ||
<span class="input-group-addon">SizeZ</span> | ||
<input matInput class="form-control" type="number" min="10" max="2500" step="10" formControlName="sizeZ"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">OffsetX</span> | ||
<input matInput class="form-control" type="number" min="-2500" max="2500" step="10" formControlName="offsetX"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">OffsetY</span> | ||
<input matInput class="form-control" type="number" min="-2500" max="2500" step="10" formControlName="offsetY"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">OffsetZ</span> | ||
<input matInput class="form-control" type="number" min="-2500" max="2500" step="10" formControlName="offsetZ"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">Rotate Angle</span> | ||
<input matInput class="form-control" type="number" min="-10" max="+10" step="0.1" formControlName="rotate3DAngle"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">Rotate Vect X</span> | ||
<input matInput class="form-control" type="number" min="-10" max="+10" step="0.1" formControlName="rotate3DVectX"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">Rotate Vect Y</span> | ||
<input matInput class="form-control" type="number" min="-10" max="+10" step="0.1" formControlName="rotate3DVectY"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">Rotate Vect Z</span> | ||
<input matInput class="form-control" type="number" min="-10" max="+10" step="0.1" formControlName="rotate3DVectZ"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">KeepRatio</span> | ||
<mat-checkbox class="form-control" formControlName="keepRatio"></mat-checkbox> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">Zoom</span> | ||
<input matInput class="form-control" type="number" min="0.1" step="0.1" formControlName="zoom"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">CutterSize</span> | ||
<input matInput class="form-control" formControlName="cutterSize"/> | ||
</div> | ||
|
||
<div class="form-group input-group"> | ||
<span class="input-group-addon">LaserSize</span> | ||
<input matInput class="form-control" formControlName="laserSize"/> | ||
</div> | ||
|
||
<button mat-stroked-button class="btn btn-default" (click)='rotate1()'>Rotate 1</button> | ||
|
||
<!--<button mat-stroked-button type="submit" class="btn btn-default" [disabled]="!gCodeForm.valid">Run</button>--> | ||
|
||
</form> |
91 changes: 91 additions & 0 deletions
91
Src/Serial.Server/ClientApp/src/app/preview/preview-input/preview-input.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* | ||
This file is part of CNCLib - A library for stepper motors. | ||
Copyright (c) Herbert Aitenbichler | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), | ||
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
import { Component, OnInit, Input } from '@angular/core'; | ||
import { FormGroup, FormArray, FormControl, FormBuilder, Validators } from '@angular/forms'; | ||
import { PreviewGCode } from '../../models/preview-input'; | ||
|
||
@Component( | ||
{ | ||
selector: 'preview-input', | ||
templateUrl: './preview-input.component.html', | ||
styleUrls: ['./preview-input.component.css'] | ||
}) | ||
export class PreviewInputComponent implements OnInit { | ||
@Input() | ||
previewOpt: PreviewGCode; | ||
previewOptForm: FormGroup; | ||
|
||
constructor( | ||
private fb: FormBuilder | ||
) { | ||
|
||
this.previewOptForm = fb.group( | ||
{ | ||
sizeX: [0.0, [Validators.required]], | ||
sizeY: [0.0, [Validators.required]], | ||
sizeZ: [0.0, [Validators.required]], | ||
keepRatio: [true, [Validators.required]], | ||
zoom: [0.0, [Validators.required]], | ||
offsetX: [0.0, [Validators.required]], | ||
offsetY: [0.0, [Validators.required]], | ||
offsetZ: [0.0, [Validators.required]], | ||
cutterSize: [0.0, [Validators.required]], | ||
laserSize: [0.0, [Validators.required]], | ||
machineColor: [0, [Validators.required]], | ||
laserOnColor: [0, [Validators.required]], | ||
laserOffColor: [0, [Validators.required]], | ||
cutColor: [0, [Validators.required]], | ||
cutDotColor: [0, [Validators.required]], | ||
cutEllipseColor: [0, [Validators.required]], | ||
cutArcColor: [0, [Validators.required]], | ||
fastMoveColor: [0, [Validators.required]], | ||
helpLineColor: [0, [Validators.required]], | ||
|
||
rotate3DAngle: [0.0, [Validators.required]], | ||
|
||
rotate3DVectX: [0.0, [Validators.required]], | ||
rotate3DVectY: [0.0, [Validators.required]], | ||
rotate3DVectZ: [1.0, [Validators.required]], | ||
|
||
renderSizeX: [0, [Validators.required]], | ||
renderSizeY: [0, [Validators.required]], | ||
}); | ||
|
||
this.previewOptForm.valueChanges.subscribe(( | ||
value) => { | ||
Object.assign(this.previewOpt, value); | ||
}); | ||
} | ||
|
||
rotate1() { | ||
this.previewOptForm.patchValue({ | ||
rotate3DAngle: -1.0407742907225024, | ||
rotate3DVectX: 101, | ||
rotate3DVectY: -13, | ||
rotate3DVectZ: 1, | ||
offsetX: -10, | ||
offsetY: 10, | ||
}); | ||
} | ||
|
||
async savegCode(value: any): Promise<void> { | ||
} | ||
|
||
async ngOnInit() { | ||
this.previewOptForm.patchValue(this.previewOpt); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
Src/Serial.Server/ClientApp/src/app/preview/preview-view/preview-view.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.previewinput { | ||
-ms-flex: 0 0 200px; | ||
flex: 0 0 200px; | ||
} | ||
|
||
.reloadbuttons { float: right } | ||
|
||
.hmyslider { width: 200px; } | ||
|
||
.vyslider { } |
22 changes: 22 additions & 0 deletions
22
Src/Serial.Server/ClientApp/src/app/preview/preview-view/preview-view.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<div class="container-fluid"> | ||
|
||
<div class="col previewinput"> | ||
<div class="row"> | ||
<div *ngIf="previewGlobal.isShowParam"> | ||
<preview-input [previewOpt]="previewOpt"> </preview-input> | ||
<button mat-stroked-button class="btn btn-default" (click)='refreshImage()'>Refresh</button> | ||
</div> | ||
<div class="col"> | ||
<img [src]="imageBlobUrl"/> | ||
</div> | ||
<mat-slider class="hmyslider" min="-200" max="200" step="1" [value]="previewOpt.offsetX" (valueChange)="this.previewOpt.offsetX= $event; this.refreshImage()"></mat-slider> | ||
<mat-slider class="vmyslider" vertical min="-200" max="200" step="1" [value]="previewOpt.offsetY" (valueChange)="this.previewOpt.offsetY= $event; this.refreshImage()"></mat-slider> | ||
<mat-slider class="hmyslider" min="0.1" max="10" step="0-1" [value]="previewOpt.zoom" (valueChange)="this.previewOpt.zoom= $event; this.refreshImage()"></mat-slider> | ||
</div> | ||
</div> | ||
|
||
<span class="reloadbuttons"> | ||
<button mat-stroked-button (click)="previewGlobal.isShowParam = !previewGlobal.isShowParam">Show/Hide</button> | ||
</span> | ||
|
||
</div> |
Oops, something went wrong.