Skip to content

Commit c4382a2

Browse files
authored
Merge pull request #82 from UnstableDesign/op-extensions
Op extensions
2 parents 00aa66b + 8b26775 commit c4382a2

File tree

76 files changed

+3347
-3242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+3347
-3242
lines changed

src/app/core/core.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ import { AuthService } from './provider/auth.service';
114114
SignupComponent,
115115
ProfileComponent,
116116
EmailComponent
117-
],
117+
],
118118
providers: [
119119
PatternService,
120120
UploadService,

src/app/core/draftviewer/draftviewer.component.ts

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ export class DraftviewerComponent implements OnInit {
292292
//this is called anytime a new draft object is loaded.
293293
onNewDraftLoaded() {
294294
var dims = this.render.getCellDims("base");
295-
296295
this.canvasEl.width = this.weave.warps * dims.w;
297296
this.canvasEl.height = this.weave.wefts * dims.h;
298297
this.threadingCanvas.width = this.weave.warps * dims.w;
@@ -1279,7 +1278,7 @@ export class DraftviewerComponent implements OnInit {
12791278
* @returns {void}
12801279
*/
12811280
private drawOnThreading( currentPos: Interlacement ) {
1282-
1281+
12831282

12841283
if (!this.cxThreading || !currentPos) { return; }
12851284

@@ -1501,7 +1500,7 @@ export class DraftviewerComponent implements OnInit {
15011500

15021501
//cx.fillStyle = color;
15031502
cx.fillStyle = color;
1504-
if(color != '#FFFFFF') cx.fillRect(left+j*base_dims.w + base_fill.x, top+i*base_dims.h + base_fill.y, base_fill.w, base_fill.h);
1503+
cx.fillRect(left+j*base_dims.w + base_fill.x, top+i*base_dims.h + base_fill.y, base_fill.w, base_fill.h);
15051504

15061505

15071506
}
@@ -1559,7 +1558,15 @@ export class DraftviewerComponent implements OnInit {
15591558
private redrawRow(y, i, cx) {
15601559

15611560
for (var j = 0; j < this.weave.warps; j++) {
1562-
this.drawCell(this.cx, i, j, "drawdown");
1561+
//get the system at this warp
1562+
const sys_id = this.weave.colSystemMapping[j];
1563+
const sys = this.ss.getWarpSystem(sys_id)
1564+
1565+
if(sys !== undefined && sys.isVisible()){
1566+
this.drawCell(this.cx, i, j, "drawdown");
1567+
}else{
1568+
1569+
}
15631570
}
15641571
}
15651572

@@ -1992,6 +1999,9 @@ public drawWeftEnd(top, left, shuttle){
19921999
public redrawYarnView(){
19932000

19942001

2002+
2003+
2004+
19952005
for(let i = 0; i < this.render.visibleRows.length; i++){
19962006

19972007
let index_row = this.render.visibleRows[i];
@@ -2085,7 +2095,7 @@ public drawWeftEnd(top, left, shuttle){
20852095
//else this.drawBlank(this.cxTieups,this.tieupsCanvas);
20862096

20872097

2088-
2098+
console.log("this.loom.threading", this.loom.threading);
20892099
for (var j = 0; j < this.loom.threading.length; j++) {
20902100
this.drawCell(this.cxThreading, this.loom.threading[j], j, "threading");
20912101
}
@@ -2140,6 +2150,7 @@ public drawDrawdown(){
21402150
//takes inputs about what, exactly to redraw
21412151
public redraw(flags:any){
21422152

2153+
21432154
var base_dims = this.render.getCellDims("base");
21442155

21452156
if(flags.drawdown !== undefined){
@@ -2171,7 +2182,8 @@ public redraw(flags:any){
21712182
this.drawWarpMaterials(this.cxWarpMaterials, this.warpMaterialsCanvas);
21722183
}
21732184

2174-
if(flags.loom !== undefined && this.loom.isFrame()){
2185+
2186+
if(flags.loom !== undefined){
21752187
this.redrawLoom();
21762188
}
21772189

@@ -2186,7 +2198,7 @@ public redraw(flags:any){
21862198
public redrawDraft() {
21872199

21882200
var base_dims = this.render.getCellDims("base");
2189-
this.cx.fillStyle = "white";
2201+
this.cx.fillStyle = "grey";
21902202
this.cx.fillRect(base_dims.w,base_dims.h,this.canvasEl.width - base_dims.w*2,this.canvasEl.height-base_dims.h*2);
21912203

21922204
var i,j;
@@ -2200,28 +2212,28 @@ public redraw(flags:any){
22002212
}
22012213

22022214

2203-
for (var x = 0; x < this.weave.colShuttleMapping.length; x++) {
2215+
// for (var x = 0; x < this.weave.colShuttleMapping.length; x++) {
22042216

2205-
let system;
2217+
// let system;
22062218

2207-
var id = this.weave.colShuttleMapping[x];
2208-
if(id === undefined) system = this.ss.getFirstWarpSystem();
2219+
// var id = this.weave.colShuttleMapping[x];
2220+
// if(id === undefined) system = this.ss.getFirstWarpSystem();
22092221

2210-
else system = this.ss.getWarpSystem(id);
2211-
var shuttle = this.ms.getShuttle(id);
2222+
// else system = this.ss.getWarpSystem(id);
2223+
// var shuttle = this.ms.getShuttle(id);
22122224

22132225

2214-
if(system !== undefined && !system.visible){
2215-
var c = "#3d3d3d";
2216-
var t = 100;
2226+
// if(system !== undefined && !system.visible){
2227+
// var c = "#3d3d3d";
2228+
// var t = 100;
22172229

2218-
var width = base_dims.w;
2219-
var w_margin = base_dims.w;
2220-
this.cx.fillStyle = c;
2221-
this.cx.fillRect(x*base_dims.w+w_margin, 0, width, base_dims.h*this.render.visibleRows.length);
2230+
// var width = base_dims.w;
2231+
// var w_margin = base_dims.w;
2232+
// this.cx.fillStyle = c;
2233+
// this.cx.fillRect(x*base_dims.w+w_margin, 0, width, base_dims.h*this.render.visibleRows.length);
22222234

2223-
}
2224-
}
2235+
// }
2236+
// }
22252237

22262238
this.drawGrid(this.cx,this.canvasEl);
22272239

src/app/core/modal/init/init.modal.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class InitModal implements OnInit {
2727
opts: StartOptions[] = [
2828
{value: 'example', viewValue: 'Load an Example', mixeronly: true},
2929
{value: 'ada', viewValue: 'AdaCAD (.ada) File', mixeronly: true},
30-
{value: 'bmp', viewValue: 'Two Color Image (.bmp, .jpg, .png) File', mixeronly: false},
30+
// {value: 'bmp', viewValue: 'Two Color Image (.bmp, .jpg, .png) File', mixeronly: false},
3131
// {value: 'wif', viewValue: 'WIF (.wif) File', mixeronly: false},
3232
{value: 'new', viewValue: 'Empty Draft', mixeronly: false}
3333

@@ -46,7 +46,6 @@ export class InitModal implements OnInit {
4646

4747
constructor(
4848
private fls: FileService,
49-
private auth: AuthService,
5049
private dm: DesignmodesService,
5150
private http: HttpClient,
5251
private dialogRef: MatDialogRef<InitModal>,
@@ -91,11 +90,9 @@ export class InitModal implements OnInit {
9190

9291
}
9392

94-
// selectionMade(selection: any){
95-
// if(selection === 'recover'){
96-
// this.loadSavedFile();
97-
// }
98-
// }
93+
selectionMade(selection: any){
94+
95+
}
9996

10097
loadExample(filename: string){
10198
console.log("loading example: ", filename);

src/app/core/modal/weaverview/weaverview.component.html

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929

30-
30+
<div class="yarns-and-back">
3131
<div class="view_slider">
3232
View Yarns
3333

@@ -46,7 +46,7 @@
4646
(change)="front = !front; viewFront($event, front, 'front')">
4747
</mat-slide-toggle>
4848
</div>
49-
49+
</div>
5050
<!-- <div class="view_slider">
5151
View Crossings
5252
<mat-slide-toggle
@@ -55,35 +55,57 @@
5555
</mat-slide-toggle>
5656
</div> -->
5757

58-
<div class="system-viz">
5958

60-
<ng-container *ngIf="ss.weft_systems.length > 1">
61-
<ng-container *ngFor="let system of ss.weft_systems">
62-
<div class="view_slider">
59+
<div class = "system-matrix">
60+
61+
<div class="system-row">
62+
<div class = "system-activate">
63+
show weft systems present on layer:
64+
</div>
65+
<div class = "warp-system">
66+
warp systems
67+
</div>
68+
<div class = "weft-system">
69+
weft systems
70+
</div>
71+
72+
</div>
6373

64-
<mat-slide-toggle
65-
[checked]="!system.visible"
66-
(change)="system.visible = !system.visible; visibleButton(system.id, system.visible, 'weft')">
67-
</mat-slide-toggle> Hide Weft System {{system.getChar()}}
68-
</div>
69-
</ng-container>
70-
</ng-container>
74+
<div *ngFor="let system_data of collective_systems;" class = "system-row">
7175

72-
<ng-container *ngIf="ss.warp_systems.length > 1">
7376

74-
<ng-container *ngFor="let system of ss.warp_systems">
75-
<div class="view_slider">
77+
<div class = "system-activate">
78+
<button *ngIf="system_data.warp !== null" mat-stroked-button (click) = "showOnly(system_data.id)"> Layer {{system_data.id+1}}</button>
79+
</div>
80+
81+
<div class = "warp-system">
82+
83+
<mat-slide-toggle *ngIf="system_data.warp !== null"
84+
[matTooltip]= system_data.warp.name
85+
[checked]="system_data.warp.visible"
86+
(change)="system_data.warp.visible = !system_data.warp.visible; visibleButton(system_data.id, system_data.warp.visible, 'warp')">
87+
</mat-slide-toggle>
88+
</div>
7689

77-
<mat-slide-toggle
78-
[checked]="!system.visible"
79-
(change)="system.visible = !system.visible; visibleButton(system.id, system.visible, 'warp')">
80-
</mat-slide-toggle> Hide Warp System {{system.getChar()}}
90+
<div class = "weft-system">
91+
<mat-slide-toggle *ngIf="system_data.weft !== null"
92+
[matTooltip]= system_data.weft.name
93+
[checked]="system_data.weft.visible"
94+
(change)="system_data.weft.visible = !system_data.weft.visible; visibleButton(system_data.id, system_data.weft.visible, 'weft')">
95+
</mat-slide-toggle>
8196
</div>
82-
</ng-container>
83-
</ng-container>
97+
98+
99+
100+
</div>
101+
102+
84103
</div>
85104

86105

106+
107+
108+
87109

88110
</mat-dialog-content>
89111
<!-- <mat-dialog-actions>

src/app/core/modal/weaverview/weaverview.component.scss

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,27 @@ h4{
1414
// margin: 14px 0 0;
1515
// }
1616

17+
18+
1719
.toprow{
1820
display: flex;
1921
flex-direction: row;
2022
line-height: 1em;
2123
}
2224

25+
.mat-stroked-button{
26+
border: 1px solid currentColor;
27+
padding: 0px 11px;
28+
line-height: 20px;
29+
font-size: 0.8em;
30+
}
2331

2432

33+
.yarns-and-back{
34+
display: flex;
35+
font-size: .8em;
36+
}
37+
2538
.view_slider{
2639
width: 100%;
2740
padding: 8px 0 16px 0;
@@ -30,6 +43,27 @@ h4{
3043
margin:auto;
3144
}
3245

46+
.system-matrix{
47+
display: flex;
48+
flex-direction: column;
49+
font-size: .8em;
50+
}
51+
52+
.system-row{
53+
display: flex;
54+
flex-direction: row;
55+
font-size: .8em;
56+
}
57+
58+
.system-activate{
59+
width: 50%;
60+
}
61+
62+
.weft-system,
63+
.warp-system{
64+
width: 25%;
65+
}
66+
3367
// mat-slide-toggle{
3468
// padding: 0px 8px;
3569
// }

0 commit comments

Comments
 (0)